@font-face {
  font-family: "Source Serif";
  src: url("fonts/SourceSerif-Variable.woff2") format("woff2-variations"),
       url("fonts/SourceSerif-Variable.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Synonym";
  src: url("fonts/Synonym-Light.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --serif: "Source Serif", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Synonym", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --bg: #ffffff;
  --bg-soft: #f8f7f4;
  --surface: #ffffff;
  --hover: #f3f2ee;
  --border: #ebe9e3;
  --border-strong: #dcd9d1;
  --text: #1f1e1c;
  --text-2: #5d5b55;
  --text-3: #8e8b83;
  --accent: #c2603e;
  --accent-soft: #f7ebe5;
  --accent-text: #a64d2e;
  --today: #c2603e;
  --shadow: 0 1px 2px rgba(31,30,28,.04), 0 8px 28px rgba(31,30,28,.08);

  --green: #3f7a52;  --green-soft: #e9f2ec;
  --amber: #a26a12;  --amber-soft: #f8efdf;
  --red: #b24638;    --red-soft: #f8e9e6;
  --blue: #3c6797;   --blue-soft: #e8eff7;
  --purple: #7655a0; --purple-soft: #f0ebf6;
  --gray: #77746c;   --gray-soft: #f1f0ec;

  --radius: 10px;
  --radius-sm: 6px;
  --maxw: 1120px;
  --gutter: 32px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #262624; --bg-soft: #1f1e1d; --surface: #2c2c2a; --hover: #343431;
    --border: #3a3936; --border-strong: #4a4945;
    --text: #f5f4ef; --text-2: #c3c1b8; --text-3: #8f8d86;
    --accent: #d97757; --accent-soft: #3d2c25; --accent-text: #eb9a7d; --today: #d97757;
    --shadow: 0 1px 2px rgba(0,0,0,.25), 0 12px 32px rgba(0,0,0,.35);
    --green: #7dbb8f; --green-soft: #26342a;
    --amber: #dcae5c; --amber-soft: #3a3121;
    --red: #e58a7c;   --red-soft: #3d2925;
    --blue: #8eb3dd;  --blue-soft: #243041;
    --purple: #b9a0db; --purple-soft: #322b3e;
    --gray: #a8a59c;  --gray-soft: #33322f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #262624; --bg-soft: #1f1e1d; --surface: #2c2c2a; --hover: #343431;
  --border: #3a3936; --border-strong: #4a4945;
  --text: #f5f4ef; --text-2: #c3c1b8; --text-3: #8f8d86;
  --accent: #d97757; --accent-soft: #3d2c25; --accent-text: #eb9a7d; --today: #d97757;
  --shadow: 0 1px 2px rgba(0,0,0,.25), 0 12px 32px rgba(0,0,0,.35);
  --green: #7dbb8f; --green-soft: #26342a;
  --amber: #dcae5c; --amber-soft: #3a3121;
  --red: #e58a7c;   --red-soft: #3d2925;
  --blue: #8eb3dd;  --blue-soft: #243041;
  --purple: #b9a0db; --purple-soft: #322b3e;
  --gray: #a8a59c;  --gray-soft: #33322f;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--serif); font-weight: 300; font-size: 16px; line-height: 1.55;
  font-synthesis: none; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--accent-soft); }

.ui, button, input, select, textarea, .pill, .tabs, .seg, .label, .meta, table {
  font-family: var(--sans); font-weight: 300;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.topbar { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 30; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 52px; }
.who { display: flex; align-items: center; gap: 10px; font-family: var(--sans); font-size: 14px; color: var(--text-2); min-width: 0; white-space: nowrap; }
.who .name { color: var(--text); font-family: var(--serif); font-size: 16px; font-weight: 400; }
.who .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); flex: none; }
.who .nim { letter-spacing: .02em; }
.top-actions { display: flex; align-items: center; gap: 4px; }

.hero { padding-top: 44px; }
.eyebrow { font-family: var(--sans); font-size: 13px; color: var(--text-3); letter-spacing: .02em; margin: 0 0 14px; }
.hero h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(40px, 6vw, 64px); line-height: 1.02; letter-spacing: -.02em; margin: 0; }
.hero .full { font-family: var(--serif); font-weight: 300; font-style: normal; font-size: clamp(15px, 1.6vw, 17px); color: var(--text-2); line-height: 1.5; max-width: 760px; margin: 14px 0 0; }
.hero .sub { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; font-family: var(--sans); font-size: 13px; color: var(--text-3); }

