:root {
  /* light = clean white on cool grey; data-theme switches palettes */
  --bg: #f6f7f9; --card: #ffffff; --ink: #111827; --muted: #6b7280;
  --line: #e5e7eb; --accent: #4f46e5; --accent-ink: #fff; --accent-fg: #4338ca;
  --danger: #dc2626; --ok: #15803d; --warn: #b45309;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08);
  --pop: 0 12px 32px rgba(16,24,40,.16);
}
html[data-theme="dark"] {
  --bg: #0b0d12; --card: #151922; --ink: #e8eaf0; --muted: #98a1b3;
  --line: #262c38; --accent: #6366f1; --accent-fg: #a5b4fc;
  --danger: #f87171; --ok: #4ade80; --warn: #fbbf24;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --pop: 0 12px 32px rgba(0,0,0,.5);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #0b0d12; --card: #151922; --ink: #e8eaf0; --muted: #98a1b3;
    --line: #262c38; --accent: #6366f1; --accent-fg: #a5b4fc;
    --danger: #f87171; --ok: #4ade80; --warn: #fbbf24;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --pop: 0 12px 32px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-fg); }
button {
  font: inherit; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); padding: 7px 14px; cursor: pointer;
  transition: background .15s, border-color .15s, filter .15s;
}
button:hover { background: var(--bg); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { background: var(--accent); filter: brightness(1.1); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* auth pages */
.authpage { display: grid; place-items: center; min-height: 100vh; }
.authcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--pop); padding: 32px 34px; width: min(380px, 92vw);
}
.authcard h1 { margin: 0 0 12px; font-size: 22px; }
.loginlogo { display: block; margin: 0 auto 4px; width: 130px; }
.authcard label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 13px; }
.authcard input { width: 100%; }
.authcard button { margin-top: 18px; width: 100%; background: var(--accent); border-color: var(--accent); color: #fff; }
.hint { color: var(--muted); }
.err { color: var(--danger); }
.okmsg { color: var(--ok); }

/* shell */
#top {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 22px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; cursor: pointer; }
.brand:hover { opacity: 0.85; }
.brand-logo { height: 26px; width: auto; display: block; }
#views { display: flex; gap: 4px; flex: 1; }
#views button { border: none; background: none; padding: 6px 14px; color: var(--muted); border-radius: 999px; }
#views button:hover { color: var(--ink); background: var(--bg); }
#views button.on { color: var(--accent-fg); background: color-mix(in srgb, var(--accent) 13%, transparent); font-weight: 600; }
.who { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 14px; }
.who a { text-decoration: none; color: var(--muted); }
.who a:hover { color: var(--ink); }
.usermenu { position: relative; }
#usermenubtn { display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 999px; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px;
}
#usermenubtn .caret { font-size: 11px; color: var(--muted); }
#usermenupanel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; z-index: 30;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop);
}
#usermenupanel[hidden] { display: none; }
#usermenupanel a { padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--ink); }
#usermenupanel a:hover { background: var(--bg); }
.menuname { padding: 6px 12px 8px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
main { max-width: 900px; margin: 22px auto; padding: 0 16px; }
.view { display: none; }
.view.on { display: block; }

/* cards & lists */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 10px; font-size: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }
.grow { flex: 1; }

/* tasks - list tabs as pills */
#listtabs {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px; position: relative;
}
#listtabs .caret { font-size: 11px; opacity: .7; }
.tabmenu {
  position: absolute; z-index: 15; min-width: 220px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--pop); padding: 6px;
}
.tabmenu a {
  display: block; padding: 7px 16px 7px 10px;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.tabmenu a { border-radius: 8px; }
.tabmenu a:hover { background: var(--bg); }
.tabmenu .check { display: inline-block; width: 20px; text-align: center; color: var(--accent); }
.tabmenu .sep { border-top: 1px solid var(--line); margin: 6px 0; }
#listtabs button {
  display: flex; align-items: center; gap: 9px; text-align: left;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); color: var(--muted); padding: 6px 14px;
}
#listtabs button:hover { color: var(--ink); }
#listtabs button.on {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-ink); font-weight: 600;
}
.dot { width: 9px; height: 9px; border-radius: 3px; flex: none; display: inline-block; }
.listchip .dot { width: 7px; height: 7px; margin-right: 5px; vertical-align: 0; }
.tabname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnt { font-size: 12px; opacity: .65; font-weight: 600; }
#listtabs .caret { font-size: 14px; opacity: .8; }
.newtab .newlabel { display: none; }
#listtabs button.newtab { padding: 7px 11px; }

