/* Classroom Walkthrough — styles
 *
 * Two layouts share this file. `.layout-walk` is the tablet screen: large
 * targets, lots of breathing room, nothing decorative. `.layout-admin` is the
 * ordinary desktop screens.
 *
 * Body text is 1.15rem (about 18px). Anything smaller is reserved for
 * genuinely secondary text — timestamps, meta lines, fine print.
 */

:root {
    --ink:        #17222e;
    --ink-soft:   #5a6672;
    --line:       #d8dee5;
    --paper:      #ffffff;
    --bg:         #f4f6f8;
    --brand:      #1f4e79;
    --brand-dark: #163c5e;
    --yes:        #1d6b3f;
    --yes-bg:     #e3f3e9;
    --no:         #9a3324;
    --no-bg:      #fbe9e6;
    --na:         #55606b;
    --na-bg:      #eceff2;
    --radius:     10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}

/* ------------------------------------------------------------------ chrome */

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: var(--brand);
    color: #fff;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar .brand { font-weight: 700; margin-right: auto; }
.topbar nav { display: flex; gap: 1rem; }
.topbar nav a { padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.topbar nav a:hover { border-bottom-color: rgba(255, 255, 255, 0.6); }
.topbar .who { font-size: 0.95rem; text-align: right; line-height: 1.2; }
.topbar .who small { display: block; opacity: 0.8; font-size: 0.8rem; }
.topbar .signout { font-size: 0.95rem; text-decoration: underline; }

.wrap {
    max-width: 52rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}
.layout-walk .wrap { max-width: 44rem; }

.footer {
    max-width: 52rem;
    margin: 0 auto;
    padding: 0 1rem 2.5rem;
    color: var(--ink-soft);
    font-size: 0.9rem;
}
.footer .notice { margin: 0 0 0.25rem; font-weight: 600; }
.footer .demo-flag { margin: 0; }

/* ------------------------------------------------------------------- cards */

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
.card-narrow { max-width: 30rem; margin-left: auto; margin-right: auto; }

h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 0.5rem; }
h2 { font-size: 1.3rem; margin: 0 0 0.4rem; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 0.4rem; text-transform: uppercase;
     letter-spacing: 0.04em; color: var(--ink-soft); }

.lede { color: var(--ink-soft); margin-top: 0; }
.meta { color: var(--ink-soft); font-size: 0.95rem; margin: 0.25rem 0; }
.error {
    background: var(--no-bg);
    border-left: 4px solid var(--no);
    color: var(--no);
    padding: 0.75rem 1rem;
    border-radius: 4px;
}

.priorities { margin: 0.5rem 0 1.25rem; padding-left: 1.4rem; }
.priorities li { margin-bottom: 0.6rem; }
.priorities span { display: block; color: var(--ink-soft); font-size: 0.95rem; }

/* ------------------------------------------------------------- form basics */

label { display: block; font-weight: 600; margin: 1rem 0 0.3rem; }