.tabs { display: flex; gap: 2px; margin-top: 30px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { text-decoration: none; padding: 10px 12px 11px; font-size: 15px; color: var(--text-2); border-bottom: 1.5px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: 6px 6px 0 0; }
.tabs a:hover { color: var(--text); background: var(--hover); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

main.wrap { padding-top: 28px; padding-bottom: 80px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); border-color: var(--border-strong); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { opacity: .88; }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { color: var(--red); }
.btn.icon { width: 34px; padding: 0; }
.btn.sm { height: 28px; font-size: 13px; padding: 0 9px; }
.btn.sm.icon { width: 28px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.edit-badge { display: none; }
body.editing .edit-badge { display: inline-flex; }
.btn.edit-on { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.only-edit { display: none !important; }
body.editing .only-edit { display: inline-flex !important; }
body.editing .only-edit.block { display: block !important; }

/* ---------- Generic ---------- */
.section { margin-top: 40px; }
.section:first-child { margin-top: 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sec-head h2 { font-family: var(--serif); font-weight: 300; font-size: 24px; letter-spacing: -.01em; margin: 0; line-height: 1.2; }
.sec-head p { margin: 4px 0 0; color: var(--text-3); font-family: var(--sans); font-size: 13px; }
.muted { color: var(--text-3); }
.label { font-size: 12px; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.pad { padding: 18px 20px; }
.grid { display: grid; gap: 14px; }
.empty { padding: 28px; text-align: center; color: var(--text-3); font-family: var(--sans); font-size: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; background: var(--gray-soft); color: var(--gray); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.purple { background: var(--purple-soft); color: var(--purple); }
.pill.accent { background: var(--accent-soft); color: var(--accent-text); }

.bar { height: 6px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; background: var(--text); border-radius: inherit; }
.bar.accent > span { background: var(--accent); }
.bar.green > span { background: var(--green); }

/* segmented control & chips */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .left, .toolbar .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 0; background: transparent; border-radius: 6px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.seg button svg { width: 15px; height: 15px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px var(--border); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; font-size: 13px; color: var(--text-2); cursor: pointer; }
.chip:hover { background: var(--hover); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .n { opacity: .6; margin-left: 4px; }

/* ---------- Overview ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 18px 20px; border-right: 1px solid var(--border); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat .num { font-family: var(--serif); font-weight: 300; font-size: 40px; line-height: 1; letter-spacing: -.02em; margin-top: 10px; }
.stat .num small { font-size: 18px; color: var(--text-3); margin-left: 2px; letter-spacing: 0; }
.stat .hint { font-family: var(--sans); font-size: 13px; color: var(--text-3); margin-top: 8px; }

.progress-hero { padding: 22px 22px 20px; }
.ph-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ph-top .big { font-family: var(--serif); font-size: 56px; font-weight: 300; line-height: 1; letter-spacing: -.03em; }
.ph-top .big small { font-size: 22px; color: var(--text-3); }
.dual { margin-top: 18px; display: grid; gap: 12px; }
.dual-row { display: grid; grid-template-columns: 120px 1fr 48px; gap: 12px; align-items: center; font-family: var(--sans); font-size: 13px; color: var(--text-2); }
.dual-row .v { text-align: right; color: var(--text); }
.dual-row .bar { height: 8px; }

.weekstrip { display: grid; grid-template-columns: repeat(var(--cols, 17), minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.ws { position: relative; aspect-ratio: 1 / 1.25; border-radius: 5px; border: 1px solid var(--border); background: var(--bg-soft); text-decoration: none; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; font-family: var(--sans); font-size: 11px; color: var(--text-3); transition: transform .1s; min-width: 0; }
.ws:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.ws.filled { background: var(--text); border-color: var(--text); color: var(--bg); }
.ws.missing { background: var(--red-soft); border-color: transparent; color: var(--red); }
.ws.current { outline: 2px solid var(--accent); outline-offset: 2px; }
.ws.current.filled { background: var(--accent); border-color: var(--accent); color: #fff; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--sans); font-size: 12px; color: var(--text-3); margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--border); background: var(--bg-soft); }
.legend i.f { background: var(--text); border-color: var(--text); }
.legend i.c { background: var(--accent); border-color: var(--accent); }
.legend i.m { background: var(--red-soft); border-color: transparent; }

.two { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; align-items: start; }
.phase-list { display: grid; gap: 0; }
.phase { padding: 14px 20px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 140px 42px; gap: 14px; align-items: center; }
.phase:first-child { border-top: 0; }
.phase .t { font-size: 16px; }
.phase .s { font-family: var(--sans); font-size: 12px; color: var(--text-3); margin-top: 2px; }
.phase .v { font-family: var(--sans); font-size: 13px; text-align: right; color: var(--text-2); }

.list-rows { display: grid; }
.lrow { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); cursor: pointer; text-decoration: none; }
.lrow:first-child { border-top: 0; }
.lrow:hover { background: var(--hover); }
.datebox { text-align: center; font-family: var(--sans); line-height: 1.1; }
.datebox .d { font-family: var(--serif); font-size: 24px; font-weight: 300; }
.datebox .m { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.lrow .t { font-size: 16px; line-height: 1.35; }
.lrow .s { font-family: var(--sans); font-size: 12px; color: var(--text-3); margin-top: 2px; }

.current-week h3 { font-family: var(--serif); font-weight: 300; font-size: 26px; line-height: 1.2; margin: 8px 0 6px; letter-spacing: -.01em; }
.current-week p { margin: 0; color: var(--text-2); }
.checklist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 7px; }
.checklist li { display: grid; grid-template-columns: 18px 1fr; gap: 9px; align-items: start; line-height: 1.45; }
.checklist li::before { content: ""; width: 14px; height: 14px; margin-top: 4px; border-radius: 4px; border: 1px solid var(--border-strong); }
.checklist.done li::before { background: var(--text); border-color: var(--text); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-size: 14px; }
:root[data-theme="dark"] .checklist.done li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23262624' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .checklist.done li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23262624' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); } }
.checklist.next li::before { border-radius: 50%; }

/* ---------- Progress: list view ---------- */
.weeks { display: grid; gap: 10px; }
.wk { display: grid; grid-template-columns: 92px 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; scroll-margin-top: 70px; }
.wk.is-current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wk.is-upcoming { background: transparent; }
.wk-side { padding: 18px 14px; border-right: 1px solid var(--border); background: var(--bg-soft); font-family: var(--sans); }
.wk-side .w { font-size: 12px; color: var(--text-3); letter-spacing: .05em; text-transform: uppercase; }
.wk-side .n { font-family: var(--serif); font-size: 34px; font-weight: 300; line-height: 1; margin: 4px 0 8px; }
.wk-side .dr { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.wk-main { padding: 16px 20px 18px; min-width: 0; }
.wk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wk-head h3 { font-family: var(--serif); font-weight: 400; font-size: 19px; margin: 0; line-height: 1.3; }
.wk-head .acts { display: flex; gap: 4px; align-items: center; flex: none; }
.wk-sum { color: var(--text-2); margin: 6px 0 0; }
.wk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; }
.wk-block .label { margin-bottom: 2px; }
.wk-note { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: var(--bg-soft); border: 1px solid var(--border); font-size: 15px; }
.wk-note.fb { background: var(--accent-soft); border-color: transparent; }
.wk-note .label { display: block; margin-bottom: 4px; }
.wk-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.wk-links a { font-family: var(--sans); font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-2); }
.wk-links a:hover { background: var(--hover); color: var(--text); }
.wk-links svg { width: 14px; height: 14px; }
.wk-empty { font-family: var(--sans); font-size: 14px; color: var(--text-3); margin: 8px 0 0; }
.wk.collapsed .wk-cols, .wk.collapsed .wk-note, .wk.collapsed .wk-links { display: none; }
.wk-toggle { font-family: var(--sans); font-size: 13px; color: var(--text-3); background: none; border: 0; padding: 0; margin-top: 10px; cursor: pointer; }
.wk-toggle:hover { color: var(--text); }

/* table view */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.tbl th { text-align: left; font-weight: 300; font-size: 12px; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-soft); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl td.t { font-family: var(--serif); font-size: 15px; color: var(--text); }
.tbl td.num { font-family: var(--serif); font-size: 18px; color: var(--text); white-space: nowrap; }
.tbl tr.is-current td { background: var(--accent-soft); }

/* board view */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font-family: var(--sans); font-size: 13px; color: var(--text-2); }
.col-list { display: grid; gap: 8px; }
.bcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 13px; cursor: pointer; text-align: left; width: 100%; }
.bcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.bcard .w { font-family: var(--sans); font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; gap: 6px; }
.bcard .t { font-family: var(--serif); font-size: 16px; line-height: 1.3; margin-top: 4px; }
.bcard .s { font-family: var(--sans); font-size: 12px; color: var(--text-3); margin-top: 6px; }

/* ---------- Timeline: month ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; }
.cal-title { font-family: var(--serif); font-weight: 300; font-size: 26px; letter-spacing: -.01em; min-width: 190px; }
.month { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.dow { display: grid; grid-template-columns: 40px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.dow div { font-family: var(--sans); font-size: 12px; color: var(--text-3); padding: 8px 8px; letter-spacing: .04em; text-transform: uppercase; }
.wrow { display: grid; grid-template-columns: 40px 1fr; border-bottom: 1px solid var(--border); min-height: 118px; }
.wrow:last-child { border-bottom: 0; }
.wgut { border-right: 1px solid var(--border); font-family: var(--sans); font-size: 11px; color: var(--text-3); padding: 8px 0; text-align: center; background: var(--bg-soft); text-decoration: none; display: block; }
.wgut b { display: block; font-weight: 300; font-size: 12px; color: var(--text-2); }
.wgut.cur b { color: var(--accent-text); }
.wgut:hover { color: var(--text); }
.wbody { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: min-content; row-gap: 3px; padding-bottom: 6px; min-width: 0; }
.wbg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wbg button { border: 0; border-right: 1px solid var(--border); background: transparent; cursor: pointer; padding: 0; }
.wbg button:last-child { border-right: 0; }
.wbg button:hover { background: var(--hover); }
.wbg button.out { background: var(--bg-soft); }
.wbg button.sel { background: var(--accent-soft); }
.dnum { position: relative; pointer-events: none; padding: 6px 8px 2px; font-family: var(--sans); font-size: 13px; color: var(--text-2); grid-row: 1; display: flex; align-items: center; gap: 6px; }
.dnum.out { color: var(--text-3); opacity: .6; }
.dnum.today span { background: var(--today); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.ev { position: relative; z-index: 1; margin: 0 4px; height: 21px; border-radius: 4px; padding: 0 7px; font-family: var(--sans); font-size: 12px; line-height: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; text-align: left; cursor: pointer; min-width: 0; }
.ev.ms { background: var(--gray-soft); color: var(--text); }
.ev.ms.st-done { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.ev.ms.st-progress { background: var(--accent-soft); color: var(--accent-text); }
.ev.ms.st-late { background: var(--red-soft); color: var(--red); }
.ev.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.ev.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.ev.single { background: transparent; color: var(--text); padding-left: 4px; display: flex; align-items: center; gap: 5px; }
.ev.single::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--gray)); flex: none; }
.ev.single.due::before { border-radius: 2px; transform: rotate(45deg); width: 6px; height: 6px; }
.ev.single:hover, .ev.ms:hover { filter: brightness(.97); background-color: var(--hover); }
.ev.more { background: transparent; color: var(--text-3); padding-left: 6px; }
.ev.more:hover { color: var(--text); }
.dots { display: none; }

.dayview { margin-top: 14px; }
.dayview h3 { font-family: var(--serif); font-weight: 300; font-size: 20px; margin: 0 0 10px; }

.layers { display: flex; gap: 6px; flex-wrap: wrap; }

/* schedule */
.sched { display: grid; gap: 22px; }
.sgroup-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 0 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; scroll-margin-top: 70px; }
.sgroup-h h3 { font-family: var(--serif); font-weight: 300; font-size: 20px; margin: 0; }
.sgroup-h .r { font-family: var(--sans); font-size: 13px; color: var(--text-3); }
.sday { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sday:last-child { border-bottom: 0; }
.sday .dl { font-family: var(--sans); font-size: 12px; color: var(--text-3); line-height: 1.2; padding-top: 2px; }
.sday .dl b { display: block; font-family: var(--serif); font-weight: 300; font-size: 24px; color: var(--text); }
.sday.today .dl b { color: var(--accent-text); }
.sitems { display: grid; gap: 4px; min-width: 0; }
.sitem { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 6px; cursor: pointer; background: none; border: 0; text-align: left; width: 100%; }
.sitem:hover { background: var(--hover); }
.sitem .sw { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--gray)); }
.sitem .sw.sq { border-radius: 2px; }
.sitem .t { font-size: 16px; line-height: 1.35; min-width: 0; }
.sitem .k { font-family: var(--sans); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.past-toggle { width: 100%; height: 40px; border: 1px dashed var(--border-strong); background: transparent; border-radius: 8px; color: var(--text-2); font-family: var(--sans); font-size: 14px; cursor: pointer; }
.past-toggle:hover { background: var(--hover); }

/* gantt */
.gantt { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.gscroll { overflow-x: auto; }
.ginner { --lw: 240px; min-width: calc(var(--lw) + var(--cols) * 46px); position: relative; }
.grow { display: grid; grid-template-columns: var(--lw) 1fr; border-bottom: 1px solid var(--border); min-height: 42px; }
.grow:last-child { border-bottom: 0; }
.glabel { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--border); padding: 9px 14px; font-size: 14px; line-height: 1.3; display: flex; flex-direction: column; justify-content: center; cursor: pointer; min-width: 0; }
.glabel:hover { background: var(--hover); }
.glabel .s { font-family: var(--sans); font-size: 11px; color: var(--text-3); margin-top: 2px; }
.gtrack { position: relative; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.gtrack > i { border-right: 1px solid var(--border); opacity: .7; }
.gtrack > i:last-of-type { border-right: 0; }
.gtrack > i.cur { background: var(--accent-soft); opacity: .55; }
.ghead .glabel { background: var(--bg-soft); font-family: var(--sans); font-size: 12px; color: var(--text-3); cursor: default; }
.ghead .gtrack > span { font-family: var(--sans); font-size: 11px; color: var(--text-3); text-align: center; padding: 6px 0; border-right: 1px solid var(--border); background: var(--bg-soft); line-height: 1.25; }
.ghead .gtrack > span b { display: block; font-weight: 300; color: var(--text-2); font-size: 12px; }
.ghead .gtrack > span.cur { background: var(--accent-soft); }
.ghead .gtrack > span.cur b { color: var(--accent-text); }
.gphase .glabel { background: var(--bg-soft); font-family: var(--sans); font-size: 12px; color: var(--text-2); letter-spacing: .04em; text-transform: uppercase; cursor: default; padding-top: 8px; padding-bottom: 8px; }
.gphase { min-height: 34px; background: var(--bg-soft); }
.gbar { position: absolute; top: 50%; transform: translateY(-50%); height: 20px; border-radius: 5px; background: var(--gray-soft); border: 1px solid var(--border-strong); overflow: hidden; cursor: pointer; z-index: 1; padding: 0; }
.gbar > span { position: absolute; inset: 0 auto 0 0; background: var(--text); opacity: .85; }
.gbar.st-progress > span { background: var(--accent); opacity: 1; }
.gbar.st-late { border-color: var(--red); }
.gbar.st-late > span { background: var(--red); }
.gbar.st-done { border-color: var(--text); }
.gbar em { position: relative; z-index: 1; font-style: normal; font-family: var(--sans); font-size: 11px; line-height: 18px; padding: 0 6px; color: var(--text); mix-blend-mode: normal; }
.gbar.st-done em, .gbar.has-fill em { color: var(--bg); }
.gtoday { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px solid var(--today); z-index: 2; pointer-events: none; }
.gtoday::before { content: "Hari ini"; position: absolute; top: 46px; left: 4px; font-family: var(--sans); font-size: 10px; color: var(--today); white-space: nowrap; background: var(--surface); padding: 0 3px; border-radius: 3px; }
.gev { position: absolute; top: 50%; width: 12px; height: 12px; transform: translate(-50%, -50%) rotate(45deg); background: var(--c, var(--gray)); border: 2px solid var(--surface); z-index: 2; cursor: pointer; padding: 0; border-radius: 2px; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,19,17,.38); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.modal { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); animation: rise .18s ease; }
.modal.wide { max-width: 720px; }
.modal.narrow { max-width: 380px; }
.m-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.m-head h2 { font-family: var(--serif); font-weight: 300; font-size: 24px; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
.m-head .k { font-family: var(--sans); font-size: 13px; color: var(--text-3); margin-bottom: 4px; }
.m-body { padding: 16px 20px 20px; }
.m-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.m-foot .r { display: flex; gap: 8px; margin-left: auto; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: 15px; }
.kv dt { font-family: var(--sans); font-size: 13px; color: var(--text-3); padding-top: 2px; }
.kv dd { margin: 0; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-family: var(--sans); font-size: 13px; color: var(--text-2); }
.field .help { font-family: var(--sans); font-size: 12px; color: var(--text-3); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inp { width: 100%; height: 38px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--bg); font-family: var(--sans); font-size: 15px; outline: none; }
textarea.inp { height: auto; min-height: 84px; padding: 9px 11px; line-height: 1.5; resize: vertical; font-family: var(--serif); font-size: 16px; }
.inp:focus { border-color: var(--text-2); box-shadow: 0 0 0 3px var(--hover); }
input[type="range"] { accent-color: var(--accent); width: 100%; }

.passcode { display: flex; gap: 8px; justify-content: center; margin: 6px 0 4px; }
.passcode input { width: 44px; height: 54px; text-align: center; font-family: var(--serif); font-size: 26px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg); outline: none; padding: 0; }
.passcode input:focus { border-color: var(--text); }
.passcode.err input { border-color: var(--red); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.msg { font-family: var(--sans); font-size: 13px; text-align: center; min-height: 20px; color: var(--text-3); margin-top: 8px; }
.msg.err { color: var(--red); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-family: var(--sans); font-size: 14px; z-index: 200; box-shadow: var(--shadow); animation: rise .2s ease; max-width: calc(100vw - 32px); }
.banner { font-family: var(--sans); font-size: 13px; padding: 9px 14px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); margin-bottom: 18px; }

.foot { border-top: 1px solid var(--border); padding: 22px 0 40px; font-family: var(--sans); font-size: 13px; color: var(--text-3); }
.foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .two { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .board { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .who .nim-label { display: none; }
  .hero { padding-top: 28px; }
  .tabs { margin-top: 22px; }
  .tabs a { padding: 10px 10px 11px; font-size: 14px; }
  main.wrap { padding-top: 20px; }
  .stat { padding: 14px 16px; }
  .stat .num { font-size: 32px; }
  .ph-top .big { font-size: 44px; }
  .dual-row { grid-template-columns: 112px 1fr 40px; gap: 10px; }
  .phase { grid-template-columns: 1fr 70px 36px; padding: 12px 16px; }
  .lrow { padding: 12px 16px; grid-template-columns: 46px 1fr; }
  .lrow > .pill { grid-column: 2; justify-self: start; }
  .weekstrip { --cols: 9 !important; }
  .wk { grid-template-columns: 1fr; }
  .wk-side { border-right: 0; border-bottom: 1px solid var(--border); display: flex; align-items: baseline; gap: 10px; padding: 10px 16px; }
  .wk-side .n { font-size: 22px; margin: 0; }
  .wk-side .dr br { display: none; }
  .wk-main { padding: 14px 16px 16px; }
  .wk-cols { grid-template-columns: 1fr; gap: 12px; }
  .seg button .tx { display: none; }
  .seg button { padding: 0 10px; }
  .cal-title { font-size: 21px; min-width: 0; }
  .dow { grid-template-columns: 28px repeat(7, minmax(0, 1fr)); }
  .dow div { padding: 6px 2px; text-align: center; font-size: 11px; }
  .wrow { grid-template-columns: 28px 1fr; min-height: 58px; }
  .wgut { padding-top: 6px; font-size: 0; }
  .wgut b { font-size: 10px; }
  .dnum { justify-content: center; padding: 6px 2px 0; font-size: 13px; }
  .ev, .ev.single { display: none; }
  .dots { display: flex; justify-content: center; gap: 3px; grid-row: 2; pointer-events: none; position: relative; padding-top: 2px; }
  .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--text-3)); }
  .sday { grid-template-columns: 52px 1fr; gap: 8px; }
  .sitem { grid-template-columns: 10px 1fr; }
  .sitem .k { grid-column: 2; }
  .ginner { --lw: 150px; min-width: calc(var(--lw) + var(--cols) * 40px); }
  .glabel { padding: 8px 10px; font-size: 13px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .row2 { grid-template-columns: 1fr; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: 14px 14px 0 0; max-height: 92vh; overflow-y: auto; }
  .passcode input { width: 40px; height: 50px; }
}

/* ---------- Print (untuk dosen yang mau PDF) ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --bg-soft: #fafafa; --text: #000; }
  .topbar, .tabs, .toolbar, .btn, .wk-toggle, .foot, .past-toggle { display: none !important; }
  .hero { padding-top: 0; }
  .wk { break-inside: avoid; box-shadow: none !important; }
  .wk.collapsed .wk-cols, .wk.collapsed .wk-note, .wk.collapsed .wk-links { display: grid !important; }
  body { font-size: 12pt; }
}