.tasklist-head {
  display: flex; gap: 14px; align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px; margin-bottom: 6px;
}
.notetoggle {
  text-decoration: none; color: var(--muted);
  width: 16px; display: inline-block; text-align: center;
  transform: translateY(1px);
}
.notetoggle:hover { color: var(--ink); }
.notetoggle-spacer { width: 16px; display: inline-block; }
.task {
  display: flex; align-items: baseline; gap: 10px;
  padding: 11px 6px; border-bottom: 1px solid var(--line);
}
.task:last-child { border-bottom: none; }
.task input[type=checkbox] { transform: translateY(2px); }
.task .donebox {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; padding: 0;
  width: 20px; height: 20px; border-radius: 50%; cursor: pointer; transform: translateY(3px);
  border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent); background: transparent;
  transition: background .15s, border-color .15s;
}
.task .donebox:hover { border-color: var(--accent); }
.task .donebox:checked {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.7 2.7L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
  border-color: var(--accent);
}
.task .title { flex: 1; }
.task.done .title { text-decoration: line-through; color: var(--muted); }
/* due-date labels: small colored pills */
.due {
  font-size: 12px; font-weight: 600; white-space: nowrap;
  padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--muted);
}
.due.overdue { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.due.soon { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.due.far { color: var(--muted); }

.badge { font-size: 12px; border-radius: 5px; padding: 1px 7px; white-space: nowrap; }
.badge.overdue { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.badge.today { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.badge.future { background: var(--bg); color: var(--muted); }
/* edit/delete appear on hover with a mouse; always visible on touch screens */
@media (hover: hover) and (pointer: fine) {
  .task .edit, .task .del { opacity: 0; transition: opacity .15s; }
  .task:hover .edit, .task:hover .del, .task:focus-within .edit, .task:focus-within .del { opacity: 1; }
}
.task .del { color: var(--muted); text-decoration: none; padding: 0 5px; }
.task .del:hover { color: var(--danger); }
.task .edit { color: var(--muted); text-decoration: none; padding: 0 5px; }
.task .edit:hover { color: var(--accent); }
.prio { font-weight: 700; font-size: 12px; margin-right: 6px; }
.prio.p1 { color: var(--warn); }
.prio.p2 { color: var(--danger); }
.prio.pm1 { color: var(--muted); }
.notetext { font-size: 13px; color: var(--muted); white-space: pre-wrap; margin-top: 2px; }
.listchip {
  font-size: 11px; color: var(--muted); background: var(--bg);
  border-radius: 6px; padding: 1px 8px; margin-left: 6px; vertical-align: 1px;
}

/* add-task composer: big title field, compact controls under it */
.composer .newtask-title { width: 100%; font-size: 16px; padding: 12px 14px; }
.composer-controls { margin-top: 10px; }
.composer-controls input, .composer-controls select { padding: 7px 10px; }

/* add-task extra options row */
#morefields {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* planner chat */
#chatlog { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.msg {
  max-width: 85%; padding: 8px 12px; border-radius: 12px;
  white-space: pre-wrap; line-height: 1.4;
}
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.msg.ai { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.confirm {
  align-self: stretch; border: 1px solid var(--warn); border-radius: 10px;
  padding: 10px 14px; margin-top: 4px;
}
.confirm-item { padding: 3px 0; font-size: 14px; }

/* task editor */
.overlay {
  position: fixed; inset: 0; background: rgba(15,18,28,.45); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 20;
}
.modal {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--pop); padding: 22px 24px; width: min(480px, 94vw); max-height: 90vh; overflow: auto;
}
.modal h2 { margin: 0 0 6px; font-size: 16px; }
.modal input, .modal select, .modal textarea { width: 100%; }
.modal .row > span { flex: 1; }
.dangerbtn { color: var(--danger); border-color: var(--danger); }

/* planner schedule */
.slot { display: flex; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.slot .time { width: 105px; color: var(--muted); white-space: nowrap; }
.slot.break .act { color: var(--muted); }
.slot.other .act { color: var(--warn); }

/* settings forms - a grid of cards, not one long list */
#view-settings.on {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  align-items: start;
}
#view-settings .card { margin-bottom: 0; }
.frm label { display: block; margin: 10px 0 3px; font-size: 13px; color: var(--muted); }
.frm input, .frm select, .frm textarea { width: 100%; }
.frm .row input, .frm .row select { width: auto; }
.frm .row input.grow, .frm .row input[id="s-title"] { flex: 1; width: auto; }
.frm button { margin-top: 12px; }
/* checkbox + label as a tight inline pair, never a spread flex row */
.checkrow, .frm label:has(> input[type=checkbox]) {
  display: flex; align-items: center; gap: 8px;
  width: auto; margin: 10px 0 3px; cursor: pointer;
}
.checkrow input[type=checkbox], .frm label > input[type=checkbox] {
  width: auto; flex: none; margin: 0;
}
.checkrow span { color: var(--ink); font-size: 14px; }

/* legal / doc pages */
html { scroll-behavior: smooth; }
.docpage { max-width: 680px; margin: 28px auto; padding: 0 18px; line-height: 1.6; }
/* changelog: a rail stuck to the left edge, content beside it */
.docpage.wide { max-width: 720px; margin-left: 200px; }
.chlog-side {
  position: fixed; left: 0; top: 45px; bottom: 0; width: 160px;
  background: var(--card); border-right: 1px solid var(--line);
  padding: 18px 22px; font-size: 14px; overflow-y: auto;
}
.chlog-side b { display: block; margin-bottom: 10px; }
.chlog-side a { display: block; padding: 4px 0; text-decoration: none; }
.chlog-body { min-width: 0; }
.chlog-body h2 { scroll-margin-top: 70px; }
@media (max-width: 900px) {
  .docpage.wide { margin-left: auto; }
  .chlog-side {
    position: static; width: auto; border-right: none;
    border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px;
  }
  .chlog-side a { display: inline-block; padding: 2px 10px 2px 0; }
  .chlog-side b { display: inline-block; margin: 0 10px 0 0; }
}
.docpage h1 { font-size: 24px; margin: 0 0 10px; }
.docpage h2 { font-size: 16px; margin: 22px 0 6px; }
.docpage li { margin: 5px 0; }
.legalfoot { text-align: center; font-size: 12px; margin: 16px 0 0; }
.legalfoot a { color: var(--muted); }

/* flash */
#flash {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); border-radius: 12px;
  padding: 10px 18px; opacity: 0; pointer-events: none; transition: opacity .25s;
  max-width: 85vw; z-index: 80;
}
#flash.show { opacity: .95; }

/* sharing */
.sharedmark { font-size: 11px; opacity: .7; }
.listchip.shared { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-fg); }
.sharerow { display: block; padding: 4px 0; color: var(--ink); font-size: 14px; }
.sharechip a { color: var(--muted); text-decoration: none; padding-left: 3px; }
.sharechip a:hover { color: var(--danger); }

/* analytics bars */
.bar-row { display: flex; align-items: center; gap: 10px; padding: 2px 0; font-size: 13px; }
.bar-day { width: 46px; color: var(--muted); }
.bar-track { flex: 1; background: var(--bg); border-radius: 4px; height: 14px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); }
.bar-n { width: 40px; text-align: right; }

/* ---------- interactive tutorial (spotlight tour) ---------- */
#tour { position: fixed; inset: 0; z-index: 1000; }
#tour::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
}
#tour-hole {
  position: absolute; border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.55);
  outline: 2px solid var(--accent); transition: all .18s ease;
  pointer-events: none;
}
#tour-pop {
  position: absolute; z-index: 1; max-width: 320px; width: calc(100vw - 24px);
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0,0,0,.28); padding: 16px 18px;
}
#tour-pop h3 { margin: 4px 0 6px; font-size: 17px; }
#tour-pop p { margin: 0 0 12px; }
#tour-step { font-size: 12px; }
.tour-btns { display: flex; align-items: center; gap: 10px; }
.tour-btns .grow { flex: 1; }