input[type="email"], input[type="password"], input[type="search"],
select, textarea {
    width: 100%;
    font: inherit;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible {
    outline: 3px solid rgba(31, 78, 121, 0.35);
    outline-offset: 1px;
}

.btn {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    padding: 0.7rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: #f7f9fb; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-big { padding: 1rem 1.4rem; font-size: 1.1rem; min-height: 3.25rem; }
.btn-block { width: 100%; margin-top: 1.25rem; }
.btn-quiet { background: transparent; border-style: dashed; color: var(--brand); }

.table { width: 100%; border-collapse: collapse; background: var(--paper);
         border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 0.6rem 0.75rem;
                       border-bottom: 1px solid var(--line); font-size: 1rem; }
.table th { background: #eef2f6; font-size: 0.9rem; text-transform: uppercase;
            letter-spacing: 0.03em; color: var(--ink-soft); }
.table tr:last-child td { border-bottom: 0; }

code { background: #eef2f6; padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.95em; }

/* ------------------------------------------------- walkthrough: classrooms */

.walk-h1 { margin-bottom: 1rem; }
.school-picker { margin-bottom: 1rem; }
.school-picker label { margin-top: 0; }
.filter { margin-bottom: 1rem; }

.teacher-list { list-style: none; margin: 0; padding: 0; }
.teacher-list li { margin-bottom: 0.6rem; }
.teacher-list a {
    display: block;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    min-height: 3.5rem;
    text-decoration: none;
    color: var(--ink);
}
.teacher-list a:hover { border-color: var(--brand); }
.t-name { display: block; font-weight: 700; font-size: 1.15rem; }
.t-meta { display: block; color: var(--ink-soft); font-size: 0.95rem; }
.t-visit { display: block; margin-top: 0.3rem; font-size: 0.9rem; font-weight: 600; }
.t-visit.never  { color: var(--no); }
.t-visit.stale  { color: #8a6116; }
.t-visit.recent { color: var(--ink-soft); }

/* ------------------------------------------------------ walkthrough: form  */

.walk-header {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.walk-header h1 { margin-bottom: 0.2rem; }
.non-eval {
    margin: 0.6rem 0 0;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
}

.walk-row { margin-bottom: 1.25rem; }
.walk-row label { margin-top: 0; }

.indicator {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem 1.25rem;
    margin-bottom: 1.25rem;
}
.indicator .prompt { margin: 0 0 1rem; font-size: 1.15rem; }

.choices { display: flex; gap: 0.6rem; }
.choice {
    flex: 1;
    margin: 0;
    position: relative;
    text-align: center;
    font-weight: 700;
    border: 2px solid var(--line);
    border-radius: 8px;
    padding: 1rem 0.5rem;
    min-height: 3.5rem;
    cursor: pointer;
    background: #fff;
    color: var(--na);
    display: flex;
    align-items: center;
    justify-content: center;
}
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { font-size: 1.05rem; }
.choice:hover { border-color: var(--ink-soft); }

.choice-yes:has(input:checked) { background: var(--yes-bg); border-color: var(--yes); color: var(--yes); }
.choice-no:has(input:checked)  { background: var(--no-bg);  border-color: var(--no);  color: var(--no); }
.choice-not_observed:has(input:checked) { background: var(--na-bg); border-color: var(--na); color: var(--na); }
/* :has() is well supported on current tablets; this is the fallback for older
   browsers, applied by app.js adding .is-chosen to the label. */
.choice.is-chosen { border-color: var(--brand); background: #eef4fa; color: var(--brand-dark); }

.evidence { margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.evidence-label { margin: 0 0 0.5rem; font-weight: 600; font-size: 0.95rem; color: var(--ink-soft); }

.check { display: flex; align-items: flex-start; gap: 0.6rem; font-weight: 400;
         margin: 0 0 0.5rem; padding: 0.5rem; border-radius: 6px; cursor: pointer; }
.check:hover { background: #f4f7fa; }
.check input { width: 1.4rem; height: 1.4rem; margin: 0.1rem 0 0; flex: none; }
.check span { font-size: 1.05rem; }

.note { margin-top: 1rem; }
.note textarea { margin-top: 0.6rem; }

.extra .extra-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

.save-bar {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding: 1rem 0 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    border-top: 1px solid var(--line);
}
.save-bar .btn-primary { flex: 1 1 16rem; }
.autosave { flex: 1 1 100%; margin: 0; font-size: 0.9rem; color: var(--ink-soft); }

/* -------------------------------------------------------------- narrow/tall */

@media (max-width: 30rem) {
    .wrap { padding-left: 1rem; padding-right: 1rem; }
    .choices { flex-direction: column; }
    .choice { min-height: 3.25rem; }
    .topbar { gap: 0.5rem; }
    .topbar .who { text-align: left; }
}

/* --------------------------------------------------------------- reporting */

.filters .filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.75rem 1rem;
}
.filters .filter-grid label { margin-top: 0; font-size: 0.95rem; }
.filters .filter-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.filters .meta { margin-top: 0.75rem; }

.headline { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem;
            margin: 0.5rem 0 0; padding: 0; }
.headline li { color: var(--ink-soft); font-size: 0.95rem; }
.headline strong { display: block; font-size: 1.6rem; color: var(--ink); line-height: 1.1; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th small { display: block; font-weight: 400; font-size: 0.75rem;
                  letter-spacing: 0.04em; color: var(--ink-soft); }

/* Wide matrices scroll sideways rather than squeezing the labels. */
.scroller { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.matrix th[scope="row"] { white-space: nowrap; background: #fafbfc; }
.matrix td { min-width: 5.5rem; }
.matrix .group-row { background: #eef2f6; font-weight: 700; }

/* A percentage, with the bar behind the number rather than beside it, so a
   column of these reads as a shape at a glance. */
.pct { position: relative; display: block; min-width: 4.5rem; padding: 0.2rem 0.35rem;
       border-radius: 4px; background: #eef2f6; overflow: hidden; }
.pct-bar { position: absolute; inset: 0 auto 0 0; background: #c6dcef; }
.pct-num { position: relative; font-variant-numeric: tabular-nums; font-size: 0.95rem; }

/* Withheld because n is too small. Deliberately quiet, not alarming: it is
   normal, not an error. */
.too-few { color: var(--ink-soft); cursor: help; }

.delta { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.95rem; }
.delta.up   { color: var(--yes); }
.delta.down { color: var(--no); }
.delta.flat { color: var(--ink-soft); }

.gap { display: block; margin-top: 0.15rem; font-size: 0.8rem;
       font-variant-numeric: tabular-nums; }
.gap-ok   { color: var(--ink-soft); }
.gap-wide { color: #8a6116; font-weight: 700; }

.evidence-rank { list-style: none; margin: 0.4rem 0 1rem; padding: 0; }
.evidence-rank li { display: flex; align-items: baseline; gap: 0.6rem;
                    padding: 0.3rem 0; border-bottom: 1px solid var(--line); }
.evidence-rank li:last-child { border-bottom: 0; }
.evidence-rank .count { flex: none; min-width: 2.5rem; text-align: right;
                        font-weight: 700; font-variant-numeric: tabular-nums; }
.evidence-rank small { color: var(--ink-soft); }

.callout { border-left: 4px solid var(--brand); background: #f5f9fc; }
.callout p { margin: 0 0 0.5rem; }
.callout p:last-child { margin-bottom: 0; }

.note-quote { margin: 0 0 1rem; padding: 0.75rem 1rem; background: #fafbfc;
              border-left: 3px solid var(--line); border-radius: 4px; }
.note-quote p { margin: 0 0 0.4rem; }
.note-quote footer { font-size: 0.85rem; color: var(--ink-soft); }

td.partial { color: #8a6116; font-weight: 700; }

/* ---------------------------------------------------------------- feedback */

.feedback-box { border-left: 4px solid #c8b273; }
.feedback-box .meta { margin-bottom: 0.75rem; }

.feedback-item .fb-head { display: flex; align-items: baseline;
                          justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.feedback-item h2 { margin: 0; font-size: 1.15rem; }
.feedback-item h2 a { color: var(--brand-dark); text-decoration: none; }
.feedback-item h2 a:hover { text-decoration: underline; }
.fb-subject { font-weight: 600; margin: 0.5rem 0 0.25rem; }
.fb-excerpt { margin: 0; color: var(--ink-soft); }

.badge { font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
         letter-spacing: 0.05em; padding: 0.2rem 0.5rem; border-radius: 999px;
         white-space: nowrap; }
.badge-draft { background: var(--na-bg); color: var(--na); }
.badge-sent  { background: var(--yes-bg); color: var(--yes); }

.notice-ok { background: var(--yes-bg); border-left: 4px solid var(--yes);
             color: var(--yes); padding: 0.75rem 1rem; border-radius: 4px; }

.btn-danger { color: var(--no); border-color: #e4bdb6; }
.btn-danger:hover { background: var(--no-bg); }

.email-preview { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.email-preview > p { margin: 0; padding: 0.5rem 0.9rem; border-bottom: 1px solid var(--line);
                     background: #fafbfc; font-size: 0.95rem; }
.email-preview > p span { display: inline-block; min-width: 4.5rem; color: var(--ink-soft);
                          font-weight: 600; }
.email-body { margin: 0; padding: 1rem 0.9rem; white-space: pre-wrap; word-wrap: break-word;
              font-family: inherit; font-size: 1.05rem; line-height: 1.55; background: #fff; }

.send-row { border-bottom: 1px solid var(--line); padding: 0.5rem 0; }
.send-row:last-child { border-bottom: 0; }
.send-row summary { cursor: pointer; font-size: 0.95rem; }
.send-row .email-body { background: #fafbfc; border-radius: 6px; margin-top: 0.5rem; }

.teacher-list .school-head { font-weight: 700; color: var(--ink-soft);
                             font-size: 0.9rem; text-transform: uppercase;
                             letter-spacing: 0.04em; margin: 1rem 0 0.4rem; }

/* ----------------------------------------------------------------- admin */

.crumb { font-size: 0.95rem; color: var(--ink-soft); margin: 0 0 0.5rem; }
.crumb a { color: var(--brand); }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
.admin-tile { display: block; text-decoration: none; color: inherit; margin: 0; }
.admin-tile:hover { border-color: var(--brand); }
.admin-tile h2 { font-size: 1.05rem; color: var(--brand-dark); }
.admin-tile .big { font-size: 2.2rem; font-weight: 700; margin: 0.2rem 0; line-height: 1; }

.section-head { margin: 2rem 0 0.25rem; }

.row-retired { opacity: 0.6; }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline; }
.table td small { display: block; color: var(--ink-soft); font-size: 0.85rem; }

/* A button that reads as a link, for in-table actions. */
.linkish { background: none; border: 0; padding: 0 0.4rem; font: inherit;
           font-size: 0.95rem; color: var(--brand); text-decoration: underline;
           cursor: pointer; }
.linkish:hover { color: var(--brand-dark); }
.linkish.danger { color: var(--no); }

.inline-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
               margin: 0.5rem 0; }
.inline-form input[type="text"] { width: auto; flex: 1 1 10rem; }

.question-card { border-left: 4px solid var(--brand); }
.question-card h3 { margin: 0; font-size: 1.1rem; text-transform: none;
                    letter-spacing: 0; color: var(--ink); }
.question-card h3 code { font-size: 0.8em; }
.question-card h4 { margin: 1.25rem 0 0.5rem; font-size: 0.95rem;
                    text-transform: uppercase; letter-spacing: 0.04em;
                    color: var(--ink-soft); }

.evidence-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
                padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.evidence-row:last-of-type { border-bottom: 0; }
.evidence-row input[type="text"] { flex: 1 1 16rem; width: auto; }
.evidence-row select { flex: 0 1 14rem; width: auto; }
.evidence-row .narrow { width: 4.5rem; flex: none; }
.evidence-row.new { border-top: 1px dashed var(--line); padding-top: 0.75rem; margin-top: 0.5rem; }
.tick-count { min-width: 3rem; text-align: right; }

.priority-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
                   gap: 0.2rem; margin: 0.75rem 0; }

.inset { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.inset label { font-size: 0.95rem; }

.error-inline { color: var(--no); font-weight: 600; }

/* --------------------------------------------------------------- coverage */

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
                   overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.table .sub { display: block; color: var(--ink-soft); font-size: 0.9rem; font-weight: 400; }

.coverage-schools { list-style: none; margin: 1rem 0 0; padding: 0; }
.coverage-schools li { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr auto;
                       align-items: center; gap: 0.75rem; padding: 0.3rem 0; }
.cs-bar { display: block; height: 0.7rem; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.cs-bar span { display: block; height: 100%; background: #6f9ac2; }
.cs-num { font-variant-numeric: tabular-nums; font-size: 0.95rem; color: var(--ink-soft); }

@media (max-width: 30rem) {
    .coverage-schools li { grid-template-columns: 1fr auto; }
    .cs-bar { grid-column: 1 / -1; grid-row: 2; }
}

.table.coverage td { vertical-align: top; }
.table.coverage tr.not-seen td:first-child { box-shadow: inset 4px 0 0 #c8962e; }
.table.coverage .btn { padding: 0.45rem 0.8rem; white-space: nowrap; }

.badge-unseen { background: #fbf1dc; color: #7a5410; }
.badge-mine   { background: #e6eef7; color: var(--brand-dark); margin-left: 0.3rem; }

.caseload-grid th.cg-person { text-align: center; min-width: 8rem; text-transform: none;
                              letter-spacing: 0; font-size: 0.95rem; }
.caseload-grid th.cg-person small { text-transform: none; }
.caseload-grid th[scope="row"] { white-space: nowrap; background: #fafbfc; font-weight: 600; }
.caseload-grid td.cg-cell { text-align: center; padding: 0; }
/* The whole cell is the tap target, not just the box. */
.cg-check { display: flex; justify-content: center; align-items: center; margin: 0;
            min-height: 3rem; cursor: pointer; }
.cg-check:hover { background: #f4f7fa; }
.cg-check input { width: 1.4rem; height: 1.4rem; margin: 0; }

.caseload-card .headline { margin-bottom: 0.75rem; }
.teacher-list .t-mine { color: var(--brand-dark); }
.caseload-grid .group-row td { background: #eef2f6; font-weight: 700; }
