/* Colours sampled from the PDF screenshots; layout measured at 1494px wide. */
:root {
  --sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}
/* Theme and chat font are independent of the page: Settings switches them at runtime. */
body[data-theme='dark'] {
  --bg: #191919; --side: #1f1f1f; --line: #303030; --bubble: #252525; --active: #404040;
  --text: #f4f3ee; --soft: #c9c8c2; --muted: #8e8d88; --card-line: #3c3c3a; --chip: #3b3b3b;
  --composer: #303030; --composer-line: #454543; --code: #2a2a2a; --row: #333331; --fold-line: #232323; --fold-text: #a8a7a2;
  --seg-on: #3b3b3b; --upgrade-line: #2c2c2c; --menu: #252525;
  --hidden-bg: #2a2424; --hidden-line: #4a3a3a; --warn-bg: #4a2525; --warn-line: #6a3535; --warn: #f0a0a0;
  --ask-bg: #f4f3ee; --ask-text: #1f1f1e;
  color-scheme: dark;
}
body[data-theme='light'] {
  --bg: #ffffff; --side: #fafafa; --line: #e7e7e5; --bubble: #f3f3f3; --active: #ececec;
  --text: #1f1f1e; --soft: #3d3d3a; --muted: #73726c; --card-line: #e0e0dd; --chip: #f1f1f0;
  --composer: #ffffff; --composer-line: #d9d8d3; --code: #f3f3f2; --row: #e6e6e4; --fold-line: #ebebe8; --fold-text: #6f6e68;
  --seg-on: #ffffff; --upgrade-line: #e0e0dd; --menu: #ffffff;
  --hidden-bg: #fbf5f5; --hidden-line: #dcd5d5; --warn-bg: #f8dfdf; --warn-line: #e8c7c7; --warn: #b4232a;
  --ask-bg: #1f1f1e; --ask-text: #ffffff;
  color-scheme: light;
}
body { --prose-width: 674px; --primary: #cc785c; --primary-active: #a9583e; --error: #c64545; }
body[data-variant='shared'] { --prose-width: 664px; }
body[data-font='default'] { --prose-font: var(--serif); --prose-size: 15px; --prose-track: -.13px; }
body[data-font='sans'] { --prose-font: var(--sans); --prose-size: 15px; --prose-track: 0; }
body[data-font='system'] { --prose-font: system-ui, -apple-system, 'Segoe UI', sans-serif; --prose-size: 15px; --prose-track: 0; }
body[data-font='dyslexic'] { --prose-font: 'Comic Sans MS', 'Comic Neue', sans-serif; --prose-size: 15px; --prose-track: .2px; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 15px/21px var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; cursor: pointer; }
svg { flex: none; display: block; }
#app { display: flex; height: 100dvh; overflow: hidden; }

/* Sidebar */
[hidden] { display: none !important; }
.sidebar { width: 288px; flex: none; display: flex; flex-direction: column; overflow: hidden; background: var(--side); border-right: 1px solid var(--line); }
/* Children keep the full width so nothing reflows while the rail animates. */
.brand, .side-scroll, .me { width: 287px; }
.panel-btn { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 -1px 0 -4px; border-radius: 6px; }
.panel-btn:hover { background: var(--active); }
.wordmark, .seg, .group, .upgrade, .nav-item span, .name, .plan, .me > svg, .me-device { transition: opacity .15s; }
.sidebar.rail { width: 49px; }
.sidebar.rail :is(.wordmark, .seg, .group, .upgrade, .nav-item span, .name, .plan, .me > svg, .me-device) { opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .sidebar { transition: width .2s ease; }
}
.brand { height: 44px; flex: none; display: flex; align-items: center; gap: 7px; padding: 0 14px; color: var(--soft); }
.wordmark { font: 600 22px/1 var(--serif); letter-spacing: -.3px; color: var(--text); }
.seg { margin-left: auto; display: flex; padding: 2px; border-radius: 8px; background: var(--active); margin-right: -6px; }
.seg button { width: 32px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: var(--soft); }
.seg .on { background: var(--seg-on); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.side-scroll { flex: 1; overflow: hidden auto; min-height: 0; padding-top: 4px; }
.nav-item { height: 34px; white-space: nowrap; display: flex; align-items: center; gap: 10px; padding: 0 14px; font-size: 14.5px; font-weight: 450; }
.nav-item svg { color: var(--soft); }
.upgrade { margin-left: auto; font-style: normal; font-size: 12.5px; color: #6ea8e6; padding: 2px 6px; border: 1px solid var(--upgrade-line); border-radius: 99px; margin-right: -2px; }
.group { margin-top: 18px; padding: 0 8px; }
.group .nav-item { padding: 0 8px; }
.group h5 { display: flex; align-items: center; gap: 8px; height: 34px; margin: 0; padding: 0 8px; font: 500 12.5px/1 var(--sans); color: var(--muted); }
.group h5.strong { font-size: 13.5px; color: var(--text); }
.group h5 svg { margin-left: auto; color: var(--soft); }
.tri { width: 0; height: 0; border: 4px solid transparent; border-top: 5px solid currentColor; border-bottom: 0; }
.row { height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 8px; border-radius: 8px; font-size: 14.5px; font-weight: 450; }
.row svg { color: var(--muted); margin-left: auto; }
.row.dim { color: var(--muted); }
.row.active { height: 32px; background: var(--active); margin-bottom: 2px; }
.dot { width: 5px; height: 5px; flex: none; margin: 0 7px 0 4px; border: 1px solid var(--muted); border-radius: 50%; }
.fade { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; -webkit-mask: linear-gradient(90deg, #000 92%, transparent); mask: linear-gradient(90deg, #000 92%, transparent); }
.sub { margin-left: 16px; padding-left: 8px; border-left: 1px solid var(--line); }
.me { height: 48px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 14px; border-top: 1px solid var(--line); color: var(--muted); text-align: left; white-space: nowrap; }
.me:hover .name { opacity: .8; }
.avatar { width: 20px; height: 20px; margin-right: 2px; display: grid; place-items: center; border-radius: 50%; background: var(--active); color: var(--text); font-size: 9px; font-weight: 600; }
.name { color: var(--text); font-weight: 450; }
.plan { font-size: 13px; }
.me-device { margin-left: auto; color: var(--soft); }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.chat-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.topbar { height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 24px 0 18px; border-bottom: 1px solid var(--line); }
.crumb, .top-actions, .share-btn { display: flex; align-items: center; }
.crumb { gap: 8px; font-weight: 500; }
.top-actions { gap: 12px; font-weight: 500; }
.share-btn { gap: 4px; padding: 4px 8px; margin-right: -8px; border-radius: 8px; }
.share-btn:hover { background: var(--active); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.thread { width: 731px; max-width: calc(100% - 32px); margin: 0 auto; flex: 1 0 auto; padding: 37px 0 72px; }
[data-variant='shared'] .thread { width: 721px; padding-top: 16px; }

.banner { display: flex; gap: 8px; padding: 16px 16px 14px; margin-bottom: 22px; border: 1px solid var(--card-line); border-radius: 16px; font-size: 14.5px; line-height: 20px; }
.banner > svg { color: var(--soft); margin-top: 0; }
.banner p { max-width: 590px; margin: 0 0 8px; }
.banner button { padding: 5px 9px; border-radius: 8px; background: var(--chip); }

/* User turn */
.turn.user { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-bottom: 39px; }
.turn.assistant + .turn.user { margin-top: 56px; }
/* Hover row under a user message; absolutely placed so it never shifts the thread. */
.turn.user { position: relative; }
.msg-actions { position: absolute; top: 100%; right: 0; display: flex; align-items: center; gap: 2px; margin-top: 2px; color: var(--soft); opacity: 0; transition: opacity .15s; }
.turn.user:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg-actions time { margin-right: 6px; font-size: 12px; color: var(--muted); }
.msg-actions .icon-btn { width: 28px; height: 28px; }
.msg-copy.copied { color: var(--text); }
@media (hover: none) { .msg-actions { opacity: 1; } }
.atts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 632px; }
.att { position: relative; width: 120px; height: 120px; padding: 10px; display: flex; flex-direction: column; border: 1px solid var(--card-line); border-radius: 12px; overflow: hidden; font-size: 13px; line-height: 17px; }
.att-meta { font-size: 12.5px; line-height: 16px; color: var(--muted); }
.att-type { position: absolute; left: 10px; bottom: 9px; padding: 1px 6px; border: 1px solid var(--card-line); border-radius: 99px; font-size: 11.5px; font-weight: 500; line-height: 15px; color: var(--soft); }
.att.img { padding: 0; display: grid; place-items: center; background: var(--side); }
.att.img img { width: 100%; display: block; }
.att.img.tall img { width: auto; height: 100%; }
.hidden-att { background: var(--hidden-bg); border-color: var(--hidden-line); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); font-size: 13px; line-height: 18px; color: var(--muted); }
.hidden-att b { position: absolute; right: 9px; bottom: 9px; width: 26px; height: 18px; display: grid; place-items: center; border: 1px solid var(--warn-line); border-radius: 4px; background: var(--warn-bg); color: var(--warn); }
.bubble { max-width: 632px; padding: 10px 16px 11px; border-radius: 16px; background: var(--bubble); white-space: pre-wrap; font-size: 15px; line-height: 21px; }
.clip { max-height: 209px; overflow: hidden; -webkit-mask: linear-gradient(#000 76%, transparent 98%); mask: linear-gradient(#000 76%, transparent 98%); }
.collapsed { width: 632px; }
.collapsed.expanded .clip { max-height: none; -webkit-mask: none; mask: none; }
.more { display: block; margin-top: 4px; padding: 4px 0; font-size: 13px; line-height: 16px; font-weight: 500; }

/* Assistant turn */
.prose { font: 400 var(--prose-size)/21px var(--prose-font); letter-spacing: var(--prose-track); }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol { max-width: var(--prose-width); }
.prose p { margin: 0 0 11px; }
.prose ul, .prose ol { margin: 0 0 20px; padding: 0 0 0 25px; }
.prose li { margin: 0 0 3.6px; padding-left: 9px; }
.prose li::marker { font-weight: 400; }
.prose strong { font-weight: 600; }
.prose h3, .prose h4 { font: 600 var(--prose-size)/21px var(--prose-font); margin: 23px 0 8px; }
.prose ul + h3, .prose ol + h3, .prose table + h3, .prose ul + h4 { margin-top: 0; }
.prose h3 + h4 { margin-top: 0; }
.prose p + ul, .prose p + ol { margin-top: 0; }
.prose h4 { font-weight: 500; margin-bottom: 11px; }
.prose table { width: 100%; margin: 0 0 22px; border-collapse: collapse; }
.prose th { padding: 6px 12px 7px 0; text-align: left; font-weight: 600; vertical-align: top; }
.prose td { padding: 7px 12px 8px 0; vertical-align: top; }
.prose tbody tr { border-top: 1px solid var(--row); }
.prose code { padding: 2px 5px; border-radius: 4px; background: var(--code); font: 400 13.5px/1 var(--mono); }
/* Markdown pieces used by conversations built from chat.json */
.prose h1, .prose h2 { font: 600 calc(var(--prose-size) + 2px)/1.35 var(--prose-font); margin: 24px 0 10px; }
.prose a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.prose hr { max-width: var(--prose-width); margin: 22px 0; border: 0; border-top: 1px solid var(--row); }
.prose blockquote { max-width: var(--prose-width); margin: 0 0 14px; padding: 0 0 0 16px; border-left: 3px solid var(--row); color: var(--fold-text); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose li > ul, .prose li > ol { margin: 4px 0 6px; }
.prose li > p { margin: 4px 0 0; }
.code-block { position: relative; max-width: var(--prose-width); margin: 4px 0 16px; border: 1px solid var(--card-line); border-radius: 10px; background: var(--code); }
.code-block pre { margin: 0; padding: 14px 44px 14px 16px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-block code { padding: 0; background: none; font: 400 13px/20px var(--mono); letter-spacing: 0; }
.code-copy { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.code-copy:hover { background: var(--active); color: var(--text); }
/* File Claude handed back, e.g. an edited .docx */
.file-card { width: min(100%, 584px); display: flex; align-items: center; gap: 14px; margin: 16px 0 6px; padding: 14px 16px; border: 1px solid var(--card-line); border-radius: 12px; background: var(--bubble); font-family: var(--sans); cursor: pointer; }
.file-card:hover { border-color: var(--muted); }
.file-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, #6ea8e6 18%, transparent); color: #6ea8e6; }
.file-card b { display: block; font-weight: 450; font-size: 15px; line-height: 21px; }
.file-card small { display: block; font-size: 13px; line-height: 18px; color: var(--muted); }
.prose .tool + p { margin-top: 0; }
.think, .tool { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font: 400 15px/21px var(--sans); color: var(--muted); cursor: pointer; }
[data-variant='shared'] .tool { font-size: 14px; margin: 36px 0; }
[data-variant='shared'] .after-tool { margin-top: 0; }
.caret { width: 0; height: 0; border: 3px solid transparent; border-left: 4px solid currentColor; border-right: 0; transition: transform .2s; }
.fold > button { width: fit-content; padding: 0; background: none; text-align: left; }
.fold > button:hover { color: var(--text); }
.fold.open > button .caret { transform: rotate(90deg); }
.fold-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.fold.open .fold-body { grid-template-rows: 1fr; }
.fold-inner { min-height: 0; overflow: hidden; }
.fold-body { margin: 0 -1px 0 -4px; }
.fold-card { margin: -2px 0 19px; border: 1px solid var(--fold-line); border-radius: 12px; font: 400 14px/20px var(--sans); letter-spacing: 0; color: var(--fold-text); }
.fold-card:not(.rows) { padding: 9px 11px 8px; }
.thought-time { margin-bottom: 7px; font-size: 13px; line-height: 18px; }
.thought-line { padding: 3px 0 6px; font-size: 14px; }
.thought-line:last-child { padding-bottom: 2px; }
.tool-row { min-height: 36.8px; padding: 8px 11px; display: flex; align-items: center; gap: 8px; }
.tool-row + .tool-row { border-top: 1px solid var(--fold-line); }
.tool-row u { color: var(--text); text-underline-offset: 2px; }
.row-clip { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; -webkit-mask: linear-gradient(90deg, #000 94%, transparent); mask: linear-gradient(90deg, #000 94%, transparent); }
.doc-chip { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0 -4px; padding: 5px 9px 5px 8px; border-radius: 8px; background: var(--chip); font-size: 14.5px; line-height: 18px; font-weight: 450; }
.actions { display: flex; align-items: center; gap: 6px; margin-top: 13px; color: var(--soft); }
.actions time { margin-left: 8px; font-size: 11.5px; color: var(--muted); }
.turn.assistant:has(.actions) + .turn.user { margin-top: 24px; }

/* Bottom dock */
.dock { position: sticky; bottom: 0; width: 100%; flex: none; }
[data-variant='personal'] .dock { width: 769px; max-width: calc(100% - 32px); margin: 0 auto; padding-bottom: 14px; background: var(--bg); box-shadow: 0 -24px 24px -8px var(--bg); }
.composer { height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 14px 0 12px; border: 1px solid var(--composer-line); border-radius: 16px; background: var(--composer); color: var(--soft); }
.composer input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 400 15px/21px var(--sans); }
.composer input::placeholder { color: var(--muted); }
.c-right { display: flex; align-items: center; gap: 8px; }
.disclaimer { display: flex; justify-content: space-between; padding: 10px 16px 0; font-size: 13px; line-height: 16px; color: var(--muted); }
/* Shared view: the button sits after the last message, so it only shows once scrolled to the end. */
[data-variant='shared'] .dock { position: static; padding: 24px 0 32px; text-align: center; }
.ask {padding: 6px 10px; border-radius: 8px; background: var(--ask-bg); color: var(--ask-text); font-size: 14px; line-height: 20px; font-weight: 500; }

/* Account menu: the trigger is pinned bottom-left, so fixed insets need no anchoring. */
.menu { position: fixed; inset: auto auto 54px 8px; width: 272px; margin: 0; padding: 6px; border: 1px solid var(--card-line); border-radius: 12px; background: var(--menu); color: var(--text); box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--line); }
.menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; font-size: 14px; line-height: 20px; }
.menu button svg { color: var(--soft); }
.menu button:is(:hover, :focus-visible) { background: var(--active); outline: 0; }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: 14px; line-height: 18px; }
.menu-head b { display: block; font-weight: 500; }
.menu-head small { color: var(--muted); font-size: 12.5px; }
@media (prefers-reduced-motion: no-preference) {
  .menu { opacity: 0; translate: 0 .25rem; transition: opacity .15s, translate .15s, display .15s allow-discrete, overlay .15s allow-discrete; }
  .menu:popover-open { opacity: 1; translate: 0 0; transition-duration: .1s; @starting-style { opacity: 0; translate: 0 .25rem; } }
}

/* Settings */
.settings-view { flex: 1; min-height: 0; overflow-y: auto; }
.settings { max-width: 920px; margin: 0 auto; padding: 18px 32px 64px; }
.back { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; margin-left: -4px; border-radius: 6px; font-size: 13.5px; color: var(--muted); }
.back:hover { color: var(--text); }
.settings h1 { margin: 14px 0 24px; font: 400 28px/1.2 var(--serif); letter-spacing: -.3px; }
.set-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 40px; }
.set-nav { display: flex; flex-direction: column; gap: 2px; }
.set-nav button { padding: 7px 12px; border-radius: 8px; text-align: left; font-size: 14px; font-weight: 500; color: var(--muted); }
.set-nav button:hover { color: var(--text); }
.set-nav [aria-current] { background: var(--chip); color: var(--text); }
.tab h2 { margin: 0 0 14px; font: 500 16px/1.4 var(--sans); }
.tab h3 { margin: 20px 0 10px; font: 500 14px/1.4 var(--sans); }
.tab hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; font-size: 14px; color: var(--soft); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field :is(input, select, textarea) { width: 100%; min-height: 40px; padding: 9px 14px; border: 1px solid var(--card-line); border-radius: 8px; background: transparent; color: var(--text); font: 400 14px/20px var(--sans); resize: vertical; }
.field select option { background: var(--menu); }
.field :is(input, select, textarea):focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 10px 0; font-size: 14px; }
.set-row b { display: block; font-weight: 500; }
.set-row small { display: block; font-size: 13px; line-height: 18px; color: var(--muted); }
input[switch] { appearance: none; flex: none; position: relative; width: 36px; height: 20px; margin: 0; border-radius: 99px; background: var(--active); cursor: pointer; transition: background .15s; }
input[switch]::before { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: translate .15s; }
input[switch]:checked { background: var(--primary); }
input[switch]:checked::before { translate: 16px 0; }
input[switch]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.opt { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--card-line); border-radius: 12px; font-size: 13.5px; text-align: center; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.opt:has(:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.swatch { height: 56px; padding: 8px; display: flex; flex-direction: column; gap: 5px; border-radius: 8px; border: 1px solid var(--line); }
.swatch u { height: 8px; border-radius: 3px; }
.swatch u + u { width: 60%; }
.s-light { background: #fff; } .s-light u { background: #e4e3de; }
.s-dark { background: #191919; } .s-dark u { background: #404040; }
.s-auto { background: linear-gradient(105deg, #fff 50%, #191919 50%); } .s-auto u { background: #8e8d88; }
.font-sample { height: 48px; display: grid; place-items: center; font-style: normal; font-size: 22px; }
.f-default { font-family: var(--serif); } .f-sans { font-family: var(--sans); }
.f-system { font-family: system-ui, 'Segoe UI', sans-serif; } .f-dyslexic { font-family: 'Comic Sans MS', 'Comic Neue', sans-serif; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-height: 34px; padding: 6px 14px; border: 1px solid var(--card-line); border-radius: 8px; font-size: 14px; font-weight: 500; }
.btn.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.btn.primary:active { background: var(--primary-active); }
.btn.danger { border-color: var(--error); color: var(--error); }
.btn[aria-pressed='true'] { background: var(--chip); }
.meter { margin-bottom: 16px; font-size: 14px; }
.meter span, .meter small { display: block; }
.meter small { color: var(--muted); font-size: 13px; }
.meter progress { width: 100%; height: 8px; margin: 6px 0 4px; accent-color: var(--primary); }

/* Hover feedback on sidebar links */
.row:not(.active):hover { background: color-mix(in srgb, var(--active) 60%, transparent); }
.nav-item:hover span, .nav-item:hover svg { color: var(--text); }
a.wordmark:hover { opacity: .85; }

/* Home (new chat) */
.home .scroll { position: relative; }
.home-top { display: flex; justify-content: center; padding: 14px 16px 0; }
.plan-pill { padding: 5px 12px; border-radius: 99px; background: var(--chip); font-size: 13px; line-height: 18px; color: var(--muted); }
.plan-pill a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.home-center { width: 672px; max-width: calc(100% - 32px); margin: 0 auto; padding: max(48px, 17vh) 0 48px; }
.greet { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 30px; font: 300 40px/1.15 var(--serif); letter-spacing: -.6px; text-align: center; }
.spark { flex: none; color: #d97757; }
@media (prefers-reduced-motion: no-preference) {
  .spark { animation: spark-in .7s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes spark-in { from { opacity: 0; rotate: -60deg; scale: .6; } }
}
.big-composer { display: flex; flex-direction: column; gap: 10px; padding: 14px 12px 10px; border: 1px solid var(--composer-line); border-radius: 20px; background: var(--composer); box-shadow: 0 4px 24px rgba(0, 0, 0, .05); transition: border-color .15s, box-shadow .15s; }
.big-composer:focus-within { border-color: color-mix(in srgb, var(--composer-line) 70%, var(--text)); box-shadow: 0 4px 24px rgba(0, 0, 0, .08); }
.big-composer textarea { min-height: 48px; max-height: 320px; padding: 2px 6px 0; border: 0; outline: 0; resize: none; background: none; color: var(--text); font: 400 16px/24px var(--sans); }
.big-composer textarea::placeholder { color: var(--muted); }
.bc-row { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--soft); transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--active); color: var(--text); }
.icon-btn.boxed { border: 1px solid var(--composer-line); }
.icon-btn[aria-pressed='true'] { color: #6ea8e6; border-color: color-mix(in srgb, #6ea8e6 45%, transparent); background: color-mix(in srgb, #6ea8e6 12%, transparent); }
.model-pick { margin-left: auto; display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 8px; font-size: 14px; color: var(--soft); }
.send { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--primary); color: #fff; transition: background .12s, opacity .12s; }
.send:not(:disabled):hover { background: var(--primary-active); }
.send:disabled { opacity: .45; cursor: default; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.chip { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--card-line); border-radius: 8px; font-size: 14px; color: var(--soft); transition: background .12s, color .12s; }
.chip svg { color: var(--muted); }
.chip:hover { background: var(--chip); color: var(--text); }
.suggest { margin-top: 12px; border: 1px solid var(--card-line); border-radius: 14px; overflow: hidden; background: var(--composer); }
.suggest-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; font-size: 13.5px; color: var(--muted); }
.suggest-head .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.suggest-item { display: block; width: 100%; padding: 11px 14px; border-top: 1px solid var(--composer-line); text-align: left; font-size: 14.5px; line-height: 20px; }
.suggest-item:hover, .suggest-item:focus-visible { background: var(--chip); outline: 0; }

/* Share dialog */
.modal { width: min(480px, calc(100% - 32px)); padding: 20px; border: 1px solid var(--card-line); border-radius: 16px; background: var(--menu); color: var(--text); box-shadow: 0 16px 48px rgba(0, 0, 0, .3); }
.modal::backdrop { background: rgba(0, 0, 0, .5); }
@media (prefers-reduced-motion: no-preference) {
  .modal[open] { animation: modal-in .16s ease-out; }
  @keyframes modal-in { from { opacity: 0; scale: .97; } }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin: -4px -6px 0 0; }
.modal h2 { margin: 0; font: 500 18px/1.3 var(--sans); }
.modal-sub { margin: 4px 0 16px; font-size: 14px; color: var(--muted); }
.share-access { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--card-line); border-radius: 12px; font-size: 14px; color: var(--soft); }
.share-access b { display: block; font-weight: 500; color: var(--text); }
.share-access small { display: block; font-size: 13px; color: var(--muted); }
.share-link { display: flex; gap: 8px; margin-top: 12px; }
.share-link input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid var(--card-line); border-radius: 8px; background: transparent; color: var(--text); font: 400 13.5px/1 var(--sans); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Report dialog (shared page) */
.banner .report-btn:disabled { color: var(--muted); cursor: default; }
.modal.report { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal-sub a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.report fieldset { margin: 0 0 14px; padding: 0; border: 0; }
.report legend { margin-bottom: 8px; font-size: 14px; color: var(--soft); }
.report legend i { font-style: normal; color: var(--error); }
.reasons { display: grid; gap: 6px; }
.reason { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border: 1px solid var(--card-line); border-radius: 10px; font-size: 14px; line-height: 19px; cursor: pointer; }
.reason:hover { background: var(--chip); }
.reason:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.reason input { margin: 3px 0 0; accent-color: var(--primary); flex: none; }
.reason b { display: block; font-weight: 500; }
.reason small { display: block; font-size: 12.5px; line-height: 17px; color: var(--muted); }
.report .field em { font-style: normal; color: var(--muted); }
.report .count { display: block; margin-top: 4px; text-align: right; font-size: 12px; color: var(--muted); }
.report-note { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 12%, transparent); font-size: 13.5px; line-height: 19px; }
.report-error { margin: 0; font-size: 13.5px; color: var(--error); }
.report-done { padding: 8px 4px 0; text-align: center; }
.report-done h2 { outline: 0; }
.report-done p { margin: 8px 0 0; font-size: 14px; line-height: 20px; color: var(--soft); }
.report-done .report-id { font-size: 12.5px; color: var(--muted); }
.report-done .modal-foot { justify-content: center; }
.done-icon { width: 44px; height: 44px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }

@media (max-width: 860px) {
  .greet { font-size: 30px; gap: 10px; }
  .greet .spark { width: 28px; height: 28px; }
  .home-center { padding-top: 10vh; }
  .set-grid { grid-template-columns: 1fr; gap: 20px; }
  .set-nav { flex-direction: row; flex-wrap: wrap; }
  .field-pair { grid-template-columns: 1fr; gap: 0; }
  .sidebar { display: none; }
  .prose { overflow-x: hidden; }
  .prose table { display: block; overflow-x: auto; }
  .atts, .bubble, .collapsed { max-width: 100%; }
}

/* Conversation not found (404.html, share/index.html) */
.nf-page { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; box-sizing: border-box; }
.nf { width: min(440px, 100%); margin-bottom: 8vh; text-align: center; }
.nf-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 36px; color: var(--text); font: 600 28px/1 var(--serif); letter-spacing: -.4px; }
.nf-brand img { display: block; }
.nf h1 { margin: 0 0 10px; font: 400 28px/1.2 var(--serif); letter-spacing: -.3px; }
.nf p { margin: 0 0 14px; font-size: 15px; line-height: 22px; color: var(--soft); }
.nf .nf-hint { font-size: 14px; line-height: 20px; color: var(--muted); }

/* Model picker: one popover shared by the home composer and the chat footer; JS sets its position.
   "Effort" and "More models" open side panels placed beside the menu. */
.model-pick, .model { display: inline-flex; align-items: center; gap: 0; padding: 6px 10px; border-radius: 8px; font-size: 15px; line-height: 20px; color: var(--text); white-space: nowrap; }
.model { margin: -6px -10px; font-size: 13px; line-height: 16px; padding: 4px 8px; }
.model-pick:hover, .model:hover, .model-pick[aria-expanded='true'], .model[aria-expanded='true'] { background: var(--active); color: var(--text); }
.mp-name { font-weight: 450; margin-right: 6px; }
.mp-effort { color: var(--muted); }
.model-menu { position: fixed; inset: auto; margin: 0; padding: 8px; overflow: visible; border: 1px solid var(--card-line); border-radius: 16px; background: var(--menu); color: var(--text); box-shadow: 0 8px 28px rgba(0, 0, 0, .14); }
body[data-theme='dark'] .model-menu { box-shadow: 0 8px 28px rgba(0, 0, 0, .4); }
.model-menu hr { margin: 4px 12px; border: 0; border-top: 1px solid var(--line); }
.mm-item, .mm-sub, .mm-opt { width: 100%; display: flex; align-items: center; gap: 8px; border-radius: 10px; text-align: left; }
.mm-item { padding: 6px 12px; }
.mm-item:is(:hover, :focus-visible), .mm-sub:is(:hover, :focus-visible, [aria-expanded='true']), .mm-opt:is(:hover, :focus-visible) { background: var(--active); outline: 0; }
.mm-text { flex: 1; min-width: 0; }
.mm-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mm-item b { font-size: 16px; line-height: 23px; font-weight: 400; }
.mm-item small { display: block; font-size: 15px; line-height: 22px; color: var(--muted); }
.mm-tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border: 1px solid var(--card-line); border-radius: 99px; font-size: 12px; line-height: 17px; color: var(--muted); white-space: nowrap; }
.mm-tag.warn { border-color: transparent; background: #fbefc9; color: #6d5200; }
.mm-tag.warn svg { color: #a06c00; }
body[data-theme='dark'] .mm-tag.warn { background: #4a3a10; color: #f3d98a; }
body[data-theme='dark'] .mm-tag.warn svg { color: #f3c04a; }
.mm-buy { align-self: flex-start; margin-top: 3px; padding: 0 6px; border-radius: 6px; background: #dce9fb; color: #1f62c4; font-size: 12.5px; line-height: 18px; font-weight: 500; white-space: nowrap; }
body[data-theme='dark'] .mm-buy { background: #1d3557; color: #9cc3f5; }
.mm-check { display: grid; flex: none; color: #2c84db; visibility: hidden; }
[aria-checked='true'] > .mm-check { visibility: visible; }
.mm-item .mm-check { margin-left: auto; }
.mm-sub { min-height: 34px; padding: 6px 12px; font-size: 16px; line-height: 22px; }
.mm-sub > span:first-child { flex: 1; }
.mm-val { color: var(--muted); }
.mm-sub svg { color: var(--soft); }
.mm-note { margin: 6px 12px 4px; font-size: 15px; line-height: 22px; color: var(--muted); }
.mm-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mm-note a:hover { color: var(--text); }
.mm-panel { position: absolute; width: 400px; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 8px; border: 1px solid var(--card-line); border-radius: 16px; background: var(--menu); box-shadow: 0 8px 28px rgba(0, 0, 0, .14); }
body[data-theme='dark'] .mm-panel { box-shadow: 0 8px 28px rgba(0, 0, 0, .4); }
.mm-panel[hidden] { display: none; }
.mm-hint { margin: 6px 12px 6px; font-size: 15px; line-height: 21px; color: var(--muted); }
.mm-opt { min-height: 35px; padding: 4px 12px; font-size: 16px; line-height: 22px; }
.mm-opt .mm-check { margin-left: auto; }
@media (prefers-reduced-motion: no-preference) {
  .model-menu { opacity: 0; translate: 0 .25rem; transition: opacity .15s, translate .15s, display .15s allow-discrete, overlay .15s allow-discrete; }
  .model-menu:popover-open { opacity: 1; translate: 0 0; transition-duration: .1s; @starting-style { opacity: 0; translate: 0 .25rem; } }
}

/* Recents page (/recents): the "View all" list of every conversation. */
.rc { width: 100%; max-width: 1296px; margin: 0 auto; padding: 40px 48px 64px; box-sizing: border-box; }
.rc h1 { margin: 0 0 32px; font: 500 32px/1.2 var(--serif); letter-spacing: -.5px; }
.rc-bar { min-height: 36px; display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.rc-tabs { display: flex; gap: 2px; }
.rc-tabs[hidden], .rc-picked[hidden], .rc-search[hidden], .rc-btn[hidden] { display: none; }
.rc-tabs button { height: 34px; padding: 0 15px; border-radius: 8px; font-size: 16px; color: var(--soft); }
.rc-tabs button:hover { color: var(--text); }
.rc-tabs [aria-selected='true'] { background: var(--chip); color: var(--text); }
.rc-picked { display: flex; align-items: center; gap: 16px; font-size: 15px; }
.rc-all { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.rc-all:hover { color: var(--text); }
.rc-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.rc .rc-find { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; color: var(--text); }
.rc-find[aria-expanded='true'] { background: var(--active); }
.rc-search input { width: 240px; height: 36px; padding: 0 12px; box-sizing: border-box; border: 1px solid var(--card-line); border-radius: 8px; background: transparent; color: var(--text); font: 400 15px/1 var(--sans); outline: 0; }
.rc-search input:focus { border-color: var(--muted); }
.rc-search input::placeholder { color: var(--muted); }
.rc-btn { height: 35px; display: inline-flex; align-items: center; padding: 0 11px; border-radius: 8px; background: var(--chip); color: var(--text); font-size: 16px; font-weight: 450; white-space: nowrap; }
.rc-btn:hover { background: var(--active); }
.rc-btn:disabled { opacity: .5; cursor: default; background: var(--chip); }
.rc-btn.dark { background: var(--text); color: var(--bg); }
.rc-btn.dark:hover { background: var(--soft); }
.rc-list { margin: 0; padding: 0; list-style: none; }
.rc-list li { border-bottom: 1px solid var(--line); }
.rc-row { min-height: 65px; display: flex; align-items: center; gap: 16px; font-size: 16px; line-height: 22px; cursor: pointer; }
.rc-row:hover .rc-title { text-decoration: underline; text-underline-offset: 3px; }
.rc-row:focus-visible { outline: 2px solid #2c84db; outline-offset: -2px; border-radius: 6px; }
.rc-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-row time { flex: none; color: var(--muted); }
.rc-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--text); }
.rc-list .rc-empty { padding: 48px 0; text-align: center; color: var(--muted); border: 0; }
@media (max-width: 860px) {
  .rc { padding: 28px 16px 48px; }
  .rc h1 { font-size: 26px; margin-bottom: 20px; }
  .rc-bar { flex-wrap: wrap; }
  .rc-tools { flex-wrap: wrap; justify-content: flex-end; }
  .rc-search { flex: 1 1 100%; order: 9; }
  .rc-search input { width: 100%; }
}

/* Upgrade links: the sidebar pill, locked rows in the model menu, the Settings button. */
a.upgrade:hover { background: var(--active); }
