:root { color-scheme: light; --ink: #1f2933; --surface: #fff; --muted: #616e7c; --line: #d9e2ec; --bg: #f5f7fa; --brand: #12355b; --brand-2: #e8eef6; --header: #12355b; --accent: #c2410c; --accent-ink: #fff; --accent-hover: #9a3412; --gold: #f0a020; --ok: #2f855a; --warn: #b7791f; --bad: #c53030; }
:root[data-theme=dark] { color-scheme: dark; --ink: #edf2f7; --surface: #1f2937; --muted: #bbc7d4; --line: #526174; --bg: #111827; --brand: #9bc8ff; --brand-2: #243d5b; --header: #183a62; --accent: #f97316; --accent-ink: #111827; --accent-hover: #fb923c; --gold: #f0a020; --ok: #80d6a5; --warn: #f2cc80; --bad: #ffb4b4; }
@media (prefers-color-scheme: dark) { :root[data-theme=system] { color-scheme: dark; --ink: #edf2f7; --surface: #1f2937; --muted: #bbc7d4; --line: #526174; --bg: #111827; --brand: #9bc8ff; --brand-2: #243d5b; --header: #183a62; --accent: #f97316; --accent-ink: #111827; --accent-hover: #fb923c; --gold: #f0a020; --ok: #80d6a5; --warn: #f2cc80; --bad: #ffb4b4; } }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
.container { max-width: 1050px; margin: 0 auto; padding: 1.5rem; }
.site-header { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; padding: .6rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header a { color: var(--ink); text-decoration: none; }
.brand { display: inline-flex; }
.brand img { display: block; height: 46px; width: auto; }
.brand .logo-dark, :root[data-theme=dark] .brand .logo-light { display: none; }
:root[data-theme=dark] .brand .logo-dark { display: block; }
@media (prefers-color-scheme: dark) { :root[data-theme=system] .brand .logo-light { display: none; } :root[data-theme=system] .brand .logo-dark { display: block; } }
.tag { background: var(--gold); color: #1f2933; font-size: .7rem; padding: .1rem .4rem; border-radius: 4px; vertical-align: middle; }
.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }
.btn { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; cursor: pointer; font: inherit; text-decoration: none; }
.btn:hover { border-color: var(--brand); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) !important; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--bad); }
.btn-small { padding: .2rem .5rem; font-size: .85rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; }
.flash { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash-success { background: var(--surface); border: 1px solid var(--ok); }
.flash-error { background: var(--surface); border: 1px solid var(--bad); }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input[type=search] { flex: 1; min-width: 200px; }
input, select, textarea { font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 6px; width: 100%; background: var(--surface); color: var(--ink); }
.filters select, .filters input { width: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plans { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.codes, .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; white-space: nowrap; }
.code { background: var(--brand-2); color: var(--brand); padding: .05rem .35rem; border-radius: 4px; margin-right: .3rem; }
.badge { background: #ede9fe; color: #5b21b6; font-size: .7rem; padding: .1rem .35rem; border-radius: 4px; }
.empty { text-align: center; padding: 3rem; background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.form-grid label, .edit-form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; }
.wide { grid-column: 1 / -1; }
.optional, .hint { color: var(--muted); font-weight: 400; font-size: .85rem; }
label.inline, label.check { flex-direction: row !important; align-items: flex-start; gap: .5rem; font-weight: 400 !important; }
label.check { padding: .25rem 0; }
label.inline input, label.check input { width: auto; margin-top: .3rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin: 1rem 0; }
legend { font-weight: 700; padding: 0 .4rem; }
details { margin: .3rem 0; }
summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }
.ai-box.disabled { background: var(--bg); }
.actions { display: flex; gap: .5rem; margin-top: 1rem; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.toolbar form { margin: 0; }
.inline-form { display: flex; gap: .3rem; }
.inline-form input { width: 220px; }
.plan h1 { margin-top: 0; color: var(--brand); }
.plan h2 { font-size: 1.1rem; color: var(--brand); border-bottom: 2px solid var(--brand-2); padding-bottom: .2rem; margin-top: 1.5rem; }
.plan h3 { font-size: 1rem; margin-bottom: .3rem; }
.meta { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0; }
.meta dt { font-size: .75rem; text-transform: uppercase; color: var(--muted); }
.meta dd { margin: 0; font-weight: 600; }
.eq { font-size: 1.1rem; font-style: italic; }
.standards { list-style: none; padding: 0; }
.standards li { padding: .3rem 0; }
.anchor { font-size: .75rem; text-transform: uppercase; color: var(--muted); margin-right: .3rem; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li { background: var(--brand-2); padding: .15rem .6rem; border-radius: 999px; font-size: .9rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.section-block { border-left: 4px solid var(--gold); padding-left: 1rem; margin-bottom: 1rem; }
.minutes { font-size: .8rem; font-weight: 600; background: var(--brand-2); padding: .1rem .5rem; border-radius: 999px; margin-left: .4rem; }
.warning { background: var(--surface); border: 1px solid var(--warn); padding: .5rem .8rem; border-radius: 6px; }
.pre { white-space: pre-wrap; }
.section-edit { border: 1px solid var(--line); border-radius: 8px; padding: .6rem; margin-bottom: .6rem; background: var(--bg); }
#worksheet-editor [hidden] { display: none; }
#worksheet-editor .actions { flex-wrap: wrap; align-self: start; margin-top: 0; }
.section-edit .row { display: flex; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.section-edit .row input[name=section_name] { flex: 1; }
.minutes-input { width: 80px !important; }
.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.tabs a.active { background: var(--header); color: #fff; border-color: var(--header); }
.progress { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 1.25rem; }
.progress div { height: 100%; background: var(--ok); }
table.coverage tr.covered td:first-child { border-left: 4px solid var(--ok); }
table.coverage tr.gap td:first-child { border-left: 4px solid var(--line); }
.gap-label { color: var(--muted); font-style: italic; font-size: .85rem; }
.plans-cell { width: 35%; font-size: .9rem; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.shell-plain { display: block; }
.shell-main { min-width: 0; }
.site-nav { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: .1rem;
  padding: 1rem .75rem 2rem; border-right: 1px solid var(--line); background: var(--surface); min-height: calc(100vh - 68px); }
.site-nav h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1rem .6rem .3rem; }
.site-nav h2:first-child { margin-top: 0; }
.site-nav a, .site-nav summary { display: block; padding: .38rem .6rem; border-radius: 6px; color: var(--ink); text-decoration: none; cursor: pointer; }
.site-nav summary { list-style: none; position: relative; }
.site-nav summary::-webkit-details-marker { display: none; }
.site-nav summary::after { content: "›"; position: absolute; right: .6rem; color: var(--muted); transition: transform .15s; }
.site-nav details[open] > summary::after { transform: rotate(90deg); }
.site-nav details a { padding-left: 1.4rem; font-size: .95rem; }
.site-nav a:hover, .site-nav summary:hover { background: var(--brand-2); }
.site-nav a[aria-current=page] { background: var(--brand-2); color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.workspace-chip { color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .15rem .7rem; font-size: .85rem; }
.header-actions { margin-left: auto; display: flex; gap: .8rem; align-items: center; }
.header-actions form { margin: 0; }
.theme-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--bg); }
.theme-switch button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .85rem; padding: .2rem .7rem; border-radius: 999px; cursor: pointer; }
.theme-switch button[aria-pressed=true] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.nav-toggle { display: none; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: .35rem .7rem; font: inherit; cursor: pointer; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; position: static; max-height: none; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .site-nav.open { display: flex; }
  .workspace-chip { display: none; }
}
@media (max-width: 720px) { .form-grid, .two-col, .three-col, .form-grid.three { grid-template-columns: 1fr; } }
@media print {
  :root, :root[data-theme] { color-scheme: light; --ink: #1f2933; --surface: #fff; --bg: #fff; --muted: #616e7c; --line: #d9e2ec; --brand: #1d4e89; --brand-2: #e8f0fb; --header: #1d4e89; --ok: #2f855a; --warn: #b7791f; --bad: #c53030; }
  .no-print, .site-header, .site-footer { display: none !important; }
  .shell { display: block; }
  body { background: #fff; font-size: 11pt; }
  .container { max-width: none; padding: 0; }
  .card { border: none; padding: 0; }
  .section-block { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* Student worksheet */
.worksheet { max-width: 8in; margin: 0 auto; font-size: 1.05rem; color: #1f2933; background: #fff; }
.worksheet.primary { font-size: 1.3rem; }
.ws-head { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.ws-sub { color: #555; margin-top: -.5rem; }
.ws-item { margin: 1.25rem 0; break-inside: avoid; }
.ws-item h2 { font-size: 1.1em; margin-bottom: .5rem; }
.ws-box { border: 2px solid #333; border-radius: 8px; height: 3.2in; }
.ws-line { border-bottom: 1px solid #333; height: 2.1em; }
.primary .ws-line { height: 2.8em; }
.ws-options { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; }
.ws-options li { padding: .4rem .8rem; }
.ws-mark { margin-right: .4rem; }
.ws-bank span { display: inline-block; border: 1px dashed #333; padding: .2rem .6rem; margin: .2rem; }
.ws-table { width: 100%; border-collapse: collapse; background: #fff; }
.ws-table th, .ws-table td { border: 1px solid #333; padding: .4rem; height: 2.4em; text-align: left; }
.ws-match td { padding: .6rem; }
.ws-match .gap { width: 35%; }
.ws-match .dot { font-size: 1.4em; }
@media print { .worksheet { box-shadow: none; border: 0; } }

/* Scope, grid, calendar */
.scope-table, .grid-table, .cal { width: 100%; border-collapse: collapse; }
.scope-table th, .scope-table td, .grid-table th, .grid-table td { border-bottom: 1px solid #ddd; padding: .5rem; vertical-align: top; text-align: left; }
.scope-table td:first-child { font-weight: bold; width: 2.5rem; }
ul.tight { margin: 0 0 .3rem; padding-left: 1.1rem; }
.table-scroll { overflow-x: auto; }
.grid-table { font-size: .85rem; }
.grid-table td.hit { box-shadow: inset 4px 0 var(--ok); }
.grid-table td.miss { box-shadow: inset 4px 0 var(--bad); }
.group-row td { background: var(--brand-2); font-weight: bold; }
.cal th { background: var(--brand-2); padding: .3rem; }
.cal td { border: 1px solid #ccc; vertical-align: top; height: 6.5rem; width: 20%; padding: .25rem; font-size: .8rem; }
.cal td.out { background: var(--bg); color: var(--muted); }
.cal td.closed { background: var(--brand-2); }
.daynum { font-weight: bold; }
.closed-label { color: var(--warn); font-style: italic; }
.event { margin-top: .2rem; }
.month { break-inside: avoid; page-break-after: always; }

.resource-preview { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
label.inline { display: inline-flex; gap: .25rem; margin-right: .75rem; }

.ai-ok { color: #1f7a3a; font-weight: 600; }
.ai-error { color: #b42318; font-weight: 600; }

.add-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.add-option { border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; }
.add-option h3 { margin-top: 0; }