/* ---------- nav panel / mobile ---------- */
/* Desktop: the panel is a transparent flex row that keeps the old layout. */
#navtoggle { display: none; }
#navpanel { display: flex; align-items: center; gap: 18px; flex: 1; }
@media (max-width: 640px) {
  #top { gap: 10px; padding: 9px 14px; position: relative; }
  .brand span { font-size: 15px; }
  #navtoggle {
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: auto; border: 1px solid var(--line); background: var(--card);
    color: var(--ink); border-radius: 8px; width: 38px; height: 34px; font-size: 18px;
    cursor: pointer; flex: 0 0 auto;
  }
  /* The panel becomes a dropdown holding nav buttons + account links. */
  #navpanel {
    display: none; position: absolute; top: 100%; right: 12px; left: auto;
    flex-direction: column; align-items: stretch; gap: 0; flex: none;
    min-width: 210px; margin-top: 6px; z-index: 30; padding: 6px;
    background: var(--card); border: 1px solid var(--line); border-radius: 11px;
    box-shadow: 0 10px 30px rgba(0,0,0,.24);
  }
  #top.navopen #navpanel { display: flex; }
  #views { display: flex; flex-direction: column; gap: 2px; flex: none; }
  #views button {
    display: block; width: 100%; text-align: left; padding: 11px 12px;
    border-radius: 8px;
  }
  .who {
    display: flex; flex-direction: column; align-items: stretch; gap: 8px; font-size: 14px;
    border-top: 1px solid var(--line); margin-top: 6px; padding: 10px 12px 4px;
  }
  #usermenubtn { display: none; }
  #usermenupanel, #usermenupanel[hidden] {
    display: flex; position: static; box-shadow: none; border: none; padding: 0; min-width: 0;
  }
  #usermenupanel a { padding: 6px 0; }
  .menuname { border: none; padding: 6px 0 2px; margin: 0; }
  main { margin: 16px auto; padding: 0 12px; }
  #listtabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  #listtabs::-webkit-scrollbar { display: none; }

  #listtabs button { flex: 0 0 auto; }
  .card { padding: 14px; }
  #newtask, .grow { min-width: 0; }
  .task { flex-wrap: wrap; }
}

/* ---------- onboarding empty-state ---------- */
.onboard { text-align: center; padding: 18px 6px; }
.onboard h3 { margin: 0 0 6px; font-size: 18px; }
.onboard-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px;
}
.onboard-actions button {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 10px 16px; cursor: pointer;
}
.onboard-actions button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- global search ---------- */
#searchbtn { white-space: nowrap; }
#searchbar[hidden] { display: none; }
#searchbar {
  display: flex; align-items: center; gap: 10px;
  max-width: 900px; margin: 14px auto 0; padding: 0 16px;
}
#searchinput {
  flex: 1; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--card); color: var(--ink); font-size: 15px;
}
#searchclose { font-size: 22px; text-decoration: none; padding: 0 4px; }
.srow { cursor: pointer; }
.srow:hover { background: var(--bg); }
.flashrow { animation: flashrow 1.4s ease; }
@keyframes flashrow {
  0%, 40% { background: color-mix(in srgb, var(--accent) 22%, transparent); }
  100% { background: transparent; }
}

/* ---------- undo toast link ---------- */
/* the toast ignores clicks (so it never blocks the page), but its Undo link must not */
.undolink { color: #7fb3ff; font-weight: 600; text-decoration: none; pointer-events: auto; cursor: pointer; padding: 2px 4px; }
.undolink:hover { text-decoration: underline; }
#flash:not(.show) .undolink { pointer-events: none; }

/* ---------- bulk select + drag reorder ---------- */
.selbox { display: none; }
body.selectmode .selbox { display: inline-grid; }
body.selectmode .donebox,
body.selectmode .draghandle { display: none; }
.task.selected { background: color-mix(in srgb, var(--accent) 12%, transparent); }

.draghandle {
  display: none; cursor: grab; color: var(--muted); user-select: none;
  letter-spacing: -3px; padding-right: 2px; font-size: 12px;
}
@media (pointer: fine) {
  .task:hover .draghandle { display: inline-block; }
}
body.selectmode .draghandle { display: none !important; }
.task.dragging { opacity: .5; background: var(--bg); }

#bulkbar {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--pop); padding: 10px 14px; z-index: 40;
  max-width: 92vw;
}
#bulkbar[hidden] { display: none; }
#bulkbar button { padding: 7px 12px; }
#bulkbar button.danger { color: var(--danger); border-color: var(--danger); }
#bulkbar .bulkmove { display: flex; align-items: center; gap: 6px; }
#bulkn { font-weight: 600; }

/* "What's new" popup badge */
.wn-badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent-ink); background: var(--accent);
  padding: 2px 9px; border-radius: 20px; margin-bottom: 8px;
}

/* kcuts banner */
#kcutsad {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 18px; background: var(--accent); color: var(--accent-ink);
}
#kcutsad[hidden] { display: none; }
#kcutsad span { flex: 1 1 320px; }
#kcutsad code { background: rgba(0,0,0,.15); padding: 1px 5px; border-radius: 4px; }
#kcutsad a { color: inherit; font-size: 20px; text-decoration: none; }
#kcutsad button { background: var(--card); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
#kcutsad button:disabled { opacity: .6; }

