/* The worker's screen. One dark theme (the system map's family): calm, typography-led.
   One accent (mint) for what is active, amber only for the assistant's passage. Every colour is a token here.
   Nothing a person must read is darker than --ink-3 (0.8 lightness). */
:root {
  --bg: oklch(0.145 0.012 178);            /* page */
  --side: oklch(0.185 0.014 178);          /* sidebar, summary panel: one step raised */
  --surface: oklch(0.185 0.014 178);       /* inputs */
  --raised: oklch(0.235 0.016 178);        /* popovers, the user's question, the original-word popup */
  --hover: oklch(0.215 0.015 178);
  --side-on: oklch(0.265 0.018 178);
  --line: oklch(0.42 0.02 178 / 0.42);
  --line-2: oklch(0.58 0.02 178 / 0.55);
  --ink: oklch(0.965 0.008 165);           /* text */
  --ink-2: oklch(0.88 0.012 170);
  --ink-3: oklch(0.8 0.016 172);           /* muted: the floor for anything a person reads */
  --accent: oklch(0.875 0.145 163);        /* mint */
  --accent-hover: oklch(0.93 0.11 163);
  --accent-ink: oklch(0.875 0.145 163);    /* mint used as text */
  --on-accent: oklch(0.17 0.03 170);       /* dark text on filled mint */
  /* tints are opaque mixes: neighbouring highlighted words overlap without darker seams */
  --tint: color-mix(in srgb, var(--accent) 16%, var(--bg));
  --tint-2: color-mix(in srgb, var(--accent) 30%, var(--bg));  /* the lit word */
  --amber: oklch(0.865 0.15 86);
  --amber-tint: color-mix(in srgb, var(--amber) 20%, var(--bg));
  --amber-ink: oklch(0.865 0.15 86);
  --qbg: oklch(0.235 0.016 178);
  --wave: oklch(0.5 0.022 176);            /* unplayed bars */
  --scrim: oklch(0.08 0.01 178 / 0.62);
  --sel: oklch(0.875 0.145 163 / 0.32);
  --scroll: oklch(0.36 0.018 178);
  /* paper, for documents (a page inside the dark UI, like a PDF viewer) */
  --stage: oklch(0.12 0.01 178);
  --paper: oklch(0.972 0.005 95);
  --paper-scan: oklch(0.93 0.028 82);
  --paper-ink: oklch(0.25 0.012 250);
  --paper-mute: oklch(0.46 0.01 250);
  --paper-line: oklch(0.84 0.008 95);
  --paper-mark: oklch(0.9 0.115 92);
  --paper-mark-ink: oklch(0.38 0.08 70);
  --stamp: oklch(0.47 0.17 285);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --side-w: 268px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { scrollbar-color: var(--scroll) transparent; }
* { scrollbar-color: var(--scroll) transparent; }
::selection { background: var(--sel); color: var(--ink); }
body {
  font-family: "Figtree", system-ui, sans-serif;
  font-size: 16.5px; line-height: 1.55; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ic svg { width: 100%; height: 100%; }
.mark { display: inline-flex; width: 28px; height: 28px; color: var(--accent); flex: none; }
.mark svg { width: 100%; height: 100%; }
.mark--lg { width: 52px; height: 52px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.topbar { display: none; }
.scrim { display: none; }
.side {
  background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 12px 12px; min-height: 0; overflow: hidden;
}
.main { min-width: 0; height: 100vh; height: 100dvh; overflow-y: auto; position: relative; scroll-behavior: auto; }
.main--assistant { overflow: hidden; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15.5px; text-decoration: none; letter-spacing: -0.005em; min-width: 0; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 14px; }
.icon-btn.side-close { display: none; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2); transition: background-color .18s var(--ease), color .18s var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }

.new-chat, .nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-size: 15px;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.new-chat { color: var(--ink); font-weight: 550; margin-bottom: 6px; }
.new-chat:hover, .nav-item:hover { background: var(--hover); color: var(--ink); }
.nav { display: grid; gap: 2px; }
.nav-item.is-on { background: var(--side-on); color: var(--ink); font-weight: 550; }
.nav-item.is-on .ic { color: var(--accent-ink); }

.side-label { font-size: 12.5px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.01em; margin: 0; }
.recent { margin-top: 22px; min-height: 0; display: flex; flex-direction: column; flex: 1; }
.recent > .side-label { padding: 0 10px 6px; }
.recent-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; }
.recent-item {
  display: block; padding: 7px 10px; border-radius: 9px; font-size: 14.5px; color: var(--ink-2); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background-color .18s var(--ease);
}
.recent-item:hover { background: var(--hover); color: var(--ink); }
.recent-item.is-on { background: var(--side-on); color: var(--ink); }
.recent-empty { font-size: 14px; color: var(--ink-3); margin: 2px 10px; }

.side-foot { position: relative; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.person {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 12px; text-align: left;
  transition: background-color .18s var(--ease);
}
.person:hover, .person[aria-expanded="true"] { background: var(--hover); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--tint); color: var(--accent-ink); font-size: 12.5px; font-weight: 650; letter-spacing: 0.02em;
}
.avatar--sm { width: 30px; height: 30px; font-size: 11.5px; }
.person-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.person-name { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-role { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-chev { color: var(--ink-3); width: 16px; height: 16px; }

.menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); background: var(--raised);
  border: 1px solid var(--line); border-radius: 14px; padding: 6px; z-index: 30;
  animation: pop .16s var(--ease);
}
.menu-label { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 8px 10px 6px; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; text-align: left;
  font-size: 14.5px; color: var(--ink-2); transition: background-color .15s var(--ease);
}
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.menu-seat.is-on { color: var(--ink); }
.menu-check { color: var(--accent); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.side > .foot--side { display: none; }
.foot { font-size: 12.5px; line-height: 1.55; color: var(--ink-3); margin: 56px 0 0; max-width: 680px; }

/* ---------- buttons, badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; font-weight: 600;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--on-accent); height: 50px; padding: 0 24px; font-size: 16px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary.is-busy { cursor: default; background: var(--accent-hover); }
.btn-wide { width: 100%; }
.btn-outline { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); height: 38px; padding: 0 16px 0 13px; font-size: 14.5px; font-weight: 550; }
.btn-outline .ic { width: 17px; height: 17px; color: var(--accent); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-ink); }
.link-btn { font-size: 14px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); transition: color .18s var(--ease); }
.link-btn:hover { color: var(--ink); text-decoration-color: currentColor; }

.badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 550; white-space: nowrap;
  padding: 3px 11px 3px 9px; border-radius: 999px; color: var(--ink-2); line-height: 1.5;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); display: inline-block; }
.badge--new .dot { background: var(--accent); }
.badge--new { border: 1px solid var(--line); padding: 2px 10px 2px 8px; }
.badge--edited { background: var(--raised); color: var(--ink-2); }
.badge--checked { background: var(--tint); color: var(--accent-ink); }
.badge--checked .ic { width: 15px; height: 15px; }
.badge--lg { font-size: 14px; padding: 7px 14px 7px 11px; }

.spin {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .75s linear infinite;
}
.spin--light { border-color: oklch(0.17 0.03 170 / 0.3); border-top-color: var(--on-accent); width: 16px; height: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px 24px; }
.signin-box { width: min(400px, 100%); text-align: center; margin: auto 0; animation: rise .4s var(--ease); }
.eyebrow { margin: 22px 0 6px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.signin-title { font-size: 34px; font-weight: 600; letter-spacing: -0.022em; line-height: 1.15; margin: 0; }
.signin-lead { font-size: 16.5px; color: var(--ink-2); margin: 12px 0 30px; }
.signin-note { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13.5px; color: var(--ink-3); margin: 18px 0 0; }
.signin-note .ic { width: 15px; height: 15px; }
.foot--signin { text-align: center; margin: 40px auto 0; max-width: 620px; font-size: 12px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- assistant ---------- */
.chat { height: 100%; display: flex; flex-direction: column; }
.thread { flex: 1; overflow-y: auto; min-height: 0; }
.thread-inner { max-width: 768px; margin: 0 auto; padding: 48px 24px 24px; }
.chat.is-empty .thread-inner { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding-top: 32px; }

.hello { animation: rise .35s var(--ease); }
.hello-title { font-size: clamp(32px, 3.4vw, 44px); font-weight: 300; letter-spacing: -0.025em; line-height: 1.12; margin: 0; }
.hello-lead { font-size: 17px; color: var(--ink-2); margin: 10px 0 34px; }
.suggest-label { padding: 0 14px 8px; }
.suggest { list-style: none; margin: 0; padding: 0; }
.suggest li + li { border-top: 1px solid var(--line); }
.suggest-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left;
  padding: 12px 14px; border-radius: 12px; font-size: 15.5px; color: var(--ink-2); line-height: 1.4;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.suggest-item:hover { background: var(--hover); color: var(--ink); }
.suggest-go { width: 16px; height: 16px; color: var(--accent); opacity: 0; transform: translateX(-4px); transition: opacity .18s var(--ease), transform .18s var(--ease); }
.suggest-item:hover .suggest-go, .suggest-item:focus-visible .suggest-go { opacity: 1; transform: none; }
.suggest--inline { margin: 4px 0 0 -14px; }

.q-row { display: flex; justify-content: flex-end; margin: 8px 0 22px; animation: rise .25s var(--ease); }
.q { background: var(--qbg); border-radius: 22px; padding: 11px 19px; max-width: min(82%, 600px); font-size: 16.5px; line-height: 1.5; white-space: pre-wrap; }
.a { margin: 0 0 44px; }
.steps-run { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 7px; }
.step-run { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--ink-3); animation: rise .25s var(--ease); }
.step-run.is-done { color: var(--ink-3); }
.step-ic { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.step-ic .ic { width: 16px; height: 16px; color: var(--accent); }
.a-body p { font-size: 17px; line-height: 1.72; margin: 0 0 14px; }
.a-body p:last-child { margin-bottom: 0; }
.cite {
  display: inline-flex; align-items: center; justify-content: center; min-width: 21px; height: 21px; padding: 0 6px;
  border-radius: 11px; background: var(--tint); color: var(--accent-ink); font-size: 12px; font-weight: 650;
  vertical-align: 2px; margin: 0 1px 0 5px; font-variant-numeric: tabular-nums; animation: fade .2s var(--ease);
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.cite:hover { background: var(--accent); color: var(--on-accent); }
.nowrap { white-space: nowrap; }
.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; background: var(--ink); vertical-align: -2px; border-radius: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.srcs-wrap { margin-top: 26px; animation: rise .3s var(--ease); }
.srcs-wrap .side-label { margin-bottom: 8px; }
.srcs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.src {
  width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 14px; align-items: start; text-align: left;
  padding: 14px 10px 14px 4px; border-bottom: 1px solid var(--line); transition: background-color .18s var(--ease);
}
.src:hover { background: var(--hover); }
.src:focus-visible { border-radius: 10px; }
.src-n {
  width: 22px; height: 22px; border-radius: 50%; background: var(--tint); color: var(--accent-ink); font-size: 12px; font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; justify-self: center;
}
.src-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.src-meta { font-size: 13.5px; color: var(--ink-3); font-weight: 500; }
.src-quote { font-size: 15.5px; line-height: 1.5; color: var(--ink); }
.src-go { display: inline-flex; align-items: center; gap: 10px; padding-top: 1px; }
.src-time { font-size: 13.5px; color: var(--ink-3); }
.src-play {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--tint); color: var(--accent-ink); transition: background-color .18s var(--ease), color .18s var(--ease);
}
.src-play .ic { width: 14px; height: 14px; margin-left: 2px; }
.src:hover .src-play { background: var(--accent); color: var(--on-accent); }
.audit { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); margin: 18px 0 0; animation: fade .3s var(--ease); }
.audit .ic { width: 15px; height: 15px; }

.composer-wrap { padding: 8px 24px 14px; max-width: 816px; width: 100%; margin: 0 auto; }
.composer {
  display: flex; align-items: flex-end; gap: 10px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 28px; padding: 8px 8px 8px 22px; transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.composer:focus-within { border-color: var(--accent); }
.composer-input {
  flex: 1; border: 0; background: transparent; resize: none; font-size: 16.5px; line-height: 1.5; padding: 8px 0;
  max-height: 200px; outline: none; min-height: 40px;
}
.composer-input::placeholder { color: var(--ink-3); }
.send {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center;
  flex: none; transition: background-color .18s var(--ease), opacity .18s var(--ease);
}
.send:hover:not(:disabled) { background: var(--accent-hover); }
.send:disabled { background: var(--raised); color: var(--ink-3); cursor: default; }
.send .ic { width: 19px; height: 19px; }
.foot--chat { text-align: center; margin: 10px auto 0; font-size: 12px; max-width: 640px; }

/* ---------- pages ---------- */
.page { max-width: 980px; margin: 0 auto; padding: 52px 44px 36px; animation: rise .3s var(--ease); }
.page-head h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.018em; margin: 0; line-height: 1.2; }
.lead { font-size: 16.5px; color: var(--ink-2); margin: 8px 0 0; max-width: 620px; }
.lead--wide { max-width: 720px; }

.search {
  display: flex; align-items: center; gap: 10px; max-width: 440px; height: 46px; margin-top: 28px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; color: var(--ink-3);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.search:focus-within { border-color: var(--accent); }
.search-input { flex: 1; border: 0; background: transparent; outline: none; font-size: 15.5px; color: var(--ink); min-width: 0; }
.search-input::placeholder { color: var(--ink-3); }

.mlist { margin-top: 24px; }
.mrow {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) 96px 172px; gap: 20px; align-items: center;
  padding: 15px 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: background-color .18s var(--ease);
}
a.mrow:hover { background: var(--hover); }
a.mrow:focus-visible { border-radius: 10px; }
.mrow--head { padding-top: 0; padding-bottom: 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.mdate { font-size: 14.5px; color: var(--ink-2); white-space: nowrap; }
.mtopic { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mtopic-t { font-size: 16px; font-weight: 550; line-height: 1.4; }
.msnip { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.msnip mark { background: var(--tint); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.mlen { font-size: 14.5px; color: var(--ink-2); }
.num.mlen, .mrow--head .num { text-align: left; }
.nomatch { font-size: 15px; color: var(--ink-3); padding: 18px 12px; margin: 0; }
.mlocked { display: flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--ink-3); margin: 18px 12px 0; }
.mlocked .ic { width: 16px; height: 16px; }
.mlocked--page { margin: 28px 0 0; font-size: 16px; }

.steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.step-card { border-top: 2px solid var(--line); padding-top: 18px; position: relative; }
.step-card:first-child { border-top-color: var(--accent); }
.step-n {
  display: inline-flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--tint); color: var(--accent-ink); font-size: 13.5px; font-weight: 650;
}
.step-card h3 { font-size: 18px; font-weight: 600; margin: 14px 0 6px; letter-spacing: -0.005em; }
.step-card p { font-size: 15.5px; color: var(--ink-2); margin: 0; line-height: 1.6; }
.leaves { display: flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--ink-2); margin: 32px 0 0; padding: 14px 16px; background: var(--side); border-radius: 12px; }
.leaves .ic { color: var(--accent-ink); }
.section-title { font-size: 19px; font-weight: 600; margin: 48px 0 12px; letter-spacing: -0.005em; }
.queue { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.queue-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-bottom: 1px solid var(--line); text-decoration: none;
  transition: background-color .18s var(--ease);
}
.queue-item:hover { background: var(--hover); }
.queue-check { width: 28px; height: 28px; border-radius: 50%; background: var(--tint); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.queue-check .ic { width: 16px; height: 16px; }
.queue-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.queue-topic { font-size: 16px; font-weight: 550; }
.queue-meta { font-size: 14px; color: var(--ink-3); }
.queue-go { color: var(--ink-3); width: 17px; height: 17px; }
.queue-empty { font-size: 15px; color: var(--ink-3); margin: 0; padding: 20px; border: 1px dashed var(--line-2); border-radius: 14px; }

/* ---------- meeting ---------- */
.meeting { min-height: 100%; display: flex; flex-direction: column; }
.m-head { width: 100%; max-width: 1200px; margin: 0 auto; padding: 26px 44px 6px; animation: rise .3s var(--ease); }
.back {
  display: inline-flex; align-items: center; gap: 4px; font-size: 14.5px; color: var(--ink-2); text-decoration: none;
  margin-left: -6px; padding: 4px 10px 4px 4px; border-radius: 8px; transition: background-color .18s var(--ease), color .18s var(--ease);
}
.back:hover { background: var(--hover); color: var(--ink); }
.m-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-3); margin-top: 20px; }
.m-meta .sep { color: var(--line-2); }
.ext { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-ink); text-decoration: none; font-weight: 550; }
.ext .ic { width: 15px; height: 15px; }
.ext:hover { text-decoration: underline; text-underline-offset: 3px; }
.m-title { font-size: 31px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin: 6px 0 18px; max-width: 800px; }
.m-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.m-check { display: inline-flex; align-items: center; gap: 14px; }
.fixcount { font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.fixcount::before { content: ""; width: 14px; height: 0; border-bottom: 2px dotted var(--accent); }
.checked-note { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--accent-ink); margin: 14px 0 0; animation: rise .25s var(--ease); }
.checked-note .ic { width: 16px; height: 16px; }

