/* shell.css — base reset, nav (bottom bar / left rail), screen container. */

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--night-0);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* Tabular numerals wherever a time or price sits */
.tnum, time { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* Gold focus ring on everything interactive */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Screen container ─────────────────────────────────────────────── */

.screen {
  min-height: 100vh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); /* clear the tab bar */
}

.screen-enter { animation: screenFade var(--t-screen) var(--ease); }
@keyframes screenFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Placeholder card shown while a sibling screen has not landed yet */
.ph-card {
  margin: 18vh auto 0;
  max-width: 420px;
  padding: 28px 24px;
  background: var(--night-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.ph-card h2 { font-family: var(--font-display); font-size: var(--fs-2); font-weight: 700; }
.ph-card p { margin-top: 8px; color: var(--ink-dim); }
.ph-card .btn { margin-top: 18px; }

/* ── Shared small pieces ──────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-s);
  font-size: var(--fs-body);
  font-weight: 600;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn-primary { background: var(--gold); color: var(--on-accent); }
.btn-primary:hover { background: var(--gold-hover); }
.btn-danger { background: var(--bad); color: var(--night-1); }
.btn-danger:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--line-hover); }

.cap {
  font-size: var(--fs-cap);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

/* ── Nav ──────────────────────────────────────────────────────────── */

.nav { z-index: 40; }

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 44px;
  min-width: 44px;
  color: var(--ink-dim);
  font-size: var(--fs-cap);
  font-weight: 600;
  letter-spacing: .04em;
  border-radius: var(--radius-s);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-item svg { width: 22px; height: 22px; flex: none; }
.nav-item:hover { color: var(--ink); }
.nav-item[aria-current="page"] { color: var(--gold); }

.nav-brand { display: none; }

/* Mobile: fixed bottom bar, 5 slots */
@media (max-width: 1023px) {
  .nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--nav-glass);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .nav-desktop { display: none; }
}

/* Desktop: left rail */
@media (min-width: 1024px) {
  .nav {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 232px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 22px 14px;
    background: var(--night-1);
    border-right: 1px solid var(--line);
  }
  .nav-mobile { display: none; }
  .nav-brand {
    display: block;
    padding: 4px 12px 18px;
  }
  .nav-trip {
    font-family: var(--font-display);
    font-size: var(--fs-3);
    font-weight: 700;
    line-height: 1.25;
  }
  .nav-count {
    margin-top: 5px;
    color: var(--gold);
    font-size: var(--fs-small);
    font-weight: 600;
    font-feature-settings: "tnum";
  }
  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 12px;
    font-size: var(--fs-body);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
  }
  .nav-item[aria-current="page"] { background: var(--gold-dim); }
  .screen {
    margin-left: 232px;
    padding-bottom: 40px;
  }
}

/* ── Motion off ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* The frame remains calm while dense planning tools live inside it. */
html { scroll-padding-top: 24px; }
body { overflow-x: clip; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
input, select, textarea { color-scheme: inherit !important; }
button:disabled { cursor: wait; opacity: .65; }
::selection { background: var(--gold-dim); color: var(--ink); }
h1 { letter-spacing: -.04em; line-height: 1.15; }
h2 { letter-spacing: -.025em; }
.nav-mark { display:flex; align-items:center; gap:10px; font-weight:750; font-size:17px; letter-spacing:-.04em; padding-bottom:24px; }
.nav-mark svg { width:32px; height:32px; color:var(--gold); }
.nav-trip { font-size:13px; color:var(--ink-dim); }
.nav-count { font-size:12px; }
.nav-item { min-height:48px; }
.nav-separator { height:1px; background:var(--line); margin:18px 10px 12px; }
.nav-utility { margin-top:8px; }
.nav-utility.nav-item { font-size:13px; }
.nav-item[aria-current="page"] { font-weight:700; }
.skip-link { position:fixed; top:10px; left:10px; padding:12px 18px; background:var(--ink); color:var(--night-1); z-index:100; transform:translateY(-150%); }
.skip-link:focus { transform:none; }
.app-strip { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; padding:10px 24px; border-bottom:1px solid var(--line); background:var(--night-1); color:var(--ink-dim); font-size:12px; }
.app-strip b { color:var(--gold); }
.app-strip a { text-decoration:underline; text-underline-offset:3px; }
.app-strip[hidden], .save-problem[hidden] { display:none; }
.save-problem { padding:16px 24px; background:var(--bad-dim); border-bottom:1px solid var(--bad); color:var(--ink); }
.save-problem p { margin:4px 0 12px; }
.appearance-pick { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:16px 0; }
.appearance-pick button { min-height:72px; padding:12px; border:1px solid var(--line); border-radius:var(--radius-s); background:var(--night-1); }
.appearance-pick button[aria-pressed="true"] { border:2px solid var(--gold); background:var(--gold-dim); }
.sheet-x { min-width:44px; min-height:44px; }
.sheet-row { padding-top:10px; padding-bottom:10px; }
.sheet-row b { color:var(--ink); }
@media(min-width:1024px){ .app-chrome { margin-left:232px; } .screen { min-height:calc(100vh - 42px); } .nav-more-all { margin-top:auto; } .nav-separator { flex-shrink:0; } }
@media(max-width:1023px){ .nav-utility,.nav-separator { display:none; } .app-strip { padding:10px 16px; } .nav-item { letter-spacing:0; font-size:10px; } .nav-item[aria-current="page"] { background:var(--gold-dim); } }
@media(max-width:600px){ input,select,textarea { font-size:16px !important; } }
/* Components may declare display:flex; hidden must remain authoritative. */
[hidden] { display:none !important; }
