/* MT Tracker - light "Soft Cards" theme, mobile-first. See docs/brandbook.md */
:root {
  --bg: #f1f1ee; --nav-bg: #ffffff; --surface: #ffffff; --surface-2: #f4f4f1;
  --border: #e2e2dc; --border-strong: #c9c9c1;
  --text: #17171a; --text-dim: #5d5d66;
  --gold: #d9ac3f; --gold-deep: #b8861b; --gold-text: #7d5a0a; --gold-ink: #1a1304; --gold-tint: #fbf3dc;
  --green: #1f7a45; --neutral: #6d6d75; --danger: #c62828;
  --r: 16px; --r-sm: 10px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --shadow: 0 1px 2px rgba(20,20,10,.06), 0 4px 14px rgba(20,20,10,.06);
  --tap: 48px; /* minimum touch target */
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overflow-x: hidden; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--s4); }
main.wrap { padding-bottom: 96px; } /* clears the floating button */
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.dim { color: var(--text-dim); }

/* Nav (single-page, no links) */
.nav { background: var(--nav-bg); border-bottom: 1px solid var(--border); box-shadow: 0 1px 6px rgba(20,20,10,.04); }
.nav__in { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: var(--s3); }
.wordmark { font: italic 900 26px/1 "Arial Narrow", "Roboto Condensed", Impact, sans-serif; text-transform: uppercase; letter-spacing: .5px; color: var(--text); }
.wordmark__mt { color: var(--gold-deep); }
.nav__sub { display: none; color: var(--text-dim); font-size: 13px; }

.h { font-size: 18px; font-weight: 700; margin: var(--s5) 0 var(--s3); }