.m-tabs { display: none; }
.m-body {
  flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 22px 44px 48px;
  display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 64px; align-items: start;
}
.m-main { min-width: 0; max-width: 720px; }
.hint { font-size: 14px; color: var(--ink-3); margin: 0 0 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.turn { margin: 0 0 30px; }
.turn-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.spk { font-size: 13.5px; font-weight: 650; color: var(--ink-2); }
.turn-time { font-size: 13px; color: var(--ink-3); padding: 1px 6px; border-radius: 6px; transition: color .18s var(--ease), background-color .18s var(--ease); }
.turn-time:hover { color: var(--accent-ink); background: var(--tint); }
.turn-text { font-size: 18px; line-height: 1.78; margin: 0; color: var(--ink); overflow-wrap: break-word; }
.w {
  cursor: pointer; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-color .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease);
}
.w:hover { background: var(--hover); box-shadow: 0 0 0 2px var(--hover); }
.w.is-fixed {
  text-decoration: underline dotted var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px;
}
.w.is-cited { background: var(--amber-tint); box-shadow: 0 0 0 3px var(--amber-tint); border-radius: 0; }
.w.cited-first { border-radius: 4px 0 0 4px; }
.w.cited-last { border-radius: 0 4px 4px 0; }
.w.is-flash { animation: flash 2.6s var(--ease); }
@keyframes flash { 0%, 55% { background: var(--tint-2); box-shadow: 0 0 0 3px var(--tint-2); } 100% { background: transparent; box-shadow: 0 0 0 3px transparent; } }
.w.is-now { background: var(--tint-2); box-shadow: 0 0 0 3px var(--tint-2); color: var(--ink); border-radius: 4px; }
.w.just-fixed { animation: fixed .9s var(--ease); }
@keyframes fixed { 0% { background: var(--tint-2); box-shadow: 0 0 0 3px var(--tint-2); } 100% { background: transparent; box-shadow: 0 0 0 3px transparent; } }
.w.is-editing { background: none; box-shadow: none; cursor: text; }
.w-input {
  font-size: 18px; line-height: 1.4; padding: 0 5px; border: 0; border-radius: 6px; background: var(--surface); color: var(--ink);
  outline: 2px solid var(--accent); width: auto;
}
.turn--cited .turn-text { position: relative; }
.cite-label {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--amber-ink);
  background: var(--amber-tint); border-radius: 999px; padding: 3px 11px 3px 9px; margin: 4px 0 8px;
}
.cite-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }

.m-side { position: sticky; top: 24px; }
.m-side-in { background: var(--side); border-radius: 18px; padding: 24px 24px 20px; }
.m-side .side-label { margin-bottom: 8px; }
.summary { font-size: 15.5px; line-height: 1.62; margin: 0 0 24px; }
.points { list-style: none; margin: 0 -10px; padding: 0; }
.point {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; text-align: left;
  padding: 9px 10px; border-radius: 10px; font-size: 15px; line-height: 1.45; transition: background-color .18s var(--ease);
}
.point:hover { background: var(--hover); }
.point-time { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); padding-top: 1px; transition: color .18s var(--ease); }
.point-time .ic { width: 12px; height: 12px; color: var(--accent); }
.point:hover .point-time { color: var(--accent-ink); }
.draft { display: flex; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--ink-3); margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.draft .ic { width: 15px; height: 15px; margin-top: 1px; }
.foot--meeting { margin-top: 40px; }

.player {
  position: sticky; bottom: 0; z-index: 10; background: var(--bg); border-top: 1px solid var(--line);
}
.player-in { max-width: 1200px; margin: 0 auto; padding: 12px 44px; display: flex; align-items: center; gap: 18px; }
.play-btn {
  width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--on-accent); flex: none;
  display: inline-flex; align-items: center; justify-content: center; transition: background-color .18s var(--ease), transform .18s var(--ease);
}
.play-btn:hover { background: var(--accent-hover); }
.play-btn:active { transform: scale(0.96); }
.play-btn .ic { width: 20px; height: 20px; }
.player:not(.is-playing) .play-btn .ic { margin-left: 3px; }
.ptime { font-size: 14px; color: var(--ink-2); min-width: 90px; white-space: nowrap; }
.wave { flex: 1; height: 44px; cursor: pointer; border-radius: 8px; min-width: 0; touch-action: none; }
.wave-canvas { width: 100%; height: 100%; display: block; }
.speed {
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px;
  height: 32px; min-width: 60px; padding: 0 12px; transition: border-color .18s var(--ease), color .18s var(--ease);
}
.speed:hover { border-color: var(--accent); color: var(--accent-ink); }

