:root {
  --accent: #EB593D;
  --hero-a: #FCD9BF;
  --hero-b: #F7A387;
  --win: #f6f6f6;
  --panel: #ffffff;
  --panel-2: #f0f0f2;
  --fill: rgba(0,0,0,.055);
  --fill-2: rgba(0,0,0,.09);
  --sep: rgba(0,0,0,.1);
  --text: #1d1d1f;
  --text-2: rgba(60,60,67,.68);
  --text-3: rgba(60,60,67,.42);
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.06);
  --good: #2faa5b; --warn: #f0a020; --bad: #e0443a;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-scheme="dark"] {
  --win: #1e1e20; --panel: #2a2a2d; --panel-2: #323236;
  --fill: rgba(255,255,255,.08); --fill-2: rgba(255,255,255,.14);
  --sep: rgba(255,255,255,.12); --text: #f5f5f7;
  --text-2: rgba(235,235,245,.62); --text-3: rgba(235,235,245,.36);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --win: #1e1e20; --panel: #2a2a2d; --panel-2: #323236;
    --fill: rgba(255,255,255,.08); --fill-2: rgba(255,255,255,.14);
    --sep: rgba(255,255,255,.12); --text: #f5f5f7;
    --text-2: rgba(235,235,245,.62); --text-3: rgba(235,235,245,.36);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font: 13px/1.45 var(--font); color: var(--text); background: var(--win); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1,h2,h3,h4,p { margin: 0; }