/* Submit form (lives in the bottom sheet) */
.submit { display: flex; flex-direction: column; gap: var(--s3); background: var(--surface); padding: var(--s4); border-radius: var(--r); box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: var(--s2); }
.field--grow { flex: 1; }
label { font-size: 14px; color: var(--text-dim); font-weight: 600; }
/* 16px+ font on inputs prevents iOS zoom-on-focus */
textarea, input[type=date] { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: var(--s3) var(--s4); font: inherit; font-size: 16px; color-scheme: light; width: 100%; min-height: var(--tap); }
textarea { resize: vertical; min-height: 150px; flex: 1; }
textarea::placeholder { color: #85858d; }
.btn { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 0 var(--s5); min-height: var(--tap); font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; gap: var(--s2); align-items: center; justify-content: center; }
.btn:hover { border-color: var(--text-dim); }
.btn--gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); width: 100%; min-height: 52px; font-size: 17px; }
.btn--gold:hover { filter: brightness(1.05); border-color: var(--gold); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn[disabled], textarea[disabled], input[disabled] { opacity: .6; cursor: not-allowed; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(26,19,4,.3); border-top-color: var(--gold-ink); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner--lg { width: 20px; height: 20px; flex: none; border-color: var(--border); border-top-color: var(--gold-deep); }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { margin: var(--s3) 0 0; padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: var(--gold-tint); border-left: 4px solid var(--gold); display: flex; gap: var(--s3); align-items: center; }
.notice--error { background: #fdecec; border-color: var(--danger); color: #8e1b1b; }
.review { margin-top: var(--s4); }
.review__label { color: var(--gold-text); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: var(--s2); display: flex; justify-content: space-between; align-items: center; }

/* Journey hero (brandbook: Journey hero) */
.hero { margin-top: var(--s4); background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: var(--s5) var(--s4) var(--s4); }
.hero__eyebrow { margin: 0; text-align: center; font: italic 800 15px/1.3 "Arial Narrow", "Roboto Condensed", Impact, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.hero__eyebrow strong { color: var(--gold-text); font-size: 1.25em; }
.hero__nums { display: flex; justify-content: center; gap: var(--s6); margin: var(--s3) 0 var(--s4); text-align: center; }
.hero__n { font: italic 900 56px/1 "Arial Narrow", "Roboto Condensed", Impact, sans-serif; }
.hero__l { color: var(--text-dim); font-size: 14px; font-weight: 600; }
.path { padding: 0 10px; }
.path__track { position: relative; height: 24px; }
.path__track::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; background: var(--border-strong); border-radius: 2px; }
.path__fill { position: absolute; left: 0; top: 11px; height: 2px; background: var(--gold); border-radius: 2px; }
.path__dot { position: absolute; top: 5px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--gold-deep); }
.path__dot--last { background: var(--gold-deep); }
.path__ends { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--text-dim); margin: 0 -10px; }
.hero__sum { margin: var(--s3) 0 0; text-align: center; color: var(--text-dim); font-size: 15px; }

/* Corner Advice: latest session + Casper's quote */
.advice { margin-top: var(--s3); background: var(--gold-tint); border-left: 4px solid var(--gold); border-radius: 0 var(--r) var(--r) 0; box-shadow: var(--shadow); padding: var(--s4); }
.advice__title { margin: 0; font-size: 18px; font-weight: 800; }
.advice__meta { margin: var(--s1) 0 var(--s3); color: var(--text-dim); font-size: 14px; }
.advice__quote { margin: 0; font-size: 18px; font-style: italic; line-height: 1.45; overflow-wrap: anywhere; }
.advice__by { margin: var(--s2) 0 0; color: var(--gold-text); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.advice__first { margin: var(--s3) 0 0; color: var(--green); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }

/* Needs Attention strip */
.attn .h { margin-bottom: var(--s1); }
.attn__sub { margin: 0 0 var(--s3); font-size: 14px; }
.attn__strip { display: flex; gap: var(--s2); overflow-x: auto; padding: 2px 2px var(--s2); scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.attn__chip { flex: none; scroll-snap-align: start; min-height: var(--tap); background: var(--surface); border: 1px solid var(--gold); border-radius: 999px; padding: 0 var(--s4); font: inherit; font-weight: 700; color: var(--text); cursor: pointer; box-shadow: var(--shadow); }
.attn__chip span { color: var(--gold-text); font-weight: 600; }
.attn__chip:hover { background: var(--gold-tint); }
.tech--flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: var(--shadow); } }

/* Floating action button (safe-area aware) */
.fab { position: fixed; z-index: 5; right: max(var(--s4), env(safe-area-inset-right)); bottom: max(var(--s4), env(safe-area-inset-bottom)); min-height: 56px; padding: 0 var(--s5) 0 var(--s4); border: 0; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font: inherit; font-size: 17px; font-weight: 800; display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; box-shadow: 0 6px 20px rgba(120,86,10,.4); }
.fab:hover { filter: brightness(1.05); }
.fab__plus { font-size: 28px; line-height: 1; font-weight: 700; }

/* Log bottom sheet (native dialog) */
.sheet { border: 0; padding: var(--s2) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); background: var(--bg); color: var(--text); width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh; overflow-y: auto; border-radius: var(--r) var(--r) 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.25); }
.sheet::backdrop { background: rgba(20,20,10,.45); }
.sheet[open] { animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet__grab { width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 0 auto var(--s2); }
.sheet__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s3); }
.sheet__title { margin: 0; font-size: 20px; }
.sheet__close { min-height: 44px; }