.tip {
  position: fixed; z-index: 50; display: flex; align-items: center; gap: 10px; background: var(--raised); color: var(--ink); border: 1px solid var(--line-2);
  font-size: 13.5px; border-radius: 10px; padding: 6px 6px 6px 12px; opacity: 0; transform: translateY(3px);
  transition: opacity .16s var(--ease), transform .16s var(--ease); pointer-events: auto; max-width: calc(100vw - 16px);
}
.tip.is-on { opacity: 1; transform: none; }
.tip b { font-weight: 650; }
.tip-undo {
  display: inline-flex; align-items: center; gap: 5px; background: var(--tint); color: var(--accent-ink); border-radius: 7px;
  padding: 4px 9px 4px 7px; font-size: 13px; font-weight: 550; white-space: nowrap; transition: background-color .15s var(--ease);
}
.tip-undo:hover { background: var(--tint-2); }
.tip-undo .ic { width: 15px; height: 15px; }

/* ---------- assistant with documents ---------- */
.ast { display: flex; height: 100%; min-height: 0; }
.ast > .chat { flex: 1; min-width: 0; position: relative; }
.vpanel { width: 46%; flex: none; border-left: 1px solid var(--line); background: var(--stage); min-height: 0; display: flex; animation: fade .2s var(--ease); }
.vpanel > .viewer { flex: 1; min-width: 0; }

