/* CCS Coaching student app. Phone first. Same calm palette as the coach site:
   gray and black for everything, one dark green main button per screen, red only for errors. */
:root {
  --bg: #F3F6F3; --surface: #FFFFFF; --fg: #15201A; --muted: #5A6A5F; --line: #D5DED7;
  --brand: #006738; --lime: #B3F063; --bad: #B3261E; --tint: #E6EBE7;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0F1612; --surface: #17211B; --fg: #E3ECE5; --muted: #93A398; --line: #2C3A31;
    --brand: #7FD69E; --bad: #F2B8B5; --tint: #24302A; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.bar { display: flex; align-items: center; gap: 12px; padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.mark { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--lime); }
.name { font-weight: 700; font-size: 17px; }
.env { font: 600 13px var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }

.tabs { position: sticky; top: 0; z-index: 5; display: flex; justify-content: center; background: var(--surface); border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; max-width: 214px; min-height: 48px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted);
  font: 600 15px var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tabs button.on { color: var(--fg); border-bottom-color: var(--brand); }
.count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--fg); color: var(--bg); font-size: 13px; line-height: 22px; text-align: center; }

main { max-width: 640px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left)) 96px; outline: none; }
h1 { font-size: 24px; margin: 4px 0 2px; line-height: 1.25; }
h2 { font-size: 13px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 24px 0 8px; font-weight: 600; }
h3 { font-size: 19px; margin: 2px 0 6px; line-height: 1.3; }
p { margin: 0 0 10px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 12px; }
.eyebrow { font-size: 14px; color: var(--muted); font-weight: 600; margin: 0; }
.goal { font-weight: 600; margin: 0 0 10px; }
.field { margin: 12px 0 0; }
.field .k { display: block; font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.links { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.links a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }
.links a::after { content: "↗"; margin-left: auto; padding-left: 10px; color: var(--muted); }

.progress { margin: 4px 0 0; }
.progress .row { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 6px 0 4px; }
.meter > span { display: block; height: 100%; background: var(--fg); border-radius: 4px; }
.note { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.due { border-left: 4px solid var(--fg); padding: 8px 12px; background: var(--bg); border-radius: 8px; margin-top: 10px; font-size: 15px; }

.done-list { list-style: none; margin: 0; padding: 0; }
.card.done-list, .card.entries { padding: 2px 16px; }
.done-list li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.done-list li:last-child { border-bottom: 0; }
.done-list .what { flex: 1; min-width: 0; }
.done-list .res { font-size: 14px; font-weight: 600; white-space: nowrap; }
.done-list .res.passed { color: var(--fg); }
.done-list .res.moved { color: var(--muted); }

.banner { border: 1px solid var(--line); border-left: 4px solid var(--fg); border-radius: 10px; padding: 12px 14px; background: var(--surface); margin-bottom: 12px; }

/* Messages */
.thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.msg { max-width: 85%; padding: 10px 12px; border-radius: 14px; overflow-wrap: anywhere; }
.msg .who { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.msg.coach { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.student { align-self: flex-end; background: var(--tint); border: 1px solid transparent; border-bottom-right-radius: 4px; }
.msg .when { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.day-sep { align-self: center; font-size: 13px; color: var(--muted); font-weight: 600; margin: 6px 0 0; }
.compose { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

/* Forms */
label { font-weight: 600; display: block; margin: 12px 0 4px; }
textarea, input[type=text], input[type=email] { width: 100%; font: 16px/1.4 var(--font); color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
textarea { min-height: 96px; resize: vertical; }
textarea:focus, input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
input.code { font: 600 22px var(--mono); letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.btn, .ghost { min-height: 48px; border-radius: 10px; padding: 10px 18px; font: 600 16px var(--font); cursor: pointer; }
.btn { background: var(--brand); border: 1px solid var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn { color: #0F1612; } }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.ghost { background: var(--surface); border: 1px solid var(--line); color: var(--fg); }
.ghost.sm { min-height: 44px; padding: 6px 14px; font-size: 15px; }
.btn:focus-visible, .ghost:focus-visible, .tabs button:focus-visible, .seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; min-height: 48px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 10px; font: 600 15px var(--font); cursor: pointer; }
.seg button.on { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.consent { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 12px; background: var(--bg); }
.consent p { font-size: 15px; }
.check { display: flex; gap: 12px; align-items: center; min-height: 44px; font-weight: 600; margin: 8px 0 0; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--brand); }
.err { color: var(--bad); font-weight: 600; margin: 8px 0 0; }

.entries { list-style: none; margin: 0; padding: 0; }
.entries li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.entries li:last-child { border-bottom: 0; }
.entries .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.entries .tag { font-weight: 700; color: var(--fg); }

.signin { max-width: 420px; margin: 24px auto 0; }
.signin h1 { margin-bottom: 8px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px);
  background: var(--fg); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.2); font-size: 15px; }
.toast button { background: none; border: 1px solid currentColor; color: inherit; border-radius: 8px; min-height: 40px; padding: 4px 12px; font-weight: 700; cursor: pointer; }
.so-far { margin: -4px 0 10px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 20px 0 4px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
