/* TeacherDesk — calm forest/cream glass theme. Plain CSS, no external fonts or assets. */
:root {
  --bg: #F4F1EA;
  --wash: #DDEFE8;
  --panel: rgba(255, 255, 255, .78);
  --panel-solid: #FFFFFF;
  --glass-line: rgba(255, 255, 255, .7);
  --line: #E4E2D9;
  --soft: #F1EFE8;
  --ink: #0F3D36;
  --text: #17322D;
  --muted: #586B66;            /* 5.6:1 on white, 5:1 on cream */
  --accent: #F28C4B;           /* orange: primary actions only, dark ink text on it */
  --accent-ink: #3A1D08;
  --teal: #2E8B7A;
  --peach: #F6C9A8;
  --mint: #DDEFE8;
  --mint-ink: #0F5C50;
  --ok: #23774B; --ok-soft: #E2F2E8;
  --warn: #8A5A00; --warn-soft: #FBEFD3;   /* amber text darkened for contrast */
  --bad: #B23A36; --bad-soft: #FBE6E4;
  --info: #31607F; --info-soft: #E3EEF5;
  --radius-lg: 24px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 24px rgba(15, 61, 54, .08);
  --shadow-hover: 0 16px 36px rgba(15, 61, 54, .14);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Inter", "Plus Jakarta Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1715; --wash: #12302A; --panel: rgba(22, 38, 35, .82); --panel-solid: #162623; --glass-line: rgba(255,255,255,.06);
    --line: #263B37; --soft: #1B2E2A; --ink: #CFEBE2; --text: #E3EFEB; --muted: #9DB5AE;
    --mint: #1D3B35; --mint-ink: #A9E3D3; --accent-ink: #2A1405;
    --ok: #6CCB98; --ok-soft: #173326; --warn: #E9B95A; --warn-soft: #3A2E15; --bad: #F08A84; --bad-soft: #3D2020; --info: #8CBFE0; --info-soft: #1B2D3A;
    --shadow: 0 8px 24px rgba(0,0,0,.35); --shadow-hover: 0 16px 36px rgba(0,0,0,.45);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) { --panel-solid: #162623; }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 700px at 85% -10%, var(--wash), transparent 60%), radial-gradient(900px 600px at -10% 110%, var(--wash), transparent 55%), var(--bg);
  color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--mint-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: -.02em; color: var(--ink); font-weight: 700; }
h2 { font-size: 15px; margin: 0; color: var(--ink); font-weight: 650; }
h3 { font-size: 14px; margin: 12px 0 6px; color: var(--ink); }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.i { flex: none; vertical-align: -3px; }