.dl-home { margin: 0 0 30px; }
.dl-home .side-label { margin-bottom: 10px; padding: 0 2px; }
.dl-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dl-card {
  text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 15px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--side); transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.dl-card:hover { border-color: var(--accent); }
.dl-card .dl-days { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink-2); line-height: 1.15; }
.dl-card.is-soon .dl-days { color: var(--accent); }
.dl-what { font-size: 14.5px; line-height: 1.4; color: var(--ink); }
.dl-meta { font-size: 12.5px; color: var(--ink-3); }

.scen-label-h { padding: 0 2px 8px; }
.scen { list-style: none; margin: 0; padding: 0; }
.scen li + li { border-top: 1px solid var(--line); }
.scen-item {
  width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 16px; gap: 14px; align-items: center; text-align: left;
  padding: 11px 12px; border-radius: 12px; transition: background-color .18s var(--ease);
}
.scen-item:hover { background: var(--hover); }
.scen-item:hover .suggest-go, .scen-item:focus-visible .suggest-go { opacity: 1; transform: none; }
.scen-n { width: 26px; height: 26px; border-radius: 50%; background: var(--tint); color: var(--accent-ink); font-size: 13px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; }
.scen-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.scen-label { font-size: 15.5px; font-weight: 600; }
.scen-q { font-size: 14.5px; color: var(--ink-2); }
.scen-file { color: var(--ink-3); display: inline-flex; }
.scen-file .ic { width: 17px; height: 17px; }
.a .scen { margin: 6px 0 0 -12px; }
.more { margin-top: 18px; }
.more summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 550; color: var(--ink-3);
  padding: 8px 12px; border-radius: 10px; transition: background-color .18s var(--ease), color .18s var(--ease);
}
.more summary::-webkit-details-marker { display: none; }
.more summary:hover { background: var(--hover); color: var(--ink); }
.more[open] summary { color: var(--ink-2); }
.more .ic { width: 16px; height: 16px; }
.more .suggest-item { font-size: 14.5px; padding: 10px 12px; }

