/* ONYX: a quiet chat app. Neutral surfaces, one green accent, no gradients. */
:root {
  color-scheme: dark;
  --bg: #0b0d0c;
  --side: #08090a;
  --surface: #131615;
  --surface-2: #1a1e1c;
  --hover: #1d2220;
  --line: #242a27;
  --line-2: #2f3633;
  --text: #e9ecea;
  --muted: #8d9792;
  --faint: #5f6864;
  --accent: #2fd57d;
  --accent-ink: #04150b;
  --accent-soft: rgba(47, 213, 125, .12);
  --ok: #2fd57d;
  --warn: #e8a94f;
  --bad: #f06a6a;
  --bad-soft: rgba(240, 106, 106, .1);
  --code-bg: #0e1110;
  --user: #1c211f;
  --radius: 12px;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #ffffff; --side: #f6f7f6; --surface: #ffffff; --surface-2: #f3f5f4; --hover: #eceeed;
    --line: #e3e6e4; --line-2: #d3d8d5; --text: #161a18; --muted: #5d6762; --faint: #8c9590;
    --accent: #0f9d58; --accent-ink: #ffffff; --accent-soft: rgba(15, 157, 88, .1);
    --ok: #0f9d58; --warn: #b7791f; --bad: #c93c3c; --bad-soft: rgba(201, 60, 60, .08);
    --code-bg: #f5f7f6; --user: #f0f2f1;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: .88em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.mt { margin-top: 20px; }
.mt-s { margin-top: 12px; }
h2, h3 { margin: 0 0 8px; line-height: 1.3; letter-spacing: -.01em; }
h2 { font-size: 22px; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 10px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------ layout */
.app { display: flex; height: 100vh; height: 100dvh; }
.side { width: 264px; flex: none; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 12px 10px; gap: 8px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.only-mobile, .icon-btn.only-mobile { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 30; }

.side-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 4px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 24px; height: 24px; stroke: none; }
.gem-a { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1; }
.gem-b { fill: var(--bg); }
.gem-c { fill: var(--accent); }

.new-chat { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; }
.new-chat:hover { background: var(--hover); }
.search { width: 100%; padding: 7px 11px; border-radius: 9px; border: 1px solid transparent; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
.search:focus { border-color: var(--line-2); outline: none; }

.history { flex: 1; overflow-y: auto; margin: 4px -4px 0; padding: 0 4px; scrollbar-width: thin; }
.history h4 { margin: 14px 8px 4px; font-size: 12px; font-weight: 600; color: var(--faint); }
.history .empty { padding: 10px 8px; font-size: 13px; color: var(--faint); }
.hitem { position: relative; display: flex; align-items: center; border-radius: 8px; }
.hitem a { flex: 1; min-width: 0; padding: 7px 8px; color: var(--text); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hitem a:hover { text-decoration: none; }
.hitem:hover, .hitem.active { background: var(--hover); }
.hitem .pin { color: var(--faint); width: 13px; height: 13px; margin-left: 6px; }
.hitem .more { opacity: 0; padding: 4px; margin-right: 2px; }
.hitem:hover .more, .hitem.active .more, .hitem .more[aria-expanded="true"] { opacity: 1; }
.menu { position: absolute; right: 4px; top: 32px; z-index: 20; min-width: 150px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 4px; box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .5); }
.menu button { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; border-radius: 7px; cursor: pointer; }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--bad); }
.rename { flex: 1; margin: 2px; padding: 5px 7px; border: 1px solid var(--accent); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }

.side-nav { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 8px; }
.side-nav a, .account-chip { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.side-nav a:hover, .account-chip:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.side-nav a.on, .account-chip.on { background: var(--hover); color: var(--text); }
.badge { margin-left: auto; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.account-chip { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; padding-top: 10px; color: var(--text); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); font-weight: 650; font-size: 13px; flex: none; }
.who-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who-text strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------ top bar, banners */
.top { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid transparent; }
.top.lined { border-bottom-color: var(--line); }
.page-title { font-size: 16px; margin: 0; font-weight: 600; }
.model-pick select { appearance: none; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; font-weight: 600; padding: 6px 28px 6px 10px; border-radius: 9px; cursor: pointer; max-width: 56vw;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d9792' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; background-size: 16px; }
.model-pick select:hover { background-color: var(--hover); }
.model-pick option, .model-pick optgroup { background: var(--surface); color: var(--text); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill.ok i { background: var(--ok); }
.pill.warn i { background: var(--warn); }
.pill.bad i { background: var(--bad); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: none; color: var(--muted); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.bell .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }

.banner { display: flex; align-items: center; gap: 10px; margin: 0 16px 8px; padding: 9px 14px; border-radius: 10px; font-size: 14px; }
.banner.down { background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.banner.down strong { color: var(--bad); letter-spacing: .04em; }
.banner.info { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.banner.info span { flex: 1; }
.banner .icon-btn { width: 26px; height: 26px; }

/* ------------------------------------------------ views */
.view { flex: 1; min-height: 0; }
.page { overflow-y: auto; }
.page-inner { max-width: 980px; margin: 0 auto; padding: 18px 20px 60px; }
.page-inner.narrow { max-width: 720px; }
.page-inner.wide { max-width: 1180px; }
.page-head { margin-bottom: 18px; }
.page-head p { max-width: 70ch; }
.sub-h { margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 18px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.alias { padding: 14px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.alias:hover { border-color: var(--line-2); background: var(--surface-2); }
.alias code { font-size: 14px; font-weight: 600; color: var(--text); }
.alias p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 11px; font: 13px var(--mono); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.tag.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.tag.warn { color: var(--warn); }
.tag.bad { color: var(--bad); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat .label { font-size: 12.5px; color: var(--muted); }
.stat strong { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.meter { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 6px 0 2px; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-head .sub-h { margin-bottom: 10px; }

/* forms */
.row { display: flex; gap: 8px; align-items: center; }
.wrap-row { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 11px; min-width: 0; }
.row > input { flex: 1; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); padding: 0; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field input, .field textarea, .field select { font-size: 15px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline input { width: 110px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.primary:hover { opacity: .88; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.error { color: var(--bad); font-size: 14px; margin: 8px 0 0; }
.newkey { border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
.newkey code { flex: 1; overflow-wrap: anywhere; font-size: 14px; padding: 8px 10px; background: var(--bg); border-radius: 8px; border: 1px solid var(--line); }
.list { list-style: none; margin: 8px 0 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.list li:first-child { border-top: 0; }
.list li .k { color: var(--muted); flex: 1; }
.prov-form { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:first-child td { border-top: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.refills { color: var(--muted); font-size: 13px; max-width: 280px; }
.table input[type="number"] { width: 80px; padding: 4px 7px; text-align: right; }
.table .acts { white-space: nowrap; text-align: right; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; padding: 10px 12px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--text); }
.owner-tabs { padding: 0; margin-bottom: 18px; }
.kv { margin: 0; padding: 16px 18px; display: grid; gap: 10px; }
.kv div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: center; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.kv code { overflow-wrap: anywhere; }
.snippet { position: relative; }
.snippet pre { margin: 0; padding: 16px 18px; background: var(--code-bg); border-radius: 0 0 var(--radius) var(--radius); overflow-x: auto; font-size: 13px; line-height: 1.55; }
.snippet .copy { position: absolute; top: 10px; right: 10px; }
pre.log { margin: 0; padding: 10px 12px; background: var(--code-bg); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; line-height: 1.5; max-height: 260px; overflow: auto; white-space: pre-wrap; color: var(--muted); }
pre.log:empty { display: none; }
.faq details { border-top: 1px solid var(--line); padding: 12px 2px; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 550; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.page pre:not(.log) { background: var(--code-bg); border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; overflow-x: auto; }

/* owner: providers and sharing */
.prov-rows { display: flex; flex-direction: column; }
.prow { border-top: 1px solid var(--line); padding: 12px 0; }
.prow:first-child { border-top: 0; }
.prow-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prow-head strong { font-size: 14.5px; }
.prow-head .grow { min-width: 10px; }
.prow .note { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.prow form { margin-top: 8px; }
.share-tree { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.share-tree details { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.share-tree summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.share-tree summary::-webkit-details-marker { display: none; }
.share-tree summary .count { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.share-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.share-models label { font-size: 13px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* updates feed */
.feed { display: flex; flex-direction: column; gap: 12px; }
.ann { padding: 16px 18px; }
.ann.pinned { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.ann.private { border-style: dashed; }
.ann-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.ann h3 { font-size: 16px; margin: 2px 0 6px; }
.ann .md p:last-child { margin-bottom: 0; }
.ann .chips { margin-top: 10px; }
.ann-acts { display: flex; gap: 6px; margin-top: 10px; }
.ann.unread h3::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.post-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

/* ------------------------------------------------ chat */
.chat-view { display: flex; flex-direction: column; position: relative; }
.thread { flex: 1; overflow-y: auto; scroll-behavior: auto; }
.welcome { max-width: 760px; margin: 0 auto; padding: 12vh 20px 20px; text-align: center; }
.welcome h2 { font-size: 28px; font-weight: 650; margin-bottom: 6px; }
.suggest { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 28px; text-align: left; }
.sugg { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.sugg:hover { background: var(--surface-2); }
.sugg span { color: var(--muted); font-size: 13.5px; }
.msgs { max-width: 780px; margin: 0 auto; padding: 8px 20px 24px; }
.msg { margin: 22px 0; }
.msg.user { display: flex; flex-direction: column; align-items: flex-end; }
.msg.user .bubble { background: var(--user); border-radius: 18px; padding: 9px 15px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user .files { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 6px; }
.msg .actions { display: flex; gap: 2px; margin-top: 4px; opacity: 0; transition: opacity .12s; }
.msg:hover .actions, .msg.last .actions { opacity: 1; }
.msg .actions .icon-btn { width: 28px; height: 28px; }
.msg .actions svg { width: 15px; height: 15px; }
.msg.bot .meta { font-size: 12px; color: var(--faint); margin-bottom: 4px; font-family: var(--mono); }
.msg.bot.error .body { color: var(--bad); }
.body { overflow-wrap: anywhere; }
.body > :first-child { margin-top: 0; }
.body p { margin: 0 0 12px; }
.body h3, .body h4 { margin: 18px 0 8px; font-size: 16px; }
.body ul, .body ol { margin: 0 0 12px; padding-left: 22px; }
.body li { margin: 3px 0; }
.body blockquote { margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--line-2); color: var(--muted); }
.body table { border-collapse: collapse; margin: 0 0 12px; font-size: 14px; display: block; overflow-x: auto; }
.body th, .body td { border: 1px solid var(--line-2); padding: 5px 10px; }
.body hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.body :not(pre) > code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.codeblock { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--code-bg); }
.codeblock .cb-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 12px; font-size: 12px; color: var(--muted); background: var(--surface-2); font-family: var(--mono); }
.codeblock .cb-head button { border: 0; background: none; color: var(--muted); font: 12px var(--sans); padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.codeblock .cb-head button:hover { background: var(--hover); color: var(--text); }
.codeblock pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.55; }
.cursor > :last-child::after, .cursor:empty::after { content: ""; display: inline-block; width: 8px; height: 15px; margin-left: 2px; background: var(--text); vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.think { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.think summary { cursor: pointer; user-select: none; }
.think > div { margin-top: 6px; padding: 8px 0 8px 12px; border-left: 2px solid var(--line-2); white-space: pre-wrap; max-height: 320px; overflow-y: auto; }

.gate { position: absolute; inset: 0 0 auto 0; bottom: 0; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 85%, transparent); z-index: 5; }
.gate-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; text-align: center; }
.gate-card form { margin-top: 14px; }
.gate-card .muted { margin-top: 10px; }

.composer { max-width: 780px; width: 100%; margin: 0 auto; padding: 0 20px 10px; flex: none; }
.composer-box { display: flex; align-items: flex-end; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 22px; padding: 7px 7px 7px 8px; }
.composer-box:focus-within { border-color: var(--faint); }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; padding: 7px 4px; max-height: 220px; line-height: 1.5; }
.composer textarea:focus { border: 0; }
.attach { cursor: pointer; }
.send { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); display: grid; place-items: center; cursor: pointer; }
.send:disabled { opacity: .35; cursor: not-allowed; }
.send .i-stop { display: none; fill: currentColor; stroke: none; }
.send.stop .i-send { display: none; }
.send.stop .i-stop { display: block; }
.attached { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--line-2); border-radius: 9px; font-size: 13px; background: var(--surface); }
.file-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: 15px; line-height: 1; }
.fine { font-size: 12px; color: var(--faint); text-align: center; margin: 7px 0 0; }

/* notice pages (OAuth callbacks) */
.notice { max-width: 520px; margin: 14vh auto; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
body:has(.notice) { overflow: auto; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 10px; font-size: 14px; z-index: 50; }

/* ------------------------------------------------ small screens */
@media (max-width: 860px) {
  .only-mobile, .icon-btn.only-mobile { display: inline-grid; }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform .18s ease; width: 280px; }
  .side.open { transform: none; }
  .top { padding: 0 8px; }
  .pill span { display: none; }
  .pill { padding: 6px; }
  .suggest { grid-template-columns: 1fr; }
  .suggest .sugg:nth-child(n+3) { display: none; }
  .welcome { padding-top: 8vh; }
  .msgs, .composer { padding-left: 12px; padding-right: 12px; }
  .page-inner { padding: 14px 16px 48px; }
  .prov-form { grid-template-columns: 1fr; }
  .kv div { grid-template-columns: 1fr; gap: 2px; }
  .grid.two { grid-template-columns: 1fr; }
  .msg.user .bubble { max-width: 92%; }
}
