:root {
  --ink: #1f2328; --muted: #6b7078; --faint: #9aa0a6; --line: #e6e4df; --bg: #f7f6f3; --card: #ffffff;
  --first: #1d9e75; --first-bg: #e1f5ee; --first-ink: #085041;
  --trial: #d85a30; --trial-bg: #faece7; --trial-ink: #712b13;
  --renew: #ba7517; --renew-bg: #faeeda; --renew-ink: #633806;
  --recog: #7f77dd; --recog-bg: #eeedfe; --recog-ink: #3c3489;
  --done-bg: #f3f2ee; --warn-bg: #fdf3d8; --warn-ink: #7a5300; --red: #b42318;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
button { font: inherit; font-size: 13px; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 12px; cursor: pointer; }
button:hover { border-color: #cfccc4; }
button.ghost { border-color: transparent; background: transparent; padding: 2px 8px; }
button.ghost:hover { background: #ecebe6; }
.muted { color: var(--muted); }

.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding: 22px 28px 10px; max-width: 980px; margin: 0 auto; }
h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h1 .studio { font-weight: 400; color: var(--muted); }
.sub { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted); margin-top: 6px; font-size: 14px; }
.sub #day { color: var(--ink); min-width: 230px; }
.sub #day b { font-weight: 600; }
.daynav { display: inline-flex; align-items: center; gap: 0; }
.daynav[hidden] { display: none; }
.daynav [data-go] { border-radius: 0; margin-left: -1px; padding: 4px 12px; }
.daynav [data-go="-1"] { border-radius: 8px 0 0 8px; margin-left: 0; }
.daynav [data-go="1"] { border-radius: 0 8px 8px 0; }
.daynav [data-go].on { background: var(--ink); color: #fff; border-color: var(--ink); position: relative; }
.daynav .arrow { font-size: 18px; line-height: 1; padding: 2px 8px; }
.dayhint { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 0; }
.dayhint:empty { display: none; }
.loading .small { font-size: 13px; }
.status { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.proto { background: var(--warn-bg); color: var(--warn-ink); padding: 3px 9px; border-radius: 999px; font-size: 12px; }

.legend { max-width: 980px; margin: 0 auto; padding: 0 28px 14px; display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sw.first { background: var(--first); } .sw.trial { background: var(--trial); }
.sw.renew { background: var(--renew); } .sw.recog { background: var(--recog); }

main { max-width: 980px; margin: 0 auto; padding: 0 28px 40px; }
.loading, .empty { color: var(--muted); padding: 40px 0; text-align: center; }
.section-label { font-size: 12px; text-transform: none; color: var(--muted); margin: 22px 0 8px; letter-spacing: 0.02em; }

.cls { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.cls.finished { opacity: 0.86; }
.cls-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px;
  cursor: pointer; user-select: none; }
.cls.open .cls-head { border-bottom: 1px solid var(--line); }
.cls-name { font-weight: 600; }
.cls-meta { color: var(--muted); font-size: 13px; }
.cls-right { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.when { padding: 2px 9px; border-radius: 999px; font-size: 12px; background: var(--done-bg); color: var(--muted); }
.when.soon { background: var(--warn-bg); color: var(--warn-ink); }
.when.live { background: var(--first-bg); color: var(--first-ink); }
.chev { color: var(--faint); transition: transform .15s; }
.cls.open .chev { transform: rotate(90deg); }
.cls-body { display: none; }
.cls.open .cls-body { display: block; }

.row { display: flex; gap: 14px; padding: 12px 16px 12px 13px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
.row:last-child { border-bottom: 0; }
.row.first { border-left-color: var(--first); } .row.trial { border-left-color: var(--trial); }
.row.punch, .row.prepaid { border-left-color: var(--renew); } .row.recognition { border-left-color: var(--recog); }
.row.done { background: var(--done-bg); }
.row.done .name, .row.done .facts, .row.done .logbox { color: var(--muted); }
.row-main { flex: 1; min-width: 0; }
.name { font-weight: 600; font-size: 15px; }
.name .check { color: var(--first); margin-right: 4px; }
.name .wait { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 6px; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: 8px; vertical-align: 1px; }
.chip { font-size: 12px; padding: 1px 8px; border-radius: 6px; white-space: nowrap; }
.chip.first { background: var(--first-bg); color: var(--first-ink); }
.chip.trial { background: var(--trial-bg); color: var(--trial-ink); }
.chip.punch, .chip.prepaid { background: var(--renew-bg); color: var(--renew-ink); }
.chip.recognition { background: var(--recog-bg); color: var(--recog-ink); }
.chip.emph.first { background: var(--first); color: #fff; }
.chip.emph.trial { background: var(--trial); color: #fff; }
.chip.emph.punch, .chip.emph.prepaid { background: var(--renew); color: #fff; }
.chip.emph.recognition { background: var(--recog); color: #fff; }
.facts { font-size: 13px; color: var(--muted); margin-top: 3px; }
.facts div + div { margin-top: 1px; }

.logbox { margin-top: 8px; font-size: 13px; display: grid; grid-template-columns: 82px 1fr; gap: 2px 10px; }
.logbox .k { color: var(--faint); }
.logbox .v .by { color: var(--faint); }
.logbox .overdue { color: var(--red); }
.logbox .none { color: var(--faint); font-style: italic; }
.row-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.fulllog { margin-top: 10px; padding: 10px 12px; background: var(--bg); border-radius: 8px; font-size: 13px; }
.fulllog .ln { display: grid; grid-template-columns: 82px 1fr; gap: 10px; padding: 2px 0; }
.fulllog .ln.b .t { font-weight: 600; }
.fulllog .ln.a .t { color: #2e5f8a; }
.fulllog .d, .fulllog .by { color: var(--faint); }

.others { padding: 9px 16px; font-size: 13px; color: var(--muted); }
.others button { margin-left: 6px; }
.others .list { margin-top: 6px; color: var(--ink); }

footer { max-width: 980px; margin: 0 auto; padding: 0 28px 30px; font-size: 12px; color: var(--faint); }

/* ── phase 2: sign-in, notes ───────────────────────────────────────────── */
.who { background: var(--ink); color: #fff; border-color: var(--ink); }
.who:hover { background: #3a3f45; }
body.locked main, body.locked footer, body.locked .legend { filter: blur(7px); pointer-events: none; user-select: none; }
.overlay { position: fixed; inset: 0; background: rgba(247, 246, 243, 0.72); display: flex; align-items: center;
  justify-content: center; z-index: 10; }
.overlay[hidden] { display: none; }
.gate-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px;
  width: min(440px, 92vw); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08); }
.gate-card h2 { margin: 0 0 4px; font-size: 19px; font-weight: 600; }
.gate-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.names { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.names button.sel { background: var(--ink); color: #fff; border-color: var(--ink); }
.names .none { color: var(--muted); font-size: 14px; }
#pin-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#pin-form label { font-size: 13px; color: var(--muted); width: 100%; }
#pin { font: inherit; font-size: 20px; letter-spacing: 0.4em; width: 120px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 8px; }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); padding: 7px 16px; }
.err { color: var(--red); font-size: 13px; margin: 0; width: 100%; min-height: 1em; }
.gate-foot { margin: 14px 0 0; font-size: 12px; }
.gate-foot a { color: var(--muted); }

.compose { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.compose .sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.compose .sugg button { font-size: 12px; padding: 2px 9px; border-radius: 999px; color: var(--muted); }
.compose .line { display: flex; gap: 8px; align-items: center; }
.compose .date { color: var(--faint); font-size: 13px; white-space: nowrap; }
.compose input { flex: 1; font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.compose input:focus, #pin:focus { outline: 2px solid #b9d4f0; border-color: #8bb6e3; }
.compose .sig { color: var(--faint); font-size: 12px; }
.msg { font-size: 13px; margin-top: 6px; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--first-ink); }
.linkbtn { border: 0; background: none; padding: 0 4px; font-size: 12px; color: #2e5f8a; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.pending { margin-top: 8px; padding: 7px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; }
.cls.tests { border-style: dashed; }
.row.test { border-left-color: #8a8f98; }
#pin-form[hidden] { display: none; }
button:disabled { opacity: 0.55; cursor: default; }
.compose input:disabled { background: var(--bg); color: var(--muted); }
.okbtn { margin-left: 8px; font-size: 12px; padding: 1px 10px; }

/* ── phase 3: follow-ups, desk notes, management notes ─────────────────── */
.desk-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.desk-body .line, .walkin-form .line { display: flex; gap: 8px; align-items: center; }
.desk-body input { flex: 1; font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.desk-body input:focus { outline: 2px solid #b9d4f0; border-color: #8bb6e3; }
.found { display: flex; flex-direction: column; gap: 4px; }
.pick { text-align: left; display: flex; justify-content: space-between; gap: 10px; }
.picked { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.walkin-form summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.walkin-form[open] summary { margin-bottom: 8px; }
.walkin-form .line + .line { margin-top: 6px; }
.tray { border-top: 1px solid var(--line); padding-top: 10px; }
.tray-h { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.walkin { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.walkin:last-child { border-bottom: 0; }
.match { margin-top: 4px; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.small { font-size: 12px; }
.mnote { font-size: 14px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.mnote .by { color: var(--faint); font-size: 12px; }
.row.none { border-left-color: var(--line); }

/* ── follow-ups: one line each, detail on tap ──────────────────────────── */
.frow { display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 13px; border-bottom: 1px solid var(--line);
  border-left: 4px solid transparent; cursor: pointer; font-size: 14px; }
.frow:hover { background: #faf9f6; }
.frow:focus-visible { outline: 2px solid #8bb6e3; outline-offset: -2px; }
.frow.trial { border-left-color: var(--trial); } .frow.punch, .frow.prepaid { border-left-color: var(--renew); }
.frow.done { background: var(--done-bg); color: var(--muted); }
.frow .fname { font-weight: 600; min-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow.done .fname { font-weight: 500; }
.frow .fstatus { flex: 1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .fdue { font-size: 12px; color: var(--warn-ink); white-space: nowrap; }
.frow .fdue.over { color: var(--red); }
.frow .chev { color: var(--faint); transition: transform .15s; }
.frow.open .chev { transform: rotate(90deg); }
.chip.more { background: var(--done-bg); color: var(--muted); }
.fopen { border-bottom: 1px solid var(--line); }
.fopen .frow { border-bottom: 0; }
.fexp .row { border-left-color: transparent; padding-top: 0; }
.fexp .row .name { display: none; }
@media (max-width: 760px) {                 /* narrow screens: status drops to a second line instead of being cut */
  .frow { flex-wrap: wrap; row-gap: 2px; }
  .frow .fname { min-width: 0; }
  .frow .fstatus { order: 5; flex-basis: 100%; white-space: normal; padding-left: 0; font-size: 13px; }
  .frow .chev { margin-left: auto; }
}

/* ── tabs ──────────────────────────────────────────────────────────────── */
.tabs { max-width: 980px; margin: 2px auto 14px; padding: 0 28px; display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs[hidden] { display: none; }
.tab { border: 0; background: none; border-radius: 0; padding: 9px 14px; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); background: none; }
.tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tab .count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; font-size: 12px;
  background: var(--done-bg); color: var(--muted); font-weight: 500; }
.tab.on .count { background: var(--ink); color: #fff; }
.legend[hidden] { display: none; }
@media (max-width: 760px) {                 /* narrow screens: class summary under the title, not squeezing it */
  .cls-head { flex-wrap: wrap; row-gap: 4px; }
  .cls-head > div:first-child { flex-basis: 100%; }
  .cls-right { flex-basis: 100%; justify-content: space-between; white-space: normal; }
  .top { padding: 16px 16px 8px; } .tabs, .legend, main, footer { padding-left: 16px; padding-right: 16px; }
}
.desk-body .sig, .walkin-form .sig { color: var(--faint); font-size: 12px; }

/* ── follow-up quick actions and "Don't follow up" ─────────────────────── */
.frow .quick { display: inline-flex; gap: 4px; }
.qbtn { font-size: 12px; padding: 2px 9px; border-radius: 999px; color: var(--muted); background: var(--card); }
.qbtn:hover { color: var(--ink); border-color: #cfccc4; }
.frow .fok { font-size: 12px; color: var(--first-ink); white-space: nowrap; }
.frow.done .quick { opacity: 0.55; }
.fextra { padding: 0 16px 10px; }
.dismiss { margin: 0 16px 12px; padding: 10px 12px; background: var(--bg); border-radius: 8px; font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dismiss .other { display: inline-flex; gap: 6px; }
.dismiss .other input { font: inherit; font-size: 13px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; width: 150px; }
.dismiss .sig { width: 100%; color: var(--faint); font-size: 12px; }
@media (max-width: 760px) { .frow .quick { order: 6; } }

/* ── studio login page ─────────────────────────────────────────────────── */
body.studio-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { padding: 20px; width: 100%; display: flex; justify-content: center; }
.pw-label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
.pw-line { display: flex; gap: 8px; }
.pw-line input { flex: 1; font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.pw-line input:focus { outline: 2px solid #b9d4f0; border-color: #8bb6e3; }
.gate-foot a + a { margin-left: 12px; }

/* ── onboarding: owner setup link, first PIN, Studio setup tab (2026-11-24) ─ */
.gate-card.setup { width: min(480px, 94vw); }
.setup fieldset { border: 0; border-top: 1px solid var(--line); margin: 0 0 14px; padding: 12px 0 0; }
.setup legend { font-weight: 600; font-size: 14px; padding: 0 8px 0 0; }
.setup label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
.setup input, .admin input { font: inherit; font-size: 15px; width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.setup input:focus, .admin input:focus, #pin2:focus { outline: 2px solid #b9d4f0; border-color: #8bb6e3; }
.hint { color: var(--faint); font-size: 12px; margin: 2px 0 0; }
.names button .newpin { display: block; font-size: 11px; color: var(--trial-ink); }
.names button.sel .newpin { color: #f0d9cf; }
#pin2 { font: inherit; font-size: 20px; letter-spacing: 0.4em; width: 120px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.admin .who-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.admin .who-row:last-of-type { border-bottom: 0; }
.admin .who-row .nm { font-weight: 500; min-width: 150px; }
.admin .who-row .st { flex: 1; font-size: 13px; color: var(--muted); }
.admin .tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--done-bg); color: var(--muted); margin-left: 6px; }
.admin .tag.wait { background: var(--trial-bg); color: var(--trial-ink); }
.admin .line { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.admin .line input { flex: 1; min-width: 0; }
.admin .pw-grid { display: grid; grid-template-columns: 1fr 1fr 110px auto; gap: 8px; margin-top: 10px; }
@media (max-width: 760px) { .admin .pw-grid { grid-template-columns: 1fr; } }
