/* Seuil — dark, calm, icon-first. Fraunces for display, IBM Plex Sans for UI. */

:root {
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;

  --bg: #0b0b0e;
  --bg-2: #0e0f13;
  --surface: #131419;
  --surface-2: #191b22;
  --surface-3: #22242e;
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .14);
  --text: #eceada;
  --muted: #98978f;
  --faint: #605f66;
  --accent: #c9a35c;          /* threshold brass */
  --accent-soft: rgba(201, 163, 92, .13);
  --ok: #58b788;
  --ok-soft: rgba(88, 183, 136, .13);
  --warn: #d9a03f;
  --warn-soft: rgba(217, 160, 63, .14);
  --bad: #cf6a72;
  --bad-soft: rgba(207, 106, 114, .13);
  --shadow: 0 1px 0 rgba(255, 255, 255, .02) inset, 0 12px 32px -20px rgba(0, 0, 0, .65);

  /* day types */
  --t-anatomy: #56c4b8;  --t-anatomy-soft: rgba(86, 196, 184, .14);
  --t-orale: #ab8fe0;    --t-orale-soft: rgba(171, 143, 224, .15);
  --t-ecrite: #6da3d8;   --t-ecrite-soft: rgba(109, 163, 216, .15);
  --t-mock: #d9a03f;     --t-mock-soft: rgba(217, 160, 63, .14);
  --t-review: #cf8fbf;   --t-review-soft: rgba(207, 143, 191, .15);
  --t-rest: #58b788;     --t-rest-soft: rgba(88, 183, 136, .13);
  --t-exam: #d8707c;     --t-exam-soft: rgba(216, 112, 124, .15);
  /* skills (block icons) */
  --sk-ee: #6da3d8;   --sk-ee-soft: rgba(109, 163, 216, .14);
  --sk-eo: #ab8fe0;   --sk-eo-soft: rgba(171, 143, 224, .14);
  --sk-co: #56c4b8;   --sk-co-soft: rgba(86, 196, 184, .14);
  --sk-ce: #8fbc6e;   --sk-ce-soft: rgba(143, 188, 110, .14);
  --sk-quiz: #d9c04f; --sk-quiz-soft: rgba(217, 192, 79, .13);
  --sk-mock: #d9a03f; --sk-mock-soft: rgba(217, 160, 63, .14);
  --sk-log: #cf8fbf;  --sk-log-soft: rgba(207, 143, 191, .14);
  --sk-misc: #98978f; --sk-misc-soft: rgba(152, 151, 143, .12);

  --radius: 16px;
  --sidebar: 240px;
}
html[data-theme="light"] {
  --bg: #f2f2ef;
  --bg-2: #ecece7;
  --surface: #fbfbf9;
  --surface-2: #f1f1ec;
  --surface-3: #e5e5df;
  --border: rgba(31, 30, 26, .09);
  --border-strong: rgba(31, 30, 26, .18);
  --text: #24231e;
  --muted: #6d6c64;
  --faint: #a3a29a;
  --accent: #9a7328;
  --accent-soft: rgba(154, 115, 40, .12);
  --ok: #2f8f60;   --ok-soft: rgba(47, 143, 96, .12);
  --warn: #a56f14; --warn-soft: rgba(165, 111, 20, .13);
  --bad: #b34b55;  --bad-soft: rgba(179, 75, 85, .11);
  --shadow: 0 1px 2px rgba(31, 30, 26, .05), 0 12px 30px -22px rgba(31, 30, 26, .3);
  --t-anatomy: #178f83; --t-anatomy-soft: rgba(23, 143, 131, .12);
  --t-orale: #7a55c9;   --t-orale-soft: rgba(122, 85, 201, .12);
  --t-ecrite: #3573b5;  --t-ecrite-soft: rgba(53, 115, 181, .12);
  --t-mock: #a56f14;    --t-mock-soft: rgba(165, 111, 20, .13);
  --t-review: #a75a92;  --t-review-soft: rgba(167, 90, 146, .12);
  --t-rest: #2f8f60;    --t-rest-soft: rgba(47, 143, 96, .12);
  --t-exam: #bb4a58;    --t-exam-soft: rgba(187, 74, 88, .12);
  --sk-ee: #3573b5;  --sk-ee-soft: rgba(53, 115, 181, .11);
  --sk-eo: #7a55c9;  --sk-eo-soft: rgba(122, 85, 201, .11);
  --sk-co: #178f83;  --sk-co-soft: rgba(23, 143, 131, .11);
  --sk-ce: #5d8a35;  --sk-ce-soft: rgba(93, 138, 53, .12);
  --sk-quiz: #96820a; --sk-quiz-soft: rgba(150, 130, 10, .11);
  --sk-mock: #a56f14; --sk-mock-soft: rgba(165, 111, 20, .12);
  --sk-log: #a75a92;  --sk-log-soft: rgba(167, 90, 146, .11);
  --sk-misc: #6d6c64; --sk-misc-soft: rgba(109, 108, 100, .1);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
svg { display: block; }
code { font-size: .9em; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }

#app { min-height: 100dvh; }
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100dvh; }

