/* shell.css — AppCaddy tokens for the grown-up shell chrome (the settings panel and its footer).
   Deliberately separate from the paper-craft play surface: crossing the grown-ups gate lands the
   adult in AppCaddy's clean, labelled panel. Only settings/Data/Contribute/footer use these tokens.
   Tokens mirror the shared AppCaddy tokens.css (self-hosted DM Sans + Syne, no CDN). */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/DMSans-Latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/DMSans-LatinExt.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../../assets/fonts/Syne-Latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../../assets/fonts/Syne-LatinExt.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.ac-screen {
  --ac-canvas: #f4f5f4;
  --ac-ink: #141414;
  --ac-accent: #3d7575;
  --ac-accent-hover: #2c5858;
  --ac-accent-tint: #eaf1f1;
  --ac-muted: #5e5e5e;
  --ac-border: #e0e2e0;
  --ac-surface: #ffffff;
  --ac-down: #9b3a3a;
  --ac-font-display: 'Syne', 'DM Sans', -apple-system, sans-serif;
  --ac-font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  position: absolute;
  inset: 0;
  overflow-y: auto;
  background: var(--ac-canvas);
  color: var(--ac-ink);
  font-family: var(--ac-font-body);
  font-size: 15px;
  line-height: 1.5;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}
[data-theme='dark'] .ac-screen {
  --ac-canvas: #141414;
  --ac-ink: #ebebeb;
  --ac-accent: #5fa8a8;
  --ac-accent-hover: #6fb8b8;
  --ac-accent-tint: #1a2e2e;
  --ac-muted: #9e9e9e;
  --ac-border: #252525;
  --ac-surface: #1e1e1e;
  --ac-down: #c46a6a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']):not([data-theme='dark']) .ac-screen {
    --ac-canvas: #141414;
    --ac-ink: #ebebeb;
    --ac-accent: #5fa8a8;
    --ac-accent-hover: #6fb8b8;
    --ac-accent-tint: #1a2e2e;
    --ac-muted: #9e9e9e;
    --ac-border: #252525;
    --ac-surface: #1e1e1e;
    --ac-down: #c46a6a;
  }
}

/* Header */
.ac-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.ac-head-left { display: flex; align-items: center; gap: 10px; }
.ac-back {
  width: 34px; height: 34px; border-radius: 6px;
  border: 1px solid var(--ac-border); background: var(--ac-surface); color: var(--ac-ink);
  cursor: pointer; font-size: 20px; line-height: 1; padding-right: 2px;
}
.ac-title { font-family: var(--ac-font-display); font-weight: 700; font-size: 20px; margin: 0; }
.ac-wordmark {
  font-family: var(--ac-font-display); font-weight: 700; font-size: 14px;
  color: var(--ac-muted); text-decoration: none;
}
.ac-wordmark:hover { color: var(--ac-accent); }

/* Sections */
.ac-section { margin-bottom: 28px; }
.ac-section-title { font-family: var(--ac-font-display); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ac-muted); margin: 0 0 12px; }
.ac-section-sub { font-size: 13px; color: var(--ac-muted); margin: 0 0 12px; }

.ac-field { padding: 10px 0; border-bottom: 1px solid var(--ac-border); }
.ac-field:last-child { border-bottom: 0; }
.ac-field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ac-field-head { display: flex; align-items: center; gap: 8px; }
.ac-field-label { font-weight: 500; }
.ac-info-btn {
  /* 24px minimum tap target (WCAG 2.5.8); the drawn circle stays small via the inner ::before. */
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--ac-border); background: transparent; color: var(--ac-muted);
  cursor: pointer; font-size: 11px; font-style: italic; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.ac-field-info { margin: 8px 0 0; font-size: 13px; color: var(--ac-muted); }

/* Segmented control (Appearance) */
.ac-segmented { display: inline-flex; border: 1px solid var(--ac-border); border-radius: 6px; overflow: hidden; }
.ac-seg {
  border: 0; background: var(--ac-surface); color: var(--ac-muted);
  cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 14px;
}
.ac-seg + .ac-seg { border-left: 1px solid var(--ac-border); }
.ac-seg.is-active { background: var(--ac-accent); color: #fff; font-weight: 700; }
/* Check glyph: the selected state must not rest on color alone. */
.ac-seg.is-active::before { content: '✓ '; }

/* Toggle */
.ac-toggle {
  width: 46px; height: 27px; border-radius: 20px; border: 0; cursor: pointer;
  background: var(--ac-border); position: relative; padding: 0;
  transition: background 160ms ease-out;
}
.ac-toggle.is-on { background: var(--ac-accent); }
.ac-toggle-knob {
  position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 160ms ease-out;
}
.ac-toggle.is-on .ac-toggle-knob { transform: translateX(19px); }

/* Buttons */
.ac-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; padding: 9px 16px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 500; text-decoration: none;
  border: 1px solid transparent;
}
.ac-btn-secondary { background: transparent; border-color: var(--ac-ink); color: var(--ac-ink); }
.ac-btn-secondary:hover { background: var(--ac-accent-tint); border-color: var(--ac-accent); }
.ac-btn-destructive { background: transparent; border-color: var(--ac-down); color: var(--ac-down); }
.ac-btn-destructive:hover { background: rgba(155, 58, 58, 0.08); }
.ac-btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Details sections (Data, Contribute) */
.ac-details { border-top: 1px solid var(--ac-border); padding: 14px 0; }
.ac-summary {
  cursor: pointer; font-family: var(--ac-font-display); font-weight: 700; font-size: 15px;
  list-style: none; display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.ac-summary::-webkit-details-marker { display: none; }
.ac-summary::before { content: '▸'; color: var(--ac-muted); font-size: 12px; }
.ac-details[open] .ac-summary::before { content: '▾'; }

/* Focus: the settings panel rings in AppCaddy teal instead of the play surface's. */
.ac-screen :focus-visible {
  outline: 2px solid var(--ac-accent);
  outline-offset: 2px;
}

/* Footer */
.ac-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--ac-border); font-size: 13px; color: var(--ac-muted); }
.ac-footer a { color: var(--ac-muted); text-decoration: none; }
.ac-footer a:hover { color: var(--ac-accent); }

@media (prefers-reduced-motion: reduce) {
  .ac-toggle, .ac-toggle-knob { transition: none !important; }
}