/* Layout: single column on mobile (submit, stats, timeline, dictionary) */
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--s5); align-items: start; }
.cols > section { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.empty { color: var(--text-dim); background: var(--surface); padding: var(--s4); border-radius: var(--r); margin: 0; box-shadow: var(--shadow); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { font-size: 14px; padding: 4px 12px; border-radius: 999px; background: var(--neutral); color: #fff; max-width: 100%; overflow-wrap: anywhere; }
.chip--introduced { background: var(--green); }
.chip--drilled { background: var(--neutral); }
.chip--refined { background: var(--gold); color: var(--gold-ink); font-weight: 600; }
.badge { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); }
.flag { display: inline-flex; gap: 6px; align-items: center; color: var(--green); background: #e6f4ec; font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 999px; margin: 0 var(--s2) var(--s2) 0; }

/* Session card: date stacks above content on mobile */
.card { background: var(--surface); border-radius: var(--r); padding: var(--s3) var(--s4); box-shadow: var(--shadow); }
.card--review { border: 2px solid var(--gold); }
.session { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
.session > div { min-width: 0; }
.session__date { font-size: 20px; font-weight: 800; line-height: 1.2; display: inline; }
.session__wd { color: var(--text-dim); font-size: 14px; display: inline; margin-left: var(--s2); }
.session__top { display: flex; gap: var(--s2); align-items: center; margin-bottom: var(--s2); flex-wrap: wrap; }
/* Coach quote: tinted block with gold left bar (editorial blend) */
.quote { margin: var(--s2) 0; padding: var(--s2) var(--s3); border-left: 4px solid var(--gold); background: var(--gold-tint); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 15px; font-style: italic; overflow-wrap: anywhere; }
.flags { margin-top: var(--s3); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
/* Text-buttons become full-size touch targets */
.link { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 0 var(--s4); min-height: var(--tap); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.actions .link { flex: 1 1 auto; white-space: nowrap; padding: 0 var(--s3); }
.link:hover { border-color: var(--text-dim); }
.link--danger { color: var(--danger); }
.link--danger:hover { border-color: var(--danger); }
.link[disabled] { opacity: .5; cursor: wait; }
.review__label .link { min-height: 40px; }
.detail { margin-top: var(--s3); border-top: 1px solid var(--border); padding-top: var(--s3); }
.detail h4 { margin: var(--s3) 0 var(--s2); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.detail ul { margin: 0; padding-left: 18px; }
.raw { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: var(--r-sm); padding: var(--s3); font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--text-dim); margin: 0; }

/* Technique card */
.tech__name { font-size: 18px; font-weight: 700; margin: 0 0 var(--s1); }
.tech__meta { color: var(--text-dim); font-size: 14px; }
.stale { display: inline-block; background: var(--gold); color: var(--gold-ink); font-weight: 700; margin-top: var(--s2); font-size: 14px; padding: 4px 12px; border-radius: 999px; }
.tech--stale { border-left: 4px solid var(--gold); }
.cues { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.cues li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--s3); background: var(--surface-2); border-radius: var(--r-sm); padding: var(--s2) var(--s3); overflow-wrap: anywhere; }
.cues time { color: var(--text-dim); font-size: 13px; padding-top: 2px; }

/* Dialog + toast */
.dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r); padding: var(--s5); width: min(380px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(20,20,10,.45); }
.dialog h3 { margin: 0 0 var(--s2); }
.dialog__actions { display: flex; gap: var(--s3); margin-top: var(--s4); }
.dialog__actions .btn { flex: 1; }
.toast { position: fixed; top: var(--s3); left: 50%; transform: translateX(-50%); background: #fff; color: var(--text); border: 1px solid var(--danger); border-left-width: 5px; padding: var(--s3) var(--s4); border-radius: var(--r-sm); width: max-content; max-width: calc(100vw - 32px); box-shadow: var(--shadow); z-index: 10; }
.toast--ok { border-color: var(--green); }

/* Tablet: sheet becomes a centered modal, session date column */
@media (min-width: 700px) {
  .nav__sub { display: block; }
  .btn--gold { width: auto; }
  .hero { padding: var(--s6) var(--s6) var(--s5); }
  .hero__n { font-size: 72px; }
  .hero__nums { gap: 96px; }
  .path { max-width: 720px; margin: 0 auto; }
  .advice { padding: var(--s5); }
  .advice__quote { font-size: 22px; }
  .sheet { width: min(640px, calc(100vw - 32px)); margin: auto; border-radius: var(--r); padding: var(--s4) var(--s5) var(--s5); }
  .sheet__grab { display: none; }
  .submit { padding: var(--s5); display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: var(--s4); align-items: stretch; }
  .field:last-child { justify-content: flex-start; }
  .field:last-child .btn { margin-top: auto; }
  .session { grid-template-columns: 92px minmax(0, 1fr); gap: var(--s4); }
  .session__date, .session__wd { display: block; margin-left: 0; }
  .card { padding: var(--s3) var(--s5); }
  .actions .link { flex: 0 0 auto; min-height: 44px; }
  .actions { justify-content: flex-end; }
}
/* Desktop: hero full width, timeline + dictionary side by side */
@media (min-width: 900px) {
  .cols { grid-template-columns: 1.6fr 1fr; }
  .wrap { padding: 0 var(--s5); }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } .sheet[open], .tech--flash { animation: none; } }
