:root {
  --bg: #f5f6f8; --card: #ffffff; --ink: #1a2230; --muted: #5d6877; --line: #e1e5eb; --soft: #eef1f5;
  --brand: #1f3a5f; --brand-ink: #ffffff; --brand-soft: #e6edf6; --accent: #a8802b;
  --ok: #1b7a4b; --ok-soft: #e1f3ea; --warn: #a65f00; --warn-soft: #fdf0d9; --bad: #b3261e; --bad-soft: #fbe6e4;
  --info: #235f9f; --info-soft: #e3eefa; --cell: #f0f2f5; --shadow: 0 1px 2px rgba(20,30,50,.06), 0 4px 14px rgba(20,30,50,.06);
  --radius: 10px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b; --card: #1a2029; --ink: #e8ecf2; --muted: #9aa6b6; --line: #2b3441; --soft: #222a35;
    --brand: #7ea6dc; --brand-ink: #0c1420; --brand-soft: #1f2d42; --accent: #d4aa55;
    --ok: #55c28a; --ok-soft: #173326; --warn: #e5a54b; --warn-soft: #3a2b12; --bad: #f08a82; --bad-soft: #3d1c1a;
    --info: #7db4ee; --info-soft: #172a40; --cell: #262e3a; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: var(--info); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .tiny { font-size: .78rem; }
.right { margin-left: auto; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }

/* buttons & inputs */
.btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 7px 13px; border-radius: 8px; font: inherit; font-size: .9rem; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--soft); }
.btn:focus-visible, .cell:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--info); outline-offset: 1px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.sm { padding: 4px 9px; font-size: .82rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=email], input[type=url], input[type=date], input[type=time], input[type=number], input[type=search], input[type=password], select, textarea {
  font: inherit; font-size: .92rem; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.45; }
