/* Manners Studio. The app's tokens (mobile/src/design/theme.ts), set for a desk rather than a phone. */
:root {
  --bg: #FAFAF8; --surface: #FFFFFF; --inset: #F4F3F0; --border: #ECEAE6; --hair: #F1EFEB;
  --edge: #9AA49F; --ring: #CFCBC3; --ink: #0F1A17; --ink2: #3D4B46; --ink3: #6B7873;
  --deep: #0B2E28; --deep2: #154840; --on-deep: #FFFFFF; --mint: #E4F2EB; --accent: #E0206B;
  /* The bands: what needs a look, what is slipping, what is loved. Never the accent, which the app keeps for its own few things. */
  --trouble: #C7332F; --trouble-soft: #FBEAE9; --watch: #B7791F; --watch-soft: #FBF2E3;
  --loved: #22A06B; --loved-soft: #E4F4EC;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --body: "Geist", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--deep); text-underline-offset: 3px; text-decoration-color: var(--edge); }
a:hover { text-decoration-color: var(--deep); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; border-radius: 8px; }
.loading { color: var(--ink3); padding: 80px 24px; text-align: center; }
.num { font-variant-numeric: tabular-nums; }

/* ── the bar ─────────────────────────────────────────────── */
.bar {
  position: sticky; top: 0; z-index: 5; background: rgba(250, 250, 248, 0.92);
  backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--hair);
}
.bar-in { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand b { font-weight: 600; font-size: 11.5px; letter-spacing: 0.32em; }
.brand i { font-family: var(--serif); font-size: 22px; color: var(--ink2); }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.nav a { text-decoration: none; color: var(--ink3); padding: 7px 12px; border-radius: 999px; font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--ink); background: var(--inset); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.who { display: flex; align-items: center; gap: 12px; color: var(--ink3); font-size: 13px; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

/* ── the page ────────────────────────────────────────────── */
.page { max-width: 1120px; margin: 0 auto; padding: 0 24px 96px; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink3); margin: 44px 0 6px; }
h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 52px);
  line-height: 1.04; letter-spacing: -0.02em; margin: 0 0 10px; text-wrap: balance;
}
h1 em { font-style: italic; color: var(--ink2); }
h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: -0.01em; margin: 0 0 14px; line-height: 1.1; }
h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink3); margin: 0 0 10px; }
.lede { color: var(--ink2); font-size: 16px; margin: 0 0 28px; max-width: 64ch; }
.note { color: var(--ink3); font-size: 13.5px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.card + .card { margin-top: 16px; }

/* ── controls ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  padding: 0 18px; border-radius: 999px; border: 1px solid var(--deep); background: var(--deep);
  color: var(--on-deep); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--deep2); }
.btn[disabled] { opacity: 0.45; cursor: default; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--border); }
.btn.quiet:hover { background: var(--inset); }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--trouble); border-color: #EBC9C7; }
.btn.danger:hover { background: var(--trouble-soft); }
.field { display: grid; gap: 6px; margin: 0 0 14px; }
.field span { font-size: 13px; font-weight: 500; color: var(--ink2); }
input[type="email"], input[type="password"], input[type="search"], input[type="text"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface);
}
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--deep); box-shadow: 0 0 0 3px rgba(11, 46, 40, 0.12); }
.error { color: var(--trouble); font-size: 13.5px; margin: 10px 0 0; }
.ok { color: var(--loved); font-size: 13.5px; margin: 10px 0 0; }

/* ── sign in ─────────────────────────────────────────────── */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin form { width: min(400px, 100%); }
.signin .brand { margin-bottom: 36px; }
.signin h1 { font-size: 44px; }
.signin .btn { width: 100%; margin-top: 6px; }

/* ── the report ──────────────────────────────────────────── */
.tally { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.tally button {
  display: inline-flex; align-items: baseline; gap: 8px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 500; font-size: 13.5px; color: var(--ink2);
}
.tally button b { font-weight: 600; color: var(--ink); }
.tally button[aria-pressed="true"] { background: var(--deep); border-color: var(--deep); color: var(--on-deep); }
.tally button[aria-pressed="true"] b { color: var(--on-deep); }
.tally .dot { width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.filters { display: grid; grid-template-columns: 1fr 180px 200px; gap: 10px; margin: 0 0 18px; }

.list { display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 104px minmax(0, 1fr) 230px 130px 180px; gap: 18px; align-items: center;
  padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  text-decoration: none; color: var(--ink);
}
.row:hover { border-color: var(--ring); box-shadow: 0 2px 10px rgba(15, 26, 23, 0.05); }
.rating { display: grid; gap: 2px; }
.rating b { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1; letter-spacing: -0.02em; }
.band { font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.band.trouble { color: var(--trouble); } .band.watch { color: var(--watch); } .band.loved { color: var(--loved); }
.band.fine { color: var(--ink2); } .band.quiet { color: var(--ink3); }
.dish-name { font-weight: 600; font-size: 16px; line-height: 1.25; }
.dish-meta { color: var(--ink3); font-size: 13px; margin-top: 2px; }
.dish-why { color: var(--ink2); font-size: 13px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--hair); }
.split i { display: block; height: 100%; }
.split .again { background: var(--loved); } .split .good { background: var(--ring); } .split .less { background: var(--trouble); }
.split-legend { display: flex; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--ink3); white-space: nowrap; }
.split-legend b { color: var(--ink); font-weight: 600; }
.counts { font-size: 12.5px; color: var(--ink3); display: grid; gap: 2px; }
.counts b { color: var(--ink); font-weight: 600; }
.chip { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--inset); color: var(--ink2); line-height: 1.3; }
.chip.replace { background: var(--mint); color: var(--deep); }
.chip.rewrite { background: var(--watch-soft); color: #7A5010; }
.chip.rewritten { background: var(--loved-soft); color: #13643F; }
.empty { padding: 48px 24px; text-align: center; color: var(--ink3); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.more { display: flex; justify-content: center; margin-top: 16px; }

/* ── one dish ────────────────────────────────────────────── */
.back { display: inline-block; margin-top: 28px; color: var(--ink3); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--ink); }
.dish-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dish-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; margin-top: 18px; }
.decide { position: sticky; top: 80px; }
.standing { display: flex; gap: 22px; align-items: flex-start; }
.standing .rating b { font-size: 64px; }
.reasons { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--ink2); }
.reasons li::before { content: "—"; color: var(--edge); margin-right: 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }
.fact { background: var(--inset); border-radius: 12px; padding: 12px 14px; }
.fact b { display: block; font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.05; }
.fact span { font-size: 12.5px; color: var(--ink3); }
.months { display: grid; gap: 8px; }
.month { display: grid; grid-template-columns: 74px 1fr 120px; gap: 12px; align-items: center; font-size: 13px; }
.month .bar-cooked { height: 10px; border-radius: 99px; background: var(--deep); min-width: 2px; }
.seg { display: flex; gap: 6px; background: var(--inset); padding: 4px; border-radius: 999px; margin: 0 0 16px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 8px 10px; font-weight: 600; font-size: 13px; color: var(--ink3); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 26, 23, 0.1); }
.choices { display: grid; gap: 8px; margin: 0 0 14px; }
.choice { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: start; padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.choice:hover { background: var(--bg); }
.choice:has(input:checked) { border-color: var(--deep); background: var(--mint); }
.choice input { margin: 3px 0 0; accent-color: var(--deep); }
.choice strong { font-weight: 600; display: block; }
.choice small { color: var(--ink3); font-size: 12.5px; }
.choice em { font-style: normal; font-family: var(--serif); font-size: 22px; line-height: 1; }
.current { padding: 14px 16px; border-radius: 14px; background: var(--inset); margin: 0 0 16px; }
.current p { margin: 0; }
.current p + p { margin-top: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.log li { font-size: 13.5px; color: var(--ink2); }
.log time { color: var(--ink3); margin-right: 8px; }

/* ── decisions and the team ──────────────────────────────── */
.section { margin-top: 28px; }
.lines { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.lines li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; flex-wrap: wrap; }
.lines li + li { border-top: 1px solid var(--hair); }
.lines .what { min-width: 0; }
.lines .what a { font-weight: 600; text-decoration: none; color: var(--ink); }
.lines .what a:hover { text-decoration: underline; }
.lines .what p { margin: 2px 0 0; color: var(--ink3); font-size: 13px; }
.add { display: grid; grid-template-columns: 1fr 150px auto; gap: 10px; align-items: end; margin-top: 16px; }
.add .field { margin: 0; }

/* ── narrow screens: Dan reads on his phone ─────────────── */
@media (max-width: 960px) {
  .dish-grid { grid-template-columns: 1fr; }
  .decide { position: static; }
}
@media (max-width: 860px) {
  .row { grid-template-columns: 92px minmax(0, 1fr); gap: 6px 14px; }
  .row .answers, .row .counts, .row .decision { grid-column: 2; }
  .row .counts { display: flex; gap: 12px; flex-wrap: wrap; }
  .rating b { font-size: 28px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters input { grid-column: 1 / -1; }
  .who span { display: none; }
}
@media (max-width: 560px) {
  /* Two rows: the mark and Sign out, then the three pages. */
  .bar-in { flex-wrap: wrap; height: auto; padding: 10px 16px 8px; row-gap: 6px; justify-content: space-between; }
  .nav { order: 3; flex-basis: 100%; }
  .nav a { padding: 6px 10px; }
  .page { padding: 0 16px 72px; }
  .add { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .row, .btn, .tally button { transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s; }
}