svg.i { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.fill { fill: currentColor; stroke: none; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); }
.row { display: flex; align-items: center; gap: 8px; } .col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; } .spacer { flex: 1; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 280px 1fr; height: 100vh; }
.app.no-sidebar { grid-template-columns: 0 1fr; }
.sidebar { display: flex; flex-direction: column; background: var(--win); border-right: 1px solid var(--sep); min-height: 0; }
.sidebar .brand { padding: 14px 14px 8px; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 2px 4px rgba(0,0,0,.14); }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.side-scroll { flex: 1; overflow: auto; padding: 4px 10px 10px; }
.nav-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; text-align: left; position: relative; }
.nav-row .i { font-size: 16px; color: var(--accent); }
.nav-row:hover { background: var(--fill); }
.nav-row.sel { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.nav-row.sel .label { font-weight: 600; }
.nav-row .count { margin-left: auto; font-size: 11px; color: var(--text-3); }
.nav-row .more { margin-left: auto; opacity: 0; color: var(--text-3); padding: 2px 4px; border-radius: 5px; }
.nav-row:hover .more { opacity: 1; } .nav-row .more:hover { background: var(--fill-2); }
.nav-row.drop { outline: 2px solid var(--accent); outline-offset: -2px; }
.side-head { display: flex; align-items: center; gap: 6px; padding: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--text-3); text-transform: uppercase; cursor: pointer; user-select: none; }
.side-head .i { font-size: 10px; transition: transform .15s; } .side-head.open .i { transform: rotate(90deg); }
.side-link { display: flex; align-items: center; gap: 6px; padding: 5px 10px; color: var(--accent); font-weight: 500; font-size: 13px; }
.side-link:hover { opacity: .8; }
.tree-children { margin-left: 14px; }
.side-foot { border-top: 1px solid var(--sep); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.session-card { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, transparent); text-align: left; width: 100%; }
.session-card .i { font-size: 19px; color: var(--accent); }
.session-card b { font-size: 12px; display: block; } .session-card span { font-size: 11px; color: var(--text-2); }
.foot-btns { display: flex; gap: 4px; }
.foot-btns .nav-row { font-size: 13px; padding: 6px 8px; width: auto; }
.foot-btns .nav-row.grow { flex: 1; min-width: 0; }
.avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; object-fit: cover; flex: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.toolbar { height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--sep); background: var(--win); flex: none; }
.search { display: flex; align-items: center; gap: 6px; background: var(--fill); border-radius: 8px; padding: 5px 10px; width: min(300px, 40vw); color: var(--text-3); }
.search input { border: 0; background: none; outline: 0; width: 100%; font-size: 13px; color: var(--text); }
.seg { display: inline-flex; background: var(--fill); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { padding: 4px 11px; border-radius: 6px; font-size: 12.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.15); font-weight: 600; }
.content { flex: 1; min-height: 0; display: flex; }
.page { flex: 1; overflow: auto; }
.page-inner { max-width: 1100px; margin: 0 auto; padding: 24px 36px 56px; display: flex; flex-direction: column; gap: 22px; }
.page-inner.narrow { max-width: 760px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 13px; border-radius: 8px; background: var(--fill); font-weight: 500; font-size: 13px; white-space: nowrap; }
.btn:hover { background: var(--fill-2); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.btn.ghost { background: none; } .btn.ghost:hover { background: var(--fill); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 28px; height: 28px; border-radius: 7px; display: inline-grid; place-items: center; color: var(--text-2); font-size: 15px; }
.icon-btn:hover { background: var(--fill); color: var(--text); } .icon-btn.on { color: var(--accent); }
.field, .textarea, .select { background: var(--fill); border: 1px solid transparent; border-radius: 8px; padding: 7px 10px; outline: 0; width: 100%; }
.field:focus, .textarea:focus, .select:focus { border-color: var(--accent); background: var(--panel); }
.textarea { resize: vertical; min-height: 80px; }
label.lbl { font-size: 12px; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 4px; }
.card { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; }
.card h3 { font-size: 15px; margin-bottom: 10px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 11.5px; font-weight: 600; }
.pill.gray { background: var(--fill); color: var(--text-2); }
.pill .x { opacity: .6; cursor: pointer; } .pill .x:hover { opacity: 1; }
.progress { height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; } .progress > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 11px; background: var(--fill-2); transition: .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: .15s; }
.switch.on { background: var(--accent); } .switch.on::after { left: 18px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.page-sub { color: var(--text-2); margin-top: 2px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.section-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.section-head a, .link { color: var(--accent); font-weight: 500; cursor: pointer; font-size: 12.5px; }
.empty { display: grid; place-items: center; text-align: center; color: var(--text-2); gap: 8px; padding: 48px 20px; flex: 1; }
.empty .i { font-size: 38px; color: var(--text-3); }
.empty h3 { color: var(--text); font-size: 16px; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: thin; }
.grid { display: grid; gap: 14px; }
.error-text { color: var(--bad); font-size: 12.5px; }

/* ---------- note list column ---------- */
.list-col { width: 296px; flex: none; border-right: 1px solid var(--sep); display: flex; flex-direction: column; min-height: 0; background: var(--win); }
.list-head { padding: 14px 14px 10px; display: flex; align-items: flex-start; gap: 8px; }
.list-head h2 { font-size: 17px; font-weight: 700; } .list-head .sub { font-size: 12px; color: var(--text-2); }
.list-scroll { flex: 1; overflow: auto; padding: 6px 8px 12px; }
.note-row { display: flex; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; position: relative; }
.note-row:hover { background: var(--fill); } .note-row.sel { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.note-row .thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--fill-2); flex: none; display: grid; place-items: center; font-size: 22px; }
.note-row .t { font-weight: 600; font-size: 13.5px; } .note-row .p { font-size: 12px; color: var(--text-2); }
.note-row .d { font-size: 11px; color: var(--text-3); }
.note-row .ic { color: var(--text-3); font-size: 12px; }

/* ---------- editor ---------- */
.editor-col { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--panel); position: relative; }
.editor-bar { display: flex; align-items: center; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--sep); flex-wrap: wrap; }
.editor-scroll { flex: 1; overflow: auto; }
.cover { height: 170px; background-size: cover; background-position: center; position: relative; }
.cover .cover-btns { position: absolute; right: 12px; bottom: 10px; display: flex; gap: 6px; opacity: 0; transition: .15s; }
.cover:hover .cover-btns { opacity: 1; }
.cover-btns .btn { background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px); }
.editor-body { max-width: 760px; margin: 0 auto; padding: 24px 40px 80px; }
.title-row { display: flex; align-items: center; gap: 10px; }
.title-input { flex: 1; border: 0; outline: 0; background: none; font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; padding: 4px 0; min-width: 0; resize: none; overflow: hidden; font-family: inherit; color: inherit; }
.note-icon { font-size: 34px; width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; background: var(--fill); }
.note-icon:hover { background: var(--fill-2); }
.meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; font-size: 12px; color: var(--text-2); }
.rich { min-height: 320px; outline: 0; font-size: 15.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; caret-color: var(--accent); }
.rich:empty::before { content: attr(data-ph); color: var(--text-3); }
.rich img.inline-img { max-width: 100%; border-radius: 10px; display: block; margin: 8px 0; }
.rich .cb { display: inline-block; width: 1.05em; height: 1.05em; border: 1.8px solid var(--text-3); border-radius: 50%; vertical-align: -.17em; margin-right: .45em; cursor: pointer; position: relative; user-select: none; }
.rich .cb.on { background: var(--accent); border-color: var(--accent); }
.rich .cb.on::after { content: ""; position: absolute; left: 28%; top: 10%; width: 30%; height: 56%; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(40deg); }
.rich mark.cm { background: color-mix(in srgb, var(--warn) 32%, transparent); border-radius: 3px; cursor: pointer; }
.rich.locked { opacity: .6; pointer-events: none; }
.attach-grid { display: grid; gap: 10px; margin-top: 22px; }
.attach { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--panel-2); }
.attach video, .attach audio { width: 100%; border-radius: 8px; }
.attach details { font-size: 12.5px; color: var(--text-2); } .attach summary { cursor: pointer; font-weight: 600; }
.pager { display: flex; flex-wrap: wrap; row-gap: 6px; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--sep); background: var(--panel-2); font-size: 12.5px; }
.inspector { width: 340px; flex: none; border-left: 1px solid var(--sep); display: flex; flex-direction: column; background: var(--win); min-height: 0; }
.inspector-head { padding: 12px 14px; border-bottom: 1px solid var(--sep); display: flex; align-items: center; gap: 8px; font-weight: 600; }
.inspector-scroll { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.comment { background: var(--panel); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); font-size: 13px; }
.comment q { display: block; color: var(--text-2); border-left: 3px solid var(--warn); padding-left: 8px; margin-bottom: 6px; font-size: 12px; quotes: none; }
.sel-pop { position: fixed; z-index: 60; display: flex; gap: 2px; padding: 4px; background: var(--panel); border-radius: 9px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }

/* ---------- chat ---------- */
.chat-msgs { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 88%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; line-height: 1.5; }
.bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--sep); align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; max-height: 140px; min-height: 36px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 8px; }

/* ---------- folder grid / cards ---------- */
.note-card { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; text-align: left; display: flex; flex-direction: column; transition: transform .12s; }
.note-card:hover { transform: translateY(-2px); }
.note-card .cv { height: 96px; background-size: cover; background-position: center; background-color: var(--fill-2); }
.note-card .bd { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 3px; }
.note-card .bd b { font-size: 13.5px; } .note-card .bd span { font-size: 12px; color: var(--text-2); }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: minmax(440px, 560px) 1fr; gap: 16px; }
.hero-card { height: 168px; border-radius: 16px; overflow: hidden; display: flex; box-shadow: var(--shadow); color: #fff; text-align: left; background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); }
.hero-card .txt { flex: 1; padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; color: #2b1a14; min-width: 0; }
:root[data-scheme="dark"] .hero-card .txt, .hero-card.darkbg .txt { color: #fff; }
.hero-card .cv { width: 148px; background-size: cover; background-position: center; }
.hero-card h3 { font-size: 19px; letter-spacing: -.01em; } .hero-card .kicker { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; } .stat .l { font-size: 12px; color: var(--text-2); }
.stat .delta { font-size: 11.5px; font-weight: 600; } .delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.pick { width: 168px; flex: none; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; text-align: left; }
.pick .cv { height: 72px; background-size: cover; background-position: center; }
.pick .bd { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; } .pick b { font-size: 12.5px; }
.path { min-width: 220px; min-height: 128px; border-radius: 14px; padding: 14px; color: #fff; display: flex; flex-direction: column; gap: 6px; text-align: left; box-shadow: var(--shadow); flex: none; }
.path .progress { background: rgba(255,255,255,.3); } .path .progress > i { background: #fff; }
.path .i { font-size: 20px; } .path b { font-size: 15px; } .path span { font-size: 12px; opacity: .85; }
.practice { width: 220px; flex: none; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.practice .badge { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 17px; }

/* ---------- calendar / plan ---------- */
.week { display: grid; grid-template-columns: 56px repeat(7, 1fr); border: 1px solid var(--sep); border-radius: 12px; overflow: hidden; background: var(--panel); }
.week .hd { padding: 8px 6px; text-align: center; font-size: 12px; border-bottom: 1px solid var(--sep); background: var(--panel-2); }
.week .hd.today b { color: var(--accent); }
.week .hours { display: flex; flex-direction: column; } .week .hours div { height: 48px; font-size: 10.5px; color: var(--text-3); text-align: right; padding: 2px 6px; border-top: 1px solid var(--sep); }
.week .daycol { position: relative; border-left: 1px solid var(--sep); height: calc(48px * 16); }
.week .daycol .line { height: 48px; border-top: 1px solid var(--sep); }
.evt { position: absolute; left: 3px; right: 3px; border-radius: 7px; padding: 3px 6px; font-size: 11px; line-height: 1.25; overflow: hidden; background: color-mix(in srgb, var(--accent) 22%, var(--panel)); border-left: 3px solid var(--accent); text-align: left; }
.evt.done { opacity: .55; text-decoration: line-through; } .evt.deadline { background: color-mix(in srgb, var(--bad) 22%, var(--panel)); border-color: var(--bad); }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.month .cell { aspect-ratio: 1.15; background: var(--panel); border-radius: 9px; padding: 5px 7px; font-size: 12px; text-align: left; position: relative; }
.month .cell.sel { outline: 2px solid var(--accent); } .month .cell.out { opacity: .4; } .month .cell.today b { color: var(--accent); }
.month .dots { display: flex; gap: 3px; position: absolute; bottom: 6px; left: 7px; } .month .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.session-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); text-align: left; width: 100%; }
.session-row .badge { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-size: 17px; }
.check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-3); display: grid; place-items: center; color: #fff; font-size: 12px; }
.check.on { background: var(--good); border-color: var(--good); }

/* ---------- quiz ---------- */
.opt { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 11px; background: var(--panel); box-shadow: var(--shadow); width: 100%; text-align: left; border: 2px solid transparent; font-size: 14px; }
.opt:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.opt.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--panel)); }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--panel)); }
.opt .k { width: 24px; height: 24px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; }
.flash { perspective: 1200px; width: 100%; max-width: 560px; height: 300px; margin: 0 auto; cursor: pointer; }
.flash-in { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.flash.flip .flash-in { transform: rotateY(180deg); }
.flash .face { position: absolute; inset: 0; backface-visibility: hidden; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); display: grid; place-items: center; padding: 28px; text-align: center; font-size: 18px; font-weight: 600; }
.flash .face.back { transform: rotateY(180deg); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.tile { padding: 10px 14px; border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; border: 2px solid transparent; text-align: left; }
.tile.sel { border-color: var(--accent); } .tile.ok { border-color: var(--good); opacity: .5; pointer-events: none; } .tile.no { border-color: var(--bad); }
.letters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.letters button { width: 44px; height: 52px; border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); font-size: 22px; font-weight: 700; text-transform: uppercase; }
.letters button.used { opacity: .25; pointer-events: none; }