label.field { display: grid; gap: 4px; font-size: .84rem; color: var(--muted); font-weight: 600; }
label.field > input, label.field > select, label.field > textarea { font-weight: 400; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; }
.check input { width: 16px; height: 16px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* layout */
.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--brand); color: var(--brand-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
@media (prefers-color-scheme: dark) { .side { background: #172233; color: #e8ecf2; } }
.side .brand { padding: 4px 10px 16px; font-weight: 700; line-height: 1.25; }
.side .brand small { display: block; font-weight: 400; opacity: .75; font-size: .78rem; margin-top: 2px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: inherit; text-decoration: none; font-size: .93rem; opacity: .88; }
.nav:hover { background: rgba(255,255,255,.12); opacity: 1; }
.nav.active { background: rgba(255,255,255,.2); opacity: 1; font-weight: 600; }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 99px; font-size: .72rem; padding: 1px 7px; font-weight: 700; }
.side .spacer { flex: 1; }
.main { padding: 26px 30px 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.card > h2, .card > .card-head { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 8px; }
  .side .brand, .side .spacer { display: none; }
  .main { padding: 16px 14px 50px; }
}

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
.t th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--soft); position: sticky; top: 0; white-space: nowrap; }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover { background: color-mix(in srgb, var(--soft) 55%, transparent); }
.t td.name { cursor: pointer; font-weight: 600; } .t td.name:hover { text-decoration: underline; }
.t select { padding: 4px 8px; font-size: .85rem; min-width: 150px; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select { width: auto; }

/* tiles & pipeline */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); text-align: left; font: inherit; color: inherit; cursor: pointer; }
a.tile { text-decoration: none; display: block; }
.tile .n { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.tile .l { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.tile:hover { border-color: var(--brand); }
.pipeline { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--soft); }
.pipeline > span { display: block; height: 100%; min-width: 2px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.stage-needs_availability { background: #9aa6b6; } .stage-needs_faculty { background: #d19a2a; } .stage-awaiting_faculty { background: #cc7a3b; }
.stage-ready { background: #2e7fc4; } .stage-scheduled { background: #2c9a66; } .stage-completed { background: #1d6a47; }

.todo { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }
.todo .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--warn-soft); color: var(--warn); flex: none; }
.todo .dot.bad { background: var(--bad-soft); color: var(--bad); } .todo .dot.info { background: var(--info-soft); color: var(--info); }
.allgood { padding: 14px; background: var(--ok-soft); color: var(--ok); border-radius: 8px; font-weight: 600; }

/* modal & toast */
.overlay { position: fixed; inset: 0; background: rgba(10,15,25,.5); display: grid; place-items: start center; padding: 4vh 14px; overflow-y: auto; z-index: 50; }
.modal { background: var(--card); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); width: min(560px, 100%); display: flex; flex-direction: column; }
.modal.wide { width: min(880px, 100%); } .modal.xwide { width: min(1100px, 100%); }
.modal-head { padding: 16px 20px 10px; display: flex; gap: 10px; align-items: center; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 6px 20px 18px; display: grid; gap: 14px; }
.modal-foot { padding: 12px 20px 16px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(520px, 94vw); }
.toast { background: #1a2230; color: #fff; padding: 11px 15px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); display: flex; gap: 12px; align-items: center; font-size: .92rem; }
.toast.bad { background: #8f1d17; } .toast.ok { background: #14603b; }
.toast .btn { background: rgba(255,255,255,.15); color: #fff; border-color: transparent; }
.notice { padding: 10px 13px; border-radius: 8px; font-size: .9rem; background: var(--info-soft); color: var(--info); }
.notice.warn { background: var(--warn-soft); color: var(--warn); } .notice.bad { background: var(--bad-soft); color: var(--bad); } .notice.ok { background: var(--ok-soft); color: var(--ok); }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--soft); border-radius: 8px; padding: 6px 8px 6px 12px; }
.linkbox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

/* availability grid */
.avwrap { overflow-x: auto; padding-bottom: 6px; }
.avgrid { display: grid; gap: 2px; grid-template-columns: var(--axis, 64px) repeat(var(--cols, 11), minmax(62px, 1fr)); min-width: max-content; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.avgrid .hd { font-size: .76rem; font-weight: 700; text-align: center; padding: 4px 2px; color: var(--ink); background: var(--soft); border-radius: 6px; border: 0; font-family: inherit; cursor: pointer; line-height: 1.2; position: sticky; top: 0; z-index: 2; }
.avgrid .hd:hover { background: var(--brand-soft); }
.avgrid .hd.static { cursor: default; }
.avgrid .hd small { display: block; font-weight: 500; color: var(--muted); }
.avgrid .tm { font-size: .72rem; color: var(--muted); text-align: right; padding: 4px 6px 0 0; border: 0; background: none; cursor: pointer; font-family: inherit; white-space: nowrap; position: sticky; left: 0; background: var(--card); z-index: 1; }
.avgrid .tm.static { cursor: default; }
.avgrid .tm .loc { display: block; color: var(--info); }
.cell { appearance: none; border: 0; border-radius: 5px; min-height: 28px; background: var(--cell); cursor: pointer; padding: 0; font-size: .7rem; color: var(--muted); font-family: inherit; }
.cell:hover { filter: brightness(.94); }
.cell.on { background: var(--brand); color: var(--brand-ink); }
.cell.busy { background: repeating-linear-gradient(135deg, var(--cell), var(--cell) 4px, var(--line) 4px, var(--line) 8px); cursor: not-allowed; color: var(--muted); }
.cell.busy.on { background: repeating-linear-gradient(135deg, var(--brand), var(--brand) 4px, color-mix(in srgb, var(--brand) 60%, #000) 4px, color-mix(in srgb, var(--brand) 60%, #000) 8px); }
.cell.both { background: var(--ok); color: #fff; } .cell.one { background: var(--warn-soft); color: var(--warn); }
.cell.pick { outline: 3px solid var(--accent); outline-offset: -1px; font-weight: 700; }
.cell.none { background: var(--cell); }
.cell.ro { cursor: default; }
.cell.heat { background: color-mix(in srgb, var(--brand) calc(var(--v) * 100%), var(--cell)); color: var(--ink); font-weight: 600; cursor: default; }
.cell.heat.hi { color: var(--brand-ink); }
.cell.heat.zero { color: transparent; }
.keyrow { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.keyrow i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -3px; margin-right: 5px; }

/* scheduling cards */
.qcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--card); display: grid; gap: 10px; }
.slotbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.slotbtn { border: 1px solid var(--brand); background: var(--brand-soft); color: var(--brand); border-radius: 9px; padding: 7px 12px; font: inherit; font-size: .88rem; cursor: pointer; text-align: left; line-height: 1.3; }
.slotbtn:hover { background: var(--brand); color: var(--brand-ink); }
.slotbtn small { display: block; opacity: .8; font-size: .75rem; }
.chip { border: 1px solid var(--line); background: var(--soft); border-radius: 99px; padding: 3px 10px; font: inherit; font-size: .8rem; cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--brand); }
.sugg { display: grid; gap: 6px; max-height: 340px; overflow-y: auto; }
.sugg .slotbtn { display: flex; justify-content: space-between; gap: 12px; align-items: center; width: 100%; }

/* emails */
.mail { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 12px 16px; display: grid; gap: 8px; }
.mail.sent { opacity: .72; }
.mail .subj { font-weight: 600; }
.mail pre { margin: 0; white-space: pre-wrap; font: inherit; font-size: .88rem; background: var(--soft); padding: 12px 14px; border-radius: 8px; max-height: 380px; overflow: auto; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 8px 14px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--ink); border-color: var(--brand); font-weight: 600; }
.split { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }
.tlist { display: grid; gap: 2px; }
.tlist h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 8px 4px; }
.tlist button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); display: flex; gap: 6px; align-items: center; }
.tlist button:hover { background: var(--soft); } .tlist button.active { background: var(--brand-soft); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* public pages */
.pub { max-width: 1040px; margin: 0 auto; padding: 22px 16px 70px; display: grid; gap: 16px; }
.pub-head { padding: 6px 2px; }
.pub-head .org { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.pub-head h1 { margin-top: 4px; }
.steps { display: grid; gap: 8px; margin: 0; padding-left: 20px; }
.sticky-bar { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; box-shadow: 0 -6px 18px rgba(0,0,0,.06); border-radius: 12px 12px 0 0; z-index: 5; }
.bigtime { font-size: 1.35rem; font-weight: 700; }
.ivcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; background: var(--card); }
@media print { .side, .toasts, .btn { display: none !important; } }

/* help and training */
.help-sec { padding: 0; }
.help-sec > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; gap: 12px; align-items: center; }
.help-sec > summary::-webkit-details-marker { display: none; }
.help-sec > summary::after { content: "+"; margin-left: auto; font-size: 1.2rem; color: var(--muted); font-weight: 400; }
.help-sec[open] > summary::after { content: "\2212"; }
.help-sec[open] > summary { border-bottom: 1px solid var(--line); }
.help-body { padding: 14px 18px 18px; }
.help-body p { margin: 0; }
.help-body ul, .help-body ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.help-num { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700; flex: none; }
.player { display: grid; gap: 12px; }
.player-frame { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); box-shadow: var(--shadow); }
.player-chrome { display: flex; gap: 6px; align-items: center; padding: 8px 12px; background: var(--soft); border-bottom: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.player-chrome i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: inline-block; }
.player-chrome span { margin-left: 10px; }
.player-screen { padding: 22px 24px; min-height: 280px; animation: scenein .35s ease both; pointer-events: none; }
.player-bar { height: 4px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.player-bar span { display: block; height: 100%; width: 0; background: var(--brand); }
.player-caption { min-height: 92px; }
.player-list { display: flex; flex-wrap: wrap; gap: 6px; }
.player-list .chip.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pulse { display: inline-block; border-radius: 10px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); outline: 2px solid var(--accent); outline-offset: 2px; } }
@keyframes scenein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fillin { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pulse, .player-screen, .cell { animation: none !important; } }

/* public landing page */
.landing-band { background: var(--brand); color: var(--brand-ink); padding: 44px 16px 38px; }
@media (prefers-color-scheme: dark) { .landing-band { background: #172233; color: #e8ecf2; } }
.landing-band .org { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; font-weight: 600; }
.landing-band h1 { margin-top: 8px; font-size: 1.9rem; }
.landing-inner { max-width: 760px; margin: 0 auto; }
.landing-body { padding: 24px 16px 60px; display: grid; gap: 16px; }