/* task steps (checklist) */
.stepschip { text-decoration: none; cursor: pointer; }
.steps { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.step { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.step.done { text-decoration: line-through; opacity: .7; }
.estep { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.estep a { color: var(--muted); text-decoration: none; font-size: 18px; }
.frm .estep input[type=checkbox] { width: auto; flex: none; }
.frm .estep input.grow { flex: 1; width: auto; min-width: 0; }

/* page header + summary strip */
.pagehead { margin: 4px 0 14px; }
.pagehead h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 10px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 12px 16px; border-left: 4px solid var(--line);
}
.stat b { display: block; font-size: 24px; line-height: 1.15; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat.late { border-left-color: var(--danger); }
.stat.late b { color: var(--danger); }
.stat.today { border-left-color: var(--warn); }
.stat.ok { border-left-color: var(--ok); }
.stat:not(.late):not(.today):not(.ok) { border-left-color: var(--accent); }
.progress { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 18px; }
.progress span { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }
.task:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }

/* ---------- style "sidebar": light left sidebar (desktop) ---------- */
.ico, .uname { display: none; }
@media (min-width: 641px) {
  html[data-style="sidebar"] body { padding-left: 252px; }
  html[data-style="sidebar"] main { max-width: 940px; margin-top: 28px; }
  html[data-style="sidebar"] #top {
    position: fixed; left: 0; top: 0; bottom: 0; width: 252px; z-index: 6;
    flex-direction: column; align-items: stretch; gap: 0; padding: 18px 14px 14px;
    background: var(--card); border-right: 1px solid var(--line); border-bottom: none;
    backdrop-filter: none; overflow-y: auto;
  }
  html[data-style="sidebar"] .brand { font-size: 18px; letter-spacing: -.01em; padding: 2px 8px 16px; }
  html[data-style="sidebar"] #navpanel { flex-direction: column; align-items: stretch; gap: 0; flex: 1; min-height: 0; }
  html[data-style="sidebar"] .who { display: contents; }
  html[data-style="sidebar"] #searchbtn {
    order: -1; display: flex; align-items: center; gap: 9px; margin: 0 0 14px; padding: 8px 12px;
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--muted);
  }
  html[data-style="sidebar"] #searchbtn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--ink); }
  html[data-style="sidebar"] .ico { display: block; width: 18px; height: 18px; flex: none; }
  html[data-style="sidebar"] #views { flex-direction: column; flex: none; gap: 2px; }
  html[data-style="sidebar"] #views button {
    display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
    padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 500;
  }
  html[data-style="sidebar"] #views button:hover { background: var(--bg); color: var(--ink); }
  html[data-style="sidebar"] #views button.on {
    background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-fg); font-weight: 600;
  }
  html[data-style="sidebar"] #sidelists { margin-top: 22px; flex: 1; }
  html[data-style="sidebar"] #sidelists:not(:empty)::before {
    content: "LISTS"; display: block; padding: 0 12px 8px; color: var(--muted);
    font-size: 11px; font-weight: 700; letter-spacing: .08em;
  }
  html[data-style="sidebar"] #listtabs { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 1px; margin: 0; }
  html[data-style="sidebar"] #listtabs button {
    border: none; background: none; border-radius: 9px; padding: 8px 12px;
    color: var(--ink); font-weight: 500;
  }
  html[data-style="sidebar"] #listtabs button:hover { background: var(--bg); }
  html[data-style="sidebar"] #listtabs button.on { background: var(--bg); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
  html[data-style="sidebar"] #listtabs button.newtab { color: var(--muted); }
  html[data-style="sidebar"] #listtabs button.newtab:hover { color: var(--ink); }
  html[data-style="sidebar"] .newtab .newlabel { display: inline; }
  html[data-style="sidebar"] .usermenu { order: 5; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
  html[data-style="sidebar"] #usermenubtn {
    width: 100%; padding: 8px 10px; border-radius: 12px; background: var(--bg); gap: 10px; text-align: left;
  }
  html[data-style="sidebar"] #usermenubtn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
  html[data-style="sidebar"] .uname { display: block; flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html[data-style="sidebar"] #usermenupanel { top: auto; bottom: calc(100% + 8px); left: 0; right: 0; }
  html[data-style="sidebar"] #searchbar { max-width: 940px; }
  html[data-style="sidebar"] .tabmenu { min-width: 200px; }
}

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 10px 12px; }
  .stat b { font-size: 21px; }
  .pagehead h1 { font-size: 21px; }
}

/* ---------- style "classic": the original warm look, top bar + tab strip ---------- */
html[data-style="classic"]:not([data-theme="dark"]) {
  --bg: #f1e9d8; --card: #fbf6ea; --ink: #37301f; --muted: #857763;
  --line: #e0d5bd; --accent: #8b5a2b; --accent-ink: #fff; --accent-fg: #8b5a2b;
  --danger: #b3341f; --ok: #4c7031; --warn: #96660f;
  --shadow: none; --pop: 0 6px 22px rgba(0,0,0,.14);
}
html[data-style="classic"][data-theme="dark"] {
  --bg: #111418; --card: #1a1f26; --ink: #e6e9ec; --muted: #9aa4ae;
  --line: #2a323b; --accent: #3b82f6; --accent-fg: #6ea8fe;
  --danger: #f08a7a; --ok: #8fc27a; --warn: #e0b45a; --shadow: none;
}
@media (prefers-color-scheme: dark) {
  html[data-style="classic"][data-theme="system"] {
    --bg: #111418; --card: #1a1f26; --ink: #e6e9ec; --muted: #9aa4ae;
    --line: #2a323b; --accent: #3b82f6; --accent-fg: #6ea8fe;
    --danger: #f08a7a; --ok: #8fc27a; --warn: #e0b45a; --shadow: none;
  }
}
html[data-style="classic"] button,
html[data-style="classic"] input,
html[data-style="classic"] select,
html[data-style="classic"] textarea { border-radius: 7px; }
html[data-style="classic"] .card { border-radius: 10px; }
html[data-style="classic"] #top { background: var(--card); backdrop-filter: none; }
html[data-style="classic"] #views button,
html[data-style="classic"] #views button:hover { border-radius: 7px; }
html[data-style="classic"] #views button.on { background: var(--bg); color: var(--ink); }
html[data-style="classic"] .pagehead,
html[data-style="classic"] .stats,
html[data-style="classic"] .progress { display: none; }
html[data-style="classic"] #listtabs {
  gap: 4px; align-items: flex-end; border-bottom: 1px solid var(--line); padding: 0 6px;
}
html[data-style="classic"] #listtabs button {
  border: 1px solid var(--line); border-bottom: none; border-radius: 9px 9px 0 0;
  background: var(--bg); color: var(--muted); padding: 7px 16px; margin-bottom: -1px;
}
html[data-style="classic"] #listtabs button.on {
  background: var(--card); color: var(--ink); border-bottom: 1px solid var(--card);
}
html[data-style="classic"] #listtabs .dot,
html[data-style="classic"] #listtabs .cnt { display: none; }
html[data-style="classic"] .listchip .dot { display: none; }
html[data-style="classic"] .listchip { background: none; border: 1px solid var(--line); }

/* ---------- popup menus & styled dropdowns ---------- */
.nativesel { display: none !important; }
.selbtn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); text-align: left; padding: 8px 11px; font-weight: 400;
}
.selbtn .caret { font-size: 11px; color: var(--muted); }
.selbtn[aria-expanded="true"] { border-color: var(--accent); }
.frm .selbtn, .modal .selbtn { width: 100%; margin-top: 0; }
.frm .row .selbtn, .modal .row .selbtn { width: auto; }
.frm .chip, .frm .tbtn { margin-top: 0; }
.popmenu {
  position: fixed; z-index: 60; max-height: min(70vh, 420px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--pop); padding: 6px;
}
.popmenu .sep { border-top: 1px solid var(--line); margin: 5px 4px; }
.pmitem {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: none; background: none; border-radius: 8px; padding: 8px 10px; white-space: nowrap;
}
.pmitem:hover, .pmitem:focus-visible { background: var(--bg); outline: none; }
.pmitem.on { font-weight: 600; }
.pmitem.danger { color: var(--danger); }
.pmitem .check { width: 14px; color: var(--accent-fg); font-size: 12px; flex: none; }
.pmlabel { flex: 1; }