/* ---------- charts / graph ---------- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 52px; gap: 10px; align-items: center; font-size: 13px; }
.spark { width: 100%; height: 140px; }
.heat { display: grid; grid-template-columns: repeat(18, 1fr); gap: 4px; }
.heat i { aspect-ratio: 1; border-radius: 4px; background: var(--fill); } 
.graph-wrap { position: relative; flex: 1; min-height: 0; background: var(--panel); }
.graph-wrap svg { width: 100%; height: 100%; display: block; cursor: grab; }
.graph-tip { position: absolute; left: 16px; bottom: 16px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; max-width: 280px; }
.canvas-board { position: relative; flex: 1; overflow: auto; background-image: radial-gradient(var(--sep) 1px, transparent 1px); background-size: 22px 22px; }
.canvas-card { position: absolute; width: 220px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); cursor: grab; user-select: none; overflow: hidden; }
.canvas-card.sel { outline: 2px solid var(--accent); }
.canvas-card .bd { padding: 10px 12px; } .canvas-card .bd b { display: block; margin-bottom: 3px; }
.timeline { position: relative; padding: 24px 40px 60px 120px; }
.timeline::before { content: ""; position: absolute; left: 100px; top: 0; bottom: 0; width: 2px; background: var(--sep); }
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item .when { position: absolute; left: -108px; width: 90px; text-align: right; font-size: 11.5px; color: var(--text-2); top: 12px; }
.tl-item::before { content: ""; position: absolute; left: -26px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--win); }
.tl-item .tl-card { margin-left: 0; }

/* ---------- modal / toast / menu ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.38); display: grid; place-items: center; z-index: 100; animation: fade .12s; padding: 20px; }
.modal { background: var(--panel); border-radius: 16px; box-shadow: 0 20px 70px rgba(0,0,0,.4); width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; animation: pop .16s; }
.modal.wide { width: min(860px, 100%); } .modal.full { width: min(980px, 100%); height: 86vh; }
.modal-head { padding: 16px 20px 6px; display: flex; align-items: center; gap: 10px; } .modal-head h3 { font-size: 16px; flex: 1; }
.modal-body { padding: 8px 20px 16px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--sep); display: flex; gap: 8px; justify-content: flex-end; }
.option-tile { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 11px 13px; border-radius: 11px; background: var(--fill); }
.option-tile:hover { background: var(--fill-2); } .option-tile .badge { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-size: 18px; flex: none; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.picker-grid button { aspect-ratio: 1; border-radius: 10px; background: var(--fill); font-size: 22px; display: grid; place-items: center; } .picker-grid button:hover, .picker-grid button.sel { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.cover-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .cover-grid button { height: 70px; border-radius: 10px; background-size: cover; background-position: center; border: 3px solid transparent; } .cover-grid button.sel { border-color: var(--accent); }
.menu { position: fixed; z-index: 120; min-width: 190px; background: var(--panel); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.3); padding: 5px; animation: fade .1s; }
.menu button { display: flex; width: 100%; align-items: center; gap: 9px; text-align: left; padding: 6px 10px; border-radius: 6px; font-size: 13px; } .menu button:hover { background: var(--accent); color: #fff; }
.menu button.danger { color: var(--bad); } .menu button.danger:hover { color: #fff; background: var(--bad); } .menu hr { border: 0; border-top: 1px solid var(--sep); margin: 4px 0; }
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #222; color: #fff; padding: 9px 16px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.35); font-size: 13px; animation: pop .16s; max-width: 80vw; }
.toast.err { background: var(--bad); }
.spin { width: 16px; height: 16px; border: 2px solid var(--fill-2); border-top-color: var(--accent); border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } } @keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: scale(.96); } }
.swatch { width: 54px; height: 36px; border-radius: 9px; border: 3px solid transparent; } .swatch.sel { border-color: var(--text); }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; align-items: center; }
.settings-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--sep); } .settings-row:first-of-type { border-top: 0; }
.rec { width: 12px; height: 12px; border-radius: 50%; background: var(--bad); animation: pulse 1s infinite; } @keyframes pulse { 50% { opacity: .3; } }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; } .sidebar { display: none; } body.menu-open .sidebar { display: flex; position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50; }
  .list-col { width: 240px; } .hero { grid-template-columns: 1fr; } .inspector { display: none; } .page-inner { padding: 18px 16px 40px; }
}
.nav-row .twist { width: 14px; height: 14px; display: inline-grid; place-items: center; flex: none; margin-left: -4px; margin-right: -3px; }
.nav-row .twist .i { font-size: 10px; color: var(--text-3) !important; transition: transform .15s; } .nav-row .twist.open .i { transform: rotate(90deg); }

.pager > *, .pager label { white-space: nowrap; }
