/* Nylon live demo — product UI tokens from LCwebapp (html[data-theme='nylon']) */
:root {
  --ink: #111827; --blue: #1974f9; --cyan: #27d1ff; --navy: #0b254d;
  --bg-shell: #f3f8fa; --bg-main: #fcfcfc; --bg-card: #fff; --bg-question: #f3f8fa;
  --bg-pill: #f3f4f6; --bg-hover: #f9fafb; --bg-secondary: #e1e9ed; --light-blue-50: #f1f7ff;
  --text: #111827; --text-body: #475569; --text-2: #4a5565; --muted: #6a7282; --faint: #9ca3af; --g800: #1f2937;
  --icon: #364153; --border: #e5e7eb; --border-strong: #d1d5db;
  --success: #177848; --success-bg: #f2f9eb;
  --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sh-xs: 0 1px 2px 0 rgba(0,0,0,.05);
  --sh-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --sh-subtle: 0 1px 4px 0 rgba(0,0,0,.10);
  --sh-message: 0 1px 4px 0 rgba(0,0,0,.16);
  --sh-focus-cyan: 0 0 8px 0 rgba(127,206,242,.4);
  --rail: 3.4rem; --rail-open: 13.375rem;
  /* guide (demo layer) */
  --guide-bg: #0f1726; --guide-fg: #f8fafc; --guide-muted: #94a3b8;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg-shell); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
svg { display: block; }
.ico { display: inline-flex; width: 16px; height: 16px; color: var(--icon); flex: none; }
.ico svg { width: 100%; height: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- app shell ---------- */
.app { display: flex; height: 100dvh; width: 100vw; }
.rail { width: var(--rail-open); flex: none; display: flex; flex-direction: column; padding: 12px 8px 8px; transition: width .2s ease; overflow: hidden; }
.rail.collapsed { width: var(--rail); }
.rail-top { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 6px; margin-bottom: 14px; }
.rail-top .mark { display: block; width: 24px; height: 24px; }
.rail-top .mark svg { width: 24px; height: 24px; }
.rail.collapsed .rail-top .toggle { display: none; }
.newthread { display: flex; align-items: center; gap: 12px; padding: 9px 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--sh-xs); font-size: 14px; font-weight: 600; white-space: nowrap; }
.newthread .kbd { margin-left: auto; color: var(--faint); font-weight: 400; font-size: 13px; }
.rail.collapsed .newthread { width: 38px; justify-content: center; padding: 10px 0; }
.rail.collapsed .newthread span:not(.ico) { display: none; }
.nav { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 10px; font-size: 14px; color: var(--g800); white-space: nowrap; transition: background .15s; }
.nav-item:hover { background: var(--bg-secondary); }
.nav-item.active { background: var(--bg-secondary); }
.rail.collapsed .nav-item span:not(.ico) { display: none; }
.nav hr { border: 0; border-top: 1px solid rgba(0,0,0,.1); margin: 6px 4px; }
.recents { margin-top: 16px; padding: 0 10px; font-size: 12px; color: var(--muted); overflow: hidden; }
.recents h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.recents div { padding: 5px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.rail.collapsed .recents { display: none; }
.rail-foot { margin-top: auto; border-top: 1px solid rgba(0,0,0,.1); padding: 12px 8px 4px; display: flex; gap: 10px; align-items: center; font-size: 13px; white-space: nowrap; }
.rail-foot .ini { font-size: 13px; color: var(--g800); }
.rail-foot small { display: block; color: var(--faint); font-size: 11px; }
.rail.collapsed .rail-foot .who { display: none; }

.main { flex: 1; min-width: 0; margin: 8px 8px 8px 0; background: var(--bg-main); border: 1px solid var(--border); border-radius: 20px; position: relative; overflow: hidden; display: flex; }
.thread-col { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.trial-banner { background: var(--bg-pill); color: var(--text-2); font-size: 13px; text-align: center; padding: 7px 12px; }
.trial-banner b { color: var(--ink); }

/* home */
.home { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 24px; }
.greeting { font-size: 30px; font-weight: 600; color: var(--ink); text-align: center; margin: 0; letter-spacing: -.01em; }

/* composer */
.composer { width: 100%; max-width: 766px; background: #fff; border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--sh-subtle); padding: 12px; transition: box-shadow .2s; position: relative; }
.composer.focus { box-shadow: var(--sh-focus-cyan), var(--sh-subtle); border-color: #cfe9f6; }
.composer textarea { width: 100%; border: 0; outline: 0; resize: none; font: inherit; font-size: 16px; color: var(--ink); min-height: 44px; max-height: 192px; padding: 4px 10px; background: transparent; }
.composer textarea::placeholder { color: var(--muted); }
.c-row { display: flex; align-items: center; gap: 8px; padding-top: 8px; min-height: 40px; }
.c-round { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--border); display: grid; place-items: center; background: #fff; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: 14px; color: var(--g800); white-space: nowrap; }
.pill.muted { color: var(--muted); }
.pill .ico { width: 16px; height: 16px; }
.pill.eng { gap: 8px; }
.pill.eng .ph { color: var(--faint); }
.pill.muted .ico { color: var(--icon); }
.c-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.submit { border-color: var(--border-strong); }
.submit.ready { background: var(--ink); border-color: var(--ink); }
.submit.ready .ico { color: #fff; }
.mode-pill { gap: 6px; height: auto; padding: 6px 12px; color: #374151; font-weight: 500; }
.mode-pill .ico { width: 14px; height: 14px; color: currentColor; }
.mode-pill .ico.chev { width: 12px; height: 12px; transform: rotate(180deg); }

/* popovers */
.pop { position: absolute; z-index: 30; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-lg); padding: 6px; font-size: 14px; animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }
.opt:hover, .opt.sel { background: var(--bg-hover); }
.opt small { display: block; color: var(--muted); font-size: 12px; }
.juris-pop { width: min(560px, calc(100vw - 2rem)); padding: 0; overflow: hidden; border-radius: 10px; }
.juris-pop .search { height: 44px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--faint); display: flex; gap: 12px; align-items: center; }
.juris-pop .search .ico { color: var(--faint); }
.juris-pop { display: grid; grid-template-columns: 232px minmax(0, 1fr); column-gap: 8px; }
.juris-pop .search { grid-column: 1 / -1; }
.juris-pop .col { display: flex; flex-direction: column; gap: 8px; padding: 12px 0 12px 12px; min-width: 0; }
.juris-pop .col + .col { padding: 12px 12px 12px 0; }
.juris-pop h5 { margin: 0; padding: 0 4px; font-size: 14px; font-weight: 400; text-transform: uppercase; letter-spacing: .42px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.juris-pop h5 .info { display: inline-flex; color: var(--faint); cursor: help; }
.juris-pop h5 .info .ico { color: var(--faint); }
.juris-pop .panel { border: 1px solid var(--border); border-radius: 10px; background: #fcfcfd; padding: 8px; height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.juris-pop .opt { gap: 10px; padding: 6px 12px; border-radius: 10px; font-size: 14px; color: var(--ink); }
.juris-pop .opt > div { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.juris-pop .opt:hover, .juris-pop .opt.sel { background: var(--bg-pill); }
.juris-pop .opt .code { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 24px; border-radius: 10px; background: var(--bg-pill); font-size: 14px; font-weight: 600; color: var(--icon); padding: 0; }
.juris-pop .badge-ico { flex: none; width: 38px; display: flex; justify-content: center; }
.juris-pop .opt .chk { color: var(--ink); margin-left: auto; }
.juris-pop .opt small { color: #757575; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.juris-pop .explainer { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 0 20px; }
.juris-pop .explainer b { font-size: 16px; font-weight: 600; color: #1e1e1e; }
.juris-pop .explainer p { margin: 0; font-size: 14px; line-height: 1.5; color: #757575; }
.juris-pop .explainer .btn { justify-content: center; margin-top: 8px; height: 36px; font-size: 14px; }
.mode-pop { width: 240px; padding: 4px 0; border-radius: 12px; }
.mode-pop .opt { gap: 12px; padding: 10px 16px; border-radius: 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.mode-pop .opt .ico { color: #6b7280; }
.mode-pop .opt .ico:last-child:not(:first-child) { color: #374151; }
.mode-pop .opt small { font-size: 12px; font-weight: 400; color: #6b7280; }
.mode-pop .opt:hover, .mode-pop .opt.sel { background: var(--bg-hover); }

/* thread */
.thread { flex: 1; overflow-y: auto; scroll-behavior: smooth; padding: 18px 16px 180px; }
.turn { max-width: 720px; margin: 0 auto 36px; }
.qcard { position: sticky; top: 0; z-index: 4; background: var(--bg-question); border-radius: 16px; box-shadow: var(--sh-message); margin-bottom: 18px; }
.qcard .q { padding: 14px 18px; font-size: 16px; line-height: 1.5; }
.qcard .qfoot { border-top: 1px solid rgba(0,0,0,.06); display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 6px 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 12px; background: var(--bg-pill); color: var(--icon); border: 1px solid var(--border); }
.qcard .qfoot .chip { background: var(--bg-secondary); border: 0; padding: 4px 8px; font-size: 12px; color: #374151; line-height: 1.25; }
.qcard .qfoot .chip.certainty { background: transparent; padding: 0 8px; font-size: 14px; font-weight: 600; color: #374151; line-height: 1; }
.loading { display: flex; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 10px; }
.spin { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--ink); border-radius: 999px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* progress */
.progress { margin: 0 0 18px; font-size: 14px; }
.progress-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 4px; color: #4b5563; font-weight: 400; font-size: 16px; line-height: 1; }
.progress-toggle .ico { color: #4b5563; transition: transform .2s; }
.progress.open .progress-toggle .pchev { transform: rotate(180deg); }
.steps { margin-top: 4px; background: #fbfbfb; border-radius: 28px; padding: 12px 20px; }
.step { display: flex; gap: 12px; animation: fadein .3s ease; }
.step:not(:last-child) { margin-bottom: 16px; }
.s-rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.s-rail .s-ico { width: 12px; height: 12px; margin: 4.5px 0; color: var(--icon); }
.s-rail .s-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--border); margin: 6.5px 0; }
.step:not(:last-child) .s-rail::after { content: ''; width: 2px; background: var(--border); flex: 1; margin: 4px 0 -8px; }
.step.live .s-ico { animation: pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.s-body { flex: 1; min-width: 0; padding-bottom: 4px; }
.step .lbl { font-size: 14px; color: var(--ink); line-height: 1.5; }
.step.live .lbl::after { content: '...'; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; animation: ellip 1.2s steps(4) infinite; }
@keyframes ellip { from { width: 0; } to { width: 1.2em; } }
.step .sub { font-size: 14px; margin-top: 8px; color: var(--ink); }
.step .sub2 { font-size: 12px; margin: 8px 0; color: var(--ink); }
.step .srcs { display: flex; flex-direction: column; margin-top: 8px; background: #fff; border: 1px solid var(--border); border-radius: 12px; max-height: 112px; overflow-y: auto; }
.step .srcs:empty { display: none; }
.step .srcs > span { display: flex; gap: 8px; align-items: center; padding: 8px; font-size: 12px; color: var(--faint); min-width: 0; animation: fadein .3s ease; }
.step .srcs .dt, .step .srcs .wt > span, .step .srcs .wt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step .srcs .wt { display: flex; flex-direction: column; min-width: 0; }
.step .srcs .wt small { font-size: 12px; color: var(--muted); }
.step .srcs .fav { width: 16px; height: 16px; border-radius: 4px; flex: none; }
.step .srcs .ico { width: 12px; height: 12px; }
.subq { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.subq:empty { display: none; }
.subq > span { font-size: 12px; background: var(--bg-pill); color: #6b7280; border-radius: 999px; padding: 4px 8px; margin-bottom: 8px; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes fadein { from { opacity: 0; transform: translateY(3px); } }

/* answer */
.answer { font-size: 16px; line-height: 1.6; color: var(--ink); }
.answer h1, .answer h2, .answer h3, .answer h4 { font-size: 17px; margin: 22px 0 8px; font-weight: 700; }
.answer p { margin: 0 0 12px; }
.answer ul, .answer ol { padding-left: 21px; margin: 0 0 12px; }
.answer li { margin: 3px 0; }
.answer blockquote { margin: 8px 0 12px; padding: 2px 0 2px 14px; border-left: 3px solid var(--border-strong); font-style: italic; color: var(--text-2); }
.answer table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; border: 1px solid var(--border); border-radius: 15px; overflow: hidden; margin: 8px 0 14px; }
.answer th { background: var(--bg-pill); text-align: left; font-weight: 600; }
.answer th, .answer td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.answer tr:last-child td { border-bottom: 0; }
.answer .caret { display: inline-block; width: 7px; height: 16px; background: var(--ink); vertical-align: -3px; animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.cite { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-pill); border-radius: 999px; padding: 3px 8px 3px 3px; margin-left: 4px; font-size: 12px; font-style: normal; color: #374151; vertical-align: 1px; cursor: pointer; line-height: 18px; transition: background .15s, box-shadow .15s; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.cite:hover { background: var(--border); }
.cite.hl { background: #e6efff; box-shadow: 0 0 0 2px rgba(25,116,249,.25); }
.cite .n { min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 400; color: var(--muted); flex: none; }
.cite .ico { width: 12px; height: 12px; color: var(--muted); }
.cite .ct { color: #374151; overflow: hidden; text-overflow: ellipsis; }
.refs { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 14px; }
.refs-h { font-weight: 600; font-style: italic; display: inline-flex; align-items: center; gap: 4px; font-size: 16px; line-height: 1.5; color: var(--ink); }
.refs-h .ico { color: #4b5563; margin: 0 4px; }
.refs .reviewed { font-size: 16px; color: var(--ink); line-height: 1.5; margin: 0 0 10px; }
.refs .reviewed b { display: block; font-weight: 600; font-style: italic; margin-bottom: 8px; }
.refs .reviewed p { margin: 0; }
.refs ol { font-size: 14px; line-height: 1.5; color: var(--ink); padding-left: 20px; margin: 10px 0; }
.refs li { margin: 4px 0; cursor: pointer; }
.refs li:hover { color: var(--blue); }
.cards { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.scard { flex: none; width: 230px; background: #fff; border: 1px solid var(--bg-pill); border-radius: 10px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--sh-xs); transition: box-shadow .2s, border-color .2s, transform .15s; }
.scard:hover, .scard.hl { box-shadow: 0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1); border-color: var(--border-strong); }
.scard.hl { transform: translateY(-1px); }
.scard .top { display: flex; gap: 8px; align-items: center; min-width: 0; }
.scard .top .ico { width: 12px; height: 12px; }
.scard .t { flex: 1; min-width: 0; font-weight: 600; font-style: italic; font-size: 14px; line-height: 1.25; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scard .meta { margin-top: auto; display: flex; justify-content: space-between; font-size: 12px; line-height: 1.25; color: #6b7280; align-items: center; }
.scard .meta b { display: inline-flex; align-items: center; height: 18px; margin-left: 4px; background: var(--bg-pill); border-radius: 99px; padding: 0 4px; color: #374151; font-weight: 400; }
.answer-actions { display: flex; gap: 6px; margin-top: 6px; }

/* email canvas */
.email { border: 1px solid var(--border); border-radius: 20px; background: #fff; margin: 14px 0; overflow: hidden; animation: fadein .3s ease; }
.email-h { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.email-h .lbl { flex: 1; font-size: 12px; font-weight: 600; color: var(--muted); }
.email-h .sp { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--bg-pill); }
.tgl { width: 36px; height: 20px; border-radius: 99px; background: var(--border); position: relative; transition: background .15s; }
.tgl i { position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 99px; background: #fff; box-shadow: var(--sh-xs); transition: transform .15s; }
.tgl[aria-checked="true"] { background: var(--ink); }
.tgl[aria-checked="true"] i { transform: translateX(16px); }
.btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; border-radius: 10px; font-size: 13px; height: 32px; padding: 0 12px; border: 1px solid var(--border); background: #fff; color: var(--icon); }
.btn:hover { background: var(--bg-hover); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary .ico { color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.email-subj { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 16px; color: var(--g800); }
.email-subj span { color: var(--ink); font-weight: 600; }
.email-body { padding: 8px 16px 12px; font-size: 16px; color: var(--g800); line-height: 1.6; white-space: pre-wrap; }

/* bottom composer in thread */
.dock-composer { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px 16px; background: linear-gradient(to top, var(--bg-main) 70%, rgba(252,252,252,0)); display: flex; justify-content: center; z-index: 6; }

/* source panel: SourceDocumentPanel (sourceDocumentPanel.tailwind.ts), mounted beside .main like lawCyborg.tsx sidePanel */
.source { width: clamp(626px, 40vw, min(1000px, 100vw)); flex: none; margin: 8px 8px 8px 0; background: #fff; border: 1px solid var(--border); border-radius: 20px; box-shadow: -4px 0 6px -2px rgba(0,0,0,.05); display: flex; flex-direction: column; overflow: hidden; position: relative; animation: slidein .25s ease; min-height: 0; }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } }
.source-h { background: var(--bg-hover); border-bottom: 1px solid var(--border); padding: 12px 8px 12px 16px; }
.source-h .sd-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--icon); }
.source-h .sd-toggle:hover { background: var(--bg-pill); }
.source-h .sd-toggle .ico { width: 16px; height: 16px; transition: transform .2s; }
.source.sd-open .sd-toggle .ico { transform: rotate(180deg); }
.source-h .close { position: absolute; top: 12px; right: 8px; height: 24px; padding: 0 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-hover); font-size: 12px; color: #6b7280; font-weight: 400; }
.source-h .close:hover { background: var(--bg-pill); }
.sd-wrap { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .3s ease, opacity .3s ease; }
.source.sd-open .sd-wrap { grid-template-rows: 1fr; opacity: 1; }
.sd-inner { overflow: hidden; }
.source.sd-open .sd-inner { padding-top: 12px; }
.source:not(.sd-open) .sd-cards { visibility: hidden; }
.sd-cards { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; padding: 1px 1px 3px; }
.sd-card { flex: none; width: 160px; max-width: 160px; background: #fff; border: 1px solid var(--bg-pill); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; box-shadow: var(--sh-xs); cursor: pointer; transition: all .2s; }
.sd-card:hover { box-shadow: 0 1px 3px rgba(0,0,0,.1); border-color: var(--border-strong); }
.sd-card .top { display: flex; gap: 8px; align-items: center; min-width: 0; }
.sd-card .top .ico { width: 12px; height: 12px; }
.sd-card .t { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; font-style: italic; color: var(--ink); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-card .bot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #6b7280; line-height: 1.25; }
.sd-card .ref { display: inline-flex; gap: 4px; align-items: center; }
.sd-card .badge { background: var(--bg-pill); border-radius: 99px; padding: 0 4px; height: 18px; min-width: 18px; display: inline-flex; align-items: center; justify-content: center; color: var(--icon); }
.sd-none { font-size: 12px; color: var(--muted); }
.source-tabs { display: flex; overflow-x: auto; background: var(--bg-hover); scrollbar-width: none; flex: none; }
.source-tab { display: flex; gap: 8px; align-items: center; padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--bg-hover); border-bottom: 2px solid transparent; white-space: nowrap; min-width: 96px; max-width: 300px; overflow: hidden; flex: 0 1 auto; }
.source-tab .tab-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.source-tab.active { background: #fff; border-color: var(--ink); }
.tab-ico { width: 12px; height: 12px; }
.source-tab .tab-x { display: inline-flex; padding: 2px; border-radius: 99px; flex: none; cursor: pointer; }
.source-tab .tab-x:hover { background: #dadde2; }
.source-tab .tab-x .ico { width: 10px; height: 10px; }
#srcBody { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.crumb { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; background: var(--bg-hover); border-bottom: 1px solid var(--border); border-radius: 0 0 20px 20px; font-size: 14px; font-weight: 600; color: var(--ink); flex: none; }
.crumb-l { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.crumb-l b { font-weight: 600; color: var(--icon); flex: none; }
.crumb-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-menu, .m-menu, .m-close { display: grid; place-items: center; padding: 8px; border-radius: 10px; flex: none; }
.crumb-menu:hover, .m-menu:hover, .m-close:hover { background: var(--bg-pill); }
.treat { flex: none; width: 10px; height: 10px; border-radius: 99px; display: inline-block; }
.treat.none { background: #fff; border: 1px solid var(--border-strong); }
.summary { display: flex; align-items: flex-start; gap: 8px; padding: 8px 16px; font-size: 14px; color: var(--icon); border-bottom: 1px solid var(--border); line-height: 1.5; flex: none; }
.summary p { margin: 0; flex: 1; min-width: 0; }
.summary .more { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 12px; color: var(--faint); cursor: pointer; }
.summary .more:hover { color: #6b7280; }
.summary .more .ico { color: var(--faint); }
.summary .sum-m, .summary .m-more, .m-src-h { display: none; }
.doc { flex: 1; min-height: 0; overflow: hidden; position: relative; background: #fff; }
.doc-scroll { height: 100%; overflow: auto; padding: 8px 8px; scrollbar-gutter: stable; }
.doc .open { position: absolute; right: 16px; top: 16px; padding: 8px; border-radius: 99px; border: 1px solid var(--border); display: grid; place-items: center; background: #fff; box-shadow: 0 4px 6px 0 rgba(0,0,0,.1); z-index: 10; }
.doc .open:hover { background: var(--bg-hover); }
/* react-pdf page: fit-to-width white page, my-2, shadow-sm; A4 proportions */
.pdf-page { background: #fff; margin: 8px auto; width: 100%; aspect-ratio: 1 / 1.414; box-shadow: 0 1px 2px 0 rgba(0,0,0,.05), 0 0 0 1px rgba(0,0,0,.03); padding: 9% 10% 7%; font-family: Arial, Helvetica, sans-serif; color: #111; font-size: 12px; line-height: 1.5; position: relative; }
.pdf-page .run { display: flex; justify-content: space-between; font-size: 10px; color: #444; border-bottom: .5px solid #999; padding-bottom: 3px; margin-bottom: 22px; }
.pdf-page h2 { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.pdf-page .sub { font-size: 10.5px; color: #222; margin-bottom: 18px; }
.pdf-page hr { border: 0; border-top: 1px solid #bbb; margin: 0 0 16px; }
.pdf-page h3 { font-size: 13px; font-weight: 700; margin: 0 0 10px; }
.pdf-page h3 .sn { display: inline-block; min-width: 2.6em; margin-right: 6px; }
.pdf-page .paper-body p { margin: 0 0 8px; }
.pdf-page .prov { display: flex; gap: 8px; }
.pdf-page .prov .pn { flex: none; min-width: 2.4em; }
.pdf-page .prov.sub { padding-left: 2.4em; }
.pdf-page .part { font-weight: 700; margin-top: 12px; }
.pdf-page .pfoot { position: absolute; bottom: 3.5%; left: 0; right: 0; text-align: center; font-size: 10px; color: #444; }
/* PdfPanelViewer .pdf-citation-highlight */
.pdf-citation-highlight, .paper mark { background: rgba(255,213,0,.45); color: inherit; border-radius: 2px; mix-blend-mode: multiply; padding: 1px 0; animation: markin .9s ease; }
@keyframes markin { from { background: transparent; } }
.paper { font-family: Arial, Helvetica, sans-serif; color: #111; font-size: 13px; line-height: 1.55; max-width: 620px; padding: 20px 32px; }
.paper h2 { font-size: 20px; margin: 0 0 4px; }
.paper .sub { font-size: 11px; color: #333; margin-bottom: 18px; }
.paper hr { border: 0; border-top: 1px solid #ccc; margin: 14px 0; }
.paper h3 { font-size: 14px; margin: 0 0 10px; }
/* thread beside the panel: chat log goes full width (2xl: 80%), composer xl: 90% / 2xl: 80% */
body.with-source .turn { max-width: none; }
body.with-source .composer { max-width: none; }
@media (min-width: 1280px) { body.with-source .composer { width: 90%; } }
@media (min-width: 1536px) { body.with-source .turn { max-width: 80%; } body.with-source .composer { width: 80%; } }
/* citation hover card (citationHoverCard.tailwind.js) */
.cite-hover { position: fixed; z-index: 150; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; width: max-content; max-width: 448px; box-shadow: 0 4px 6px -2px rgba(0,0,0,.05), 0 10px 15px -3px rgba(0,0,0,.1); display: flex; flex-direction: column; gap: 4px; animation: pop .14s ease-out; font-family: var(--font); }
.cite-hover .hc-h { display: flex; gap: 6px; align-items: center; padding: 6px 12px 2px; font-size: 12px; font-weight: 600; color: #6b7280; line-height: 1.5; }
.cite-hover .hc-h .ico { width: 12px; height: 12px; }
.cite-hover .hc-div { border-bottom: 1px solid var(--border); }
.cite-hover .hc-src { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 12px 8px; }
.cite-hover .hc-src.headerless { padding-top: 8px; }
.cite-hover .hc-t { display: flex; gap: 8px; align-items: center; min-width: 0; flex: 1; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.cite-hover .hc-tag { background: var(--bg-pill); border-radius: 6px; padding: 6px 8px; font-size: 12px; color: #4b5563; white-space: nowrap; flex: none; }
.cite-hover .hc-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 12px 12px; }
.cite-hover .hc-sec { font-size: 14px; color: #4b5563; }
.cite-hover .hc-sec b { font-weight: 500; }
.cite-hover .hc-ref { font-size: 12px; color: #6b7280; line-height: 1.25; }
.cite-hover .hc-sum { font-size: 14px; color: #4b5563; line-height: 1.5; }

/* plans overlay */
.plans { position: absolute; inset: 0; background: var(--bg-main); z-index: 20; overflow-y: auto; padding: 32px 24px 160px; animation: fadein .25s ease; }
/* production "Select a plan" step: PlanSelect.tailwind.ts + PlanCard.tailwind.ts */
.plans-step { display: grid; width: 100%; max-width: 1100px; margin: 0 auto; grid-template-columns: 1fr 1fr; column-gap: 16px; row-gap: 32px; }
.plans-title { grid-column: 1 / -1; grid-row: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.plans-title h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.25; color: var(--ink); }
.plans-title p { margin: 0; font-size: 14px; line-height: 1.25; color: #4a5565; }
.plan-grid { grid-column: 1 / -1; grid-row: 2; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); align-items: stretch; width: 100%; max-width: 1100px; justify-self: center; gap: 24px; }
.plans-step > .btn { height: 40px; padding: 0 12px; font-size: 14px; justify-content: center; width: 100%; grid-row: 3; }
.plans-step > .btn:not(.primary) { color: var(--icon); border-color: var(--border); }
.plans-back { grid-column: 1; }
.plans-continue { grid-column: 2; }
.plans-continue:hover { background: #1f2937; }
.plans-foot { grid-column: 1 / -1; grid-row: 4; margin: 0; padding-bottom: 12px; text-align: center; font-size: 14px; line-height: 1.5; color: #4a5565; }
.plans-foot strong { font-weight: 700; }
.plans-foot a { color: var(--blue); text-decoration: underline; white-space: nowrap; }
@media (min-width: 768px) {
  .plans-step { grid-template-columns: 1fr auto 1fr; }
  .plans-title { grid-column: 2; align-self: center; }
  .plans-step > .btn { grid-row: 1; width: 171px; align-self: center; }
  .plans-back { justify-self: start; }
  .plans-continue { grid-column: 3; justify-self: end; }
  .plans-foot { grid-row: 3; }
}
@media (min-width: 1024px) { .plan-grid { column-gap: 40px; } }
.plan { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 8px; background: #fff; border: 1px solid var(--border); border-radius: 20px; text-align: left; cursor: pointer; transition: box-shadow .2s, border-color .2s; }
.plan:hover { box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1); }
.plan.sel { border-color: var(--blue); box-shadow: var(--sh-lg); }
.plan:focus-visible { outline: 2px solid #6a7282; outline-offset: 2px; }
.plan p { margin: 0; }
.plan-tick { display: none; position: absolute; right: 16px; top: 16px; color: var(--blue); }
.plan-tick .ico { width: 24px; height: 24px; color: var(--blue); }
.plan.sel .plan-tick { display: block; }
.plan-top { width: 100%; display: flex; flex-direction: column; gap: 20px; padding: 8px 8px 16px; }
.plan-name { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; text-align: center; }
.plan-name h3 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.25; color: var(--blue); }
.plan-name p { font-size: 14px; line-height: 1.5; color: #4b5563; }
.plan-price { display: flex; flex-direction: column; gap: 8px; padding: 8px 16px; text-align: center; }
.plan-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; column-gap: 8px; color: var(--ink); }
.plan-row .cur { font-size: 18px; line-height: 1.25; }
.plan-row .amt { font-size: 40px; font-weight: 700; line-height: 1.25; }
.plan-row .per { font-size: 14px; line-height: 1.25; }
.plan-tax { font-size: 12px; line-height: 1.25; color: #6a7282; }
.plan-note { font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--blue); }
.plan-credits { width: 100%; display: flex; align-items: center; background: var(--light-blue-50); border-radius: 10px; padding: 8px 0; }
.plan-credits .seg { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; font-size: 13px; line-height: 1.25; color: #4a5565; white-space: nowrap; }
.plan-credits .seg .cl { text-decoration: underline dotted; text-underline-offset: 2px; cursor: help; }
.plan-credits .coins { display: flex; gap: 6px; }
.plan-credits .ico { color: var(--icon); }
.plan-credits .plus { flex: none; }
.plan-feats { width: 100%; margin: 0; list-style: none; display: flex; flex-direction: column; gap: 20px; padding: 8px 24px; }
.plan-feats li { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.25; color: #4a5565; }
.plan-feats li.fh { font-weight: 600; }
.plan-feats .ico { color: var(--icon); }
.plan-feats .ft { text-decoration: underline dotted; text-underline-offset: 2px; }

/* ---------- demo layer: cursor, spotlight, guide ---------- */
.vcursor { position: fixed; z-index: 90; width: 22px; height: 22px; pointer-events: none; left: 0; top: 0; transform: translate(-100px, -100px); transition: transform .55s cubic-bezier(.22,.9,.3,1), opacity .3s; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.vcursor.idle { opacity: 0; }
.vcursor.click::after { content: ''; position: absolute; left: -9px; top: -9px; width: 22px; height: 22px; border-radius: 99px; border: 2px solid var(--blue); animation: ripple .45s ease-out; }
@keyframes ripple { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.spot { position: fixed; z-index: 80; pointer-events: none; border-radius: 14px; box-shadow: 0 0 0 3px var(--blue), 0 0 0 8px rgba(25,116,249,.18); transition: all .35s cubic-bezier(.22,.9,.3,1); opacity: 0; }
.spot.on { opacity: 1; }
.spot .tip { position: absolute; left: 0; top: calc(100% + 10px); background: var(--ink); color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; max-width: 320px; white-space: normal; width: max-content; box-shadow: var(--sh-lg); }

.guide { position: fixed; z-index: 95; right: 20px; bottom: 20px; width: 360px; background: var(--guide-bg); color: var(--guide-fg); border-radius: 22px; box-shadow: 0 20px 50px -12px rgba(15,23,38,.55); padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: transform .25s, opacity .25s; }
.guide.min .g-cap, .guide.min .g-input, .guide.min .g-stage { display: none; }
.g-top { display: flex; align-items: center; gap: 12px; }
.orb { width: 44px; height: 44px; border-radius: 999px; flex: none; position: relative; background: radial-gradient(circle at 35% 30%, #8be7ff, var(--cyan) 35%, var(--blue) 70%, #0b3a8a); box-shadow: 0 0 0 0 rgba(39,209,255,.0); transition: transform .08s linear, box-shadow .2s; }
.orb.listening { box-shadow: 0 0 0 4px rgba(39,209,255,.25); }
.orb.thinking { animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.92); opacity: .8; } }
.g-name { font-weight: 700; font-size: 14px; }
.g-status { font-size: 12px; color: var(--guide-muted); display: flex; align-items: center; gap: 6px; }
.g-status i { width: 7px; height: 7px; border-radius: 99px; background: #22c55e; display: inline-block; }
.g-status.off i { background: #64748b; }
.g-btns { margin-left: auto; display: flex; gap: 6px; }
.g-btn { width: 34px; height: 34px; border-radius: 99px; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #e2e8f0; transition: background .15s; }
.g-btn:hover { background: rgba(255,255,255,.16); }
.g-btn.on { background: #ef4444; color: #fff; }
.g-btn svg { width: 16px; height: 16px; }
.g-cap { font-size: 15px; line-height: 1.45; min-height: 44px; max-height: 132px; overflow-y: auto; color: #e8eef7; }
.g-cap .you { color: var(--guide-muted); font-size: 13px; display: block; margin-bottom: 4px; }
.g-input { display: flex; gap: 6px; }
.g-input input { flex: 1; min-width: 0; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; color: #fff; padding: 9px 12px; font: inherit; font-size: 14px; outline: 0; }
.g-input input::placeholder { color: #7c8aa0; }
.g-input input:focus { border-color: rgba(39,209,255,.5); }
.g-stage { display: flex; gap: 4px; }
.g-stage span { flex: 1; height: 3px; border-radius: 99px; background: rgba(255,255,255,.12); transition: background .3s; }
.g-stage span.done { background: var(--cyan); }
.g-stage span.now { background: linear-gradient(90deg, var(--cyan), rgba(255,255,255,.12)); }
.g-hint { font-size: 11px; color: #7c8aa0; text-align: center; }
.demo-tag { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); top: 8px; font-size: 11px; color: var(--muted); background: rgba(255,255,255,.8); border: 1px solid var(--border); border-radius: 99px; padding: 2px 10px; pointer-events: none; }

/* start screen */
.start { position: fixed; inset: 0; z-index: 200; background: rgba(243,248,250,.72); backdrop-filter: blur(10px); display: grid; grid-template-columns: minmax(0, 1fr); place-items: start center; padding: 16px; overflow-y: auto; }
.start-card { margin: auto; width: min(560px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--sh-lg); padding: 28px; }
.start-card .logo { height: 28px; margin-bottom: 18px; }
.start-card h1 { font-size: 24px; margin: 0 0 8px; }
.start-card p { color: var(--text-2); margin: 0 0 18px; line-height: 1.55; font-size: 15px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.mode { text-align: left; border: 1px solid var(--border); border-radius: 14px; padding: 14px; transition: border-color .15s, box-shadow .15s; }
.mode.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.mode b { display: block; margin-bottom: 4px; font-size: 14px; }
.mode span { font-size: 13px; color: var(--muted); line-height: 1.4; display: block; }
.start .go { width: 100%; height: 46px; font-size: 15px; justify-content: center; border-radius: 12px; }
.start .note { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.start .err { color: #a90101; font-size: 13px; margin: 0 0 10px; }
.start .err:empty { display: none; }
.start.invalid .modes, .start.invalid .field { display: none; }
.field { display: flex; gap: 8px; margin-bottom: 14px; }
.field label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.field input { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 400; min-width: 0; color: var(--ink); }

.toast { position: fixed; z-index: 120; left: 50%; bottom: 24px; transform: translateX(-50%); background: #d6ecd1; color: var(--ink); border-radius: 20px; padding: 12px 18px; box-shadow: var(--sh-lg); font-size: 14px; animation: fadein .25s ease; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .source { position: fixed; inset: 8px; width: auto; margin: 0; z-index: 15; }
}
/* phones: SourceDocumentPanel mobile layout (no cards, no tab bar; icon + title + menu + close; 2-line summary) */
@media (max-width: 639px) {
  .source { inset: 0; border: 0; border-radius: 0; box-shadow: none; }
  .source-h, .source-tabs, .crumb { display: none; }
  .m-src-h { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--border); flex: none; }
  .m-src-h .m-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-src-h .m-close { border-radius: 99px; }
  .m-src-h .m-close .ico { width: 20px; height: 20px; }
  .summary { background: var(--bg-hover); }
  .summary .sum-d, .summary .more { display: none; }
  .summary .sum-m { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .summary.m-open .sum-m { display: block; }
  .summary .m-more { display: grid; place-items: center; padding: 8px; border-radius: 10px; flex: none; margin: -6px -8px -6px 0; }
  .doc .open { right: 12px; top: 12px; }
  .doc-scroll { padding: 4px; }
  .paper { padding: 16px; }
}
@media (max-width: 760px) {
  .rail { display: none; }
  .main { margin: 0; border-radius: 0; border: 0; }
  .greeting { font-size: 20px; }
  .composer { border-radius: 22px; }
  .pill.eng, .mode-pill { display: none; }
  .thread { padding: 12px 12px 260px; }
  .g-cap { max-height: 84px; font-size: 14px; }
  .dock-composer { bottom: 0; padding: 10px 10px 12px; background: var(--bg-main); }
  .demo-tag { display: none; }
  .modes { grid-template-columns: 1fr; }
  .vcursor { display: none; }
}

.main.with-source .thread { padding-left: 12px; padding-right: 12px; }
.paper-body { white-space: normal; }

.answer hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
@media (min-width: 1000px) {
  body.has-guide:not(.guide-min) .thread, body.has-guide:not(.guide-min) .dock-composer { padding-right: 392px; }
  body.has-guide:not(.guide-min) .home { padding-right: 392px; }
  body.has-guide:not(.guide-min) .main.with-source .thread, body.has-guide:not(.guide-min) .main.with-source .dock-composer { padding-right: 16px; }
  body.has-guide:not(.guide-min) .plans { padding-right: 392px; }
}
@media (min-width: 1000px) and (max-width: 1400px) {
  body.has-guide.with-source .source .doc-scroll { padding-bottom: 300px; }
}
a.btn { text-decoration: none; }

.paper.help { font-family: var(--font); font-size: 14px; line-height: 1.6; color: var(--g800); }
.paper.help h2 { font-size: 20px; }
.paper.help h4 { font-size: 15px; margin: 14px 0 2px; color: var(--ink); }

/* guided sign-up card */
.signup-card { overflow: hidden; }
.su-head { padding: 20px 22px 14px; display: flex; flex-direction: column; gap: 8px; }
.su-title { font-size: 20px; font-weight: 700; color: var(--ink); }
.su-sub { font-size: 14px; color: var(--text-2); }
.su-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.su-big { height: 44px; font-size: 15px; padding: 0 18px; }
.su-note { font-size: 12px; color: var(--muted); }
.su-steps { list-style: none; margin: 0; padding: 12px 22px 18px; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 14px; }
.su-steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); transition: color .2s; }
.su-dot { width: 22px; height: 22px; border-radius: 99px; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; transition: all .2s; background: #fff; }
.su-steps li.now { color: var(--ink); font-weight: 600; }
.su-steps li.now .su-dot { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 4px rgba(25,116,249,.12); }
.su-steps li.done .su-dot { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- QA fixes (Oct 2026) ---------- */
/* sticky question card: mask the gap above it so scrolled text never shows over it */
.qcard::before { content: ''; position: absolute; left: -12px; right: -12px; top: -18px; height: 34px; pointer-events: none;
  background: linear-gradient(var(--bg-main), var(--bg-main)) left top / 100% 18px no-repeat,
    radial-gradient(circle at 100% 100%, transparent 15.5px, var(--bg-main) 16px) left 12px top 18px / 16px 16px no-repeat,
    radial-gradient(circle at 0 100%, transparent 15.5px, var(--bg-main) 16px) right 12px top 18px / 16px 16px no-repeat; }
.source-tab.active { flex-shrink: 0; max-width: 60%; }
.answer, .refs, .email, .progress, .signup-card { scroll-margin-top: 150px; }
.qfoot .more-btn { display: inline-grid; place-items: center; padding: 2px; border-radius: 6px; cursor: pointer; }
.qfoot .more-btn:hover { background: rgba(0,0,0,.05); }
body.view-thread .demo-tag, body:has(.juris-pop) .demo-tag { display: none; }
/* phone top bar with the brand */
.m-top { display: none; }
/* source panel text */
.paper-body p { margin: 0 0 10px; }
.paper.web { font-family: var(--font); font-size: 14px; line-height: 1.6; color: var(--g800); }
.paper.help ul { margin: 4px 0 10px; padding-left: 20px; }
.paper.help p { margin: 0 0 6px; }
.paper.help h4 + p, .paper.help h4 + ul { margin-top: 0; }
.src-empty { padding: 18px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--bg-hover); font-family: var(--font); color: var(--text-2); font-size: 14px; }
.src-empty p { margin: 0 0 12px; }
.src-empty .btn { text-decoration: none; }
.answer sup { font-size: .72em; line-height: 0; }
/* email card */
.email-h .tgl-l { font-size: 12px; font-weight: 400; color: var(--muted); }
.email-refs { padding: 0 16px 14px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.email.booking iframe { display: block; width: 100%; height: calc(100dvh - 140px); min-height: 480px; border: 0; }
/* keyboard focus */
.btn:focus-visible, .pill:focus-visible, .opt:focus-visible, .cite:focus-visible, .scard:focus-visible, .nav-item:focus-visible, .newthread:focus-visible,
.c-round:focus-visible, .icon-btn:focus-visible, .tgl:focus-visible, .source-tab:focus-visible, .tab-x:focus-visible, .refs li:focus-visible, .mode:focus-visible,
.g-btn:focus-visible, .crumb-menu:focus-visible, .more-btn:focus-visible, #recents > div:focus-visible, .sd-toggle:focus-visible, .close:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.composer:focus-within { box-shadow: var(--sh-focus-cyan), var(--sh-subtle); border-color: #9fd8f0; }
.nav-item { text-decoration: none; cursor: pointer; }
#recents > div { cursor: pointer; }
.juris-pop .search, .sd-toggle, .crumb-menu { cursor: pointer; }

/* guide: phones and tablets dock it full-width at the bottom; content clears its real height (--guide-h) */
@media (max-width: 999px) {
  .guide { left: 8px; right: 8px; bottom: 8px; width: auto; border-radius: 18px; padding: 12px; }
  body.has-guide .dock-composer { padding-bottom: calc(var(--guide-h, 0px) + 16px); }
  body.has-guide .thread { padding-bottom: calc(var(--guide-h, 0px) + 190px); }
  body.has-guide .home { padding-bottom: calc(var(--guide-h, 0px) + 16px); }
  body.has-guide .plans { padding-bottom: calc(var(--guide-h, 0px) + 40px); }
  body.has-guide .source .doc-scroll { padding-bottom: calc(var(--guide-h, 0px) + 24px); }
}
@media (max-width: 760px) {
  .field { flex-direction: column; }
  .m-top { display: flex; align-items: center; gap: 8px; flex: none; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-main); font-size: 15px; }
  .m-top .mark svg { width: 20px; height: 20px; }
  .m-top .m-tag { margin-left: auto; font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 2px 8px; }
  /* pinned question card: two lines while reading */
  .qcard.stuck { padding: 10px 0; }
  .qcard.stuck .q { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 0 14px; margin: 0; font-size: 15px; }
  .qcard.stuck .qfoot { display: none; }
  /* jurisdiction picker as a single-column bottom sheet */
  .juris-pop { position: fixed; left: 8px !important; right: 8px; top: auto !important; bottom: 8px !important; width: auto; grid-template-columns: minmax(0, 1fr); max-height: calc(100dvh - 24px); overflow-y: auto; z-index: 60; }
  .juris-pop .col, .juris-pop .col + .col { padding: 10px 12px 0; }
  .juris-pop .col + .col { padding-bottom: 12px; }
  .juris-pop .panel { height: auto !important; max-height: none; overflow: visible; }
  .juris-pop .opt > div { white-space: normal; }
  .juris-pop .opt small { white-space: normal; }
  .email.booking iframe { height: calc(100dvh - 120px); }
  body.has-guide .juris-pop { bottom: calc(var(--guide-h, 0px) + 16px) !important; max-height: calc(100dvh - var(--guide-h, 0px) - 32px); }
}

/* recap feedback */
.fb { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.fb-q { font-weight: 600; font-size: 14px; color: var(--ink); }
.fb-stars { display: flex; gap: 6px; }
.fb-stars button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: #fff; font-weight: 700; color: var(--text-2); }
.fb-stars button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.fb textarea { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; resize: vertical; }
.fb .fb-send { align-self: flex-start; }

.su-offer { align-self: flex-start; font-size: 13px; font-weight: 600; color: #0b4fb3; background: var(--light-blue-50); border: 1px solid #cfe0fb; border-radius: 99px; padding: 4px 12px; }
/* source panel ⋮ menu (DropdownMenu) */
.src-menu { position: fixed; z-index: 160; min-width: 200px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-lg); padding: 6px; animation: pop .14s ease-out; }
.src-menu .opt { display: flex; align-items: center; gap: 8px; width: 100%; text-decoration: none; color: var(--icon); font-size: 14px; }
.sd-card:focus-visible, .m-close:focus-visible, .m-menu:focus-visible, .m-more:focus-visible, .summary .more:focus-visible, .doc .open:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.pdf-page .prov.sub2 { padding-left: 4.8em; }
/* narrow thread beside the panel: composer pills keep their icons only so nothing clips */
.main.with-source .mode-pill span:not(.ico), .main.with-source .pill.eng { display: none; }
.pdf-page .prov.sub2 { padding-left: 4.8em; }
/* narrow thread beside the panel: composer pills keep their icons only so nothing clips */
.main.with-source .mode-pill span:not(.ico), .main.with-source .pill.eng { display: none; }

/* landing, staff sign-in, invite form */
.req { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 12px; }
.req label, .start .field label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-2); flex: 1; min-width: 0; }
.req input, .req select, #invLink { height: 42px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 15px; font-weight: 400; color: var(--ink); background: #fff; min-width: 0; }
.req input:focus-visible, .req select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.linkish { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.staff-bar { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.staff-link { text-align: center; margin-top: 10px; }
#invDone .field { display: flex; gap: 8px; }
#invDone input { flex: 1; }

.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