/* ---------- task list toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tb-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 120px; font-size: 16px; }
.count { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 1px 8px; }
.tb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tbtn { padding: 5px 11px; font-size: 13px; border-radius: 8px; color: var(--muted); }
.tbtn b { color: var(--ink); font-weight: 600; }
.tbtn:hover { color: var(--ink); }
.tbtn.on { color: var(--accent-fg); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tbtn .caret { font-size: 10px; }
.tb-note { margin: 8px 0 2px; }

/* ---------- add-task chips ---------- */
.composer .chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; font-size: 13px;
  border-radius: 8px; background: var(--bg); color: var(--muted);
}
.chip:hover { color: var(--ink); }
.chip.on { color: var(--accent-fg); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.chipicon { display: inline-flex; align-items: center; font-size: 13px; }
.newnote { width: 100%; margin-top: 10px; }
.newnote[hidden] { display: none; }

/* ---------- settings: section list + cards ---------- */
#view-settings.on { display: block; }
.settings { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; align-items: start; }
.setnav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.setnav a { padding: 8px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 500; }
.setnav a:hover { background: var(--card); color: var(--ink); }
.setnav a.on { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-fg); font-weight: 600; }
.setmain { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.setmain .card { margin: 0; scroll-margin-top: 24px; }
.setcard h2 { font-size: 17px; margin-bottom: 2px; }
.setdesc { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.w80 { width: 80px; }
.frm label.switchrow {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 16px 0 2px; padding-top: 14px; border-top: 1px solid var(--line); cursor: pointer; color: var(--ink);
}
.switchrow b { display: block; font-size: 14px; }
.switchrow small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.frm label.switchrow > input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 24px; margin: 0; padding: 0;
  border: none; border-radius: 8px; background: var(--line); position: relative; cursor: pointer; transition: background .2s;
}
.frm label.switchrow > input[type=checkbox]::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 6px;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s;
}
.frm label.switchrow > input[type=checkbox]:checked { background: var(--accent); }
.frm label.switchrow > input[type=checkbox]:checked::before { transform: translateX(18px); }
.frm label.switchrow > input[type=checkbox]:disabled { opacity: .45; cursor: default; }
@media (max-width: 640px) {
  .settings { grid-template-columns: 1fr; gap: 14px; }
  .setnav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .setnav a { white-space: nowrap; }
}
html[data-style="classic"] .chip,
html[data-style="classic"] .tbtn { border-radius: 7px; }

/* ---------- task page (/task/<id>) ---------- */
.taskpage { max-width: 980px; padding-bottom: 84px; }
.backlink { display: inline-block; margin-bottom: 10px; color: var(--muted); text-decoration: none; font-size: 14px; }
.backlink:hover { color: var(--ink); }
.tp-title {
  display: block; width: 100%; margin: 0 0 18px; padding: 8px 4px; font-size: 26px; font-weight: 700;
  letter-spacing: -.02em; background: transparent; border: none; border-bottom: 2px solid var(--line); border-radius: 0;
}
.tp-title:focus { box-shadow: none; border-bottom-color: var(--accent); }
.tp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.tp-main, .tp-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tp-main .card, .tp-side .card { margin: 0; }
.taskpage .card h2 { font-size: 15px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.taskpage textarea { width: 100%; resize: vertical; }
.taskpage .frm .row { flex-wrap: nowrap; }
.taskpage .frm .row > span { flex: 1; min-width: 0; }
.taskpage .frm .row input { width: 100%; }
.tp-actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; gap: 10px; align-items: center;
  padding: 12px 28px; background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
html[data-style="sidebar"] .tp-actions { left: 252px; }
.tp-actions button { margin: 0; }
@media (max-width: 860px) { .tp-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  html[data-style="sidebar"] .tp-actions { left: 0; }
  .tp-actions { padding: 10px 14px; }
  .tp-title { font-size: 22px; }
}

/* overdue time estimates */
.est {
  font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--muted);
  background: var(--bg); border-radius: 6px; padding: 1px 8px; margin-right: 6px;
}
.stat small { display: block; margin-top: 2px; font-size: 12px; color: var(--danger); font-weight: 600; }

