/* Design tokens — source of truth: docs/mockups/README.md
 *
 * Mockup-aligned names are primary. Legacy alias names (--bg-card, --border,
 * --text-secondary, --warn) are kept so existing component <style> blocks
 * keep working without a churny rename. New components should use the
 * mockup names.
 *
 * Dark mode was removed in Phase 1 — the mockup is intentionally warm/light
 * (luxury feel, warm copper accent). A `prefers-color-scheme: dark` media
 * query was previously flipping the accent to near-white, which conflicts
 * with the warm-copper intent. Re-add as a separate ADR if dark mode is
 * needed; for now, one intentional palette beats two half-baked ones.
 */
:root {
  /* Surfaces */
  --bg: #FAFAF7;
  --card: #FFFFFF;
  --soft: #E8E4DC;

  /* Type */
  --text: #1A1A1A;
  --muted: #6B6B6B;
  --text-tertiary: #888780;

  /* Lines + accent */
  --line: #DCD7CD;
  --accent: #A86040;
  --accent-soft: #F4ECE6;

  /* Semantic */
  --success: #5A8A4E;
  --success-soft: #F0F6EE;
  --warning: #C7821E;
  --warning-soft: #FBF1DD;
  --info: #4A7FB8;
  --info-soft: #EFF4FA;
  --danger: #B5453C;

  /* Radii / chrome */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --header-height: 52px;

  /* ── Legacy aliases (don't add new uses; keep until a sweep) ── */
  --bg-card: var(--card);
  --bg-card-active: var(--accent-soft);
  --bg-thumb: var(--soft);
  --text-secondary: var(--muted);
  --border: var(--line);
  --warn: var(--warning);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-bar {
  position: sticky; top: 0; z-index: 10;
  height: var(--header-height);
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: var(--bg);
  border-bottom: 0.5px solid var(--line);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}
.app-bar-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--text); text-decoration: none;
}
.app-bar-back:active { background: var(--accent-soft); }
.app-bar-title {
  flex: 1; font-size: 15px; font-weight: 500; margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-bar-sync { display: inline-flex; align-items: center; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }

.view-toggle {
  position: sticky; top: var(--header-height); z-index: 9;
  display: flex; gap: 4px;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 0.5px solid var(--line);
}
.view-pill {
  flex: 1;
  font-size: 13px; font-weight: 500;
  padding: 8px 12px;
  border: 0.5px solid var(--line);
  border-radius: 999px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.view-pill.active {
  background: var(--accent); color: #FFFFFF;
  border-color: var(--accent);
}

.app-main { padding: 16px 0 32px; }

.docs { padding: 0 16px; margin: 8px 0 16px; }
.docs-label {
  font-size: 12px; font-weight: 500;
  color: var(--text-tertiary);
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}
.docs-list { list-style: none; margin: 0; padding: 0; }
.docs-list li { margin-bottom: 8px; }
.doc-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 0.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  text-decoration: none; color: inherit;
  transition: background 120ms ease, transform 120ms ease;
}
.doc-link:active { background: var(--accent-soft); transform: scale(0.99); }
.doc-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 500; color: var(--muted);
  letter-spacing: 0.04em;
}
.doc-name { flex: 1; font-size: 14px; }
.doc-size { font-size: 12px; color: var(--text-tertiary); }
.doc-arrow { font-size: 16px; color: var(--text-tertiary); }

a, button { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