.fchip {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 550; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 11px 6px 9px; margin-bottom: 8px; max-width: 100%;
}
.fchip .ic { width: 17px; height: 17px; color: var(--accent); }
.fchip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pending-box { margin: 0 0 8px 8px; }
.fchip--pending { background: var(--side); margin: 0; animation: rise .2s var(--ease); }
.fchip-ok { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--accent-ink); }
.fchip-ok .ic { width: 14px; height: 14px; }
.fchip-x { display: inline-flex; color: var(--ink-3); border-radius: 6px; padding: 2px; margin-left: 2px; }
.fchip-x:hover { color: var(--ink); background: var(--hover); }
.fchip-x .ic { width: 15px; height: 15px; }
.composer { padding-left: 8px; }
.clip {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3);
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.clip:hover { background: var(--hover); color: var(--ink); }
.clip .ic { width: 19px; height: 19px; }
.drop {
  position: absolute; inset: 14px; z-index: 6; display: none; align-items: center; justify-content: center; border-radius: 20px;
  border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--bg)); pointer-events: none;
}
.chat.is-drag .drop { display: flex; }
.drop-in { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; color: var(--accent-ink); }
.drop-in .ic { width: 24px; height: 24px; }

.a-item { position: relative; padding-left: 1.8em; }
.a-item-n { position: absolute; left: 0; color: var(--accent-ink); font-weight: 650; }
.src-open .ic { margin-left: 0; width: 15px; height: 15px; }

.x { margin-top: 26px; animation: rise .3s var(--ease); }
.x > .side-label { margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.x > .side-label .ic { width: 15px; height: 15px; }
.x-note { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); margin: 12px 0 0; }
.x-note .ic { width: 15px; height: 15px; color: var(--accent); flex: none; }
.mtab-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.mtab { width: 100%; border-collapse: collapse; font-size: 15px; }
.mtab th { font-size: 12.5px; font-weight: 600; color: var(--ink-3); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--side); }
.mtab td { padding: 9px 14px; border-bottom: 1px solid var(--line); }
.mtab .r { text-align: right; }
.mtab .inv { color: var(--ink-2); }
.mtab tbody tr:last-child td { border-bottom: 0; }
.mtab tr.is-short td { background: var(--raised); font-weight: 600; }
.mtab tfoot td { font-weight: 650; border-top: 1px solid var(--line-2); border-bottom: 0; background: var(--side); }
.unpaid-call {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; padding: 12px 16px;
  border: 1px solid var(--line-2); border-radius: 12px; font-size: 15px; color: var(--ink-2);
}
.unpaid-call strong { font-size: 19px; color: var(--ink); font-weight: 650; }

.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; }
.tl li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 30px; bottom: -8px; width: 2px; background: var(--line-2); }
.tl-item {
  width: 100%; display: grid; grid-template-columns: 14px 96px minmax(0, 1fr); gap: 14px; align-items: start; text-align: left;
  padding: 10px 10px; border-radius: 10px; transition: background-color .18s var(--ease);
}
.tl-item:hover { background: var(--hover); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg); margin-top: 5px; position: relative; z-index: 1; }
.tl-date { font-size: 14px; color: var(--ink-2); padding-top: 1px; }
.tl-text { display: flex; flex-direction: column; gap: 2px; }
.tl-kind { font-size: 15px; font-weight: 600; }
.tl-sub { font-size: 14px; color: var(--ink-2); line-height: 1.45; }

.dl-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dl-row {
  width: 100%; display: grid; grid-template-columns: 120px minmax(0, 1fr) 18px; gap: 16px; align-items: center; text-align: left;
  padding: 14px 12px; border-bottom: 1px solid var(--line); transition: background-color .18s var(--ease);
}
.dl-row:hover { background: var(--hover); }
.dl-row .dl-days { font-size: 20px; font-weight: 600; color: var(--ink-3); letter-spacing: -0.01em; }
.dl-row.is-soon .dl-days { color: var(--accent); }
.dl-body { display: flex; flex-direction: column; gap: 2px; }
.dl-row .dl-what { font-size: 15.5px; }
.dl-go { width: 16px; height: 16px; color: var(--ink-3); }

