/* Inksight AI — whiteboard-marker design system
   Marker blue = AI and actions, green = decisions/done, red = risk/overdue,
   sticky yellow = open questions. One typeface (Bricolage Grotesque) plus a
   marker hand (Caveat) used only on the capture board. */

:root {
  --bg: #EDF0F3;
  --surface: #FFFFFF;
  --surface-2: #F5F7F9;
  --surface-3: #E9EDF1;
  --ink: #14202B;
  --ink-2: #4A5866;
  --ink-3: #75828F;
  --line: #DCE2E8;
  --line-2: #C6CFD8;
  --blue: #2148C0;
  --blue-ink: #1A3A9E;
  --blue-soft: rgba(33, 72, 192, .09);
  --blue-softer: rgba(33, 72, 192, .05);
  --green: #17855A;
  --green-soft: rgba(23, 133, 90, .11);
  --red: #C93226;
  --red-soft: rgba(201, 50, 38, .10);
  --yellow: #F2CC3F;
  --yellow-soft: #FCF3C9;
  --yellow-ink: #6E5A07;
  --on-blue: #FFFFFF;
  --shadow-1: 0 1px 2px rgba(20, 32, 43, .06);
  --shadow-2: 0 12px 34px -14px rgba(20, 32, 43, .28), 0 2px 6px -2px rgba(20, 32, 43, .08);
  --shadow-3: 0 30px 80px -20px rgba(20, 32, 43, .45);
  --r-xs: 6px; --r-sm: 9px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px;
  --side: 256px;
  --top: 60px;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Chalkboard SE", "Marker Felt", cursive;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E141A; --surface: #151D25; --surface-2: #1B242D; --surface-3: #222D38;
    --ink: #E6ECF1; --ink-2: #A7B4C0; --ink-3: #7A8895; --line: #25313C; --line-2: #33414E;
    --blue: #8AA5FF; --blue-ink: #A9BDFF; --blue-soft: rgba(138, 165, 255, .14); --blue-softer: rgba(138, 165, 255, .07);
    --green: #4CC38C; --green-soft: rgba(76, 195, 140, .14); --red: #FF7B6C; --red-soft: rgba(255, 123, 108, .13);
    --yellow: #EEC94E; --yellow-soft: rgba(238, 201, 78, .14); --yellow-ink: #F1D47A; --on-blue: #0E141A;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 14px 36px -14px rgba(0, 0, 0, .7), 0 2px 6px -2px rgba(0, 0, 0, .4);
    --shadow-3: 0 30px 80px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E141A; --surface: #151D25; --surface-2: #1B242D; --surface-3: #222D38;
  --ink: #E6ECF1; --ink-2: #A7B4C0; --ink-3: #7A8895; --line: #25313C; --line-2: #33414E;
  --blue: #8AA5FF; --blue-ink: #A9BDFF; --blue-soft: rgba(138, 165, 255, .14); --blue-softer: rgba(138, 165, 255, .07);
  --green: #4CC38C; --green-soft: rgba(76, 195, 140, .14); --red: #FF7B6C; --red-soft: rgba(255, 123, 108, .13);
  --yellow: #EEC94E; --yellow-soft: rgba(238, 201, 78, .14); --yellow-ink: #F1D47A; --on-blue: #0E141A;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 14px 36px -14px rgba(0, 0, 0, .7), 0 2px 6px -2px rgba(0, 0, 0, .4);
  --shadow-3: 0 30px 80px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-optical-sizing: auto; font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0; }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--blue-soft); }
kbd { font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; background: var(--surface); line-height: 18px; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 560; cursor: pointer;
  white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn.primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); background: var(--red-soft); }
.btn.small { height: 32px; padding: 0 11px; font-size: 13.5px; border-radius: 8px; gap: 6px; }
.btn.small svg { width: 15px; height: 15px; }
.btn.large { height: 46px; padding: 0 20px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.on { color: var(--blue); }
.icon-btn.bordered { border-color: var(--line-2); background: var(--surface); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; min-height: 90px; }
.select { cursor: pointer; padding-right: 30px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2375828F' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 560; color: var(--ink-2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink-2); font-size: 13px; font-weight: 520; white-space: nowrap;
  border: 0; text-decoration: none;
}
button.chip, a.chip { cursor: pointer; }
button.chip:hover, a.chip:hover { background: var(--blue-soft); color: var(--blue-ink); }
.chip svg { width: 14px; height: 14px; }
.chip.blue { background: var(--blue-soft); color: var(--blue-ink); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 11px; }
.seg button { height: 32px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2);
  font-size: 14px; font-weight: 560; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.seg button svg { width: 16px; height: 16px; flex: none; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg .badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--blue); color: var(--on-blue);
  font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }

/* ---------------------------------------------------------------- app shell */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.app[data-loading] .view { opacity: 0; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 14px;
  padding: 16px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; z-index: 30;
}
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 4px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: #2148C0; }
.brand-name { font-size: 19px; font-weight: 720; letter-spacing: -.035em; }
.nav { display: grid; gap: 2px; }
.nav a, .side-link {
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 9px;
  text-decoration: none; color: var(--ink-2); font-weight: 540; font-size: 14.5px; transition: background .12s, color .12s;
}
.nav a svg, .side-link svg { width: 18px; height: 18px; flex: none; }
.nav a:hover, .side-link:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"], .side-link[aria-current="page"] { background: var(--blue-soft); color: var(--blue-ink); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--ink-3); }
.side-section { flex: 1; min-height: 0; }
.side-label { font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 6px 10px; }
.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.recent a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; text-decoration: none;
  font-size: 13.5px; color: var(--ink-2); }
