/* NTU course planner, demo build. Dark interface, no external assets. */
:root {
  --bg-base: #0a0d16;
  --bg-surface: #111522;
  --bg-card: #161c2e;
  --bg-card-hover: #1e263d;
  --bg-input: #151a2b;

  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.18);

  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.16);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.16);
  --rose: #ef4444;
  --rose-glow: rgba(239, 68, 68, 0.16);
  --violet: #8b5cf6;
  --sky: #38bdf8;

  --text: #f3f4f6;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);

  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.55);
  --tr: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: var(--bg-base);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(99,102,241,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(16,185,129,0.06), transparent 55%);
}
a { color: var(--primary-light); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, h5 { letter-spacing: -0.01em; }

header.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 22px;
  background: rgba(10, 13, 22, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  display: grid; place-items: center; font-weight: 800; color: #fff;
}
.brand h1 { font-size: 1.02rem; font-weight: 800; }
.brand p { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }
.topbar-stats { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.stat-pill {
  font-size: 0.68rem; font-weight: 700; color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.stat-pill b { color: var(--text); font-size: 0.85rem; }
.stat-pill.good { border-color: rgba(16,185,129,0.5); background: var(--emerald-glow); }
.stat-pill.good b { color: var(--emerald); }
.stat-pill.warn { border-color: rgba(245,158,11,0.5); background: var(--amber-glow); }
.stat-pill.warn b { color: var(--amber); }
.stat-pill.bad { border-color: rgba(239,68,68,0.5); background: var(--rose-glow); }
.stat-pill.bad b { color: #fca5a5; }

.app { max-width: 1180px; margin: 0 auto; padding: 20px 22px 80px; }
nav.tabs {
  display: flex; gap: 4px; margin-bottom: 22px; flex-wrap: wrap;
  background: var(--bg-surface); border: 1px solid var(--border);
  padding: 5px; border-radius: 12px;
}
nav.tabs button {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 15px; border: none; background: transparent;
  color: var(--text-muted); font-size: 0.82rem; font-weight: 700;
  border-radius: 8px; transition: var(--tr);
}
nav.tabs button:hover { color: var(--text-secondary); }
nav.tabs button.active { background: var(--primary); color: #fff; }

.panel { display: none; animation: fade 0.22s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.1rem; font-weight: 800; }
.section-head .hint { color: var(--text-muted); font-size: 0.76rem; font-weight: 500; }
.muted { color: var(--text-muted); font-size: 0.78rem; line-height: 1.6; }
.warn-txt { color: var(--amber); font-weight: 600; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.empty { text-align: center; color: var(--text-muted); padding: 50px 20px; font-size: 0.85rem; }
.empty .big { font-size: 2rem; margin-bottom: 10px; }

.input, select.input {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  padding: 8px 11px; border-radius: 9px; font-size: 0.8rem; outline: none;
  transition: var(--tr); font-family: inherit;
}
.input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--primary-glow); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-secondary); font-size: 0.78rem; font-weight: 700;
  transition: var(--tr); white-space: nowrap;
}
.btn:hover { border-color: var(--border-hover); background: var(--bg-card-hover); color: var(--text); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-light); }
.btn.sm { padding: 5px 10px; font-size: 0.7rem; }
.btn.danger { color: #fca5a5; }
.btn.danger:hover { border-color: var(--rose); background: var(--rose-glow); }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--bg-input); color: var(--text-muted);
  display: grid; place-items: center; font-size: 0.85rem; transition: var(--tr);
}
.icon-btn:hover { color: var(--rose); border-color: var(--rose); }

.chip {
  padding: 7px 13px; border-radius: 999px; font-size: 0.74rem; font-weight: 700;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted);
  transition: var(--tr);
}
.chip:hover { border-color: var(--border-hover); color: var(--text); }
.chip.toggle.active { background: var(--emerald); border-color: var(--emerald); color: #04231a; }

.tag {
  font-size: 0.62rem; font-weight: 800; padding: 2px 7px; border-radius: 5px;
  text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap;
}
.tag-au { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.tag-approved { background: var(--emerald-glow); color: var(--emerald); }
.tag-sky { background: rgba(56,189,248,0.14); color: var(--sky); }
.tag-restricted { background: var(--rose-glow); color: #fca5a5; }
.tag-warn { background: var(--amber-glow); color: var(--amber); }
.tag-major { background: var(--emerald); color: #04231a; }
.tag-minor { background: var(--sky); color: #082436; }

.seg { display: flex; gap: 3px; flex-shrink: 0; }
.seg-btn {
  font-size: 0.66rem; font-weight: 800; padding: 6px 9px; border-radius: 7px;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  transition: var(--tr); white-space: nowrap;
}
.seg-btn:hover { border-color: var(--border-hover); color: var(--text-secondary); }
.seg-btn.st-fix.on     { background: var(--emerald); border-color: var(--emerald); color: #04241a; }
.seg-btn.st-add.on     { background: var(--amber);   border-color: var(--amber);   color: #2a1c00; }
.seg-btn.st-drop.on    { background: var(--rose);    border-color: var(--rose);    color: #2a0510; }
.seg-btn.area-major.on { background: var(--emerald); border-color: var(--emerald); color: #04241a; }
.seg-btn.area-minor.on { background: var(--sky);     border-color: var(--sky);     color: #082436; }
.seg-btn.area-elective.on  { background: var(--violet);  border-color: var(--violet);  color: #fff; }
.seg-btn.ok-yes.on     { background: var(--emerald); border-color: var(--emerald); color: #04241a; }
.seg-btn.ok-open.on    { background: var(--amber);   border-color: var(--amber);   color: #2a1c00; }
.seg-btn.ok-no.on      { background: var(--rose);    border-color: var(--rose);    color: #2a0510; }
.seg-btn.cr-ok.on      { background: var(--emerald); border-color: var(--emerald); color: #04241a; }
.seg-btn.cr-pend.on     { background: var(--amber);   border-color: var(--amber);   color: #2a1c00; }
.seg-btn.cr-open.on    { background: var(--text-muted); border-color: var(--text-muted); color: #111; }

.balance { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.card .balance { margin: 4px 0 16px; }
.bal-line { display: flex; align-items: center; gap: 12px; font-size: 0.78rem; }
.bal-label { font-weight: 800; color: var(--text-secondary); width: 52px; }
.bal-val { font-weight: 700; color: var(--text-muted); width: 62px; }
.bal-val b { color: var(--text); font-size: 0.92rem; }
.bal-line .bal-bar { flex: 1; margin: 0; }
.bal-line .bal-state { margin-left: 0; white-space: nowrap; }
.bal-line.done .bal-state { color: var(--emerald); }
.bal-line.planned .bal-state { color: var(--amber); }
.bal-line.short .bal-state { color: var(--rose); }

.bal-state { margin-left: auto; font-size: 0.68rem; font-weight: 800; }
.done .bal-state    { color: var(--emerald); }
.planned .bal-state { color: var(--amber); }
.short .bal-state   { color: #fca5a5; }

.bal-bar {
  display: flex; height: 9px; border-radius: 999px; overflow: hidden;
  background: rgba(255,255,255,0.06); margin-bottom: 8px;
}
.bal-fill { height: 100%; transition: width 0.3s; }
.bal-fill.safe { background: var(--emerald); }
.bal-fill.risk { background: repeating-linear-gradient(45deg, var(--amber) 0 5px, rgba(245,158,11,0.4) 5px 10px); }

.phase-card { margin-bottom: 20px; }
.phase-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
@media (max-width: 900px) { .phase-grid { grid-template-columns: 1fr; } }
.phase-grid h4 {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin-bottom: 10px; font-weight: 800;
}
.runsheet { list-style: none; counter-reset: fp; }
.runsheet li {
  counter-increment: fp; position: relative;
  padding: 10px 12px 10px 42px; margin-bottom: 7px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
}
.runsheet li::before {
  content: counter(fp); position: absolute; left: 12px; top: 11px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 0.66rem; font-weight: 800;
  display: grid; place-items: center;
}
.fp-main { display: flex; gap: 10px; align-items: center; }
.fp-code {
  font-weight: 800; font-size: 0.72rem; padding: 3px 8px;
  border-radius: 6px; border-left: 3px solid; background: rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.fp-title { font-size: 0.8rem; font-weight: 700; }
.fp-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.fp-meta b { color: var(--primary-light); }
.fp-fallback { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.fp-drop {
  margin-top: 10px; font-size: 0.76rem; color: var(--amber);
  background: var(--amber-glow); border: 1px solid rgba(245,158,11,0.35);
  border-radius: 9px; padding: 9px 12px;
}
.rules { list-style: none; }
.rules li {
  font-size: 0.76rem; line-height: 1.55; color: var(--text-muted);
  padding: 7px 0 7px 16px; position: relative;
  border-bottom: 1px dashed var(--border);
}
.rules li:last-child { border-bottom: none; }
.rules li::before { content: "→"; position: absolute; left: 0; color: var(--primary-light); font-weight: 800; }
.rules b { color: var(--text-secondary); }

.legend { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0; font-size: 0.7rem; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.tt-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-base); }
.tt { display: grid; position: relative; --tt-time: 52px; --tt-col: 150px; }
.tt .day-h {
  background: var(--bg-card); text-align: center; padding: 9px 6px;
  font-weight: 800; font-size: 0.76rem;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.tt .day-h small { display: block; color: var(--text-muted); font-weight: 600; font-size: 0.6rem; }
.tt .day-h.free { color: var(--emerald); }
.tt .day-h.free small { color: var(--emerald); opacity: 0.75; }
.tt .corner { background: var(--bg-card); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.tt .time-lbl {
  font-size: 0.6rem; color: var(--text-muted); text-align: right;
  padding: 2px 6px 0 0; font-weight: 600; background: var(--bg-card);
  border-right: 1px solid var(--border); border-bottom: 1px solid rgba(255,255,255,0.04);
}
.tt .daycol { position: relative; border-right: 1px solid var(--border); }
.tt .slot { border-bottom: 1px solid rgba(255,255,255,0.04); }

.tt-event {
  position: absolute; left: 3px; right: 3px;
  border-radius: 7px; padding: 4px 7px; font-size: 0.64rem;
  overflow: hidden; box-shadow: var(--shadow);
}
.tt-event b { font-size: 0.7rem; display: block; }
.tt-event .ev-name { font-size: 0.57rem; color: rgba(255,255,255,0.8); display: block; line-height: 1.25; }
.tt-event .ev-meta { color: rgba(255,255,255,0.7); font-size: 0.57rem; display: block; }
.tt-event .ev-clash { display: block; font-size: 0.57rem; font-weight: 800; color: #fca5a5; margin-top: 2px; }
.tt-event.sparse { opacity: 0.85; border-style: dashed; }
.tt-event.clash { outline: 2px solid var(--rose); z-index: 3; }

.day-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 14px;
}
.day-card.dropzone { border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.04); }
.day-card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.day-card-head h3 { font-size: 0.95rem; font-weight: 800; }
.day-au { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); font-weight: 700; }

.crow {
  border: 1px solid var(--border); border-radius: 11px;
  padding: 11px 13px; margin-bottom: 8px; background: var(--bg-card);
  transition: var(--tr);
}
.crow.fix  { border-left: 3px solid var(--emerald); }
.crow.add  { border-left: 3px solid var(--amber); }
.crow.drop { border-left: 3px solid var(--rose); opacity: 0.85; }
.crow.has-clash { border-color: var(--rose); background: rgba(239,68,68,0.06); }

.crow-main { display: flex; gap: 10px; align-items: stretch; }
.crow-bar { width: 4px; border-radius: 999px; flex-shrink: 0; }
.crow-id { min-width: 0; flex: 1; }
.crow-title { font-size: 0.84rem; line-height: 1.35; }
.crow-title b { font-weight: 800; margin-right: 5px; }
.crow-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 4px; font-size: 0.72rem; color: var(--text-muted); }

.idx-sel { font-size: 0.7rem; padding: 5px 8px; max-width: 320px; flex: 1 1 190px; }

.rescue {
  margin-top: 10px; padding: 10px 12px; border-radius: 9px;
  background: var(--emerald-glow); border: 1px solid rgba(16,185,129,0.4);
  font-size: 0.76rem; line-height: 1.6;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.rescue b { color: var(--emerald); }
.rescue .btn { margin-left: auto; }

.alts { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.alts-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.alts-head b { font-size: 0.82rem; }
.alts-loss { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); }
.alts-col { margin-bottom: 12px; }
.alts-col h5 {
  font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); font-weight: 800; margin-bottom: 7px;
}
.alt {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; margin-bottom: 5px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.74rem;
}
.alt.no { opacity: 0.55; }
.alt .btn { margin-left: auto; }
.alt-code {
  font-weight: 800; font-size: 0.72rem; padding: 2px 7px;
  border-radius: 5px; border-left: 3px solid; background: rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.alt-name { color: var(--text-secondary); flex: 1 1 130px; min-width: 0; }
.alt-when { color: var(--text-muted); font-size: 0.72rem; }
.alt-idx { color: var(--primary-light); font-weight: 700; font-size: 0.7rem; }
.alt-bad { color: #fca5a5; font-weight: 700; font-size: 0.7rem; margin-left: auto; }

.pool-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 11px; margin-bottom: 6px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 9px;
  font-size: 0.75rem;
}
.pool-row.blocked { opacity: 0.5; }
.pool-row .btn { margin-left: auto; }

.solve-opts { display: grid; gap: 16px; }
.solve-block h5 {
  font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); font-weight: 800; margin-bottom: 8px;
}
.solve-block .seg { flex-wrap: wrap; }
.solve-days { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg-btn.scn { padding: 9px 14px; font-size: 0.74rem; }
.seg-btn.scn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.sol {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 12px;
}
.sol.best { border-color: rgba(16,185,129,0.5); box-shadow: 0 0 0 1px rgba(16,185,129,0.18); }
.sol-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sol-rank { font-size: 0.76rem; font-weight: 800; color: var(--emerald); }
.sol-days { font-size: 0.8rem; font-weight: 700; }
.sol-au { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }
.sol-head .btn { margin-left: auto; }
.sol-warn {
  font-size: 0.74rem; padding: 7px 11px; border-radius: 8px; margin-bottom: 10px;
  background: var(--amber-glow); border: 1px solid rgba(245,158,11,0.35); color: var(--amber);
}
.sol-ok {
  font-size: 0.74rem; padding: 7px 11px; border-radius: 8px; margin-bottom: 10px;
  background: var(--emerald-glow); border: 1px solid rgba(16,185,129,0.35); color: var(--emerald);
}
.sol-list { display: grid; gap: 5px; }
.sol-item {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; border-radius: 8px; font-size: 0.74rem;
  background: var(--bg-card); border: 1px solid var(--border);
}
.sol-item.kept { border-color: rgba(16,185,129,0.3); }
.sol-tag { margin-left: auto; font-size: 0.68rem; font-weight: 700; color: var(--text-muted); }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; }
.cal-dow {
  font-size: 0.62rem; font-weight: 800; color: var(--text-muted);
  text-align: center; padding: 4px 0; text-transform: uppercase; letter-spacing: 0.04em;
}
.cal-wklabel {
  grid-column: 1 / -1; font-size: 0.68rem; font-weight: 800; color: var(--text-secondary);
  margin-top: 9px; padding-top: 7px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: center;
}
.cal-wklabel .wk-tag {
  font-size: 0.56rem; font-weight: 800; padding: 1px 7px; border-radius: 5px;
  background: rgba(255,255,255,0.06); color: var(--text-muted);
}
.cal-day {
  min-height: 50px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-card); padding: 4px 6px; font-size: 0.6rem; line-height: 1.35; overflow: hidden;
}
.cal-day .dn { font-weight: 800; color: var(--text-muted); font-size: 0.66rem; display: block; }
.cal-day .cc { display: block; color: var(--primary-light); font-weight: 800; font-size: 0.58rem; }
.cal-day.free { background: var(--emerald-glow); border-color: rgba(16,185,129,0.28); }
.cal-day.free .dn { color: var(--emerald); }
.cal-day.classday { background: var(--bg-card-hover); border-color: var(--border-hover); }
.cal-day.recess { background: rgba(56,189,248,0.12); border-color: rgba(56,189,248,0.3); }
.cal-day.recess .dn { color: var(--sky); }
.cal-day.exam { background: var(--rose-glow); border-color: rgba(239,68,68,0.32); }
.cal-day.exam .dn { color: #fca5a5; }
.cal-day.holiday { background: var(--amber-glow); border-color: rgba(245,158,11,0.32); }
.cal-day.holiday .dn { color: var(--amber); }
.cal-day .hol { color: var(--amber); font-weight: 700; }
.cal-day.examday { background: var(--rose); border-color: var(--rose); }
.cal-day.examday .dn, .cal-day.examday .cc { color: #fff; }
.cal-day.tripday { box-shadow: inset 0 0 0 2px rgba(20,184,166,0.65); }
.cal-day .trip-mark { display: block; color: #2dd4bf; font-weight: 800; font-size: 0.55rem; line-height: 1.2; }

.trip-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.trip-form .input { font-size: 0.74rem; padding: 7px 9px; }
.trip-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px;
  border: 1px solid rgba(20,184,166,0.35); background: rgba(20,184,166,0.07);
  border-radius: 10px; margin-bottom: 8px;
}
.trip-row .trip-ico { font-size: 1.1rem; }
.trip-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }

.backup-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 0.74rem; }
.backup-item .bc { color: var(--primary-light); font-weight: 800; font-size: 0.7rem; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 9px 0; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--primary-light);
}
.tl-item.done::before { background: var(--text-muted); border-color: var(--text-muted); }
.tl-item.urgent::before { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 0 4px var(--amber-glow); }
.tl-item.now::before { background: var(--emerald); border-color: var(--emerald); box-shadow: 0 0 0 4px var(--emerald-glow); }
.tl-date { font-size: 0.7rem; font-weight: 800; color: var(--text-secondary); }
.tl-title { font-weight: 700; font-size: 0.84rem; margin-top: 2px; }
.tl-desc { font-size: 0.74rem; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.tl-badge { font-size: 0.58rem; font-weight: 800; padding: 2px 8px; border-radius: 5px; margin-left: 8px; }
.tl-badge.urgent { background: var(--amber-glow); color: var(--amber); }
.tl-badge.now { background: var(--emerald-glow); color: var(--emerald); }
.tl-badge.done { background: rgba(255,255,255,0.06); color: var(--text-muted); }

.sync-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal.show { display: flex; }
.modal-card {
  background: var(--bg-surface); border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg); padding: 22px;
  max-width: 560px; width: 100%; max-height: 82vh; overflow-y: auto;
  position: relative; box-shadow: var(--shadow-lg);
}
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-muted);
}

#toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card); border: 1px solid var(--border-hover); color: var(--text);
  padding: 11px 18px; border-radius: var(--radius-md);
  font-size: 0.8rem; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: var(--tr); z-index: 100;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.board-group { margin-bottom: 18px; }
.board-group:last-child { margin-bottom: 0; }
.board-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.board-group-head h3 { font-size: 0.8rem; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }

.brow {
  border: 1px solid var(--border); border-radius: 11px;
  padding: 11px 13px; margin-bottom: 8px; background: var(--bg-card);
}
.brow.green { border-left: 4px solid var(--emerald); }
.brow.amber { border-left: 4px solid var(--amber); }
.brow.blue  { border-left: 4px solid var(--sky); }
.brow.grey  { border-left: 4px solid var(--border-hover); }
.brow.drop  { border-left: 4px solid var(--rose); opacity: 0.8; }

.brow-main { display: flex; gap: 10px; align-items: flex-start; }
.brow-ampel { font-size: 1rem; line-height: 1.4; }
.brow-id { flex: 1; min-width: 0; }
.brow-main .icon-btn { margin-left: auto; }

.brow-state { font-weight: 700; }
.brow-state.st-green { color: var(--emerald); }
.brow-state.st-amber { color: var(--amber); }
.brow-state.st-blue  { color: var(--sky); }
.brow-state.st-grey  { color: var(--text-muted); }
.brow-state.st-drop  { color: #fca5a5; }

.brow-ctrl {
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
}
.brow-ctl label {
  display: block; font-size: 0.58rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 4px;
}
.brow-ctl .idx-sel { max-width: 300px; }
.crow-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

details.fold { margin-top: 22px; }
details.fold summary {
  cursor: pointer; list-style: none;
  padding: 13px 16px; border-radius: var(--radius-md);
  background: var(--bg-surface); border: 1px solid var(--border);
  font-size: 0.86rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  transition: var(--tr);
}
details.fold summary:hover { border-color: var(--border-hover); }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::before { content: "▸"; color: var(--primary-light); font-weight: 800; }
details.fold[open] summary::before { content: "▾"; }
details.fold[open] summary { margin-bottom: 12px; }
.fold-ico { font-size: 1rem; }

.tt-event.target {
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.10) 0 6px, transparent 6px 12px) !important;
  border-style: dashed !important; border-width: 1px 1px 1px 3px;
  opacity: 0.8;
}
.tt-event.pendcredit { outline: 2px dashed var(--amber); outline-offset: -2px; }
.tt-event .ev-pend { display: block; font-size: 0.55rem; font-weight: 800; color: var(--amber); margin-top: 1px; }

.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.exam-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 4px solid var(--border-hover);
  border-radius: 10px; padding: 11px 13px;
}
.exam-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.exam-card-head b { font-size: 0.84rem; font-weight: 800; }
.exam-count {
  margin-left: auto; font-size: 0.62rem; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  background: var(--rose-glow); color: #fca5a5;
}
.exam-count.open { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.exam-count.past { background: rgba(255,255,255,0.06); color: var(--text-muted); text-decoration: line-through; }
.exam-card-title { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 8px; line-height: 1.35; }
.exam-card-inputs { display: flex; gap: 6px; align-items: center; }
.exam-card-inputs .input { font-size: 0.72rem; padding: 5px 8px; flex: 1; min-width: 0; }
.exam-card.nodate { border-style: dashed; opacity: 0.85; }
.exam-card-date { display: flex; align-items: center; gap: 8px; }
.exam-date-big { font-size: 0.92rem; font-weight: 800; letter-spacing: 0.01em; }
.exam-date-time { font-size: 0.72rem; color: var(--text-muted); font-weight: 700; }
.exam-card-date .icon-btn { margin-left: auto; font-size: 0.72rem; opacity: 0.55; }
.exam-card-date .icon-btn:hover { opacity: 1; }

.sp-phases { display: flex; gap: 3px; position: relative; height: 40px; }
.sp-phase {
  border-radius: 8px; display: grid; place-items: center; overflow: hidden;
  font-size: 0.64rem; font-weight: 800; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.sp-phase span { padding: 0 4px; white-space: nowrap; }
.sp-phase.teaching { background: var(--bg-card); }
.sp-phase.recess   { background: rgba(56,189,248,0.14); color: var(--sky); border-color: rgba(56,189,248,0.3); }
.sp-phase.revision { background: rgba(56,189,248,0.10); color: var(--sky); border-color: rgba(56,189,248,0.25); }
.sp-phase.exam     { background: var(--rose-glow); color: #fca5a5; border-color: rgba(239,68,68,0.32); }
.sp-today {
  position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}
.sp-today::after {
  content: "today"; position: absolute; top: -14px; left: -16px;
  font-size: 0.56rem; font-weight: 800; color: var(--emerald);
}
.sp-phases { margin-top: 16px; }
.sp-phase-dates { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 0.64rem; color: var(--text-muted); font-weight: 600; }

.sp-exam-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-exam-chip {
  font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
  background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid;
  padding: 5px 10px; border-radius: 8px;
}
.sp-exam-chip b { font-weight: 800; color: var(--text); }
.sp-exam-chip em { font-style: normal; color: var(--amber); font-weight: 800; margin-left: 3px; }

.sp-wrap { overflow-x: auto; }
.sp-table { border-collapse: collapse; width: 100%; min-width: 900px; }
.sp-table th {
  text-align: left; font-size: 0.66rem; padding: 6px 8px; color: var(--text-muted);
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.sp-th { border-left: 3px solid; padding-left: 6px; font-weight: 800; color: var(--text); }
.sp-table td { border-bottom: 1px solid var(--border); vertical-align: top; padding: 6px 8px; }
.sp-wk { min-width: 110px; white-space: nowrap; }
.sp-wk b { font-size: 0.76rem; }
.sp-wk small { display: block; color: var(--text-muted); font-size: 0.62rem; font-weight: 600; }
.sp-now {
  margin-left: 6px; font-size: 0.56rem; font-weight: 800; padding: 1px 6px; border-radius: 4px;
  background: var(--emerald); color: #04231a; vertical-align: 2px;
}
.sp-row.current td { background: rgba(16,185,129,0.05); }
.sp-row.current .sp-wk b { color: var(--emerald); }
.sp-row.past { opacity: 0.55; }
.sp-row.type-recess .sp-wk b { color: var(--sky); }
.sp-row.type-revision .sp-wk b { color: var(--sky); }
.sp-row.type-exam .sp-wk b { color: #fca5a5; }
.sp-cell { min-width: 130px; }
.sp-cell.done .sp-txt { text-decoration: line-through; color: var(--text-muted); }
.sp-dot {
  border: 1px solid var(--border); background: var(--bg-input); color: var(--text-muted);
  width: 20px; height: 20px; border-radius: 50%; font-size: 0.62rem; line-height: 1;
  margin-right: 5px; vertical-align: middle; padding: 0;
}
.sp-dot.s1 { background: var(--amber); border-color: var(--amber); color: #2a1c00; }
.sp-dot.s2 { background: var(--emerald); border-color: var(--emerald); color: #04231a; }
.sp-txt { font-size: 0.72rem; cursor: pointer; line-height: 1.45; }
.sp-txt:hover { color: var(--primary-light); }
.sp-txt.ph { color: var(--text-muted); opacity: 0.65; font-style: italic; }
.sp-edit { font-size: 0.72rem; padding: 4px 7px; width: 100%; }
td.sp-focus { min-width: 160px; }

.slot-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.slot-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 14px; }
.slot-toggles-label { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-right: 2px; }
.slot-toggle { font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: rgba(16,185,129,0.12); color: var(--text); cursor: pointer; transition: var(--tr); }
.slot-toggle:hover { border-color: var(--primary-light); }
.slot-toggle.off { background: rgba(255,255,255,0.04); color: var(--text-muted); text-decoration: line-through; opacity: 0.75; }
.slot-hide { margin-left: 6px; width: 20px; height: 20px; line-height: 1; font-size: 0.72rem; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; transition: var(--tr); }
.slot-hide:hover { color: var(--amber); border-color: var(--amber); }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.slot-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; }
.slot-card.nopick { opacity: 0.75; }
.slot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.slot-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.slot-head h4 { font-size: 0.86rem; font-weight: 800; }
.slot-head .cnt { margin-left: auto; font-size: 0.66rem; font-weight: 800; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 999px; }

.opt { display: flex; align-items: flex-start; gap: 9px; padding: 8px 8px; border-radius: 8px; border: 1px solid transparent; transition: var(--tr); }
.opt:hover { background: var(--bg-card-hover); }
.opt.pickrow { background: var(--emerald-glow); border-color: rgba(16,185,129,0.35); margin-bottom: 4px; }
.opt.clashopt { background: var(--rose-glow); border-color: rgba(239,68,68,0.3); }
.opt.multi-slot { border-left: 2px solid rgba(245,158,11,0.55); }
.opt .rank { font-size: 0.72rem; font-weight: 800; color: var(--text-muted); min-width: 20px; padding-top: 2px; text-align: center; }
.opt.pickrow .rank { color: var(--amber); }
.opt .obody { flex: 1; min-width: 0; }
.opt .ocode { color: var(--primary-light); font-weight: 800; font-size: 0.7rem; cursor: pointer; }
.opt .ocode:hover { text-decoration: underline; }
.opt .otitle { font-weight: 600; font-size: 0.78rem; cursor: pointer; }
.opt .otitle:hover { text-decoration: underline; }
.opt .ometa { font-size: 0.66rem; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.opt .ostars { margin-top: 3px; display: flex; gap: 1px; }
.opt .ostars .s { cursor: pointer; color: rgba(255,255,255,0.18); font-size: 0.85rem; line-height: 1; transition: var(--tr); }
.opt .ostars .s.on { color: var(--amber); }
.opt .ostars .s:hover { transform: scale(1.2); }
.opt .reorder { display: flex; flex-direction: column; gap: 2px; }
.opt .reorder button { border: 1px solid var(--border); background: var(--bg-input); color: var(--text-muted); border-radius: 4px; width: 22px; height: 16px; font-size: 0.55rem; line-height: 1; padding: 0; }
.opt .reorder button:hover { color: var(--text); border-color: var(--border-hover); }
.opt .opick-btn { border: 1px solid var(--border); background: var(--bg-input); border-radius: 6px; padding: 4px 9px; font-size: 0.64rem; font-weight: 800; color: var(--text-secondary); white-space: nowrap; }
.opt.pickrow .opick-btn { background: var(--emerald); border-color: var(--emerald); color: #04231a; }
.tag.multi-tag { background: var(--amber-glow); color: var(--amber); }
.tag.idx-tag.idx-tight { background: var(--rose-glow); color: #fca5a5; }
.tag.idx-tag.idx-mid { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.tag.idx-tag.idx-loose { background: var(--emerald-glow); color: var(--emerald); }
.slot-more { font-size: 0.7rem; color: var(--primary-light); font-weight: 700; cursor: pointer; padding: 6px 4px 0; display: inline-block; }
.alt-divider { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 8px 0 4px; padding-top: 7px; border-top: 1px dashed var(--border); }

.arch-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 11px; margin-bottom: 6px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 9px;
  font-size: 0.75rem;
}
.arch-row.st-rejected { opacity: 0.65; }
.arch-row.st-pending { border-left: 3px solid var(--amber); }
.arch-row.st-approved { border-left: 3px solid var(--emerald); }
.arch-row.st-rejected { border-left: 3px solid var(--rose); }
.arch-remark { font-size: 0.66rem; color: var(--text-muted); flex-basis: 100%; padding-left: 4px; }
.seg-btn.rq-approved.on { background: var(--emerald); border-color: var(--emerald); color: #04241a; }
.seg-btn.rq-pending.on  { background: var(--amber); border-color: var(--amber); color: #2a1c00; }
.seg-btn.rq-rejected.on { background: var(--rose); border-color: var(--rose); color: #2a0510; }

/* ============================================================
   Demo build additions
   ============================================================ */
html { -webkit-text-size-adjust: 100%; }
.bad-txt { color: #fca5a5; font-weight: 600; }
.section-head .hint b { color: var(--text-secondary); }
[data-info] { cursor: pointer; }
b[data-info]:hover, .alt-code[data-info]:hover { text-decoration: underline; }

/* permanent demo note */
.demo-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; gap: 9px;
  padding: 6px 16px; min-height: 30px;
  font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
  background: rgba(10, 13, 22, 0.94); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex-shrink: 0; }
.demo-reset {
  margin-left: auto; white-space: nowrap; font-weight: 700; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 7px; padding: 2px 9px;
}
.demo-reset:hover { color: var(--text); border-color: var(--border-hover); }
#toast { bottom: 46px; max-width: calc(100vw - 32px); text-align: center; }

/* status board: actions, not received, clash */
.brow-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; flex-shrink: 0; }
.brow-main .brow-actions + .icon-btn { margin-left: 0; }
.miss-btn { color: #fca5a5; border-color: rgba(239,68,68,0.4); }
.miss-btn:hover { background: var(--rose-glow); border-color: var(--rose); color: #fecaca; }
.brow.missed {
  border-left: 4px solid var(--rose); border-color: rgba(239,68,68,0.45);
  background: linear-gradient(180deg, rgba(239,68,68,0.09), rgba(239,68,68,0.02));
}
.brow.missed .crow-title { text-decoration: line-through; text-decoration-color: rgba(252,165,165,0.6); }
.brow.missed .crow-title b { text-decoration: none; }
.brow-state.st-missed { color: #fca5a5; }
.brow.has-clash { border-top-color: rgba(239,68,68,0.55); border-right-color: rgba(239,68,68,0.55); border-bottom-color: rgba(239,68,68,0.55); }
.seg-btn.st-missed.on { background: var(--rose); border-color: var(--rose); color: #2a0510; }
.brow-ctrl .seg { flex-wrap: wrap; }
.row-note { font-size: 0.72rem; color: var(--amber); line-height: 1.5; flex-basis: 100%; }
.alts-head b { font-size: 0.86rem; }
.alt.no .alt-bad { opacity: 1; }
.alt.no { opacity: 0.72; }
.arch-seg { margin-left: auto; flex-wrap: wrap; }

/* week grid */
.tt-event { cursor: pointer; }
.tt-event.target { border-style: dashed !important; border-width: 1px 1px 1px 3px; }
.tt-event .ev-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cal-day.today { outline: 2px solid var(--primary-light); outline-offset: -1px; }

/* modal */
.modal-title { font-size: 1rem; margin: 0 34px 8px 0; line-height: 1.35; }
.modal-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.modal-lbl {
  font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin: 12px 0 4px;
}
.modal-text { font-size: 0.82rem; line-height: 1.6; color: var(--text-secondary); }
.modal-slots { display: grid; gap: 4px; font-size: 0.76rem; }

/* time window planner: never wider than the screen */
.slot-grid { grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); }

/* ---------- embedded frame (about 1100 x 690): tighter, so all six courses fit ---------- */
@media (max-width: 1140px), (max-height: 720px) {
  header.topbar { padding: 7px 18px; }
  .app { padding: 10px 18px 64px; }
  nav.tabs { margin-bottom: 10px; padding: 4px; }
  nav.tabs button { padding: 7px 14px; }
  .card { padding: 12px 16px 14px; }
  .section-head { margin-bottom: 9px; }
  .card .balance { margin: 0 0 9px; gap: 3px; }
  .board-group { margin-bottom: 9px; }
  .board-group-head { margin-bottom: 5px; }
  .brow { padding: 7px 12px; margin-bottom: 5px; }
  .brow .crow-meta { margin-top: 2px; }
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
  header.topbar { padding: 8px 12px; gap: 8px; }
  .brand .logo { width: 28px; height: 28px; border-radius: 8px; }
  .brand h1 { font-size: 0.92rem; }
  .brand p { display: none; }
  .topbar-stats { gap: 5px; }
  .stat-pill { padding: 4px 8px; font-size: 0.62rem; }
  .stat-pill b { font-size: 0.76rem; }

  .app { padding: 12px 12px 64px; }
  nav.tabs { gap: 3px; margin-bottom: 12px; }
  nav.tabs button { flex: 1 1 40%; justify-content: center; padding: 8px 6px; font-size: 0.76rem; }
  .card { padding: 13px 12px; border-radius: 13px; }
  .section-head { gap: 4px 10px; margin-bottom: 10px; }
  .section-head h2 { font-size: 1rem; }

  .bal-line { flex-wrap: wrap; gap: 4px 10px; }
  .bal-line .bal-bar { order: 3; flex-basis: 100%; }
  .bal-line .bal-state { margin-left: auto; }

  .brow-main { flex-wrap: wrap; gap: 6px 9px; }
  .brow-id { flex: 1 1 0; }
  .brow-main .brow-edit { order: 2; margin-left: 0; }
  .brow-actions { order: 3; flex-basis: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .brow-ctrl { gap: 10px; }
  .brow-ctl { max-width: 100%; }
  .brow-ctl .idx-sel { max-width: 100%; width: 100%; }
  .alts-loss { margin-left: 0; }
  .alt .btn, .pool-row .btn { margin-left: auto; }
  .alt-name { flex-basis: calc(100% - 90px); }
  .arch-seg { margin-left: 0; }
  .sol-head .btn { margin-left: 0; }
  .rescue .btn { margin-left: 0; white-space: normal; }

  .tt { --tt-time: 40px; --tt-col: 116px; }
  .tt-event.half { padding: 4px 4px; }
  .tt-event.half .ev-name, .tt-event.half .ev-clash-w { display: none; }
  .tt .time-lbl { padding-right: 4px; }
  details.fold summary { padding: 11px 12px; font-size: 0.82rem; }
  .phase-grid { gap: 16px; }
  .fp-main { align-items: flex-start; }
  .tag { white-space: normal; }

  .cal { gap: 3px; }
  .cal-day { min-height: 44px; padding: 3px 3px; font-size: 0.52rem; }
  .cal-day .cc { font-size: 0.5rem; word-break: break-all; }
  .cal-wklabel { flex-wrap: wrap; gap: 4px 8px; }
  .trip-form .input[type="date"] { flex: 1 1 120px; min-width: 0; }
  .exam-grid { grid-template-columns: 1fr; }
  .sp-phase span { font-size: 0.5rem; padding: 0 1px; white-space: normal; text-align: center; line-height: 1.15; }
  .sp-table { min-width: 760px; }
  .sp-cell { min-width: 108px; }

  .slot-card { padding: 11px 10px; }
  .opt { flex-wrap: wrap; }
  .opt .obody { flex-basis: calc(100% - 40px); }
  .opt .opick-btn { margin-left: auto; }
  .modal { padding: 12px; }
  .modal-card { padding: 18px 16px; }
  .demo-bar { padding: 6px 12px; font-size: 0.66rem; }
}