/* ---------- shell ---------- */
.canvas { padding: 18px; min-height: 100vh; }
.app { display: flex; gap: 18px; min-height: calc(100vh - 36px); background: rgba(255,255,255,.35); border: 1px solid var(--glass-line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 14px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .app { background: rgba(10, 22, 20, .55); } }
.rail { z-index: 15; width: 64px; flex: none; background: #0F3D36; border-radius: 32px; padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; position: sticky; top: 18px; height: calc(100vh - 64px); }
.rail-logo { width: 40px; height: 40px; border-radius: 14px; background: var(--mint); color: #0F3D36; display: grid; place-items: center; font-weight: 800; font-size: 13px; margin-bottom: 10px; text-decoration: none !important; }
.nav { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.nav a, .rail-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #CFE6DF; border: 0; background: none; cursor: pointer; transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease); text-decoration: none !important; }
.nav a:hover, .rail-btn:hover { background: rgba(221, 239, 232, .14); color: #fff; }
.nav a.active { background: var(--mint); color: #0F3D36; }
.nav-sep { width: 22px; height: 1px; background: rgba(221,239,232,.2); margin: 4px 0; }
.badge { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid #0F3D36; }
.badge:empty { display: none; }
[data-tip] { position: relative; }
.rail [data-tip]::after { content: attr(data-tip); position: absolute; left: 52px; top: 50%; transform: translateY(-50%) translateX(-4px); background: #0F3D36; color: #fff; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 30; box-shadow: var(--shadow); }
.rail [data-tip]:hover::after, .rail [data-tip]:focus-visible::after { opacity: 1; transform: translateY(-50%); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rail-dot { width: 10px; height: 10px; border-radius: 50%; background: #6B7C78; }
.rail-dot.on { background: #7BE0B8; box-shadow: 0 0 0 4px rgba(123,224,184,.18); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; gap: 14px; align-items: center; padding: 4px 6px 14px; flex-wrap: wrap; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; margin-right: 8px; }
.brand-name { font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.search-wrap { position: relative; flex: 1; max-width: 380px; }
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search { padding-left: 36px !important; border-radius: 999px !important; background: var(--panel) !important; }
.top-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.view { padding: 4px 6px 40px; width: 100%; outline: none; }
.view > * { animation: rise .32s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: .03s; } .view > *:nth-child(3) { animation-delay: .06s; } .view > *:nth-child(4) { animation-delay: .09s; } .view > *:nth-child(n+5) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- basics ---------- */
.page-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
.head-actions, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions { margin-top: 10px; }
.row-actions.left { justify-content: flex-start; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 12px; }
.pad { padding: 10px 2px; }
.mt { margin-top: 16px; }
.ok { color: var(--ok); font-weight: 650; }
.bad-text { color: var(--bad); }
.nowrap { white-space: nowrap; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-solid); color: var(--ink); padding: 7px 14px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s; text-decoration: none !important; }
.btn:hover { background: var(--soft); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px rgba(242, 140, 75, .3); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.dark { background: #0F3D36; border-color: #0F3D36; color: #fff; }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 3px 11px; font-size: 12px; }
.btn.xs { padding: 2px 9px; font-size: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.input { border: 1px solid var(--line); background: var(--panel-solid); color: var(--text); border-radius: var(--radius-sm); padding: 7px 11px; font: inherit; width: 100%; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(46, 139, 122, .2); }
.input.sm { padding: 3px 8px; font-size: 13px; width: auto; }
.input.num { width: 76px; }
.input.wide { min-width: 360px; width: auto; }
textarea.input { resize: vertical; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters .input { width: auto; }
.filters #f-q, .filters #s-q { width: 240px; }
.lbl { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; font-weight: 600; }
.check { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.check.inline { display: inline-flex; margin-right: 14px; }

/* ---------- glass cards ---------- */
.card { background: var(--panel); border: 1px solid var(--glass-line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.card.lift:hover, .kpi:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }

.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--glass-line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); box-shadow: var(--shadow); backdrop-filter: blur(14px); transition: transform .2s var(--ease), box-shadow .2s var(--ease); text-decoration: none !important; display: block; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi-val { font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-val.sm { font-size: 20px; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0; }

/* ---------- bento home ---------- */
.bento { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.bento-main { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.bento-main > .card { margin: 0; }
.bento-side { display: flex; flex-direction: column; gap: 16px; }
.bento-side > .card { margin: 0; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span4 { grid-column: span 4; }
.hero { background: linear-gradient(135deg, #0F3D36 0%, #14524A 100%); color: #EAF6F2; border: 0; display: flex; justify-content: space-between; gap: 18px; align-items: center; min-height: 150px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(221,239,232,.18), transparent 70%); pointer-events: none; }
.hero h1 { color: #fff; font-size: 30px; line-height: 1.15; }
.hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 500; color: #FFD9BF; }
.hero p { margin: 6px 0 14px; color: #CFE6DF; max-width: 46ch; }
.hero .sub { color: #CFE6DF; }
.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; z-index: 1; }
.stack { display: flex; }
.stack .avatar { border: 2px solid #0F3D36; margin-left: -8px; }
.pill-note { background: rgba(221,239,232,.14); color: #EAF6F2; border-radius: 999px; padding: 4px 12px; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.pill-note .live { width: 7px; height: 7px; border-radius: 50%; background: #7BE0B8; }
.stat .kpi-val { font-size: 38px; }
.stat .bar { height: 6px; border-radius: 6px; background: var(--soft); margin-top: 12px; overflow: hidden; display: flex; gap: 3px; }
.stat .bar span { display: block; height: 100%; border-radius: 6px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.stat-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--mint); color: var(--mint-ink); }
.stat-ico.bad { background: var(--bad-soft); color: var(--bad); } .stat-ico.warn { background: var(--warn-soft); color: var(--warn); }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 12px; border-radius: 999px; cursor: pointer; transition: background .18s, color .18s; }
.seg button.on { background: #0F3D36; color: #fff; }
.capsules { display: flex; align-items: flex-end; gap: 14px; height: 150px; padding: 8px 4px 0; }
.capsule { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.capsule .cap { width: 100%; max-width: 44px; border-radius: 22px; background: var(--peach); min-height: 10px; transition: height .4s var(--ease); position: relative; }
.capsule .cap.hot { background: linear-gradient(180deg, #47A794, var(--teal)); }
.capsule .cap b { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--ink); }
.capsule .lab { font-size: 11px; color: var(--muted); font-weight: 600; text-align: center; line-height: 1.2; }
.members { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; max-height: 330px; overflow-y: auto; padding-right: 4px; }
.member { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--text); text-align: center; text-decoration: none !important; border-radius: 12px; padding: 6px 2px; transition: background .15s; }
.member:hover { background: var(--soft); }
.member .avatar { width: 40px; height: 40px; font-size: 13px; }
.count-pill { background: var(--mint); color: var(--mint-ink); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; margin-left: 6px; }

.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-head h2 { font-size: 18px; }
.cal-nav { display: flex; gap: 6px; }
.icon-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-solid); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--soft); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day-pill { border: 0; background: none; font: inherit; border-radius: 14px; padding: 6px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text); cursor: pointer; transition: background .15s; }
.day-pill:hover { background: var(--soft); }
.day-pill .dn { font-size: 11px; color: var(--muted); }
.day-pill .dd { font-size: 15px; font-weight: 700; }
.day-pill.today { background: #0F3D36; color: #fff; }
.day-pill.today .dn { color: #CFE6DF; }
.day-pill.sel { box-shadow: inset 0 0 0 2px var(--teal); }
.dots { display: flex; gap: 3px; height: 6px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.dots .d-due { background: var(--teal); } .dots .d-ext { background: #E58F55; } .dots .d-flag { background: var(--bad); }
.day-pill.today .d-due { background: #7BE0B8; }
.cal-legend { display: flex; gap: 12px; margin-top: 10px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; gap: 5px; align-items: center; }
.cal-list { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.tabs-mini { display: flex; gap: 16px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.tabs-mini button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; cursor: pointer; }
.tabs-mini button.on { color: var(--ink); border-bottom-color: #0F3D36; }
.notif { display: flex; gap: 10px; align-items: flex-start; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif .n-main { flex: 1; min-width: 0; font-size: 13px; cursor: pointer; }
.notif .n-main b { color: var(--ink); }
.notif .n-act { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.notif-body { animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- accommodations by type ---------- */
.acc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.acc-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--soft); color: var(--text); text-decoration: none !important; transition: background .15s, transform .15s var(--ease); }
.acc-stat:hover { background: var(--mint); transform: translateY(-2px); }
.acc-stat .kpi-val { font-size: 30px; }
.warn-text { color: var(--warn) !important; }
.acc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.acc-grid h3, .acc-card h3 { display: flex; gap: 6px; align-items: center; margin: 0 0 8px; font-size: 13px; }
.hbars { display: flex; flex-direction: column; gap: 2px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 26px; gap: 10px; align-items: center; padding: 5px 6px; border-radius: 8px; color: var(--text); font-size: 12.5px; text-decoration: none !important; transition: background .15s; }
.hbar:hover, .hbar:focus-visible { background: var(--soft); }
.hb-label { display: flex; gap: 4px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--teal); transition: width .4s var(--ease); }
.hbar.review .hb-fill { background: var(--warn); }
.hbar.review .hb-label { color: var(--warn); font-weight: 650; }
.hbar.zero { opacity: .6; }
.hb-val { text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.share { display: inline-block; width: 80px; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; vertical-align: middle; }
.share-fill { display: block; height: 100%; background: var(--teal); border-radius: 0 4px 4px 0; }
.filter-chip { gap: 6px; padding-right: 2px; }
@media (max-width: 1100px) { .acc-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .acc-grid, .acc-stats { grid-template-columns: 1fr; } }

/* ---------- lists, avatars, chips ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 10px; align-items: center; padding: 9px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); text-align: left; font: inherit; cursor: pointer; border-radius: 10px; width: 100%; transition: background .15s; }
.list-item:hover { background: var(--soft); }
.list-item.static { cursor: default; } .list-item.static:hover { background: none; }
.list-item:last-child { border-bottom: 0; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.li-right { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.more { color: var(--muted); font-size: 12px; padding: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex: none; }

.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--mint); color: var(--mint-ink); display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; letter-spacing: .02em; }
.avatar.c1 { background: #FCE3D2; color: #8A3D0E; } .avatar.c2 { background: #DDEFE8; color: #0F5C50; } .avatar.c3 { background: #E3EEF5; color: #31607F; } .avatar.c4 { background: #F3E6F5; color: #6B3478; } .avatar.c5 { background: #FBEFD3; color: #6E4A00; }
.avatar.xl { width: 64px; height: 64px; font-size: 20px; }
.who { display: flex; gap: 8px; align-items: center; }
.who.big h2 { font-size: 18px; }

.chip, .tag { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); margin: 1px 3px 1px 0; white-space: nowrap; font-weight: 650; }
.chip .i, .tag .i { width: 12px; height: 12px; vertical-align: 0; }
.tag.good { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.flag-V1, .flag-V2, .flag-V3, .flag-V6 { background: var(--bad-soft); color: var(--bad); }
.flag-V4 { background: var(--warn-soft); color: var(--warn); }
.flag-V5 { background: var(--info-soft); color: var(--info); }
.flag-H { background: var(--warn-soft); color: var(--warn); }
.plan-sped { background: var(--mint); color: var(--mint-ink); }
.plan-504 { background: var(--info-soft); color: var(--info); }
.st-graded { background: var(--ok-soft); color: var(--ok); }
.st-submitted { background: var(--mint); color: var(--mint-ink); }
.st-window_open { background: var(--info-soft); color: var(--info); }
.st-past_window { background: var(--bad-soft); color: var(--bad); }
.st-needs_review { background: var(--warn-soft); color: var(--warn); }
.dl-used { background: var(--ok-soft); color: var(--ok); }
.dl-declined { background: var(--bad-soft); color: var(--bad); }
.dl-offered { background: var(--mint); color: var(--mint-ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 650; color: var(--muted); font-size: 12px; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr[data-row], .tbl tbody tr[data-go] { cursor: pointer; }
.tbl tbody tr[data-row]:hover, .tbl tbody tr[data-go]:hover { background: rgba(221, 239, 232, .45); }
.tbl.compact td { padding: 5px 8px; }
.tbl tr:last-child td { border-bottom: 0; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel); }
.empty-title { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.digest { background: var(--soft); padding: 12px; border-radius: 12px; white-space: pre-wrap; font-size: 12px; margin: 0; }
.stops { margin: 4px 0; padding-left: 18px; }
.stops li { margin: 4px 0; }
.day-group { margin-bottom: 14px; }
.day-head { font-weight: 700; padding: 6px 0; border-bottom: 2px solid var(--line); margin-bottom: 4px; color: var(--ink); }
.warn-box { background: var(--warn-soft); color: var(--warn); padding: 8px 10px; border-radius: 10px; }

.tabs { display: inline-flex; gap: 4px; background: var(--soft); padding: 4px; border-radius: 999px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 6px 14px; color: var(--muted); border-radius: 999px; font-weight: 600; text-decoration: none !important; transition: background .18s, color .18s; }
.tab.active { background: #0F3D36; color: #fff; }
.count { background: rgba(0,0,0,.08); border-radius: 9px; padding: 0 6px; font-size: 11px; }
.tab.active .count { background: rgba(255,255,255,.2); }

.proposal .prop-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.score-edit { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
.rationale { margin-top: 6px; }
.prop-foot { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.issues { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; margin-top: 8px; }

/* ---------- student record ---------- */
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.record-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--glass-line); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.record-head .head-actions { margin-left: auto; }
.chips-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.record { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.record-main { min-width: 0; }
.props-card h3 { margin: 0; }
.prop { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 5px 0; align-items: center; font-size: 13px; }
.prop-k { color: var(--muted); }
.prop-v { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.note { border-top: 1px solid var(--line); padding: 8px 0; font-size: 13px; white-space: pre-wrap; }
.field { margin-bottom: 10px; }
.day { display: inline-flex; gap: 3px; align-items: center; margin-right: 10px; font-size: 12px; }
.aeries { margin: 6px 0; font-size: 12px; }
.aeries summary { cursor: pointer; color: var(--muted); }
.aeries .sub { margin-top: 4px; white-space: pre-wrap; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl-row { display: grid; grid-template-columns: 170px 1fr 92px; gap: 12px; align-items: center; font-size: 12px; cursor: pointer; border-radius: 10px; padding: 2px 4px; }
.tl-row:hover { background: var(--soft); }
.tl-name { font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; height: 22px; background: var(--soft); border-radius: 11px; }
.tl-base, .tl-ext { position: absolute; top: 4px; height: 14px; border-radius: 7px; }
.tl-base { background: rgba(46, 139, 122, .35); }
.tl-ext { background: var(--peach); }
.tl-ext.canvas { background: linear-gradient(90deg, var(--peach), #E9A57A); }
.tl-sub { position: absolute; top: 1px; width: 4px; height: 20px; border-radius: 2px; background: #0F3D36; }
.tl-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--accent); border-radius: 1px; }
.tl-axis { display: grid; grid-template-columns: 170px 1fr 92px; gap: 12px; font-size: 11px; color: var(--muted); }
.tl-axis div:nth-child(2) { display: flex; justify-content: space-between; }

.drop { display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; cursor: pointer; margin-bottom: 8px; transition: border-color .15s, background .15s; }
.drop.over, .drop:hover { border-color: var(--teal); background: rgba(221, 239, 232, .4); }
.drop input { display: none; }

/* ---------- overlays ---------- */
.drawer { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(15, 61, 54, .18); opacity: 0; transition: opacity .2s; backdrop-filter: blur(2px); }
.drawer-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(480px, calc(100% - 24px)); background: var(--panel-solid); border-radius: var(--radius-lg); padding: 24px; overflow-y: auto; transform: translateX(110%); transition: transform .25s var(--ease); box-shadow: var(--shadow-hover); }
.drawer.open { pointer-events: auto; }
.drawer.open .scrim { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.close { position: absolute; top: 14px; right: 14px; }
.flags-line { margin: 4px 0 8px; }
.explain { padding: 9px 12px; border-radius: 12px; margin: 6px 0; font-size: 13px; }
.modal { position: fixed; inset: 0; background: rgba(15, 61, 54, .25); display: none; place-items: center; z-index: 30; padding: 16px; backdrop-filter: blur(3px); }
.modal.open { display: grid; }
.modal-panel { background: var(--panel-solid); border-radius: var(--radius-lg); padding: 24px; width: min(520px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-hover); animation: rise .22s var(--ease); }
.modal-panel h2 { font-size: 18px; margin-bottom: 8px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: #0F3D36; color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0; transition: all .2s var(--ease); pointer-events: none; z-index: 40; max-width: 90vw; font-weight: 600; box-shadow: var(--shadow-hover); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--bad); }

/* Screen-share blur: names and keys blurred until hovered/focused. */
body.blur .nm { filter: blur(6px); transition: filter .15s; }
body.blur .nm:hover { filter: none; }

/* ---------- responsive & motion ---------- */
@media (max-width: 1280px) { .bento { grid-template-columns: 1fr; } .bento-side { display: grid; grid-template-columns: 1fr 1fr; } .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .canvas { padding: 0; }
  .app { flex-direction: column; border-radius: 0; padding: 10px; gap: 10px; }
  .rail { width: 100%; height: auto; flex-direction: row; position: static; border-radius: 22px; padding: 6px 10px; overflow-x: auto; }
  .nav { flex-direction: row; }
  .nav-sep, .rail-foot { display: none; }
  .rail-logo { margin: 0 6px 0 0; }
  .rail [data-tip]::after { display: none; }
  .bento-main { grid-template-columns: 1fr 1fr; }
  .bento-side, .grid2, .grid3, .record { grid-template-columns: 1fr; }
  .span3, .span4 { grid-column: span 2; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .input.wide { min-width: 0; width: 100%; }
  .tl-row, .tl-axis { grid-template-columns: 110px 1fr 70px; }
  .brand-text { display: none; }
}
@media (max-width: 560px) { .hero { flex-direction: column; align-items: flex-start; } .hero-side { align-items: flex-start; } .hero h1 { font-size: 24px; } .bento-main { grid-template-columns: 1fr; } .span2, .span3, .span4 { grid-column: span 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card.lift:hover, .kpi:hover, .btn:hover { transform: none; }
}

/* Grok's review-only suggestions */
.sugg { border: 1px solid var(--warn-soft); }
.sugg-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.sugg-row:first-of-type { border-top: 0; }
.sugg-row .row-actions { margin-top: 0; flex: none; }

/* Shown when the app can't start (opened as a file, or no local server) */
.startup-help { max-width: 640px; margin: 40px auto; background: var(--panel); border: 1px solid var(--glass-line); border-radius: var(--radius-lg); padding: 28px 32px; box-shadow: var(--shadow); }
.startup-help ol { padding-left: 20px; line-height: 1.8; }
.conn-banner { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }

/* Home class/period filter */
.scope-bar { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; flex-wrap: wrap; }
.scope-bar > .sub { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; }
.scope-bar .seg { flex-wrap: wrap; }
.scope-bar .seg button { padding: 6px 14px; font-size: 13px; }
.seg-n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: rgba(15, 61, 54, .1); font-size: 11px; }
.seg button.on .seg-n { background: rgba(255, 255, 255, .22); }

/* Violations · how to fix */
.fix-cell { min-width: 280px; }
.fix-item { padding: 4px 0 8px; }
.fix-item + .fix-item { border-top: 1px dashed var(--line); padding-top: 8px; }
.fix-text { font-size: 12px; color: var(--text); margin: 3px 0 5px; max-width: 360px; white-space: normal; line-height: 1.4; }
.fix-how { margin: 4px 0; }
.fix-steps { margin: 6px 0 8px; padding-left: 18px; font-size: 12.5px; }
.fix-steps li { margin: 2px 0; }

/* brief highlight after jumping to a section */
.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px var(--accent); } 100% { box-shadow: var(--shadow); } }

/* Student page: accommodations reminder + suggestion explanations */
.acc-remind { border-left: 4px solid var(--teal); }
.acc-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; }
.acc-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: var(--soft); font-size: 13px; }
.acc-item .i { color: var(--teal); margin-top: 2px; }
.acc-item.warn { background: var(--warn-soft); }
.acc-item.warn .i, .acc-item.warn b { color: var(--warn); }
.aeries-quote { margin: 12px 0 6px; font-size: 13px; }
.aeries-quote summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.aeries-quote blockquote { margin: 6px 0 0; padding: 8px 12px; border-left: 3px solid var(--line); background: var(--panel-solid); border-radius: 0 8px 8px 0; white-space: pre-wrap; }
.remind-foot { margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.sugg-why { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.sub-k { display: inline-block; min-width: 132px; font-weight: 700; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.sugg-row { align-items: flex-start; }

/* Canvas changes: status tracker */
.howto summary { cursor: pointer; display: flex; gap: 8px; align-items: center; list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto-steps { margin: 12px 0; padding-left: 22px; line-height: 1.6; }
.howto-steps li { margin: 4px 0; }
.howto-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 10px; }
.howto-grid > div { background: var(--soft); border-radius: 12px; padding: 8px 12px; }
.howto-foot { margin-top: 4px; }
.pipeline { display: flex; align-items: stretch; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.pipe { flex: 1; min-width: 130px; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--glass-line); background: var(--panel); box-shadow: var(--shadow); cursor: pointer; font: inherit; color: var(--text); transition: transform .15s var(--ease); }
.pipe:hover { transform: translateY(-2px); }
.pipe.on { outline: 2px solid var(--teal); }
.pipe.bad { background: var(--bad-soft); }
.pipe-n { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1; }
.pipe.bad .pipe-n, .pipe.bad .pipe-l { color: var(--bad); }
.pipe-l { font-weight: 700; }
.pipe-arrow { display: flex; align-items: center; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.step { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.step i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; background: var(--soft); color: var(--muted); }
.step.done i { background: var(--ok); color: #fff; } .step.done { color: var(--ok); }
.step.now i { background: #0F3D36; color: #fff; } .step.now { color: var(--ink); font-weight: 700; }
.step.fail i { background: var(--bad); color: #fff; } .step.fail { color: var(--bad); font-weight: 700; }
.step-line { width: 10px; height: 2px; background: var(--line); }
.next-warn { color: var(--warn); }
.seg-n.bad { background: var(--bad); color: #fff; }
.cbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--soft); margin-bottom: 8px; }
.cb { display: block; }
.c-appr { background: #8FA9A3; } .c-sent { background: var(--teal); } .c-appl { background: #6CB8A8; } .c-done { background: var(--ok); } .c-fail { background: var(--bad); }
.clegend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; margin-bottom: 6px; }
.clegend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
@media (max-width: 900px) { .stepper .step { font-size: 0; } .stepper .step i { font-size: 10px; } .howto-grid { grid-template-columns: 1fr; } }

/* ---------- modules: switcher, Grading, Learning Gaps ---------- */
.mod-switch { display: flex; flex-direction: column; gap: 4px; align-items: center; background: rgba(221,239,232,.08); border-radius: 22px; padding: 4px; }
.nav a.mod { width: 36px; height: 36px; color: #9FC4BA; }
.nav a.mod.on { background: var(--accent); color: var(--accent-ink); }
.nav-sep.wide { width: 30px; margin: 6px 0; }
.modcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.modcard { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--glass-line); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.modcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.modcard > div { flex: 1; min-width: 0; }
.modcard > .i:first-child { color: var(--mint-ink); }
.g3 { display: grid; grid-template-columns: 220px 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.gcol { background: var(--panel); border: 1px solid var(--glass-line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); min-width: 0; }
.gcol-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 2px 4px 8px; }
.gcol-hrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gcol-hrow .gsort { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; color: var(--text, inherit); max-width: 60%; }
.gitem, .gcard { display: block; padding: 9px 10px; border-radius: 12px; color: var(--text); text-decoration: none !important; border: 1px solid transparent; margin-bottom: 4px; }
.gitem b, .gcard b { display: block; color: var(--ink); }
.gitem .tag { margin-top: 3px; }
.gitem:hover, .gcard:hover { background: var(--soft); }
.gitem.on, .gcard.on { background: var(--mint); border-color: rgba(15,92,80,.25); }
.gcard { border-color: var(--line); background: var(--panel-solid); margin-bottom: 8px; }
.gcard-top { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.gbar { display: flex; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; margin: 8px 0 4px; gap: 2px; }
.gbar span { display: block; height: 100%; border-radius: 4px; }
.gbar-done { background: var(--teal); }
.gbar-ok { background: var(--peach); }
.gstage { margin-top: 6px; }
.tag.gbusy { white-space: normal; text-align: left; }
.gdetail { padding: 16px 18px; }
.gd-head h2 { font-size: 18px; }
.gd-head { margin-bottom: 10px; }
.gsec { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 4px; }
.gsec h3 { display: flex; gap: 6px; align-items: center; }
.ready { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.ready li::before { content: '✓'; display: inline-block; width: 18px; font-weight: 800; color: var(--ok); }
.ready li.no::before { content: '!'; color: var(--bad); }
.gfix { margin: 6px 0; }
.gfix .row-actions { margin-top: 6px; }
.info-box { background: var(--info-soft); color: var(--info); padding: 8px 10px; border-radius: 10px; margin-bottom: 10px; }
.gtools { justify-content: flex-end; margin: 6px 0 8px; }
.gtools .sub { margin-right: auto; }
.gtbl td { vertical-align: top; }
.gtbl .input:not(.num):not(.sm) { min-width: 210px; }
.gmore summary { cursor: pointer; margin-top: 4px; }
.gmore textarea { margin-top: 4px; }
.gchecks { min-width: 170px; }
.gchecks .issues { margin-top: 4px; }
.done-row { opacity: .8; }
.acc-dot { display: inline-block; width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: var(--teal); margin-left: 6px; vertical-align: 0; box-shadow: 0 0 0 2px var(--mint); cursor: pointer; position: relative; }
.acc-dot::after { content: ""; position: absolute; inset: -8px; }   /* bigger click target than the dot */
.acc-dot:hover, .acc-dot:focus-visible { box-shadow: 0 0 0 3px var(--mint), 0 0 0 5px var(--teal); outline: none; }
.acc-pop { position: fixed; z-index: 60; width: min(340px, calc(100vw - 16px)); background: var(--panel-solid); color: inherit; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 12px 14px; font-size: 13px; }
.acc-pop-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.acc-pop-h .btn { margin-left: auto; }
.acc-pop-due { background: var(--mint); border-radius: 8px; padding: 6px 8px; margin-bottom: 8px; }
.acc-pop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.acc-pop-list li { padding-left: 10px; border-left: 3px solid var(--teal); }
.acc-pop-list li.warn { border-left-color: var(--warn); }
.acc-pop-foot { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-top: 10px; flex-wrap: wrap; }
.agenda { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; margin-bottom: 10px; background: var(--soft); color: var(--text); }
.agenda.tone-good { background: var(--ok-soft); color: var(--ok); }
.agenda.tone-bad { background: var(--bad-soft); color: var(--bad); }
.agenda.tone-warn { background: var(--warn-soft); color: var(--warn); }
.agenda .sub { color: inherit; opacity: .85; }
.gapbars { display: flex; flex-direction: column; gap: 4px; }
.gapbar { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(0, 2fr) 92px; grid-template-areas: "label track val" "meta meta meta"; gap: 2px 12px; align-items: center; text-align: left; border: 1px solid transparent; background: none; font: inherit; color: var(--text); padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.gapbar:hover { background: var(--soft); }
.gapbar.on { background: var(--mint); border-color: rgba(15,92,80,.25); }
.gb-label { grid-area: label; }
.gb-track { grid-area: track; height: 10px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.gb-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.gb-val { grid-area: val; font-weight: 700; font-size: 13px; color: var(--ink); text-align: right; }
.gb-meta { grid-area: meta; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.legend { margin-top: 10px; }
.gap2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.gstud { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.gstud li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 8px; }
.gstud li:hover { background: var(--soft); }
.gapcard { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; background: var(--panel-solid); }
.gapcard h3 { margin: 0; display: flex; gap: 8px; align-items: center; }
.gap3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gblk { background: var(--soft); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.gblk-h { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.gtext { white-space: pre-wrap; font-size: 13px; flex: 1; }
.gblk .row-actions { margin-top: 0; }
@media (max-width: 1280px) { .g3 { grid-template-columns: 200px minmax(0, 1fr); } .gdetail { grid-column: 1 / -1; } }
@media (max-width: 900px) {
  .g3, .gap2, .gap3, .modcards { grid-template-columns: 1fr; }
  .mod-switch { flex-direction: row; }
  .gapbar { grid-template-columns: minmax(0, 1fr) 80px; grid-template-areas: "label val" "track track" "meta meta"; }
}

/* Settings: Apps Script setup */
ol.steps { margin: 10px 0 8px; padding-left: 22px; display: grid; gap: 8px; line-height: 1.5; }
ol.steps .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
ol.steps .row .input { flex: 1 1 260px; min-width: 0; }
ol.steps code { word-break: break-all; }

/* Quiet updates: "New data · Show" */
.fresh-btn { font-weight: 600; }
.fresh-btn::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.fresh-btn[hidden] { display: none; }
/* Grok's draft answer key (Grading → Ready check) */
.gkey-new { border-left: 3px solid var(--warn); padding-left: 12px; }
.gkey h3 { display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 6px 0; }
.gkey summary { cursor: pointer; list-style: revert; }
.gkey summary h3 { display: inline-flex; }
.knotes { margin: 6px 0 8px; padding-left: 18px; color: var(--muted); font-size: 13px; }
.ktbl td { vertical-align: top; }
.ktbl .kn { width: 28px; color: var(--muted); }
.ktbl .kexp { white-space: pre-wrap; }
.ktbl .kpts { width: 70px; text-align: right; }
.ktbl input.kpts { text-align: right; }
.ktbl textarea { width: 100%; min-width: 220px; resize: vertical; }
.ktotal { margin: 6px 0; }
/* All violations (This week): show/hide completed + search under each column */
.viol-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.switch-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tbl tr.col-search th { padding-top: 0; padding-bottom: 8px; }
.tbl tr.col-search .input { width: 100%; min-width: 70px; font-weight: 400; }
.tbl tbody tr[hidden] { display: none; }
/* Approvals alert to Grok (Review → Status) */
.notify-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.notify-box .btn { margin-left: auto; }
.warn-box.bad { background: var(--bad-soft); color: var(--bad); }

/* "What Grok is working on" header bar + panel */
.grok-bar { display: inline-flex; align-items: center; gap: 8px; max-width: min(460px, 42vw); min-width: 0; border: 1px solid var(--line); background: var(--panel-solid); color: var(--text); padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 12px; cursor: pointer; }
.grok-bar[hidden] { display: none; }
.grok-bar:hover { box-shadow: var(--shadow); }
.grok-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gs-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.gs-working .gs-dot { background: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.gs-waiting_on_teacher .gs-dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.gs-blocked .gs-dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.gs-who { font-weight: 700; color: var(--ink); }
.gs-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gs-prog { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; flex: none; }
.gs-prog i { display: block; height: 100%; background: var(--info); border-radius: 3px; }
.gs-count, .gs-more { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.gs-wait { color: var(--warn); font-weight: 650; flex: none; }
.gs-stale { color: var(--muted); font-style: italic; flex: none; }
.grok-bar.stale .gs-dot { opacity: .5; }
.grok-panel { position: fixed; z-index: 60; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; background: var(--panel-solid); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 12px 14px; font-size: 13px; }
.grok-panel .gs-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.grok-panel .gs-top .btn { margin-left: auto; padding: 2px 9px; font-size: 16px; line-height: 1; }
.gs-sec { border-top: 1px solid var(--line); padding: 8px 0 4px; }
.gs-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.gs-sec ul { margin: 0; padding: 0; list-style: none; }
.gs-sec li { padding: 4px 0; }
.gs-sec li .btn { padding: 2px 10px; font-size: 12px; margin-left: 4px; }
.gs-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.gs-row .gs-prog { width: 140px; }
.gs-recent li { display: flex; gap: 10px; }
.gs-time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 64px; }
.gs-foot { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
@media (max-width: 760px) { .grok-bar { max-width: 100%; } .grok-bar .gs-prog, .grok-bar .gs-wait { display: none; } }

/* Send back to Grok (revise requests) + full comments */
.tag.info { background: var(--info-soft); color: var(--info); }
.grevise { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.gcomment { white-space: pre-wrap; margin-top: 4px; color: var(--text); font-size: 13px; }
.gtbl td.gbtns { white-space: normal; min-width: 150px; }
.gtbl td.gbtns .btn { margin: 2px 0; }
.seg-radio { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* Draft rows: when the work was turned in and how late */
.good-text { color: var(--ok); }
.gtbl .turned { margin: 0 0 6px; line-height: 1.35; }
.gtbl .done-row .turned { margin: 6px 0 0; }

/* The hidden attribute always wins (e.g. a .tag with display:flex must not show the FAKE demo chip on real data) */
[hidden] { display: none !important; }

/* Grading: "Needs you" on top, graded assignments folded; approved draft rows folded */
.glist-h { font-size: 12px; font-weight: 700; color: var(--muted, #6b7280); text-transform: uppercase; letter-spacing: .04em; margin: 6px 2px 8px; display: flex; gap: 6px; align-items: center; }
.gdone-group { margin-top: 10px; border-top: 1px solid var(--line, #e5e7eb); padding-top: 8px; }
.gdone-group > summary { cursor: pointer; list-style: none; font-size: 12px; font-weight: 700; color: var(--muted, #6b7280); text-transform: uppercase; letter-spacing: .04em; padding: 6px 2px; display: flex; gap: 6px; align-items: center; }
.gdone-group > summary::-webkit-details-marker { display: none; }
.gdone-group > summary::after { content: '▸'; margin-left: auto; }
.gdone-group[open] > summary::after { content: '▾'; }
.gcard.gdone { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 12px; margin-bottom: 6px; }
.gcard.gdone .gdone-t { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard.gdone .sub { display: inline-flex; gap: 4px; align-items: center; color: var(--ok); }
.gtbl tr.gfold td { background: var(--soft, #f7f7f5); padding: 8px 12px; }
.gflags { font-weight: 700; margin-top: 2px; }

/* Learning Gaps by assignment */
.gasg .card-head { align-items: flex-start; gap: 12px; }
.gasg .card-head h2 { margin-bottom: 2px; }
.gitem-detail { margin: -2px 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--soft, #f7f7f5); }
.gitem-detail .gstud { margin-top: 6px; }
details.gdone-group.card { padding: 10px 16px; }
.gdone-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line, #e5e7eb); }

/* Attendance flags (Grok's daily check) */
.att-chip { white-space: normal; text-align: left; line-height: 1.3; }
.gatt .att-seg { margin: 8px 0; flex-wrap: wrap; }
tr.att-held td { background: var(--soft); }

/* "Open submission" links on grading rows */
.sublink { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sublink-files { flex-basis: 100%; display: flex; flex-direction: column; gap: 2px; }
.sublink-file { font-size: 12px; overflow-wrap: anywhere; }
.sublink-none { font-size: 12px; color: var(--muted); opacity: .7; font-style: italic; }

/* PIN login gate */
.auth-gate[hidden] { display: none; }
.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, var(--wash), var(--bg) 65%);
}
.auth-card {
  width: 100%;
  max-width: 360px;
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-hover);
  text-align: center;
}
.auth-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -.02em;
  background: var(--ink);
  color: #DDEFE8;
}
.auth-title { margin: 0 0 6px; font-size: 22px; color: var(--ink); }
.auth-sub { margin: 0 0 20px; font-size: 14px; color: var(--muted); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-pin { text-align: center; font-size: 18px; letter-spacing: .24em; padding: 11px 14px; }
.auth-btn { width: 100%; justify-content: center; padding: 11px 16px; font-size: 15px; }
.auth-error { margin: 12px 0 0; font-size: 13px; color: var(--bad); font-weight: 600; }

/* Global student search dropdown */
.search-box { position: relative; flex: 0 1 320px; }
.search-box .search-wrap { width: 100%; }
.search-drop[hidden] { display: none; }
.search-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}
.search-hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.search-hit:hover, .search-hit.active { background: var(--soft); }
.search-hit-main { min-width: 0; }
.search-hit-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-hit-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