/* in-app dialogs */
.dlg { width: min(420px, 94vw); }
.dlg h2 { font-size: 18px; margin: 0 0 8px; }
.dlg-msg { margin: 0 0 14px; color: var(--muted); overflow-wrap: anywhere; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.dlg-btns button { margin: 0; }
.dangerfill { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.dangerfill:hover { background: var(--danger); filter: brightness(1.08); }
.dlg .dangerfill:disabled, .dlg .primary:disabled { opacity: .45; }

/* settings: masked secrets (Canvas tokens, calendar links) with a Show button */
.secret { display: flex; gap: 8px; align-items: center; }
.frm .secret input { flex: 1; min-width: 0; width: auto; }
.frm .secret input[readonly] { background: var(--bg); color: var(--muted); }
.frm .secret .eye { margin: 0; flex: none; padding: 6px 12px; font-size: 13px; }
.conn { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.conn-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.calrow { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.calrow .secret { flex: 1; min-width: 0; }
.frm .calrow > button { margin: 0; flex: none; }
.linkbtn { background: none; border: none; padding: 4px 6px; margin: 0; color: var(--accent-fg); font-size: 13px; cursor: pointer; }
.frm .linkbtn { margin: 0; }
.linkbtn.danger { color: var(--danger); }
.linkbtn:hover { text-decoration: underline; background: none; }

/* ---------- progress & streaks (flat, no gradients) ---------- */
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.pstat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.pstat b { font-size: 30px; line-height: 1.2; letter-spacing: -.02em; }
.plabel { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pgood { color: var(--ok); font-size: 13px; font-weight: 600; }
.pbad { color: var(--danger); font-weight: 600; }
.pstat .pbad { font-size: 13px; }
.pslip { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; border: 1px solid var(--line); border-left-width: 4px; background: var(--card); }
.pslip.bad { border-left-color: var(--danger); }
.pslip.bad b { color: var(--danger); }
.pslip.ok { border-left-color: var(--ok); }
.pslip span { color: var(--muted); }
.pchart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 150px; }
.pbarcol { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 4px; }
.pbarwrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.pbar { width: 100%; min-height: 2px; background: var(--accent); opacity: .55; border-radius: 4px 4px 0 0; }
.pbar.today { opacity: 1; }
.pnum { font-size: 11px; color: var(--muted); height: 14px; }
.pday { font-size: 11px; color: var(--muted); }
.ptable { display: flex; flex-direction: column; }
.prow { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line); align-items: center; font-size: 14px; }
.prow.phead { border-top: none; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pname { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.ptag { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 6px; }
.ptag.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.ptag.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
@media (max-width: 640px) {
  .pstats { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 1.6fr .8fr .8fr .8fr 1fr; font-size: 13px; gap: 6px; }
  .pchart { gap: 3px; }
}

/* ---------- class workspace (/class/<id>) ---------- */
.wshead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.wshead h1 { display: flex; align-items: center; gap: 10px; }
.wshead h1 .dot { width: 12px; height: 12px; }
.wsback { font-size: 13px; text-decoration: none; display: inline-block; margin-bottom: 4px; }
.pstat b.wsred { color: var(--danger); }
.wsgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.wsgrid .card { margin-bottom: 14px; }
.wsadd, .wslinkadd { display: flex; gap: 8px; margin-bottom: 10px; }
.wsadd input { flex: 1; min-width: 0; }
.wslinkadd { flex-wrap: wrap; margin: 10px 0 0; }
.wslinkadd input { flex: 1 1 140px; min-width: 0; }
.wsgroup h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 4px; }
.wsgroup h3.pbad { color: var(--danger); }
.wsrow { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.wsrow input[type=checkbox] { width: auto; flex: none; margin: 0; }
.wstitle { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wstitle:hover { text-decoration: underline; }
.wsrow.done .wstitle { color: var(--muted); text-decoration: line-through; }
.wsstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wsday { border: 1px solid var(--line); border-radius: 8px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 62px; }
.wsday b { font-size: 16px; }
.wsday.today { border-color: var(--accent); }
.wsday.has { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.wsdn { font-size: 11px; color: var(--muted); font-weight: 600; }
.wscnt { font-size: 11px; color: var(--accent); font-weight: 700; min-height: 14px; }
.wsl { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.wsl:first-child { border-top: none; }
.wsl a { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsl a:hover { text-decoration: underline; }
.wshost { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsauto { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.wsldel { background: none; border: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; cursor: pointer; }
.wsldel:hover { color: var(--danger); background: none; }
#ws-notes { width: 100%; resize: vertical; font: inherit; font-size: 14px; line-height: 1.5; }
#ws-saved { font-size: 12px; font-weight: 400; }
.wsplan { padding: 2px 9px; font-size: 12px; flex: none; }
.wsask { display: flex; gap: 8px; }
.wsask input { flex: 1; min-width: 0; }
.wsqs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.wsq { font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.wschathead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wschathead h2 { margin: 0; }
.wschat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; margin: 12px 0; padding-right: 2px; }
.wsmsg { white-space: pre-wrap; font-size: 14px; line-height: 1.5; padding: 9px 13px; border-radius: 12px; max-width: 88%; overflow-wrap: anywhere; }
.wsmsg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.wsmsg.ai { align-self: flex-start; background: color-mix(in srgb, var(--ink) 6%, transparent); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.wsmsg.pending.ai { color: var(--muted); }
.wsacts { align-self: flex-start; max-width: 88%; border: 1px solid var(--accent); border-radius: 10px; padding: 10px 13px; font-size: 13px; margin-top: -2px; }
.wsacts.settled { border-color: var(--line); color: var(--muted); }
.wsactshead { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.wsacts.settled .wsactshead { color: var(--muted); }
.wsacts ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.45; }
.wsactbtns { display: flex; gap: 8px; margin-top: 10px; }
.wsactbtns button { padding: 5px 14px; font-size: 13px; }
.wsempty { margin: 0; font-size: 14px; }
.wsaskhint { font-size: 12px; margin: 10px 0 0; }
.steps-h { display: flex; align-items: center; gap: 8px; }
.steps-h #e-plan { margin-left: auto; font-size: 12px; }
.pname a.wslink { color: inherit; text-decoration: none; }
.pname a.wslink:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .wsgrid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  #view-class .pstats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #view-class .pstat { padding: 10px 12px; }
  #view-class .pstat b { font-size: 22px; }
  #view-class .pstat .muted { font-size: 11px; }
  .wsstrip { gap: 4px; }
}

/* ---------- calendar page (Canvas-style month / week) ---------- */
#view-calendar.on { display: block; }
body:has(#view-calendar.on) main { max-width: 1400px; }
.calbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 14px; }
.calbar h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; min-width: 220px; }
.calnav, .seg { display: flex; gap: 4px; }
.calnav button, .seg button { padding: 6px 12px; }
.seg { border: 1px solid var(--line); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button { border: none; background: none; border-radius: 8px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.calwrap { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 18px; align-items: start; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.calhead { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); padding: 10px 0; border-bottom: 1px solid var(--line); }
.calday { min-height: 118px; padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.calgrid.week .calday { min-height: 420px; }
.calday:nth-child(7n) { border-right: none; }
.calday.other { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.calday.other .calnum { opacity: .5; }
.calday.today { background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.calday.today .calnum { color: var(--accent-fg); font-weight: 800; }
.calday.drop { outline: 2px dashed var(--accent); outline-offset: -3px; }
.calnum { text-align: right; font-size: 14px; color: var(--muted); padding: 0 2px 2px; }
.calchip {
  display: flex; align-items: center; gap: 5px; padding: 3px 6px; border: 1px solid; border-radius: 5px;
  font-size: 12.5px; line-height: 1.35; text-decoration: none; background: var(--card); cursor: grab; min-width: 0;
}
.calchip svg { width: 13px; height: 13px; flex: none; }
.calchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.calgrid.week .calchip span { white-space: normal; }
.calchip:hover { background: color-mix(in srgb, currentColor 8%, var(--card)); }
.calchip.done span { text-decoration: line-through; opacity: .75; }
.calchip.dragging { opacity: .4; }
.calhint { margin: 10px 2px 0; }
.calside { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.minihead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 14px; }
.minihead button { border: none; background: none; padding: 2px 8px; font-size: 18px; color: var(--muted); }
.minigrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.minigrid > span { font-size: 11px; color: var(--muted); font-weight: 700; padding: 2px 0; }
.mday { border: 1px solid transparent; background: none; padding: 3px 0; font-size: 13px; border-radius: 5px; }
.mday.other { color: var(--muted); opacity: .55; }
.mday.has { border-color: var(--line); }
.mday.today { background: var(--accent); color: var(--accent-ink); font-weight: 700; border-color: var(--accent); }
.calside-h { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; border-top: 1px solid var(--line); padding-top: 12px; text-align: left; }
button.calside-h { border-left: none; border-right: none; border-bottom: none; border-radius: 0; background: none; width: 100%; padding-left: 0; }
.calitem { display: flex; align-items: center; gap: 10px; text-align: left; border: none; background: none; padding: 5px 4px; border-radius: 7px; font-size: 14px; }
.calitem:hover { background: var(--bg); }
.calitem.off span:last-child { color: var(--muted); }
.calbox { width: 14px; height: 14px; border-radius: 3px; border: 2px solid; flex: none; }
.undated { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 1000px) { .calwrap { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .calday { min-height: 78px; padding: 3px; }
  .calchip { font-size: 10.5px; padding: 2px 3px; }
  .calchip svg { display: none; }
  .calnum { font-size: 12px; }
  .calbar h1 { font-size: 20px; min-width: 0; }
}

/* ---------- testers banner (very top of every page) ---------- */
#testerbar {
  position: fixed; top: 0; left: 0; right: 0; height: 30px; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 0 12px;
  background: #f59e0b; color: #1f1300; font-size: 13px; font-weight: 700; text-align: center;
}
#testerbar[hidden] { display: none; }
body.has-testerbar { padding-top: 30px; }
body.has-testerbar #top { top: 30px; }
@media (min-width: 641px) { html[data-style="sidebar"] body.has-testerbar #top { top: 30px; } }

/* ---------- brain dump ---------- */
.micico { width: 15px; height: 15px; vertical-align: -2px; }
.dumpbox { width: min(760px, 96vw); }
.dumpbox textarea { width: 100%; resize: vertical; font-size: 15px; }
.bd-bar { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.frm .bd-bar button { margin: 0; }
.micbtn { display: inline-flex; align-items: center; gap: 7px; }
.micbtn.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.bd-h3 { font-size: 15px; margin: 18px 0 6px; }
.bd-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-top: 1px solid var(--line); }
.frm .bd-row > .bd-inc { width: auto; flex: none; margin-top: 10px; }
.bd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.frm .bd-main .bd-title { font-weight: 600; }
.bd-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.frm .bd-meta .selbtn, .frm .bd-meta input { width: auto; }
.bd-extra { font-size: 13px; }
.bd-dup { font-size: 13px; color: var(--warn); font-weight: 600; }
.bd-empty { margin-top: 14px; }

/* ---------- announcement banner (from the admin portal) ---------- */
#announce, .annbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 16px auto 0; max-width: 900px; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px;
}
html[data-style="sidebar"] #announce, html[data-style="sidebar"] .annbar { max-width: 940px; }
#announce[hidden], .annbar[hidden] { display: none; }
.annbar .ann-btn { border: none; cursor: pointer; font: inherit; font-weight: 600; }
.ann-msg { flex: 1 1 320px; }
.ann-btn { background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; padding: 7px 14px; border-radius: 9px; white-space: nowrap; }
.ann-x { border: none; background: none; font-size: 20px; color: var(--muted); padding: 2px 6px; }
.ann-x:hover { color: var(--ink); background: none; }
@media (max-width: 640px) { #announce, .annbar { margin: 12px 12px 0; } }

/* ---------- subtasks (real tasks under a parent) ---------- */
.subrows { margin: 0 0 4px 34px; border-left: 2px solid var(--line); padding-left: 6px; }
.subrows .task { font-size: 14px; }
.subnone { margin: 6px 8px; font-size: 13px; }
.draghandle-spacer { width: 14px; flex: none; display: inline-block; }
.subchip { text-decoration: none; white-space: nowrap; }
.tp-parent { font-size: 13px; margin: 2px 0 4px; }
.tp-parent a { font-weight: 600; }
.tp-hint { font-size: 12px; margin: 4px 0 10px; }
.subrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.subrow:first-child { border-top: none; }
.frm .subrow input[type=checkbox] { width: auto; flex: none; margin: 0; }
.subrow .subopen { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; font-size: 14px; overflow-wrap: anywhere; line-height: 1.35; }
.subrow .subopen:hover { text-decoration: underline; }
.subrow.done .subopen { color: var(--muted); text-decoration: line-through; }
.subrow .subout { color: var(--muted); text-decoration: none; font-size: 18px; line-height: 1; padding: 0 4px; }
.subrow .subout:hover { color: var(--danger); }
.subadd { display: flex; gap: 8px; margin-top: 10px; }
.frm .subadd input#e-subtitle { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .subrows { margin-left: 18px; }
  .subadd { flex-wrap: wrap; }
}

/* ---------- in-app checkboxes, date and time pickers (no browser-native controls) ---------- */
input[type=checkbox]:not(.donebox):not(label.switchrow > input) {
  appearance: none; -webkit-appearance: none; width: 18px; height: 18px; flex: none; margin: 0; padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--muted) 70%, transparent); border-radius: 5px; background: var(--card);
  place-content: center; cursor: pointer; vertical-align: middle;
  transition: background .12s, border-color .12s;
}
/* display has no weight here, so rules that hide a checkbox (like .selbox outside select mode) still win */
:where(input[type=checkbox]:not(.donebox):not(label.switchrow > input)) { display: inline-grid; }
input[type=checkbox]:not(.donebox):not(label.switchrow > input)::before {
  content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform .1s; background: #fff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type=checkbox]:not(.donebox):not(label.switchrow > input):hover { border-color: var(--accent); }
input[type=checkbox]:not(.donebox):not(label.switchrow > input):checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:not(.donebox):not(label.switchrow > input):checked::before { transform: scale(1); }
input[type=checkbox]:not(.donebox):not(label.switchrow > input):disabled { opacity: .45; cursor: default; }
input[type=checkbox]:not(.donebox):not(label.switchrow > input):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pickbtn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.pickbtn::after { content: ""; width: 14px; height: 14px; flex: none; opacity: .55; background: currentColor;
  -webkit-mask: var(--pickico) center / contain no-repeat; mask: var(--pickico) center / contain no-repeat; }
.datebtn { --pickico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M4 10h16M9 3v4M15 3v4'/%3E%3C/svg%3E"); }
.timebtn { --pickico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 8v4l3 2'/%3E%3C/svg%3E"); }
.pickbtn:hover { border-color: var(--accent); background: var(--card); }
.pickbtn.empty { color: var(--muted); }
.datepop { width: 272px; padding: 10px; }
.dphead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dphead b { font-size: 14px; }
.dpnav { border: none; background: none; font-size: 20px; line-height: 1; padding: 2px 10px; border-radius: 8px; color: var(--ink); }
.dpnav:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.dpgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dpdow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.dpday { border: none; background: none; border-radius: 8px; padding: 0; height: 32px; font-size: 13px; color: var(--ink); }
.dpday:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.dpday.other { color: var(--muted); opacity: .55; }
.dpday.today { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 700; }
.dpday.on { background: var(--accent); color: #fff; font-weight: 700; }
.dpfoot { display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.dpfoot button { flex: 1; font-size: 12px; padding: 6px 4px; border-radius: 8px; }
.dpfoot .dpclear { color: var(--danger); }

/* where the pickers sit in tight rows */
.subrow .pickbtn, .subadd .pickbtn { width: 140px; flex: none; min-height: 34px; padding: 5px 9px; font-size: 13px; }
@media (max-width: 640px) {
  .subrow .pickbtn, .subadd .pickbtn { width: 124px; }
}

/* ---------- workspace: plans, tests, Canvas ---------- */
.wschatbtns { display: flex; gap: 6px; }
.wstestform { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.wstestform label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 8px 0 4px; }
.wstestform label:first-child { margin-top: 0; }
.wstestform input, .wstestform textarea { width: 100%; }
.wstestform .pickbtn { width: 100%; }
#e-proposal { margin-bottom: 10px; }
#e-proposal .wsacts { max-width: none; }
.propitem { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--ink); cursor: pointer; }
.frm .propitem input[type=checkbox] { width: 18px; }
.propday { flex: none; width: 92px; color: var(--muted); font-size: 12px; font-weight: 600; }
.wcgrade { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 0 6px; }
.wcgrade b { font-size: 30px; letter-spacing: -.02em; }
.wcletter { font-weight: 700; font-size: 16px; color: var(--accent); }
.wch3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 4px; }
.wcrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.wcrow:first-of-type { border-top: none; }
.wcname { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.wcname a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.wcname a:hover { text-decoration: underline; }
.wcimp { flex: none; font-size: 12px; padding: 3px 10px; }
.wsparent { font-size: 12px; }
.count:empty { display: none; }

/* ---------- study guides ---------- */
.wsguidemk { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.wsguidemk input { flex: 1 1 160px; min-width: 0; }
.modal.guide { width: min(760px, 96vw); max-height: 92vh; padding: 26px 30px; }
.guidebar { position: sticky; top: -26px; display: flex; justify-content: flex-end; gap: 8px; background: var(--card); padding: 4px 0 10px; }
.modal.guide h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }
.modal.guide h2 { margin: 22px 0 6px; font-size: 15px; }
.modal.guide ul { margin: 0; padding-left: 20px; line-height: 1.55; }
.modal.guide dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.modal.guide dt { font-weight: 700; }
.modal.guide dd { margin: 0; }
.modal.guide .gq { padding-left: 20px; }
.modal.guide .gq li { margin-bottom: 12px; }
.modal.guide .gq p { margin: 0 0 6px; }
.modal.guide .ganswer { padding: 8px 12px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 6px; }
.gfoot { margin-top: 22px; font-size: 12px; }
@media (max-width: 640px) {
  .modal.guide { padding: 18px 16px; }
  .modal.guide dl { grid-template-columns: 1fr; }
}
@media print {
  body.printing-guide > *:not(.guideov) { display: none !important; }
  body.printing-guide .guideov { position: static; background: none; backdrop-filter: none; display: block; }
  body.printing-guide .modal.guide { width: auto; max-height: none; overflow: visible; border: none; box-shadow: none; padding: 0; color: #000; background: #fff; }
  body.printing-guide .guidebar, body.printing-guide .gshow { display: none !important; }
}

/* ---------- Canvas courses ---------- */
.btnlink, a.tbtn {
  display: inline-block; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--ink); padding: 7px 14px; text-decoration: none; white-space: nowrap;
}
a.tbtn { padding: 5px 11px; font-size: 13px; border-radius: 8px; color: var(--muted); }
.btnlink:hover, a.tbtn:hover { background: var(--bg); }
.btnlink.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btnlink.primary:hover { background: var(--accent); filter: brightness(1.1); }
.cvheadbtns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cvtabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.cvtab { padding: 8px 12px; white-space: nowrap; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.cvtab:hover { color: var(--ink); }
.cvtab.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
#view-course .card { margin-bottom: 14px; }
.cvhome { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cvrow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.card h2 + .cvrow, .wschathead + .cvrow, .wch3 + .cvrow { border-top: 0; }
.cvmain { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cvmain > a, .cvmain > b { overflow-wrap: anywhere; }
.cvmain .muted { font-size: 13px; }
.cvprev { font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cvside { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cvscore { font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.cvst { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.cvst-missing { color: var(--danger); border-color: var(--danger); }
.cvst-late { color: var(--warn); border-color: var(--warn); }
.cvst-graded { color: var(--ok); border-color: var(--ok); }
.cvst-new { color: var(--accent-fg); border-color: var(--accent-fg); }
.cvtag { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cvsub { font-size: 14px; margin: 12px 0 2px; color: var(--muted); }
.cvind1 { padding-left: 18px; } .cvind2 { padding-left: 36px; } .cvind3, .cvind4 { padding-left: 54px; }
.cvmore { margin: 8px 0 0; font-size: 14px; }
.cvcourses { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 8px; }
.cvcourse {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; color: var(--ink); text-decoration: none;
}
.cvcourse:hover { border-color: var(--accent); }
.cvcourse .muted { font-size: 13px; }
.cvcgrade { margin-top: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cvfacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.cvfact { display: flex; flex-direction: column; gap: 2px; }
.cvfact b { font-weight: 600; }
.cvhtml { line-height: 1.55; overflow-wrap: anywhere; }
.cvhtml img { max-width: 100%; height: auto; }
.cvhtml table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.cvhtml td, .cvhtml th { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.cvhtml pre { overflow-x: auto; }
.cvhtml blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.cvembed { display: inline-block; margin: 6px 0; }
.cvrubric { width: 100%; border-collapse: collapse; }
.cvrubric th, .cvrubric td { text-align: left; border-top: 1px solid var(--line); padding: 8px 6px; vertical-align: top; }
.cvrubric th { color: var(--muted); font-weight: 500; font-size: 13px; }
.cvrating { font-size: 13px; padding: 2px 6px; border-radius: 6px; }
.cvrating.on { outline: 1px solid var(--accent); }
.cvnum { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cvcomment { margin-top: 4px; font-size: 13px; }
.cvpost { padding: 10px 0; border-top: 1px solid var(--line); }
.card h2 + .cvpost { border-top: 0; }
.cvtext { white-space: pre-wrap; margin-top: 4px; }
.cvdepth1 { margin-left: 18px; } .cvdepth2 { margin-left: 36px; } .cvdepth3 { margin-left: 54px; }
@media (max-width: 860px) { .cvhome { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .cvrow { flex-direction: column; gap: 6px; }
  .cvscore { text-align: left; min-width: 0; }
  .cvdepth1, .cvdepth2, .cvdepth3 { margin-left: 10px; }
}