.x-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.x-foot .x-note { margin: 0; }
.btn-sm { height: 34px; padding: 0 14px 0 11px; font-size: 14px; }
.btn-sm .ic { width: 16px; height: 16px; }
.btn-outline.is-done { border-color: var(--accent); color: var(--accent-ink); }
.scan-text { border-left: 2px solid var(--line-2); padding: 2px 0 2px 16px; font-style: italic; color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.scan-text p { margin: 0 0 6px; }

.proto { margin: 4px 0 16px; border: 1px solid var(--line-2); border-radius: 16px; padding: 16px 20px 18px; background: var(--side); animation: rise .3s var(--ease); }
.proto-head { display: flex; align-items: center; gap: 10px; }
.proto-head .ic { width: 18px; height: 18px; color: var(--accent); }
.proto-head h3 { font-size: 16px; font-weight: 600; margin: 0; }
.proto-file { margin-left: auto; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.proto-dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 7px 18px; margin: 14px 0 16px; font-size: 14.5px; }
.proto-dl dt { color: var(--ink-3); }
.proto-dl dd { margin: 0; color: var(--ink); }
.proto-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.proto-foot .x-note { margin: 0; }
.btn-primary.btn-sm { height: 36px; }

/* ---------- the document viewer ---------- */
.viewer { display: flex; flex-direction: column; min-height: 0; height: 100%; background: var(--stage); }
.vbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 18px; border-bottom: 1px solid var(--line); background: var(--side); }
.vbar-t { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.vbar-t > .ic { color: var(--accent); }
.vbar-title { font-size: 14.5px; font-weight: 600; }
.vbadge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--tint); color: var(--accent-ink); }
.vbadge--scan { background: var(--raised); color: var(--ink-2); }
.vstage { flex: 1; overflow: auto; padding: 28px 28px 48px; min-height: 0; }

