/* Lotus Info — design system (from design-reference.pdf) */
:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-2: #f0f0f0;
  --surface-3: #e9e9e9;
  --line: #e6e6e6;
  --line-strong: #d4d4d4;
  --text: #1b1b1b;
  --muted: #6f6f6f;
  --faint: #9b9b9b;
  --ink: #1f1f1f;
  --ink-2: #2a2a2a;
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar: 232px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* ---------- Typography ---------- */
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: #4a4a4a; }
.h1 { font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.h3 { font-size: 15px; font-weight: 600; }
.lead { font-size: 14px; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.strong { font-weight: 600; }
.serif { font-family: var(--serif); font-weight: 400; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; flex: none; }
.logo-mark svg { width: 20px; height: 20px; }
.logo-word { font-size: 23px; font-weight: 500; letter-spacing: -.02em; }
.logo-sub { font-size: 11px; color: var(--muted); margin-left: 2px; align-self: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: #b9b9b9; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; flex: none; }
.link { font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }

/* ---------- Pills / chips ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 11.5px; color: #555; cursor: pointer; user-select: none; white-space: nowrap;
}
.pill.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill.is-checked { background: var(--surface-3); border-color: #6d6d6d; color: var(--text); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 500; }
.tag-outline { background: transparent; color: var(--muted); border: 1px solid var(--line-strong); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card-grey { background: var(--surface-2); border-color: #e2e2e2; }
.card-dark { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.card > .h2 + .small, .card > .h2 + .muted { margin-top: 4px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 16px 0; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid { display: grid; gap: 20px; }
.g-main { grid-template-columns: minmax(0, 1fr) 380px; }
.g-main-wide { grid-template-columns: minmax(0, 1fr) 340px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-half { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }

/* ---------- Forms ---------- */
.field { display: block; }
.field + .field { margin-top: 16px; }
.label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; outline: none;
  transition: border-color .15s;
}
.textarea { height: auto; min-height: 110px; padding: 12px; line-height: 1.5; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: #8a8a8a; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23333' stroke-width='1.3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 16px; height: 16px; border: 1px solid #c4c4c4; border-radius: 3px; background: #fff; flex: none; margin-top: 2px; display: grid; place-items: center; }
.check input:checked + .box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .box::after { content: ""; width: 8px; height: 4px; border: solid #fff; border-width: 0 0 1.6px 1.6px; transform: rotate(-45deg) translate(1px, -1px); }
.check .t { font-size: 14px; }
.check .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.radio .box { border-radius: 50%; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 26px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { margin-bottom: 30px; }
.side-label { font-size: 10px; font-weight: 500; text-transform: uppercase; color: var(--muted); letter-spacing: .02em; margin: 0 0 8px 0; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px; font-size: 13px; color: #555; line-height: 1.25; }
.nav a:hover { background: #f6f6f6; }
.nav a.is-active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.nav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; }
.nav .new { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); font-size: 0; flex: none; }
.side-plan { margin-top: 26px; background: var(--surface-2); border-radius: 8px; padding: 14px 14px 12px; }
.side-plan .bar { height: 2px; background: #d9d9d9; margin: 10px 0; }
.side-plan .bar i { display: block; height: 100%; width: 30%; background: var(--ink); }
.side-foot { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 14px; font-size: 11.5px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 75px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 12.5px; color: var(--muted); }
.topbar .crumbs span + span::before { content: "/"; margin: 0 8px; color: var(--faint); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: #444; }
.content { padding: 40px 40px 36px; flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.page-head .eyebrow { margin-bottom: 8px; }
.page-head .lead { margin-top: 10px; }
.page-foot { display: flex; justify-content: space-between; gap: 16px; font-size: 10.5px; color: var(--faint); padding: 0 40px 28px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 10px; font-weight: 500; text-transform: uppercase; color: var(--muted); padding: 14px 24px; border-bottom: 1px solid var(--line); }
.table td { padding: 16px 24px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-hl td { background: var(--surface-2); }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow-x: auto; }
.src-ico { width: 34px; height: 34px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #666; flex: none; }

/* ---------- Auth / onboarding (no sidebar) ---------- */
.top-plain { height: 88px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 64px; }
.top-plain .right { display: flex; align-items: center; gap: 24px; font-size: 12px; color: var(--muted); }
.wrap { max-width: 1216px; margin: 0 auto; padding: 0 40px; }

/* ---------- Misc components ---------- */
.stat-num { font-size: 64px; font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.note { background: var(--surface-2); border-radius: 6px; padding: 12px 14px; font-size: 12.5px; }
.list-check { list-style: none; padding: 0; margin: 0; }
.list-check li { display: flex; gap: 12px; padding: 7px 0; font-size: 13px; }
.list-check li::before { content: ""; width: 10px; height: 5px; border: solid currentColor; border-width: 0 0 1.5px 1.5px; transform: rotate(-45deg); margin-top: 5px; flex: none; }
.dot-list { list-style: none; padding: 0; margin: 0; }
.dot-list li { position: relative; padding-left: 16px; margin: 14px 0; font-size: 14px; }
.dot-list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 5px; height: 5px; background: var(--ink); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13px; }
.progress { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ink); }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 15px; height: 15px; }
.status-ok::before { content: "✓ "; }
.status-wait::before { content: "○ "; color: var(--faint); }
.arrow-ne { font-size: 13px; }

/* ---------- Digest ---------- */
.digest-hero { background: var(--surface-2); border: 1px solid #e2e2e2; border-radius: var(--radius); padding: 28px 26px; display: flex; justify-content: space-between; gap: 24px; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 18px; }
.post + .post { margin-top: 16px; }
.post-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.post-meta .src-ico { width: 32px; height: 32px; }
.post h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin: 16px 0 10px; line-height: 1.3; }
.post p { font-size: 13px; color: var(--muted); line-height: 1.55; }
.post .note { margin-top: 14px; }
.media-badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); font-size: 10.5px; font-weight: 600; color: #444; }
.media-badge svg { width: 10px; height: 10px; }

/* ---------- Article ---------- */
.article-title { font-family: var(--serif); font-size: 40px; font-weight: 400; line-height: 1.18; letter-spacing: -.01em; }
.article h4 { font-size: 20px; font-weight: 600; margin: 26px 0 12px; }
.article p { font-size: 15px; line-height: 1.6; color: #2b2b2b; }
.article p + p { margin-top: 14px; }

/* ---------- Stories ---------- */
.stories { display: grid; grid-template-columns: 1fr auto 420px auto 1fr; align-items: center; gap: 24px; padding: 8px 0 24px; }
.story-side { width: 178px; height: 360px; border-radius: 12px; background: var(--surface-2); border: 1px solid #e2e2e2; padding: 18px 18px; }
.story-side .bar { width: 32px; height: 2px; background: var(--ink); margin: 16px 0 20px; }
.story-side h4 { font-size: 21px; font-weight: 600; line-height: 1.25; }
.story-main { height: 650px; border-radius: 14px; background: var(--ink-2); color: #fff; padding: 26px 28px; display: flex; flex-direction: column; }
.story-progress { display: flex; gap: 6px; margin-bottom: 22px; }
.story-progress i { flex: 1; height: 3px; background: rgba(255,255,255,.25); border-radius: 2px; overflow: hidden; }
.story-progress i.done { background: #fff; }
.story-progress i.cur::after { content: ""; display: block; height: 100%; width: 60%; background: #fff; }
.story-main h3 { font-size: 34px; font-weight: 500; line-height: 1.2; letter-spacing: -.01em; }
.story-main .line { width: 48px; height: 2px; background: #fff; margin: 22px 0 26px; }
.story-points li { display: grid; grid-template-columns: 38px 1fr; font-size: 15px; line-height: 1.45; margin-bottom: 22px; }
.story-points li span { font-size: 11px; opacity: .6; padding-top: 3px; }

/* ---------- Pricing ---------- */
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 26px 26px; display: flex; flex-direction: column; }
.plan.is-current { background: var(--surface-2); border-color: #5c5c5c; }
.plan .price { font-size: 40px; font-weight: 600; letter-spacing: -.02em; margin: 18px 0 6px; }
.plan ul { flex: 1; }

/* ---------- Media analysis ---------- */
.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: #fbfbfb; padding: 32px 24px; text-align: center; transition: border-color .15s, background .15s; cursor: pointer; }
.drop:hover, .drop.is-over { border-color: #8a8a8a; background: #f6f6f6; }
.drop-ico { width: 48px; height: 48px; border-radius: 12px; background: var(--ink); display: inline-grid; place-items: center; margin-bottom: 14px; }
.drop-ico svg { width: 22px; height: 22px; stroke: #fff; }
.player { position: relative; border-radius: 12px; overflow: hidden; background: #1d1d1d; aspect-ratio: 16 / 9; color: #fff; }
.player-bg { position: absolute; inset: 0; background: radial-gradient(120% 80% at 30% 20%, #3b3b3b 0%, #1d1d1d 60%); }
.player-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(255,255,255,.95); display: grid; place-items: center; }
.player-play svg { width: 22px; height: 22px; margin-left: 4px; fill: #1d1d1d; }
.player-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 18px; display: flex; align-items: center; gap: 12px; font-size: 11.5px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.player-bar .track { flex: 1; height: 3px; background: rgba(255,255,255,.3); border-radius: 2px; position: relative; }
.player-bar .track i { position: absolute; left: 0; top: 0; bottom: 0; width: 34%; background: #fff; border-radius: 2px; }
.player-bar .track b { position: absolute; top: -3px; width: 2px; height: 9px; background: rgba(255,255,255,.7); }
.wave { display: flex; align-items: center; gap: 2px; height: 56px; min-width: 0; overflow: hidden; }
.wave i { flex: 1 1 0; background: #c9c9c9; border-radius: 2px; min-width: 1px; }
.wave i.on { background: var(--ink); }
.timecodes li { display: grid; grid-template-columns: 58px 1fr; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.timecodes li:last-child { border-bottom: 0; }
.tc { display: inline-flex; align-items: center; justify-content: center; height: 22px; border-radius: 4px; background: var(--surface-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.transcript p { font-size: 13px; line-height: 1.6; color: #333; }
.transcript p + p { margin-top: 10px; }
.transcript b { font-weight: 600; color: var(--text); margin-right: 6px; }
.transcript .t { color: var(--faint); font-size: 11px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 0 0 11px; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.is-active { color: var(--text); font-weight: 600; border-color: var(--ink); }
.ring { --p: 64; width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(var(--ink) calc(var(--p) * 1%), #e3e3e3 0); display: grid; place-items: center; font-size: 9px; font-weight: 600; position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 3px; background: #fff; border-radius: 50%; }
.ring span { position: relative; }
.type-ico { width: 34px; height: 34px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.type-ico svg { width: 16px; height: 16px; stroke: #444; }

/* ---------- Language picker ---------- */
.lang { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer; }
.lang-btn svg { width: 15px; height: 15px; }
.lang-btn .chev { width: 9px; height: 6px; transition: transform .15s; }
.lang.is-open .lang-btn { border-color: #8a8a8a; }
.lang.is-open .chev { transform: rotate(180deg); }
.lang-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 270px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.25); padding: 10px; z-index: 50; display: none; }
.lang.is-open .lang-pop { display: block; animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.lang-head { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; padding: 4px 6px 8px; }
.lang-search { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 13px; outline: none; margin-bottom: 6px; }
.lang-list { max-height: 300px; overflow-y: auto; }
.lang-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.lang-item:hover { background: var(--surface-2); }
.lang-item .flag { font-size: 18px; width: 24px; text-align: center; }
.lang-item .nm { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.lang-item .nm b { font-size: 13px; font-weight: 500; }
.lang-item .nm small { font-size: 11px; color: var(--muted); }
.lang-item .ok { opacity: 0; font-size: 12px; }
.lang-item.is-active { background: var(--surface-2); }
.lang-item.is-active .ok { opacity: 1; }

/* ---------- Choice cards / toggles ---------- */
.choice { border: 1px solid var(--line-strong); border-radius: 8px; padding: 16px 18px; cursor: pointer; display: flex; gap: 14px; align-items: flex-start; transition: border-color .15s, background .15s; }
.choice:hover { border-color: #a9a9a9; }
.choice.is-selected { border-color: #2c2c2c; background: var(--surface-3); }
.choice .ic { width: 36px; height: 36px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.choice.is-selected .ic { background: var(--ink); color: #fff; }
.choice .ic svg { width: 18px; height: 18px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #d5d5d5; border-radius: 999px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(16px); }

/* ---------- Folders ---------- */
.folders { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.folder { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; font-size: 12.5px; cursor: pointer; }
.folder svg { width: 14px; height: 14px; stroke: currentColor; }
.folder .n { font-size: 11px; color: var(--muted); }
.folder.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.folder.is-active .n { color: rgba(255,255,255,.7); }
.folder-new { border-style: dashed; color: var(--muted); }
.folder-input { height: 34px; border: 1px solid #8a8a8a; border-radius: 8px; padding: 0 10px; font-size: 12.5px; outline: none; width: 170px; }

/* ---------- Drawer ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: #fff; z-index: 61; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
.drawer.is-open { transform: none; }
.drawer-bg.is-open { opacity: 1; pointer-events: auto; }
.drawer-head { padding: 22px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.drawer h4 { font-size: 13px; font-weight: 600; margin: 22px 0 10px; }
.drawer h4:first-child { margin-top: 0; }
.x-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.set-row:last-child { border-bottom: 0; }

/* ---------- Digest feed ---------- */
.feed-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.feed-filters { position: sticky; top: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.feed-filters h5 { margin: 0 0 10px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.feed-filters h5:not(:first-child) { margin-top: 20px; }
.fl { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 10px; border-radius: 6px; border: 0; background: none; font-size: 13px; cursor: pointer; text-align: left; color: #444; }
.fl:hover { background: var(--surface-2); }
.fl.is-active { background: var(--ink); color: #fff; }
.fl .c { font-size: 11px; opacity: .65; }
.feed { height: calc(100vh - 150px); min-height: 520px; overflow-y: auto; padding-right: 6px; scroll-behavior: smooth; overscroll-behavior: contain; }
.feed::-webkit-scrollbar { width: 6px; } .feed::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 3px; }
.feed-head { display: flex; justify-content: space-between; align-items: center; padding: 0 0 12px; font-size: 12px; color: var(--muted); }
.media-thumb { position: relative; margin-top: 14px; border-radius: 8px; background: radial-gradient(120% 90% at 30% 20%, #3c3c3c 0%, #1d1d1d 65%); aspect-ratio: 16 / 6; color: #fff; overflow: hidden; }
.media-thumb .pl { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.media-thumb .pl svg { width: 16px; height: 16px; fill: #1d1d1d; margin-left: 3px; }
.media-thumb .dur { position: absolute; right: 12px; bottom: 10px; font-size: 11px; background: rgba(0,0,0,.55); padding: 2px 7px; border-radius: 4px; }
.post.is-media { border-color: #cfcfcf; }
.type-tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 10.5px; font-weight: 600; }
.type-tag svg { width: 10px; height: 10px; fill: #fff; }

/* ---------- Profile tabs ---------- */
.ptabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 26px; overflow-x: auto; }
.ptabs button { background: none; border: 0; padding: 0 4px 12px; margin-right: 18px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ptabs button.is-active { color: var(--text); font-weight: 600; border-color: var(--ink); }
.time-chip { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 6px 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.time-chip input { border: 0; outline: none; font-size: 14px; width: 74px; background: transparent; }
.time-chip button { width: 26px; height: 26px; border: 0; background: var(--surface-2); border-radius: 6px; cursor: pointer; color: #666; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); font-size: 13px; }


/* ---------- Top controls ---------- */
.hist { display: inline-flex; gap: 6px; }
.icon-round { width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); display: inline-grid; place-items: center; cursor: pointer; flex: none; transition: border-color .15s, background .15s; }
.icon-round:hover { border-color: #8a8a8a; }
.icon-round:disabled { opacity: .35; cursor: default; }
.icon-round svg { width: 16px; height: 16px; }
.topbar .crumbs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Dark theme ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214; --surface: #191a1d; --surface-2: #222327; --surface-3: #2b2c31;
  --line: #2a2b30; --line-strong: #3a3b42; --text: #ececee; --muted: #a2a2a8; --faint: #77777e;
  --ink: #f1f1f2; --ink-2: #26272b;
}
:root[data-theme="dark"] :is(.check .box, .icon-btn, .lang-btn, .lang-pop, .lang-search, .folder:not(.is-active), .drawer, .x-btn, .time-chip, .feed-filters, .net:not(.is-active), .src-row .cfg, .drop, .found, .chip-input, .folder-input) { background: var(--surface); color: var(--text); }
:root[data-theme="dark"] :is(.btn-dark, .pill.is-active, .tag, .folder.is-active, .fl.is-active, .type-tag, .net.is-active, .choice.is-selected .ic, .nav .new) { color: #111; }
:root[data-theme="dark"] .btn-dark:hover { background: #fff; border-color: #fff; }
:root[data-theme="dark"] .type-tag svg { fill: #111; }
:root[data-theme="dark"] .logo-mark svg { stroke: #111; }
:root[data-theme="dark"] .check input:checked + .box::after { border-color: #111; }
:root[data-theme="dark"] .switch input:checked + span::after { background: #111; }
:root[data-theme="dark"] .net.is-active b { background: #111; color: #fff; }
:root[data-theme="dark"] .table tbody tr:hover td { background: var(--surface-2); }
:root[data-theme="dark"] .lang-item:hover, :root[data-theme="dark"] .lang-item.is-active { background: var(--surface-2); }
:root[data-theme="dark"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ccc' stroke-width='1.3'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .story-main, :root[data-theme="dark"] .card-dark { background: #26272b; }
:root[data-theme="dark"] .media-thumb { background: radial-gradient(120% 90% at 30% 20%, #3a3b40 0%, #0d0d0f 65%); }
:root[data-theme="dark"] .wave-mini i { background: #44454b; }
:root[data-theme="dark"] .wave-mini i.on { background: var(--ink); }
:root[data-theme="dark"] .goal.is-selected::after { background-color: #000; border-color: #777; }
html { transition: background-color .2s; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g-main, .g-main-wide, .g-half { grid-template-columns: minmax(0, 1fr); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stories { grid-template-columns: 1fr; justify-items: center; }
  .stories .story-side, .stories .icon-btn { display: none; }
  .story-main { width: min(420px, 100%); }
}
@media (max-width: 860px) {
  [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .between { flex-wrap: wrap; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .main, .sidebar { min-width: 0; }
  .feed-wrap { grid-template-columns: minmax(0, 1fr); }
  .feed-filters { position: static; }
  .feed { height: 70vh; }
  .hide-m { display: none; }
  .topbar .crumbs { display: none; }
  .hist .icon-round, .topbar .icon-round { width: 32px; height: 32px; }
  .lang-pop { right: -60px; }
  .sidebar { position: static; height: auto; padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .logo { margin-bottom: 14px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .nav a { white-space: nowrap; padding: 8px 10px; }
  .side-plan, .side-foot, .side-label { display: none; }
  .topbar { padding: 0 16px; height: 56px; }
  .content { padding: 24px 16px; }
  .page-foot { padding: 0 16px 20px; flex-direction: column; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .h1 { font-size: 28px; }
  .top-plain { padding: 0 16px; height: 64px; }
  .top-plain .right .hide-m { display: none; }
  .top-plain .right { gap: 8px; }
  .top-plain .btn { white-space: normal; height: auto; min-height: 34px; padding: 6px 10px; font-size: 11.5px; max-width: 130px; line-height: 1.2; }
  .top-plain .logo-sub { display: none; }
  .wrap { padding: 0 16px; }
  .article-title { font-size: 30px; }
  .digest-hero { flex-direction: column; }
  .table th, .table td { padding: 12px 14px; }
}
:root[data-theme="dark"] :is(.nav a, .fl, .pill, .eyebrow, .lead) { color: var(--muted); }
:root[data-theme="dark"] :is(.nav a.is-active, .nav a:hover) { color: var(--text); }
:root[data-theme="dark"] .nav a:hover, :root[data-theme="dark"] .fl:hover { background: var(--surface-2); }
:root[data-theme="dark"] .fl.is-active { color: #111; }
:root[data-theme="dark"] .pill.is-active { color: #111; }
:root[data-theme="dark"] .pill.is-checked { color: var(--text); border-color: #6b6b72; }
:root[data-theme="dark"] .article p { color: #d6d6da; }
:root[data-theme="dark"] .transcript p { color: #d6d6da; }
@media (max-width: 860px) {
  .top-plain .row { gap: 8px !important; }
  .top-plain .icon-round { width: 28px; height: 28px; }
  .top-plain .hist { gap: 4px; }
  .top-plain .logo-mark { width: 28px; height: 28px; }
  .top-plain .logo-word { font-size: 19px; }
  .top-plain .btn { max-width: 96px; font-size: 11px; padding: 5px 8px; }
  .lang-btn { padding: 0 8px; height: 30px; gap: 5px; }
  .lang-btn .chev { display: none; }
}

/* ---------- Top navigation (replaces the side panel) ---------- */
:root { --head-h: 64px; --page-w: 1240px; }
.app { display: block; min-height: 100vh; }
.main { display: block; }
.apphead { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.apphead-in { max-width: var(--page-w); margin: 0 auto; padding: 0 32px; height: 64px; display: flex; align-items: center; gap: 18px; }
.apphead .logo-word { font-size: 21px; }
.apphead .logo-mark { width: 30px; height: 30px; }
.topnav { display: flex; gap: 4px; margin-left: 10px; min-width: 0; }
.topnav a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a.is-active { background: var(--ink); color: #fff; font-weight: 500; }
.topnav svg { width: 16px; height: 16px; stroke: currentColor; flex: none; }
.head-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.apphead .avatar { flex: none; }
.content { max-width: var(--page-w); margin: 0 auto; width: 100%; padding: 30px 32px 56px; }
.page-head { margin-bottom: 22px; }
:root[data-theme="dark"] .topnav a.is-active { color: #111; }
:root[data-theme="dark"] .topnav a { color: var(--muted); }
:root[data-theme="dark"] .topnav a:hover { color: var(--text); }
@media (max-width: 860px) {
  .apphead-in { height: auto; flex-wrap: wrap; padding: 10px 16px 0; gap: 10px; }
  .apphead .logo-sub { display: none; }
  .apphead .hist .icon-round, .head-right .icon-round { width: 30px; height: 30px; }
  .topnav { order: 3; width: 100%; margin: 0 -16px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; flex: 1 0 calc(100% + 32px); }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { height: 34px; padding: 0 12px; font-size: 13px; }
  .content { padding: 22px 16px 40px; }
}

/* segmented control */
.seg2 { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.seg2 button { border: 0; background: none; height: 30px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg2 button.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
:root[data-theme="dark"] .seg2 button.is-active { background: var(--surface-3); }
[id] { scroll-margin-top: calc(var(--head-h) + 12px); }
:root[data-theme="dark"] .avatar { color: var(--text); }

/* ===== micro-interactions ===== */
:root { --spring: cubic-bezier(.3, 1.5, .5, 1); --ease: cubic-bezier(.2, .7, .2, 1); }
:focus-visible { outline: 2px solid #8a8a8a; outline-offset: 2px; }
.btn { transition: background .18s, border-color .18s, color .18s, transform .12s var(--ease), box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn-dark:hover { box-shadow: 0 10px 22px -14px rgba(0,0,0,.6); }
.btn svg { transition: transform .22s var(--ease); }
.btn:hover svg path[d^="M3 8h10"] { transform: translateX(2px); }
.arr { display: inline-block; transition: transform .22s var(--ease); }
:is(a, button):hover .arr-r { transform: translateX(3px); }
:is(a, button):hover .arr-ur { transform: translate(2px, -2px); }
:is(a, button):hover .arr-l { transform: translateX(-3px); }
:is(a, button):hover .arr-d { transform: translateY(2px); }
.icon-round { transition: border-color .15s, background .15s, transform .12s var(--ease); }
.icon-round:not(:disabled):active { transform: scale(.9); }
.icon-round svg { transition: transform .22s var(--ease); }
[data-hist="back"]:not(:disabled):hover svg { transform: translateX(-2px); }
[data-hist="fwd"]:not(:disabled):hover svg { transform: translateX(2px); }
[data-theme-toggle]:hover svg { transform: rotate(-18deg); }
.lang.is-open .lang-btn .chev { transform: rotate(180deg); }
.topnav a svg { transition: transform .22s var(--ease); }
.topnav a:hover svg { transform: translateY(-1px); }
.topnav a:active { transform: scale(.97); }
.avatar { transition: transform .15s var(--ease); }
.avatar:hover { transform: scale(1.06); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); background: #1f1f1f; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 13px; z-index: 99; opacity: 0; transition: opacity .2s, transform .28s var(--spring); max-width: calc(100% - 32px); pointer-events: none; box-shadow: 0 14px 30px -16px rgba(0,0,0,.5); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
:root[data-theme="dark"] .toast { background: #f2f2f2; color: #111; }

/* selection: pills get a check that grows in */
.pill { transition: background .18s, border-color .18s, color .18s, transform .12s var(--ease); }
.pill:active { transform: scale(.95); }
.pill:not(.is-checked):not(.is-active):hover { border-color: #9a9a9a; }
[data-multi] .pill:not([data-add])::before { content: ""; width: 0; height: 13px; margin-inline-end: -4px; border-radius: 50%; flex: none; transform: scale(0);
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.3 2.2 4.7-4.8' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
  transition: width .2s var(--ease), margin-inline-end .2s var(--ease), transform .3s var(--spring); }
[data-multi] .pill.is-checked::before { width: 13px; margin-inline-end: 0; transform: scale(1); }
:root[data-theme="dark"] [data-multi] .pill::before { background-color: #f2f2f2; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.3 2.2 4.7-4.8' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.check .box { transition: background .18s, border-color .18s; border-radius: 5px; width: 17px; height: 17px; }
.check input:checked + .box::after { animation: tick-in .28s var(--spring); }
.check:hover input:not(:checked) + .box { border-color: #8a8a8a; }
@keyframes tick-in { from { transform: rotate(-45deg) translate(1px, -1px) scale(0); } }
.switch span::after { transition: transform .28s var(--spring), width .15s; }
.switch input:active + span::after { width: 20px; }
.switch input:checked:active + span::after { transform: translateX(12px); }
.choice { transition: border-color .18s, background .18s, transform .12s var(--ease); }
.choice:active { transform: scale(.99); }
.choice .ic { transition: background .2s, color .2s, transform .3s var(--spring); }
.choice.is-selected .ic { transform: scale(1.06); }
.folder { transition: background .15s, border-color .15s, color .15s, transform .12s var(--ease); }
.folder:active { transform: scale(.96); }

/* segmented control with a sliding pill */
.seg2 { position: relative; }
.seg2 > button { position: relative; z-index: 1; transition: color .2s; }
.seg2 > .seg-ind { position: absolute; left: 0; top: 3px; bottom: 3px; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.1); transition: transform .32s var(--spring), width .32s var(--spring), opacity .2s; pointer-events: none; }
.seg2.has-ind > button.is-active { background: transparent; box-shadow: none; }
:root[data-theme="dark"] .seg2 > .seg-ind { background: var(--surface-3); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ===== smooth page changes (browsers without support just switch pages) ===== */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s ease both; }
::view-transition-new(root) { animation: vt-in .26s var(--ease) both; }
.apphead { view-transition-name: apphead; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

/* contextual back button: only on pages that have somewhere to go back to */
.back-pill { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 13px 0 8px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; flex: none; transition: border-color .15s, background .15s, transform .12s var(--ease); }
.back-pill svg { width: 16px; height: 16px; transition: transform .22s var(--ease); }
.back-pill:hover { border-color: #8a8a8a; }
.back-pill:hover svg { transform: translateX(-3px); }
.back-pill:active { transform: scale(.96); }
@media (max-width: 700px) { .back-pill { width: 34px; padding: 0; justify-content: center; } .back-pill span { display: none; } }
/* back to top */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 24px -12px rgba(0,0,0,.35); opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; transition: opacity .2s, transform .3s var(--spring), bottom .25s var(--ease); }
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover svg { transform: translateY(-2px); }
.to-top svg { width: 18px; height: 18px; transition: transform .22s var(--ease); }
.to-top.is-raised { bottom: 104px; }