/* ================= sidebar ================= */
.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  padding: 24px 16px 18px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.brand:hover { text-decoration: none; }
.brand-ic { width: 30px; height: 30px; color: var(--accent); stroke-width: 1.6; }
.brand-name { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 24px; line-height: 1; color: var(--text); letter-spacing: .01em; }
.brand-sub { font-size: 11.5px; color: var(--faint); margin-top: 3px; letter-spacing: .04em; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: 14px;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.is-active { background: var(--accent-soft); color: var(--text); }
.nav-item.is-active .icon { color: var(--accent); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.exam-mini { font-size: 13px; color: var(--muted); padding: 0 8px; }
.exam-mini .num { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--text); margin-right: 2px; }
.theme-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  color: var(--muted); font-size: 13px;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }

/* ================= main / topbar ================= */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 32px 0; }
.topbar h1 { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.content { padding: 20px 32px 56px; max-width: 1080px; width: 100%; margin: 0 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); text-decoration: none; }
.btn:disabled { opacity: .45; }
.btn-primary { background: var(--accent); border-color: transparent; color: #17130a; font-weight: 600; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn .icon { width: 16px; height: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-title .icon { color: var(--muted); }
.card-sub { color: var(--faint); font-size: 12.5px; }
.section { margin-top: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; background: var(--accent-soft); font-size: 14px; }
.banner .icon { color: var(--accent); }
.empty-box { padding: 26px 20px; text-align: center; border-radius: 12px; border: 1px dashed var(--border-strong); color: var(--muted); font-size: 14px; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.tag .icon { width: 13px; height: 13px; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }

/* ================= hero ================= */
.hero-exam { text-align: center; padding: 30px 0 26px; }
.hero-num {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(96px, 15vw, 168px);
  line-height: .92;
  letter-spacing: -.02em;
}
.hero-word { font-size: clamp(54px, 8vw, 84px); font-style: italic; }
.hero-rule { width: 84px; height: 2px; background: var(--accent); margin: 20px auto 14px; }
.hero-sub { color: var(--muted); font-size: 15px; }

/* ================= day card ================= */
.day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px 22px;
}
.day-card.is-mock { border-color: rgba(217, 160, 63, .5); box-shadow: var(--shadow), 0 0 0 1px rgba(217, 160, 63, .25); }
.date-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.date-center { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; flex-wrap: wrap; color: var(--muted); font-size: 15px; }
.date-center b { color: var(--text); font-weight: 600; }
.type-ic { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; }
.type-ic .icon { width: 16px; height: 16px; }
.type-chip { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; padding: 3px 8px; border-radius: 6px; }
.t-anatomy { background: var(--t-anatomy-soft); color: var(--t-anatomy); }
.t-orale { background: var(--t-orale-soft); color: var(--t-orale); }
.t-ecrite { background: var(--t-ecrite-soft); color: var(--t-ecrite); }
.t-mock { background: var(--t-mock-soft); color: var(--t-mock); }
.t-review { background: var(--t-review-soft); color: var(--t-review); }
.t-rest { background: var(--t-rest-soft); color: var(--t-rest); }
.t-exam { background: var(--t-exam-soft); color: var(--t-exam); }
.back-today { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 2px auto 8px; width: fit-content; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.back-today:hover { color: var(--text); text-decoration: none; border-color: var(--border-strong); }
.back-today .icon { width: 14px; height: 14px; }

.mock-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 10px 0 14px; padding: 13px 16px;
  border-radius: 12px;
  background: var(--t-mock-soft);
  border: 1px solid rgba(217, 160, 63, .45);
  color: var(--t-mock);
  font-size: 14px;
}
.mock-banner b { letter-spacing: .06em; }
.mock-banner span { color: var(--muted); }

/* tasks */
.tasks { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.task {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) 48px; gap: 14px; align-items: start;
  padding: 15px 14px 15px 15px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.task-ic { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.task-ic .icon { width: 23px; height: 23px; }
.sk-ee .task-ic, .task-ic.sk-ee { background: var(--sk-ee-soft); color: var(--sk-ee); }
.sk-eo .task-ic, .task-ic.sk-eo { background: var(--sk-eo-soft); color: var(--sk-eo); }
.sk-co .task-ic, .task-ic.sk-co { background: var(--sk-co-soft); color: var(--sk-co); }
.sk-ce .task-ic, .task-ic.sk-ce { background: var(--sk-ce-soft); color: var(--sk-ce); }
.sk-quiz .task-ic { background: var(--sk-quiz-soft); color: var(--sk-quiz); }
.sk-mock .task-ic { background: var(--sk-mock-soft); color: var(--sk-mock); }
.sk-log .task-ic { background: var(--sk-log-soft); color: var(--sk-log); }
.sk-misc .task-ic { background: var(--sk-misc-soft); color: var(--sk-misc); }
.task-main { min-width: 0; padding-top: 2px; }
.task-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.task-name { font-size: 11px; letter-spacing: .09em; font-weight: 700; color: var(--faint); }
.task-due { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.task-due .icon { width: 14px; height: 14px; }
.task-due b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.task-due.is-overdue { color: var(--warn); }
.task-due.is-overdue b { color: var(--warn); }
.task-text { font-size: 16.5px; line-height: 1.55; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 12.5px; color: var(--faint); flex-wrap: wrap; }
.task-meta a { display: inline-flex; align-items: center; gap: 5px; }
.task-meta a .icon { width: 12px; height: 12px; }
.task-check {
  width: 44px; height: 44px; border-radius: 12px; margin-top: 1px;
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--faint);
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.task-check .icon { width: 21px; height: 21px; stroke-width: 2.4; }
.task-check:hover { border-color: var(--accent); color: var(--muted); }
.task-check:active { transform: scale(.94); }
.task-check.is-done { background: var(--ok); border-color: var(--ok); color: #0d2318; }
.task-check.is-locked { border-style: dashed; cursor: default; }
.task-check.is-locked:hover { border-color: var(--border-strong); color: var(--faint); }
/* task states */
.task.st-done { opacity: .62; }
.task.st-done .task-text { color: var(--muted); }
.task.st-overdue { border-left: 3px solid var(--warn); padding-left: 13px; }
.task.st-locked { opacity: .5; }

.note {
  margin-top: 14px; padding: 13px 15px; border-radius: 12px;
  background: var(--accent-soft); font-size: 14.5px; line-height: 1.55;
  display: flex; gap: 12px; align-items: flex-start;
}
.note .icon { color: var(--accent); margin-top: 2px; }
.note-big { font-size: 17px; padding: 22px 20px; }
.note-quiet { background: var(--surface-2); }
.note-quiet .icon { color: var(--faint); }

.day-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.locked-hint { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); font-size: 13.5px; }
.locked-hint .icon { width: 15px; height: 15px; }
.close-day {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 13px;
  border: 1px dashed var(--border-strong);
  color: var(--faint);
  font-size: 13.5px; font-weight: 650; letter-spacing: .14em;
  transition: all .2s ease;
}
.close-day .icon { width: 17px; height: 17px; }
.close-day:not(:disabled) { border: 1px solid var(--accent); color: var(--accent); background: var(--accent-soft); }
.close-day:not(:disabled):hover { background: var(--accent); color: #17130a; }

/* closed = the door shuts */
.closed-panel { text-align: center; padding: 44px 20px 36px; }
.door-line { position: relative; height: 1px; margin: 0 auto 30px; max-width: 420px; }
.door-line::before, .door-line::after { content: ""; position: absolute; top: 0; width: 50%; height: 1px; background: var(--accent); }
.door-line::before { left: 0; transform-origin: left; }
.door-line::after { right: 0; transform-origin: right; }
.closed-title { font-family: var(--display); font-size: 30px; font-weight: 600; }
.closed-sub { color: var(--muted); font-size: 16px; margin-top: 6px; }
.closed-time { font-size: 12.5px; color: var(--faint); margin-top: 20px; }
.reopen-row { text-align: center; margin-top: 6px; }
.animate .door-line::before, .animate .door-line::after { animation: doorShut .65s cubic-bezier(.4, 0, .2, 1) both; }
.animate .closed-title, .animate .closed-sub, .animate .closed-time { animation: settle .5s ease-out .55s both; }
@keyframes doorShut { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes settle { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .animate .door-line::before, .animate .door-line::after, .animate .closed-title, .animate .closed-sub, .animate .closed-time { animation: none; } }

/* ================= calendar ================= */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); gap: 18px; align-items: start; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-month { font-family: var(--display); font-size: 19px; font-weight: 600; min-width: 150px; text-align: center; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 11px; letter-spacing: .08em; color: var(--faint); font-weight: 700; text-align: center; padding: 4px 0 6px; }
.cal-cell {
  position: relative; min-height: 72px; padding: 7px 8px; border-radius: 12px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; width: 100%;
  transition: border-color .15s ease, transform .1s ease;
}
.cal-cell:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.cal-cell.is-out { background: transparent; border-color: transparent; min-height: 34px; padding-top: 4px; }
.cal-cell.is-out .cal-num { color: var(--faint); opacity: .5; }
.cal-cell.is-out:hover { transform: none; }
.cal-cell.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cal-cell.is-today .cal-num { background: var(--accent); color: #17130a; }
.cal-top { display: flex; align-items: center; justify-content: space-between; }
.cal-num { font-size: 12.5px; font-weight: 700; width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.cal-status { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 6px; }
.cal-status .icon { width: 11px; height: 11px; stroke-width: 3; }
.cal-cell.st-closed .cal-status { background: var(--ok); color: #0d2318; }
.cal-cell.st-partial .cal-status, .cal-cell.st-open .cal-status { background: var(--warn-soft); color: var(--warn); }
.cal-cell.st-missed .cal-status { background: var(--bad-soft); color: var(--bad); }
.cal-cell.st-closed { border-color: rgba(88, 183, 136, .35); }
.cal-cell.st-missed { border-color: rgba(207, 106, 114, .35); }
.cal-cell.t-mock:not(.is-out) { background: var(--t-mock-soft); border-color: rgba(217, 160, 63, .4); }
.cal-cell.st-future:not(.t-mock) .cal-ic { opacity: .55; }
.cal-ic { margin-top: auto; display: inline-flex; }
.cal-ic .icon { width: 17px; height: 17px; }
.t-anatomy .cal-ic { color: var(--t-anatomy); } .t-orale .cal-ic { color: var(--t-orale); }
.t-ecrite .cal-ic { color: var(--t-ecrite); } .t-mock .cal-ic { color: var(--t-mock); }
.t-review .cal-ic { color: var(--t-review); } .t-rest .cal-ic { color: var(--t-rest); }
.t-exam .cal-ic { color: var(--t-exam); }
.cal-cell { background-clip: padding-box; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; background: none; }
.cal-legend .icon { width: 14px; height: 14px; }
.cal-legend .t-anatomy { color: var(--t-anatomy); } .cal-legend .t-orale { color: var(--t-orale); }
.cal-legend .t-ecrite { color: var(--t-ecrite); } .cal-legend .t-mock { color: var(--t-mock); }
.cal-legend .t-review { color: var(--t-review); } .cal-legend .t-rest { color: var(--t-rest); }
.cal-legend .t-exam { color: var(--t-exam); }
.cal-detail { position: sticky; top: 22px; padding-top: 14px; }

/* ================= progress ================= */
.heat-card { padding: 26px; max-width: 860px; }
.heat { display: grid; grid-template-columns: 40px repeat(8, 1fr); gap: 8px; align-items: center; }
.heat-lbl { font-size: 11.5px; color: var(--faint); font-weight: 600; text-align: center; }
.heat-row-lbl { font-size: 11.5px; color: var(--faint); font-weight: 600; }
.heat-cell {
  aspect-ratio: 1; width: 100%; border-radius: 9px; background: var(--surface-3);
  border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--faint);
  transition: transform .1s ease;
}
.heat-cell:hover { transform: scale(1.07); }
.heat-cell.st-closed { background: var(--ok); color: #0d2318; font-weight: 600; }
.heat-cell.st-partial, .heat-cell.st-open { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.heat-cell.st-missed { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.heat-cell.is-today { box-shadow: 0 0 0 2px var(--accent); color: var(--text); }
.heat-cell.st-closed.is-today { color: #0d2318; }
.heat-cell.is-mock:not(.st-closed) { border-color: var(--t-mock); border-style: dashed; }
.heat-cell.is-empty { background: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 13px; height: 13px; border-radius: 4px; background: var(--surface-3); border: 1px solid transparent; }
.sw.st-closed { background: var(--ok); }
.sw.st-partial { background: var(--warn-soft); border-color: var(--warn); }
.sw.st-missed { background: var(--bad-soft); border-color: var(--bad); }
.sw.is-today { box-shadow: 0 0 0 2px var(--accent); }
.sw.is-mock { border-color: var(--t-mock); border-style: dashed; }
.stats-line { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-top: 20px; padding: 0 8px; max-width: 860px; color: var(--muted); font-size: 13.5px; }
.stats-line b { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--text); margin-right: 2px; }

/* ================= results ================= */
.charts-stack { display: flex; flex-direction: column; gap: 18px; }
.chart-title { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.chart-title .task-ic { width: 38px; height: 38px; border-radius: 10px; }
.chart-title .task-ic .icon { width: 19px; height: 19px; }
.chart-svg { width: 100%; height: auto; }
.chart-card .gridline { stroke: var(--border); stroke-width: 1; }
.chart-card .lbl { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart-card .thr { stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 6 5; }
.chart-card .thr-lbl { fill: var(--accent); font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart-card .below-band { fill: var(--bad); opacity: .045; }
.chart-card .line { fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.chart-card .pt { stroke: var(--surface); stroke-width: 2; }
.chart-card .pt.ok { fill: var(--ok); }
.chart-card .pt.bad { fill: var(--bad); }

.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.form-grid .field-date { grid-column: 1 / -1; }
.form-grid .form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.field-hint { color: var(--faint); text-transform: none; letter-spacing: 0; font-weight: 500; }
input[type="number"], input[type="date"], input[type="search"], textarea {
  width: 100%; min-height: 40px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 14px;
  font-variant-numeric: tabular-nums;
}
input[type="date"] { -webkit-appearance: none; appearance: none; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; line-height: 1.55; }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--border); text-align: right; }
.tbl th:first-child, .tbl td:first-child, .tbl th:nth-child(2), .tbl td:nth-child(2) { text-align: left; }
.tbl td:first-child { color: var(--faint); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr[data-action] { cursor: pointer; }
.tbl .ok { color: var(--ok); font-weight: 600; }
.tbl .bad { color: var(--bad); font-weight: 600; }

/* ================= errors ================= */
.err-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.err-editor textarea { min-height: 260px; font-size: 15px; }
.saved { font-size: 12px; color: var(--ok); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; transition: opacity .3s; }
.saved[hidden] { display: inline-flex; opacity: 0; }
.saved .icon { width: 13px; height: 13px; }
.err-list { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow: auto; }
.err-item { display: block; width: 100%; text-align: left; padding: 13px 15px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.err-item:hover { border-color: var(--border-strong); }
.err-item.is-current { border-color: var(--accent); }
.err-date { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; display: flex; justify-content: space-between; }
.err-text { white-space: pre-wrap; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ================= settings ================= */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: 0; }
.settings-row h3 { font-size: 14.5px; font-weight: 600; }
.settings-row p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.btn-file input { display: none; }

/* ================= bottom nav ================= */
.bottom-nav { display: none; }

/* ================= responsive ================= */
@media (max-width: 1024px) {
  :root { --sidebar: 72px; }
  .brand-name, .brand-sub, .nav-item span, .exam-mini, .theme-toggle span { display: none; }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .nav-item { justify-content: center; padding: 12px; }
  .theme-toggle { justify-content: center; }
  .cal-layout, .err-layout { grid-template-columns: 1fr; }
  .cal-detail { position: static; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 16px 16px 0; }
  .topbar h1 { font-size: 22px; }
  .content { padding: 14px 14px calc(86px + env(safe-area-inset-bottom)); }
  .grid-2 { grid-template-columns: 1fr; }
  .hero-exam { padding: 18px 0 20px; }
  .task { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 13px; }
  .task-ic { width: 40px; height: 40px; }
  .task-check { grid-column: 2; justify-self: end; margin-top: 4px; }
  .task-head { flex-wrap: wrap; }
  .cal-cell { min-height: 52px; padding: 6px; }
  .cal-cell.is-out { min-height: 30px; }
  .cal-status { display: none; }
  .cal-cell.st-closed { background: var(--ok-soft); }
  .cal-cell.st-partial, .cal-cell.st-open { background: var(--warn-soft); border-color: transparent; }
  .cal-cell.st-missed { background: var(--bad-soft); border-color: transparent; }
  .cal-ic .icon { width: 14px; height: 14px; }
  .cal-month { font-size: 16px; min-width: 0; }
  .heat { gap: 4px; grid-template-columns: 30px repeat(8, 1fr); }
  .heat-card { padding: 16px; }
  .day-foot { flex-direction: column; align-items: stretch; text-align: center; }
  .close-day { width: 100%; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--bg-2); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 60px; color: var(--muted); font-size: 10.5px; font-weight: 600; }
  .bottom-nav a.is-active { color: var(--accent); }
  .bottom-nav a:hover { text-decoration: none; }
}
@media (min-width: 721px) { .hide-desktop { display: none !important; } }
@media (max-width: 720px) { .hide-mobile { display: none !important; } }