.sheet {
  position: relative; max-width: 760px; margin: 0 auto; aspect-ratio: 1 / 1.414; background: var(--paper); color: var(--paper-ink);
  padding: 56px 60px 64px; border-radius: 2px; font-size: 14.5px; line-height: 1.62; box-shadow: 0 2px 14px oklch(0 0 0 / 0.45);
}
.sh-head { display: flex; justify-content: space-between; gap: 24px; font-size: 13px; }
.sh-from strong { display: block; max-width: 300px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.45; }
.sh-meta { text-align: right; color: var(--paper-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sh-kind { text-align: center; font-size: 15px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin: 34px 0 0; }
.sh-to { margin: 30px 0 0; }
.sh-k { color: var(--paper-mute); }
.sh-subject { font-weight: 700; margin: 10px 0 24px; }
.sh-p { margin: 0 0 12px; }
.sh-quoted { margin: 0 0 12px; }
.sh-quoted .sh-p { margin: 0; }
.q-label {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; color: var(--paper-mark-ink);
  background: var(--paper-mark); border-radius: 999px; padding: 2px 9px; margin: 0 0 6px; font-style: normal;
}
mark.q { background: var(--paper-mark); color: var(--paper-ink); border-radius: 2px; padding: 1px 0; box-shadow: 0 0 0 2px var(--paper-mark); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.is-quoted-all { background: var(--paper-mark); box-shadow: 0 0 0 4px var(--paper-mark); border-radius: 2px; }
.reg { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.reg th { text-align: left; font-weight: 700; padding: 6px 6px; border-bottom: 1.5px solid var(--paper-ink); }
.reg td { padding: 5px 6px; border-bottom: 1px solid var(--paper-line); vertical-align: top; }
.reg .r { text-align: right; }
.reg tr.is-quoted td { background: var(--paper-mark); }
.reg .unpaid { font-weight: 700; font-style: italic; }
.sh-signs { display: flex; justify-content: flex-end; margin-top: 52px; gap: 24px; }
.sh-signs--two { justify-content: space-between; }
.sh-sign { position: relative; text-align: center; min-width: 210px; font-size: 13.5px; }
.sh-role { color: var(--paper-mute); max-width: 240px; margin: 0 auto; line-height: 1.4; }
.sh-line { width: 170px; border-bottom: 1px solid var(--paper-ink); margin: 38px auto 6px; }
.sh-name { font-weight: 700; }
.stamp { position: absolute; width: 116px; height: 116px; left: -62px; top: -8px; color: var(--stamp); opacity: 0.7; transform: rotate(-14deg); mix-blend-mode: multiply; pointer-events: none; }
.stamp svg { width: 100%; height: 100%; display: block; }
.sh-signs--two .sh-sign { flex: 1; min-width: 0; }
.sh-signs--two .stamp { left: 50%; top: -18px; }
.vpanel .sheet { padding: 44px 38px 52px; }
.reg td.num { white-space: nowrap; }
.reg td, .reg th { padding-left: 5px; padding-right: 5px; }
.sh-att { margin-top: 18px; }
.sh-att ol { margin: 4px 0 0; padding-left: 20px; }

.sheet--scan {
  background: var(--paper-scan); transform: rotate(-0.9deg); font-style: italic; color: oklch(0.3 0.04 262);
  text-shadow: 0 0 0.5px currentColor; box-shadow: inset 0 0 70px oklch(0.45 0.05 70 / 0.28), 0 2px 14px oklch(0 0 0 / 0.5);
  margin-top: 8px; margin-bottom: 8px; letter-spacing: 0.005em;
}
.sheet--scan .sh-p:nth-child(2n) { color: oklch(0.34 0.035 262); }
.scan-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.4; mix-blend-mode: multiply; border-radius: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.sheet--draft { aspect-ratio: auto; max-width: none; padding: 34px 40px 30px; font-size: 14.5px; box-shadow: none; border-radius: 6px; }
.sheet--draft .sh-to { margin-top: 22px; }

.main--document { overflow: hidden; }
.docpage { height: 100%; display: flex; flex-direction: column; }
.docpage-head { padding: 14px 24px 10px; border-bottom: 1px solid var(--line); }
.docpage .viewer { flex: 1; }
.drow { grid-template-columns: 140px 180px 110px minmax(0, 1fr); }
.dkind { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.dkind .ic { width: 16px; height: 16px; color: var(--ink-3); }
.dno { font-size: 14.5px; color: var(--ink-2); }
.drow .mtopic { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; }

/* ---------- narrower ---------- */
@media (max-width: 1080px) {
  .m-tabs { display: flex; gap: 4px; width: 100%; max-width: 1200px; margin: 18px auto 0; padding: 0 44px; border-bottom: 1px solid var(--line); }
  .m-tab {
    padding: 10px 4px; margin-right: 18px; font-size: 15px; font-weight: 550; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color .18s var(--ease), border-color .18s var(--ease);
  }
  .m-tab:hover { color: var(--ink); }
  .m-tab.is-on { color: var(--ink); border-bottom-color: var(--accent); }
  .m-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .m-main { max-width: none; }
  .m-body[data-tab="transcript"] .m-side { display: none; }
  .m-body[data-tab="summary"] .m-main { display: none; }
  .m-side { position: static; }
}

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr); }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px;
    background: var(--bg); border-bottom: 1px solid var(--line); z-index: 20;
  }
  .topbar .brand { font-size: 15px; }
  .topbar .mark { width: 24px; height: 24px; }
  .main { height: auto; min-height: 0; }
  .side {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-102%);
    transition: transform .22s var(--ease); border-right: 1px solid var(--line);
  }
  .icon-btn.side-close { display: inline-flex; }
  .side .foot--side { display: block; font-size: 11.5px; margin: 12px 8px 0; }
  .shell.drawer-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .22s var(--ease); }
  .shell.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .page { padding: 32px 22px 28px; }
  .vpanel { position: fixed; inset: 0; width: auto; z-index: 45; border-left: 0; }
  .vstage { padding: 16px 12px 32px; }
  .sheet { padding: 30px 24px 36px; font-size: 13.5px; }
  .sh-head { flex-direction: column; gap: 8px; }
  .sh-meta { text-align: left; }
  .sh-signs--two { flex-direction: column; align-items: flex-end; }
  .dl-strip { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .dl-card { display: grid; grid-template-columns: 118px minmax(0, 1fr); column-gap: 10px; row-gap: 2px; padding: 11px 14px; align-items: center; }
  .dl-card .dl-days { grid-row: span 2; font-size: 18px; white-space: nowrap; }
  .proto-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .proto-dl dd { margin-bottom: 8px; }
  .dl-row { grid-template-columns: 90px minmax(0, 1fr) 16px; gap: 12px; }
  .dl-row .dl-days { font-size: 17px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .m-head { padding: 18px 22px 4px; }
  .m-tabs { padding: 0 22px; }
  .m-body { padding: 18px 22px 36px; }
  .player-in { padding: 10px 16px; gap: 12px; }
  .thread-inner { padding: 28px 18px 18px; }
  .composer-wrap { padding: 6px 14px 12px; }
}

@media (max-width: 640px) {
  .mrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "topic topic" "date state"; gap: 6px 12px; padding: 14px 6px; }
  .mrow--head { display: none; }
  .mrow > :nth-child(1) { grid-area: date; font-size: 13.5px; color: var(--ink-3); }
  .mrow > :nth-child(2) { grid-area: topic; }
  .mrow > :nth-child(3) { display: none; }
  .mrow > :nth-child(4) { grid-area: state; }
  .drow { grid-template-areas: "topic topic" "date kind"; }
  .drow > :nth-child(2) { grid-area: kind; justify-self: end; }
  .drow > :nth-child(4) { grid-area: topic; }
  .drow > :nth-child(3) { display: none; }
  .m-title { font-size: 25px; }
  .page-head h1 { font-size: 26px; }
  .ptime { min-width: 0; font-size: 13px; }
  .play-btn { width: 42px; height: 42px; }
  .speed { min-width: 0; padding: 0 9px; }
  .turn-text { font-size: 17.5px; }
  .src { gap: 10px; }
  .src-time { display: none; }
  .foot--chat { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .caret { animation: none; }
}
