/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── DESIGN TOKENS ── */
:root {
  --ink: #18181B;
  --ink-mid: #52525B;
  --ink-muted: #A1A1AA;
  --ink-faint: #D4D4D8;
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --surface2: #F4F4F5;
  --accent: #3730A3;
  --accent-mid: #4F46E5;
  --accent-light: #EEF2FF;
  --accent-dark: #312E81;
  --green: #15803D;
  --green-light: #F0FDF4;
  --amber: #B45309;
  --amber-light: #FEF3C7;
  --red: #DC2626;
  --red-light: #FEF2F2;
  --border: rgba(24,24,27,0.08);
  --border-strong: rgba(24,24,27,0.15);
  --shadow-sm: 0 1px 3px rgba(24,24,27,0.07);
  --shadow-md: 0 4px 14px rgba(24,24,27,0.08);
  --shadow-lg: 0 16px 48px rgba(24,24,27,0.10);
  --r: 10px;
  --r-sm: 6px;
  --r-lg: 14px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --nav: 56px;
  --bottom: 62px;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

html, body {
  height: 100%; height: 100dvh;
  overflow: hidden;
  font-family: var(--font-body); font-size: 14px;
  background: var(--bg); color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── SHELL ── */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 480px; margin: 0 auto; background: var(--bg); overflow: hidden; position: relative; }

/* ── TOP NAV ── */
.topnav { height: var(--nav); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 20; }
.logo { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: 0.1px; }
.logo em { color: var(--accent-mid); font-style: italic; }
.nav-sub { font-size: 10px; color: var(--ink-faint); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }
.icon-btn { width: 32px; height: 32px; border-radius: 5px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 14px; color: var(--ink-mid); transition: background 0.12s; position: relative; }
.icon-btn:hover { background: var(--bg); }
.icon-btn:active { transform: scale(0.93); }
.badge { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--red); color: #fff; font-size: 9px; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }

/* ── SCREENS ── */
.screen { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.screen.active { display: flex; }
.scroll-body { flex: 1; overflow-y: auto; padding-bottom: calc(var(--bottom) + var(--safe-bottom) + 32px); scroll-padding-bottom: 80px; }
.scroll-body::-webkit-scrollbar { width: 3px; }
.scroll-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