.recent a:hover { background: var(--surface-2); color: var(--ink); }
.recent a[aria-current="page"] { background: var(--surface-3); color: var(--ink); }
.recent a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.recent li { min-width: 0; }
.recent svg { width: 15px; height: 15px; flex: none; color: var(--ink-3); }
.recent .pin svg { color: var(--blue); }
.recent .none { padding: 6px 10px; font-size: 13px; color: var(--ink-3); }
.side-bottom { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.side-bottom .side-link { flex: 1; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); margin-left: auto; }
.status-dot.ok { background: var(--green); }
.status-dot.off { background: var(--red); }
.scrim { position: fixed; inset: 0; background: rgba(8, 14, 20, .45); z-index: 25; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 10px;
  padding: 0 clamp(14px, 3vw, 28px); background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; overflow: hidden; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.crumb a { text-decoration: none; color: var(--ink-3); }
.crumb a:hover { color: var(--ink); }
.crumb .sep { color: var(--line-2); }
.crumb .here { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-btn {
  flex: none; display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 8px 0 12px; min-width: 240px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink-3);
  font-size: 14px; cursor: pointer; transition: border-color .15s;
}
.search-btn:hover { border-color: var(--ink-3); color: var(--ink-2); }
.search-btn svg { width: 16px; height: 16px; }
.search-btn kbd { margin-left: auto; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.view { flex: 1; min-width: 0; outline: none; transition: opacity .2s; }
.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: clamp(18px, 3vw, 34px) clamp(16px, 3vw, 32px) 80px; }
.page.wide { max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -.035em; }
.page-head p { color: var(--ink-2); margin-top: 6px; max-width: 62ch; }
.only-mobile { display: none; }

/* ---------------------------------------------------------------- panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-pad { padding: 18px 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.panel-head h2, .panel-head h3 { font-size: 16px; font-weight: 650; letter-spacing: -.015em; }
.panel-head a { font-size: 13.5px; color: var(--ink-3); text-decoration: none; font-weight: 560; }
.panel-head a:hover { color: var(--blue); }
.banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--yellow-soft); color: var(--ink); margin-bottom: 20px; border: 1px solid color-mix(in srgb, var(--yellow) 50%, transparent); }
.banner svg { width: 20px; height: 20px; color: var(--yellow-ink); flex: none; }
.banner p { flex: 1; min-width: 220px; font-size: 14.5px; }
.banner code { font-size: 13px; background: var(--surface); padding: 1px 6px; border-radius: 5px; }
.empty { text-align: center; padding: clamp(28px, 6vw, 56px) 20px; color: var(--ink-2); }
.empty h3 { font-size: 18px; font-weight: 650; color: var(--ink); margin-bottom: 6px; }
.empty p { max-width: 46ch; margin: 0 auto 16px; font-size: 14.5px; }
.empty .acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.empty svg.big { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--ink-3); }

/* ---------------------------------------------------------------- home: hero + capture board */
.hero { display: grid; gap: 22px; margin-bottom: 30px; }
.hero h1 { font-size: clamp(36px, 5.6vw, 68px); font-weight: 760; letter-spacing: -.05em; line-height: .98; max-width: 14ch; }
.hero .lede { font-size: clamp(16px, 1.5vw, 18.5px); color: var(--ink-2); max-width: 58ch; line-height: 1.45; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.board {
  position: relative; border-radius: 22px; padding: 10px;
  background: linear-gradient(180deg, #D3D9DF, #A9B2BB); box-shadow: var(--shadow-2);
}
:root[data-theme="dark"] .board { background: linear-gradient(180deg, #3A4652, #26303A); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .board { background: linear-gradient(180deg, #3A4652, #26303A); } }
.board::before, .board::after { /* magnets */
  content: ""; position: absolute; top: -7px; width: 22px; height: 22px; border-radius: 50%; z-index: 3;
  box-shadow: inset -3px -4px 0 rgba(0, 0, 0, .18), 0 4px 8px rgba(0, 0, 0, .25);
}
.board::before { left: 42px; background: #C93226; }
.board::after { right: 54px; background: #2148C0; }
.board-face {
  position: relative; border-radius: 14px; background: var(--surface); overflow: hidden;
  background-image: linear-gradient(115deg, transparent 0 62%, rgba(255, 255, 255, .55) 70%, transparent 78%);
}
:root[data-theme="dark"] .board-face { background-image: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .board-face { background-image: none; } }
.board-tray { height: 12px; margin: 8px 18% -2px; border-radius: 0 0 8px 8px; background: rgba(0, 0, 0, .14); display: flex; gap: 10px; justify-content: center; padding-top: 3px; }
.board-tray i { width: 54px; height: 6px; border-radius: 3px; background: var(--c); }
.cap-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px 0; }
.cap-body { padding: 16px 18px; min-height: 270px; }
.cap-foot { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px 18px 18px; border-top: 1px dashed var(--line-2); }
.cap-foot .field { flex: 1 1 200px; }
.cap-foot .field.lang { flex: 0 1 170px; }
.cap-foot .go { flex: 0 0 auto; }
.cap-note { width: 100%; font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.cap-note svg { width: 14px; height: 14px; }

.drop {
  position: relative; display: grid; place-items: center; text-align: center; gap: 10px; min-height: 238px;
  border: 2px dashed var(--line-2); border-radius: 14px; padding: 20px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-softer); }
.drop .hand { font-family: var(--hand); font-size: clamp(34px, 4.4vw, 48px); font-weight: 700; color: var(--blue); line-height: 1; transform: rotate(-2deg); }
.drop .hand-sub { color: var(--ink-2); font-size: 14.5px; }
.drop .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.drop .scribble { position: absolute; right: 8%; top: 18%; width: 120px; color: var(--red); opacity: .8; pointer-events: none; }
.thumbs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .rm { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(10, 16, 22, .7);
  color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb .rm svg { width: 14px; height: 14px; }
.thumb.add { display: grid; place-items: center; border-style: dashed; border-width: 2px; border-color: var(--line-2); color: var(--ink-2); cursor: pointer; background: transparent; font-size: 14px; font-weight: 560; }
.thumb.add:hover { border-color: var(--blue); color: var(--blue); }
.thumb.add svg { width: 22px; height: 22px; margin: 0 auto 4px; }

.rec { display: grid; justify-items: center; gap: 14px; padding: 18px 0 6px; text-align: center; }
.rec-btn { width: 88px; height: 88px; border-radius: 50%; border: 6px solid var(--red-soft); background: var(--red); color: #fff;
  display: grid; place-items: center; cursor: pointer; transition: transform .15s, box-shadow .2s; }
.rec-btn:hover { transform: scale(1.04); }
.rec-btn svg { width: 32px; height: 32px; }
.rec-btn.on { animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 45%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }
.rec-time { font-size: 28px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.meter { display: flex; align-items: center; gap: 3px; height: 36px; }
.meter i { width: 4px; border-radius: 2px; background: var(--red); height: var(--h, 4px); transition: height .08s; opacity: .85; }
.files-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.files-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.files-list li svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.files-list audio { height: 32px; flex: 1; min-width: 120px; }
.files-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

.processing { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(18px, 3vw, 36px); align-items: center; min-height: 270px; }
.proc-visual { position: relative; border-radius: 14px; overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; display: grid; place-items: center; }
.proc-visual img { width: 100%; height: 100%; object-fit: cover; }
.proc-visual .scan { position: absolute; inset: 0; pointer-events: none; }
.proc-visual .scan::before { content: ""; position: absolute; left: 0; right: 0; height: 24%;
  background: linear-gradient(to bottom, transparent, rgba(33, 72, 192, .14) 60%, rgba(33, 72, 192, .36));
  border-bottom: 3px solid #2148C0; box-shadow: 0 6px 18px -2px rgba(33, 72, 192, .5);
  animation: sweep 2.2s cubic-bezier(.45, .05, .55, .95) infinite alternate; }
@keyframes sweep { from { top: -24%; } to { top: 100%; } }
.proc-wave { display: flex; gap: 5px; align-items: center; height: 80px; }
.proc-wave i { width: 6px; border-radius: 3px; background: var(--blue); animation: wave 1.1s ease-in-out infinite; animation-delay: calc(var(--i) * -90ms); height: 18px; }
@keyframes wave { 50% { height: 70px; } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: clamp(17px, 1.8vw, 21px); letter-spacing: -.015em; font-weight: 560; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--line-2); transition: color .3s; }
.steps li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.steps li.now { color: var(--ink); }
.steps li.now::before { border-color: var(--blue); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps li.done { color: var(--ink-2); }
.steps li.done::before { background: var(--blue); border-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }
.proc-meta { margin-top: 18px; font-size: 14px; color: var(--ink-3); }

/* home lower */
.home-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: start; }
.meeting-rows { list-style: none; margin: 0; padding: 6px 8px 8px; }
.meeting-rows li + li { border-top: 1px solid var(--line); }
.mrow { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border-radius: 12px; text-decoration: none; }
.mrow:hover { background: var(--surface-2); }
.mrow .cover { width: 56px; height: 42px; border-radius: 8px; background: var(--surface-3); overflow: hidden; display: grid; place-items: center; color: var(--ink-3); }
.mrow .cover img { width: 100%; height: 100%; object-fit: cover; }
.mrow .cover svg { width: 20px; height: 20px; }
.mrow h3 { font-size: 15.5px; font-weight: 620; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow p { font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; margin-top: 2px; }
.mrow .side { text-align: right; font-size: 13px; color: var(--ink-3); display: grid; gap: 4px; justify-items: end; }
.ask-box { display: flex; gap: 8px; padding: 0 20px 20px; }
.ask-box .input { height: 44px; border-radius: 12px; }
.ask-box .btn { height: 44px; }
.todo-mini { list-style: none; margin: 0; padding: 6px 12px 12px; display: grid; gap: 2px; }
.todo-mini li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 9px 8px; border-radius: 10px; align-items: start; }
.todo-mini li:hover { background: var(--surface-2); }
.todo-mini .t { font-size: 14.5px; font-weight: 540; line-height: 1.35; }
.todo-mini .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }

/* ---------------------------------------------------------------- meetings library */
.lib-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.lib-tools .input { max-width: 380px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.mcard { display: flex; flex-direction: column; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.mcard:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.mcard .cover { aspect-ratio: 16 / 8; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); border-bottom: 1px solid var(--line); overflow: hidden; }
.mcard .cover img { width: 100%; height: 100%; object-fit: cover; }
.mcard .cover svg { width: 30px; height: 30px; }
.mcard .cover.sticky { background: var(--surface-2); }
.sticky-note { width: 46%; aspect-ratio: 1; max-height: 82%; background: #F6D44B; color: #2A2410; transform: rotate(-3deg); box-shadow: 0 10px 18px -10px rgba(0, 0, 0, .45);
  display: grid; align-content: center; gap: 2px; padding: 10px 12px; font-family: var(--hand); font-size: 21px; font-weight: 700; line-height: 1.05; text-align: left; }
.sticky-note.audio { background: #BFD3FF; transform: rotate(2deg); }
.sticky-note span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard:hover .sticky-note { transform: rotate(0deg); transition: transform .2s; }
.mcard .body { padding: 14px 16px 16px; display: grid; gap: 8px; flex: 1; }
.mcard h3 { font-size: 16px; font-weight: 640; display: flex; gap: 6px; align-items: center; }
.mcard h3 svg { width: 14px; height: 14px; color: var(--blue); flex: none; }
.mcard p { font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mcard .foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: auto; }

/* ---------------------------------------------------------------- meeting workspace */
.mt-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 392px; min-height: calc(100vh - var(--top)); }
.mt-wrap.no-dock { grid-template-columns: minmax(0, 1fr); }
.mt-main { min-width: 0; padding: clamp(16px, 2.6vw, 30px) clamp(16px, 3vw, 34px) 80px; }
.mt-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.mt-title { font-size: clamp(26px, 3.2vw, 38px); font-weight: 740; letter-spacing: -.04em; line-height: 1.05; outline: none; border-radius: 8px; padding: 2px 4px; margin: -2px -4px; cursor: text; }
.mt-title:hover { background: var(--surface-3); }
.mt-title:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--blue); }
.mt-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; color: var(--ink-3); font-size: 13.5px; }
.mt-meta .src { display: inline-flex; align-items: center; gap: 6px; }
.mt-meta .src svg { width: 15px; height: 15px; }
.mt-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 22px 0 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; height: 42px; padding: 0 14px; border: 0; background: none; cursor: pointer; color: var(--ink-3);
  font-size: 14.5px; font-weight: 580; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tabs button svg { width: 16px; height: 16px; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); }
.tabs .n { font-size: 12px; font-weight: 650; color: var(--ink-3); background: var(--surface-3); border-radius: 99px; padding: 0 7px; line-height: 19px; }

.ov-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(18px, 3vw, 32px); align-items: start; margin-bottom: 30px; }
.ov-top.solo { grid-template-columns: minmax(0, 1fr); }
.media .main-img { position: relative; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); cursor: zoom-in; }
.media .main-img img { width: 100%; max-height: 440px; object-fit: contain; background: #fff; }
.media .strip { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.media .strip button { width: 62px; height: 46px; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: #fff; }
.media .strip button[aria-current="true"] { border-color: var(--blue); }
.media .strip img { width: 100%; height: 100%; object-fit: cover; }
.media audio { width: 100%; margin-top: 10px; }
.summary-block h2 { font-size: 13.5px; font-weight: 620; color: var(--ink-3); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; letter-spacing: 0; }
.summary-block h2 svg { width: 16px; height: 16px; color: var(--blue); }
.summary-text { font-size: clamp(17px, 1.4vw, 19.5px); line-height: 1.45; letter-spacing: -.012em; border-left: 3px solid var(--blue); padding-left: 18px; max-width: 64ch; }
.topics { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.facts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 20px; }
.fact { display: grid; gap: 2px; }
.fact b { font-size: 22px; font-weight: 680; letter-spacing: -.03em; }
.fact span { font-size: 13px; color: var(--ink-3); }

.sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 34px; }
.sec h3 { font-size: 16.5px; font-weight: 660; display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.sec h3 .n { color: var(--ink-3); font-weight: 500; }
.sec h3 .edit { margin-left: auto; opacity: 0; transition: opacity .15s; }
.sec:hover h3 .edit, .sec h3 .edit:focus-visible { opacity: 1; }
@media (hover: none) { .sec h3 .edit { opacity: 1; } }
.mark { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.mark svg { width: 14px; height: 14px; }
.mark.green { background: var(--green-soft); color: var(--green); }
.mark.yellow { background: var(--yellow); color: #3B3002; }
.mark.red { background: var(--red-soft); color: var(--red); }
.mark.blue { background: var(--blue-soft); color: var(--blue); }
.items { list-style: none; margin: 0; padding: 0; }
.items li { padding: 9px 0 9px 31px; position: relative; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.items li:first-child { border-top: 0; }
.items li::before { content: ""; position: absolute; left: 9px; top: 17px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
.items.green li::before { background: var(--green); }
.items.red li::before { background: var(--red); }
.items.yellow li { background: linear-gradient(90deg, var(--yellow-soft), transparent 75%); border-top-color: transparent; border-radius: 8px; margin-bottom: 4px; }
.items.yellow li::before { background: var(--yellow-ink); }
.items .none { color: var(--ink-3); padding-left: 0; }
.items .none::before { display: none; }
.sec-edit { display: grid; gap: 8px; }
.sec-edit .row { display: flex; gap: 8px; justify-content: flex-end; }

/* tasks inside a meeting */
.tlist { display: grid; gap: 8px; }
.trow { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "c t d" ". m m"; gap: 4px 10px; align-items: center;
  padding: 10px 10px 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.trow > .check, .trow > .plus { grid-area: c; }
.trow > .ttext { grid-area: t; }
.trow > .del { grid-area: d; }
.trow .tmeta { grid-area: m; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trow .mini { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.trow .mini span { font-size: 12px; color: var(--ink-3); padding: 0 6px 0 9px; font-weight: 560; }
.trow .mini .input, .trow .mini .select { height: 30px; border: 0; border-radius: 0; background-color: transparent; font-size: 13.5px; padding-left: 4px; width: 128px; box-shadow: none; }
.trow .mini .select { width: 104px; }
.trow .mini:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.trow .due { font-size: 13px; color: var(--ink-3); }
.trow.done .ttext { text-decoration: line-through; color: var(--ink-3); }
.check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line-2); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .15s, border-color .15s; }
.check svg { width: 14px; height: 14px; color: #fff; opacity: 0; }
.check[aria-checked="true"] { background: var(--green); border-color: var(--green); }
.check[aria-checked="true"] svg { opacity: 1; }
.ttext { border: 0; background: transparent; padding: 6px 6px; border-radius: 7px; width: 100%; font-size: 15px; font-weight: 540; }
.ttext:hover { background: var(--surface-2); }
.ttext:focus { outline: none; background: var(--surface-2); box-shadow: 0 0 0 2px var(--blue-soft); }
.trow.add { background: transparent; border-style: dashed; }
.trow.add .plus { color: var(--ink-3); width: 18px; height: 18px; margin-left: 2px; }
.pri { display: inline-flex; align-items: center; gap: 6px; }
.pri::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-3)); }
.pri.high { --c: var(--red); } .pri.medium { --c: var(--blue); } .pri.low { --c: var(--ink-3); }

/* diagram */
.diagram-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; overflow: auto; min-height: 200px; display: grid; place-items: center; }
.diagram-wrap svg { max-width: 100%; height: auto; }
.diagram-wrap pre { margin: 0; white-space: pre-wrap; font-size: 13px; color: var(--ink-2); }
.diagram-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 22px; }
.code-edit { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; min-height: 180px; }

/* transcript */
.transcript { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; white-space: pre-wrap; font-size: 15px; line-height: 1.65; max-height: 70vh; overflow: auto; }

/* AI studio */
.studio { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.acts-list { display: grid; gap: 6px; }
.act { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.act:hover { border-color: var(--blue); }
.act[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-softer); }
.act .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; }
.act .ic svg { width: 17px; height: 17px; }
.act b { display: block; font-size: 14.5px; font-weight: 620; }
.act span { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.custom-act { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.custom-act .textarea { min-height: 70px; font-size: 14px; }
.out-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-height: 360px; display: flex; flex-direction: column; }
.out-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.out-head h3 { font-size: 15px; font-weight: 640; flex: 1; }
.out-body { padding: 20px 22px; flex: 1; }
.history { margin-top: 16px; }
.history h4 { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }
.history button { display: flex; width: 100%; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 7px 4px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); text-align: left; }
.history button:hover { background: var(--surface-2); color: var(--ink); }

/* ---------------------------------------------------------------- chat */
.dock { position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.dock-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.dock-head h2 { font-size: 15px; font-weight: 650; flex: 1; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.dock-head h2 svg { width: 18px; height: 18px; color: var(--blue); }
.chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
.msg { display: grid; gap: 8px; max-width: 100%; }
.msg.user { justify-items: end; }
.msg.user .bubble { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 16px 16px 4px 16px; max-width: 88%; white-space: pre-wrap; font-size: 14.5px; }
.msg.ai { grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; }
.msg.ai .av { width: 26px; height: 26px; color: #2148C0; margin-top: 1px; }
.msg.ai .content { min-width: 0; font-size: 14.5px; }
.msg.ai .tools { display: flex; gap: 2px; margin-top: 6px; opacity: .0; transition: opacity .15s; }
.msg.ai:hover .tools, .msg.ai .tools:focus-within { opacity: 1; }
@media (hover: none) { .msg.ai .tools { opacity: 1; } }
.msg.ai .tools .icon-btn { width: 28px; height: 28px; }
.msg.ai .tools .icon-btn svg { width: 15px; height: 15px; }
.msg .err { color: var(--red); font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.msg .err svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.sources { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.sources a { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; height: 26px; padding: 0 9px 0 4px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; font-size: 12.5px; color: var(--ink-2); }
.sources a:hover { border-color: var(--blue); color: var(--blue-ink); }
.sources a b { flex: none; font-size: 11px; font-weight: 700; background: var(--blue-soft); color: var(--blue-ink); border-radius: 99px; padding: 0 6px; line-height: 18px; }
.sources a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-left: 3px; vertical-align: middle; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.thinking { display: inline-flex; gap: 4px; padding: 6px 0; }
.thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); animation: bounce 1.2s infinite; animation-delay: calc(var(--i) * .15s); opacity: .7; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-5px); opacity: 1; } }
.suggest { display: grid; gap: 8px; padding: 6px 0; }
.suggest button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; cursor: pointer; font-size: 14px; color: var(--ink-2); transition: border-color .15s, color .15s; }
.suggest button:hover { border-color: var(--blue); color: var(--ink); }
.chat-intro { padding: 4px 2px 6px; }
.chat-intro h3 { font-size: 17px; font-weight: 650; margin-bottom: 4px; }
.chat-intro p { font-size: 14px; color: var(--ink-2); }
.composer { padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.composer-box { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line-2); border-radius: 14px; padding: 6px 6px 6px 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; max-height: 180px; min-height: 24px; padding: 6px 0; font-size: 14.5px; line-height: 1.45; outline: none; }
.send { width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--blue); color: var(--on-blue); display: grid; place-items: center; cursor: pointer; flex: none; }
.send svg { width: 17px; height: 17px; }
.send[disabled] { opacity: .35; cursor: default; }
.send.stop { background: var(--ink); color: var(--bg); }
.composer small { display: block; font-size: 12px; color: var(--ink-3); margin: 6px 4px 0; }

/* Ask page */
.ask { display: grid; grid-template-columns: 270px minmax(0, 1fr); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); }
.ask-side { border-right: 1px solid var(--line); padding: 14px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.chat-list li { position: relative; }
.chat-list a { display: block; padding: 8px 34px 8px 10px; border-radius: 9px; text-decoration: none; font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list a:hover { background: var(--surface-2); color: var(--ink); }
.chat-list a[aria-current="page"] { background: var(--surface-3); color: var(--ink); }
.chat-list .del { position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; opacity: 0; }
.chat-list li:hover .del, .chat-list .del:focus-visible { opacity: 1; }
.ask-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ask-main .msgs { padding: 28px max(16px, calc((100% - 780px) / 2)) 12px; }
.ask-main .composer { padding: 12px max(16px, calc((100% - 780px) / 2)) 18px; border-top: 0; background: transparent; }
.ask-main .composer-box { border-radius: 16px; padding: 8px 8px 8px 14px; box-shadow: var(--shadow-2); }
.ask-hero { margin: auto 0; display: grid; gap: 18px; justify-items: start; padding: 20px 0; }
.ask-hero svg.mk { width: 44px; height: 44px; color: #2148C0; }
.ask-hero h1 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 740; letter-spacing: -.045em; line-height: 1.05; }
.ask-hero p { color: var(--ink-2); max-width: 56ch; }
.ask-hero .suggest { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }

/* markdown */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md table, .md pre, .md blockquote { margin: 0 0 10px; }
.md h1, .md h2, .md h3, .md h4 { margin: 18px 0 8px; font-weight: 680; }
.md h1 { font-size: 1.45em; } .md h2 { font-size: 1.25em; } .md h3 { font-size: 1.08em; } .md h4 { font-size: 1em; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 3px 0; }
.md li.task { list-style: none; margin-left: -20px; display: flex; gap: 8px; }
.md li.task::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--line-2); border-radius: 4px; margin-top: 4px; flex: none; }
.md li.task.done::before { background: var(--green); border-color: var(--green); }
.md code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; position: relative; }
.md pre code { background: none; padding: 0; font-size: 12.5px; line-height: 1.55; }
.md blockquote { border-left: 3px solid var(--line-2); padding-left: 12px; color: var(--ink-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.md a { color: var(--blue-ink); text-underline-offset: 2px; }
.md strong { font-weight: 680; }
.md .tbl { overflow-x: auto; margin: 0 0 10px; border: 1px solid var(--line); border-radius: 10px; }
.md table { border-collapse: collapse; width: 100%; font-size: .94em; margin: 0; }
.md th, .md td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 640; }
.md tr:last-child td { border-bottom: 0; }
.md a.cite { display: inline-block; text-decoration: none; font-size: 11px; font-weight: 700; line-height: 17px; padding: 0 6px; border-radius: 99px; background: var(--blue-soft); color: var(--blue-ink); vertical-align: 1px; }
.md a.cite:hover { background: var(--blue); color: var(--on-blue); }
.md .mermaid-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); margin: 0 0 10px; overflow-x: auto; }
.md .mermaid-box .mm-acts { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.action-card { border: 1px solid var(--blue); background: var(--blue-softer); border-radius: 12px; padding: 12px 14px; margin: 4px 0 10px; display: grid; gap: 10px; }
.action-card h4 { margin: 0; font-size: 14px; font-weight: 650; display: flex; gap: 8px; align-items: center; }
.action-card h4 svg { width: 16px; height: 16px; color: var(--blue); }
.action-card ul { margin: 0; padding-left: 18px; font-size: 14px; }
.action-card .row { display: flex; gap: 8px; align-items: center; }
.action-card.applied { border-color: var(--green); background: var(--green-soft); }

/* ---------------------------------------------------------------- task board */
.board-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.board-tools .input { max-width: 300px; }
.board-tools .select { width: auto; min-width: 150px; max-width: 240px; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; min-height: 240px; transition: background .15s, border-color .15s; }
.col.over { border-color: var(--blue); background: var(--blue-softer); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.col-head h2 { font-size: 15px; font-weight: 650; }
.col-head .n { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.col-head .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.cards { display: grid; gap: 8px; min-height: 40px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px 10px 15px; cursor: grab; box-shadow: var(--shadow-1); transition: box-shadow .15s, transform .15s, opacity .15s; }
.card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c, var(--line-2)); }
.card.high { --c: var(--red); } .card.medium { --c: var(--blue); } .card.low { --c: var(--line-2); }
.card:hover { box-shadow: var(--shadow-2); }
.card.dragging { opacity: .45; }
.card .t { font-size: 14.5px; font-weight: 560; line-height: 1.38; padding-right: 26px; }
.col[data-status="done"] .card .t { text-decoration: line-through; color: var(--ink-3); }
.card .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; font-size: 12.5px; color: var(--ink-3); }
.card .meta a { color: var(--ink-3); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.card .meta a:hover { color: var(--blue); }
.card .menu-btn { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; }
.due { display: inline-flex; align-items: center; gap: 4px; }
.due svg { width: 13px; height: 13px; }
.due.late { color: var(--red); font-weight: 620; }
.due.soon { color: var(--ink); font-weight: 600; }
.avatar { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; background: hsl(var(--h, 220) 52% 46%); flex: none; }
.who { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.col .add-card { width: 100%; justify-content: flex-start; margin-top: 8px; color: var(--ink-3); }

/* ---------------------------------------------------------------- insights */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 20px; }
.stat { padding: 18px 20px; display: grid; gap: 4px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .label { font-size: 13.5px; color: var(--ink-2); font-weight: 540; display: flex; align-items: center; gap: 6px; }
.stat .label svg { width: 15px; height: 15px; }
.stat .value { font-size: 32px; font-weight: 680; letter-spacing: -.03em; line-height: 1.1; }
.stat .sub { font-size: 13px; color: var(--ink-3); }
.stat.alert .label svg { color: var(--red); }
.ins-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.chart-panel { padding: 18px 20px 20px; }
.chart-panel h2 { font-size: 16px; font-weight: 650; }
.chart-panel .desc { font-size: 13.5px; color: var(--ink-3); margin: 2px 0 16px; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 130px; gap: 12px; align-items: center; font-size: 14px; }
.hbar .name { display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink); }
.hbar .track { height: 18px; position: relative; }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); border-radius: 0 4px 4px 0; min-width: 3px; }
.hbar .val { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; display: flex; gap: 8px; align-items: center; }
.hbar .val .late { color: var(--red); display: inline-flex; gap: 3px; align-items: center; }
.hbar .val .late svg { width: 13px; height: 13px; }
.cols-chart { position: relative; }
.cols-chart svg { width: 100%; height: 200px; overflow: visible; }
.cols-chart .axis text { font-size: 11.5px; fill: var(--ink-3); font-family: var(--font); }
.cols-chart .grid line { stroke: var(--line); stroke-width: 1; }
.cols-chart rect.bar { fill: var(--blue); }
.cols-chart rect.hit { fill: transparent; cursor: default; }
.cols-chart rect.hit:hover + rect.bar, .cols-chart g.col-g:hover rect.bar { fill: var(--blue-ink); }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); z-index: 5; box-shadow: var(--shadow-2); }
.segbar { display: flex; gap: 2px; height: 22px; margin: 4px 0 12px; }
.segbar i { height: 100%; background: var(--c); min-width: 4px; }
.segbar i:first-child { border-radius: 4px 0 0 4px; }
.segbar i:last-child { border-radius: 0 4px 4px 0; }
.segbar i:only-child { border-radius: 4px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.legend b { color: var(--ink); font-weight: 640; }
.topic-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-cloud .chip { height: auto; padding: 5px 12px; font-size: calc(12.5px + var(--w, 0) * 1px); }
.topic-cloud .chip b { font-weight: 700; color: var(--ink-3); margin-left: 2px; }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.log li:first-child { border-top: 0; }
.log svg { width: 18px; height: 18px; color: var(--green); margin-top: 1px; }
.log li.late svg { color: var(--red); }
.log small { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.log small a { color: inherit; }
.table-toggle { margin-top: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 10px; }
.data-table th, .data-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- settings */
.settings { display: grid; gap: 18px; max-width: 880px; }
.set-sec { padding: 20px 22px; }
.set-sec h2 { font-size: 17px; font-weight: 660; margin-bottom: 4px; }
.set-sec > p { color: var(--ink-2); font-size: 14px; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 0; font-size: 14.5px; border-top: 1px solid var(--line); }
.kv > * { padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv code { font-size: 13px; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
.feat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; }
.feat:first-of-type { border-top: 0; }
.feat b { font-weight: 620; }
.feat p { grid-column: 1; font-size: 13.5px; color: var(--ink-3); }
.feat .chip { grid-row: 1 / span 2; grid-column: 2; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 99px; font-size: 13.5px; font-weight: 600; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.off { background: var(--red-soft); color: var(--red); }
.codeblock { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; white-space: pre; overflow-x: auto; line-height: 1.6; }
.shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; font-size: 14px; }
.shortcuts div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.shortcuts kbd + kbd { margin-left: 4px; }

/* ---------------------------------------------------------------- share + login */
.share-top { display: flex; align-items: center; gap: 12px; padding: 16px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line); background: var(--surface); }
.share-top .brand-name { font-size: 17px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); padding: 28px; display: grid; gap: 16px; }
.login-card .brand { margin-bottom: 6px; }
.login-card h1 { font-size: 24px; font-weight: 700; }
.login-card .err { color: var(--red); font-size: 14px; }

/* ---------------------------------------------------------------- overlays */
.palette-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(8, 14, 20, .42); display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.palette { width: min(640px, 100%); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-3); overflow: hidden; border: 1px solid var(--line); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.palette-input svg { width: 18px; height: 18px; color: var(--ink-3); }
.palette-input input { flex: 1; height: 54px; border: 0; background: transparent; font-size: 16px; outline: none; }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: 56vh; overflow-y: auto; }
.palette-list .grp { font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 8px 10px 4px; }
.palette-list .opt { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-size: 14.5px; }
.palette-list .opt svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.palette-list .opt .sub { margin-left: auto; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.palette-list .opt span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-list .opt[aria-selected="true"] { background: var(--blue-soft); }
.palette-list .opt[aria-selected="true"] svg { color: var(--blue); }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(8, 14, 20, .5); }
.modal { border: 1px solid var(--line); border-radius: 18px; padding: 0; background: var(--surface); width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-3); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal-head h2 { font-size: 18px; font-weight: 680; flex: 1; }
.modal-body { padding: 8px 20px 20px; display: grid; gap: 14px; }
.modal-body p { color: var(--ink-2); font-size: 14.5px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.copy-row { display: flex; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.viewer { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.viewer img { max-width: 96vw; max-height: 92vh; border-radius: 12px; background: #fff; }
.viewer .icon-btn { position: absolute; top: 10px; right: 10px; background: var(--surface); }

.menu { position: fixed; z-index: 80; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); padding: 6px; animation: fade .1s; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 14px; text-decoration: none; color: var(--ink); text-align: left; }
.menu button:hover, .menu a:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu svg { width: 16px; height: 16px; color: var(--ink-3); }
.menu .danger { color: var(--red); }
.menu .danger svg { color: var(--red); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 90; transform: translate(-50%, calc(100% + 40px)); visibility: hidden;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s; background: var(--ink); color: var(--bg);
  border-radius: 14px; padding: 12px 16px; width: max-content; max-width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow-3); font-size: 14.5px; font-weight: 540; }
.toast.on { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
.toast small { display: block; opacity: .75; font-size: 13px; font-weight: 450; margin-top: 2px; }
.toast small:empty { display: none; }
.toast.error { background: var(--red); color: #fff; }
.drop-overlay { position: fixed; inset: 0; z-index: 60; pointer-events: none; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(6px); opacity: 0; transition: opacity .15s; }
.drop-overlay.on { opacity: 1; }
.drop-overlay div { border: 3px dashed var(--blue); border-radius: 26px; padding: 44px 60px; font-family: var(--hand); font-size: clamp(34px, 5vw, 52px); font-weight: 700; color: var(--blue); text-align: center; }
.drop-overlay span { display: block; font-family: var(--font); font-size: 15px; font-weight: 450; color: var(--ink-2); margin-top: 6px; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.fab { position: fixed; right: 18px; bottom: 18px; z-index: 22; display: none; height: 50px; padding: 0 18px; border-radius: 99px; box-shadow: var(--shadow-3); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .mt-wrap { grid-template-columns: minmax(0, 1fr); }
  .mt-wrap .dock { position: fixed; top: 0; right: 0; bottom: 0; height: auto; width: min(420px, 100vw); z-index: 40; transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-3); }
  .mt-wrap.dock-open .dock { transform: none; }
  .fab { display: inline-flex; }
}
@media (max-width: 1080px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .studio { grid-template-columns: minmax(0, 1fr); }
  .acts-list { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .ins-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-3); }
  .app.side-open .sidebar { transform: none; }
  .only-mobile { display: inline-grid; }
  .search-btn { min-width: 0; padding: 0 10px; }
  .search-btn span, .search-btn kbd { display: none; }
  .ov-top { grid-template-columns: minmax(0, 1fr); }
  .sections { grid-template-columns: minmax(0, 1fr); }
  .processing { grid-template-columns: minmax(0, 1fr); }
  .proc-visual { max-height: 220px; }
  .ask { grid-template-columns: minmax(0, 1fr); }
  .ask-side { display: none; }
  .ask-hero .suggest { grid-template-columns: minmax(0, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .kanban { grid-template-columns: repeat(3, minmax(260px, 86vw)); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { padding-bottom: 0; border-bottom: 0; }
  .shortcuts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .page { padding-top: 16px; }
  .trow .mini .input { width: 104px; }
  .mrow { grid-template-columns: 48px minmax(0, 1fr); }
  .mrow .side { display: none; }
  .cap-foot .field, .cap-foot .field.lang { flex: 1 1 100%; }
  .cap-foot .go { width: 100%; }
  .cap-foot .go .btn { width: 100%; }
  .hbar { grid-template-columns: 84px minmax(0, 1fr) 112px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .board::after { right: 26px; } .board::before { left: 26px; }
  .drop .scribble { display: none; }
  .mt-acts .label-text { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .dock, .tabs, .mt-acts, .fab, .toast, .composer, .diagram-tools, .no-print { display: none !important; }
  .app, .mt-wrap { display: block; }
  body { background: #fff; }
  .mt-main { padding: 0; }
  .sec h3 .edit { display: none; }
  [data-print-all] [hidden] { display: block !important; }
}
.app:has(> .sidebar[hidden]) { grid-template-columns: minmax(0, 1fr); }
.todo-mini .meta { font-size: 13px; color: var(--ink-3); align-items: center; }
.close-dock { display: none; }
@media (max-width: 1280px) { .close-dock { display: inline-grid; } }
@media (min-width: 901px) { .mobile-only-btn { display: none; } }
.field .seg { justify-self: start; }
@media (max-width: 640px) {
  .cap-top .seg { width: 100%; }
  .cap-top .seg button { flex: 1; justify-content: center; padding: 0 8px; }
  .cap-top .seg button svg { display: none; }
}

@media (max-width: 900px) { #topActions .only-dock-toggle { display: none !important; } }
