/*
 * css/pages/spend.css: /account and /chat (SPEC 12 C5), group spend. Tokens only (css/tokens.css); shared
 * components come from css/site.css. The chat workspace follows the heyaskr workspace frame: a 280px rail and a
 * main column fixed under the header to the bottom of the viewport, the rail a drawer under 900px.
 */

/* ============================================================================================ account */
.acct-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.acct-head__copy { min-width: 0; }
.acct-who {
  display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--panel);
  font: 500 13px/1 var(--font-mono); color: var(--text); white-space: nowrap;
}
.acct-who__chain { color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line-strong); }
.acct { padding-bottom: var(--section); display: flex; flex-direction: column; gap: 24px; }
.acct-nw .state { max-width: 640px; }
.acct-body { display: flex; flex-direction: column; gap: 24px; }
.acct-tabs [role="tab"] { display: inline-flex; align-items: center; gap: 8px; }
.acct-tabs [role="tab"] .icon { color: var(--muted); }
.acct-tabs [role="tab"][aria-selected="true"] .icon { color: var(--accent); }
.acct-panel { display: flex; flex-direction: column; gap: 24px; }
.acct-panel:focus-visible { outline-offset: 6px; }

.acct-band dd { min-height: 1.3em; }
.acct-band .band__note { font: 500 14px/1.4 var(--font-body); }
.acct-band .unknown.band__note { color: var(--muted); }
.acct-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.acct-routes .card { min-height: 100%; }
.acct-routes .h3 { margin-bottom: 8px; }

.acct-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 1024px) { .acct-split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; } }
.acct-aside { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.acct-aside .slashlist { padding-left: 20px; }
.acct-aside .slashlist li { font-size: 14.5px; }
.acct-aside .btn--quiet { align-self: flex-start; }

.acct-form { gap: 20px; }
.acct-form__sub { margin-top: 6px; font-size: 14.5px; color: var(--body); }
.act-preview {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px;
  padding: 14px 16px; border-radius: var(--r2); background: var(--panel-3); border: 1px solid var(--line);
  font: 500 13.5px/1.5 var(--font-mono); color: var(--dim); font-variant-numeric: tabular-nums;
}
.act-preview strong { color: var(--text); font-weight: 600; }
.act-preview__to { color: var(--muted); }
.act-adv summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; list-style: none;
  font-size: 14.5px; font-weight: 600; color: var(--dim);
}
.act-adv summary::-webkit-details-marker { display: none; }
.act-adv summary .icon { color: var(--accent); transition: transform var(--t2) var(--ease-out); }
.act-adv[open] summary .icon { transform: rotate(90deg); }
.act-adv .field { margin-top: 8px; }
.act-to { font-family: var(--font-mono); font-size: 16px; }
.act-summary .num { color: var(--text); }
[data-act-state]:empty { display: none; }
.acct-form .callout { font-size: 14.5px; }

/* your key */
.acct-key { gap: 20px; }
.acct-key.acct-key--state { padding: 0; border: 0; background: none; box-shadow: none; }
.key-status { display: flex; align-items: center; gap: 14px; }
.key-status__icon {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--r2);
  background: var(--accent-tint); border: 1px solid var(--accent-line); color: var(--accent);
}
.key-status__line { margin-top: 4px; font: 600 16px/1.35 var(--font-body); color: var(--text); overflow-wrap: anywhere; }
.key-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.key-figs > div { background: var(--panel-3); padding: 12px 14px; min-width: 0; }
.key-figs dt { font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.key-figs dd { margin-top: 6px; font: 600 15px/1.3 var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 479px) { .key-figs { grid-template-columns: minmax(0, 1fr); } }
.key-actions { gap: 10px 12px; }
.key-secret {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r3);
  border: 1px solid var(--accent-line); background: linear-gradient(180deg, var(--accent-tint), var(--panel) 80%);
}
.key-secret__value {
  display: block; padding: 12px 14px; border-radius: var(--r2); background: var(--bg-deep); border: 1px solid var(--line);
  font: 500 13.5px/1.6 var(--font-mono); color: var(--text); overflow-wrap: anywhere; word-break: break-all; user-select: all;
}
.key-secret__warn { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--warn); }
.key-paste { display: flex; flex-direction: column; gap: 8px; }
.key-paste__row { display: flex; gap: 10px; }
.key-paste__row .input { flex: 1; font-family: var(--font-mono); }
@media (max-width: 479px) { .key-paste__row { flex-direction: column; } }
.key-check:empty { display: none; }
.acct-base { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--bg-deep); }
.acct-base code { flex: 1; min-width: 0; background: none; padding: 0; font: 500 13.5px/1.5 var(--font-mono); color: var(--text); overflow-wrap: anywhere; }

/* activity */
.acct-filters { flex-wrap: wrap; align-self: flex-start; }
.act-table .table th[scope="row"] { font-weight: 600; color: var(--text); font-size: 14.5px; }
.act-table .act-date { white-space: nowrap; color: var(--muted); }
.act-table .act-amt { white-space: nowrap; color: var(--text); }
.act-table .act-detail { color: var(--muted); font-size: 14px; }
.act-x { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 13.5px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.act-x:hover { color: var(--accent); }
.act-x .icon { color: var(--muted); }
.act-more { align-self: center; margin-top: 12px; }
.acct-activity { display: flex; flex-direction: column; }
.acct-usage { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.usage-model { font: 500 13px/1.4 var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .act-table { border: 0; background: none; overflow: visible; }
  .act-table thead { display: none; }
  .act-table table, .act-table tbody { display: block; }
  .act-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; margin-bottom: 10px;
    border: 1px solid var(--line); border-radius: var(--r3); background: var(--panel);
  }
  .act-table tbody tr:hover { background: var(--panel); }
  .act-table th, .act-table td { display: block; padding: 0; border: 0; text-align: left; }
  .act-table .act-what { grid-column: 1; grid-row: 1; }
  .act-table .act-amt { grid-column: 2; grid-row: 1; text-align: right; }
  .act-table .act-date { grid-column: 1 / -1; grid-row: 2; font-size: 12.5px; }
  .act-table .act-detail { grid-column: 1 / -1; grid-row: 3; }
  .act-table .act-detail:empty { display: none; }
  .act-table .act-link { grid-column: 1 / -1; grid-row: 4; text-align: left; }
  .act-x { min-height: 44px; }
}
@media (max-width: 479px) {
  .acct-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acct-tabs [role="tab"] { justify-content: center; }
  .acct-actions .btn { flex: 1 1 100%; }
  .acct-who { width: 100%; justify-content: center; }
}

/* ============================================================================================ chat */
body:has(> main.page--chat) { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
main.page--chat { flex: 1 1 auto; min-height: 0; display: flex; }
.ws { flex: 1 1 auto; min-height: 0; width: 100%; display: grid; grid-template-columns: 280px minmax(0, 1fr); background: var(--bg-deep); }
@media (max-width: 1119px) { .ws { grid-template-columns: 248px minmax(0, 1fr); } }

.ws-label { font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .16em; color: var(--faint); }
.ws-label--dim { color: var(--muted); }
.ws-label--accent { color: var(--accent); }

/* rail */
.ws-rail {
  min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 16px; padding: 18px 16px;
  border-right: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-3), var(--bg-deep));
}
.ws-rail > * { flex-shrink: 0; }
.ws-rail__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.ws-rail__close { display: none; }
.ws-card {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r3);
  border: 1px solid var(--line-strong); background: var(--panel);
}
.ws-card--balance { border-color: var(--accent-line); background: linear-gradient(160deg, var(--accent-tint), var(--panel) 70%); }
.ws-card--key { border-color: var(--accent-line); }
.ws-card--state { align-items: flex-start; }
.ws-card__text { font-size: 14px; line-height: 1.55; color: var(--body); }
.ws-card__error { font-size: 13.5px; line-height: 1.5; color: var(--danger); }
.ws-card__foot { font: 500 12px/1.4 var(--font-mono); color: var(--muted); }
.ws-card__row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ws-card__link { display: inline-flex; align-items: center; min-height: 32px; font: 600 12.5px/1 var(--font-mono); color: var(--accent); }
.ws-card__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ws-balance { font: 700 22px/1.2 var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ws-bar { display: block; height: 3px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.ws-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.ws-key__form { display: flex; flex-direction: column; gap: 10px; }
.ws-key__input { height: 44px; font-family: var(--font-mono); font-size: 16px; }
.ws-key__remember { font-size: 14px; }
.ws-new .icon { color: var(--accent); }
.ws-chats { display: flex; flex-direction: column; gap: 10px; }
.ws-chats__list { list-style: none; display: grid; gap: 2px; }
.ws-chats__list:empty { display: none; }
.ws-chats__empty { font-size: 13.5px; line-height: 1.55; color: var(--body); }
.ws-chat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px; }
.ws-chat__open {
  display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 40px; padding: 8px 10px; text-align: left;
  border: 1px solid transparent; border-radius: var(--r2); font-size: 14px; font-weight: 500; color: var(--dim);
  transition: background-color var(--t1), border-color var(--t1), color var(--t1);
}
.ws-chat__open .icon { color: var(--muted); }
.ws-chat__open:hover { background: var(--panel-2); color: var(--text); }
.ws-chat.is-on .ws-chat__open { background: var(--panel-2); border-color: var(--line-strong); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.ws-chat.is-on .ws-chat__open .icon { color: var(--accent); }
.ws-chat__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-chat__del {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r2); color: var(--muted);
  opacity: 0; transition: opacity var(--t1), color var(--t1), background-color var(--t1);
}
.ws-chat:hover .ws-chat__del, .ws-chat__del:focus-visible, .ws-chat.is-on .ws-chat__del { opacity: 1; }
.ws-chat__del:hover { color: var(--danger); background: var(--panel-2); }
@media (hover: none) { .ws-chat__del { opacity: 1; } }
.ws-keep { font-size: 14px; margin-top: 4px; }
.ws-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.ws-foot__card { padding: 16px; border-radius: var(--r3); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.ws-foot__card p { font-size: 13.5px; line-height: 1.55; color: var(--body); }
.ws-foot__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ws-foot__head strong { color: var(--text); font-size: 14px; }
.ws-foot__head span { font: 600 11px/1 var(--font-mono); letter-spacing: .12em; color: var(--accent); }
.ws-foot__links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; }
.ws-foot__links a { display: inline-flex; align-items: center; min-height: 32px; font: 600 12.5px/1 var(--font-mono); color: var(--accent); }
.ws-foot__links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ws-scrim { display: none; }

/* main column */
.ws-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.ws-doors {
  flex: none; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 24px;
  border-bottom: 1px solid var(--line); background: var(--panel-3);
}
.ws-menu { display: none; }
.ws-doors__pills { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ws-doors__pills::-webkit-scrollbar { display: none; }
.ws-door {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-pill); font: 500 14px/1 var(--font-body); color: var(--muted); white-space: nowrap;
  transition: background-color var(--t2), border-color var(--t2), color var(--t1);
}
.ws-door .icon { width: 17px; height: 17px; }
.ws-door:hover { color: var(--text); border-color: var(--line-strong); }
.ws-door[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent-line); color: var(--text); }
.ws-door[aria-pressed="true"] .icon { color: var(--accent); }
.ws-models { flex: none; gap: 8px; }
.ws-models .icon { color: var(--accent); }
.ws-kbd {
  display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; margin-left: 2px;
  border: 1px solid var(--line-strong); border-radius: var(--r1); font: 500 11px/1 var(--font-mono); color: var(--muted);
}
@media (pointer: coarse), (max-width: 1119px) { .ws-kbd { display: none; } }

.ws-canvas {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; position: relative;
  background: radial-gradient(1100px 600px at 50% -10%, var(--glow-soft), transparent 65%);
}
.ws-welcome { width: min(1020px, 100%); margin-inline: auto; padding: 56px 24px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ws-welcome .h2 { margin-top: 14px; }
.ws-welcome__lede { max-width: 56ch; margin-top: 14px; font-size: 16px; line-height: 1.6; color: var(--body); }
.ws-tiles { width: 100%; margin-top: 30px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 14px; }
.ws-tile {
  position: relative; overflow: hidden; min-width: 0; min-height: 172px; padding: 18px 16px 16px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r3);
  background: linear-gradient(175deg, var(--panel-2), var(--panel)); box-shadow: var(--shadow-card);
  transition: border-color var(--t2) var(--ease-out), transform var(--t2) var(--ease-out), box-shadow var(--t2);
}
.ws-tile:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--ring); }
.ws-tile[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: var(--ring); }
.ws-tile strong { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; margin-top: 4px; }
.ws-tile small { max-width: 26ch; font-size: 13px; line-height: 1.5; color: var(--body); }
.ws-tile__icon {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r2);
  background: var(--accent-tint); border: 1px solid var(--accent-line); color: var(--accent);
}
.ws-tile__ghost { position: absolute; right: -16px; bottom: -20px; color: var(--text); opacity: .06; pointer-events: none; }
.ws-tile__ghost .icon { width: 110px; height: 110px; stroke-width: 1; }
.ws-using { margin-top: 22px; font-size: 13.5px; color: var(--muted); }
.ws-using strong { color: var(--text); font-weight: 650; }

/* thread */
.ws-thread { list-style: none; width: min(800px, 100%); margin-inline: auto; padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 26px; }
.ws-turn--user { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ws-bubble {
  max-width: min(100%, 620px); padding: 11px 15px; border-radius: 12px 12px 3px 12px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--dim);
  font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.ws-sent { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ws-sent-img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--r2); border: 1px solid var(--line); }
.ws-turn--ai { min-width: 0; }
.ws-reply { max-width: 70ch; color: var(--dim); font-size: 15.5px; line-height: 1.72; overflow-wrap: anywhere; }
.ws-reply > :first-child { margin-top: 0; }
.ws-reply p { margin: 0 0 12px; }
.ws-reply p:last-child { margin-bottom: 0; }
.ws-reply .md-h { color: var(--text); font-weight: 700; margin-top: 18px; }
.ws-reply strong { color: var(--text); font-weight: 600; }
.ws-reply a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.ws-reply ul, .ws-reply ol { margin: 0 0 12px; padding-left: 22px; }
.ws-reply li { margin: 4px 0; }
.ws-reply li::marker { color: var(--muted); }
.ws-reply blockquote { margin: 12px 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--line-strong); color: var(--body); }
.ws-reply pre { margin: 0 0 12px; font-size: 13px; line-height: 1.6; }
.ws-reply :not(pre) > code { font-size: .88em; }
.ws-wait { display: inline-flex; align-items: center; gap: 10px; font: 500 12.5px/1.4 var(--font-mono); color: var(--muted); }
.ws-wait__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
html.motion .ws-wait__dot { animation: ws-blink 1s steps(2, end) infinite; }
.ws-cursor { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--accent); }
html.motion .ws-cursor { animation: ws-blink 1.1s steps(2, end) infinite; }
@keyframes ws-blink { 50% { opacity: .25; } }
.ws-images { display: grid; gap: 12px; margin-top: 12px; }
.ws-gen { max-width: min(100%, 520px); height: auto; border-radius: var(--r3); border: 1px solid var(--line); background: var(--bg-deep); }
.ws-error {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 12px 14px; border-radius: var(--r2);
  background: var(--danger-tint); color: var(--text); font-size: 14.5px; line-height: 1.5;
}
.ws-error .icon { color: var(--danger); margin-top: 3px; }
.ws-receipt { margin-top: 12px; font: 400 11.5px/1.6 var(--font-mono); color: var(--faint); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* composer */
.ws-composer { flex: none; padding: 12px 24px 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--bg) 40%); }
.ws-box {
  width: min(820px, 100%); margin-inline: auto; border-radius: 12px; border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); box-shadow: var(--shadow-card);
  transition: border-color var(--t2), box-shadow var(--t2);
}
.ws-box:focus-within { border-color: var(--accent-line); box-shadow: var(--ring); }
.ws-input {
  display: block; width: 100%; min-height: 48px; max-height: 40vh; padding: 14px 16px 6px; resize: none; overflow-y: hidden;
  background: transparent; border: 0; outline: 0; color: var(--text); font: 400 16px/1.55 var(--font-body);
}
.ws-input::placeholder { color: var(--muted); opacity: 1; }
.ws-input:disabled { cursor: not-allowed; }
.ws-input:focus-visible { outline: none; }
.ws-attached { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 0; }
.ws-thumb { position: relative; width: 64px; height: 64px; border-radius: var(--r2); overflow: hidden; border: 1px solid var(--line-strong); }
.ws-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ws-thumb__x { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--scrim); color: var(--text); }
.ws-tools { display: flex; align-items: center; gap: 10px; padding: 6px 12px 12px; }
.ws-attach { flex: none; }
.ws-attach:disabled { color: var(--muted); border-color: var(--line); background: transparent; cursor: not-allowed; }
.ws-model {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; min-height: 40px; padding: 0 10px 0 6px;
  border: 1px solid var(--line-strong); border-radius: var(--r2); background: var(--panel-3); color: var(--text);
  font: 600 13.5px/1 var(--font-body); transition: border-color var(--t2);
}
.ws-model:hover { border-color: var(--line-input); }
.ws-model .icon { color: var(--muted); }
.ws-model__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-model__price { flex: none; font: 500 11.5px/1 var(--font-mono); color: var(--muted); }
.ws-mono {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: var(--r2);
  background: var(--panel-2); border: 1px solid var(--line); font: 600 13px/1 var(--font-mono); color: var(--dim);
}
.ws-mono:empty { display: none; }
.ws-send, .ws-stop { margin-left: auto; flex: none; }
.ws-send__short { display: none; }
.ws-status { width: min(820px, 100%); margin: 8px auto 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); text-align: center; }
.ws-retry { font: inherit; }

/* model picker (a B7 dialog) */
.pick-dialog { width: min(640px, 100vw - 32px); }
.pick-dialog .dialog__body { gap: 14px; padding-bottom: 12px; }
.pick { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.pick-search { height: 44px; }
.pick-group { display: flex; flex-direction: column; gap: 8px; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-chip {
  min-height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  font: 500 13px/1 var(--font-body); color: var(--body); transition: background-color var(--t1), border-color var(--t1), color var(--t1);
}
.pick-chip:hover { color: var(--text); border-color: var(--line-input); }
.pick-chip[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent-line); color: var(--text); }
.pick-count { margin-top: 2px; }
.pick-list { list-style: none; display: flex; flex-direction: column; gap: 2px; max-height: min(44vh, 420px); overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); padding-top: 6px; }
.pick-row {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 10px; border-radius: var(--r2); text-align: left;
  transition: background-color var(--t1);
}
.pick-row:hover, .pick-row:focus-visible { background: var(--panel-2); }
.pick-row.is-on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.pick-row__name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pick-row__name strong { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row__name small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row__price { flex: none; font: 600 12px/1.3 var(--font-mono); color: var(--dim); font-variant-numeric: tabular-nums; text-align: right; }
.pick-none { padding: 18px 10px; text-align: center; font-size: 14px; color: var(--muted); }

/* drawer under 900px */
@media (max-width: 899px) {
  .ws { grid-template-columns: minmax(0, 1fr); }
  .ws-rail {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 65; width: min(300px, 88vw);
    transform: translateX(-100%); visibility: hidden; box-shadow: var(--shadow-pop);
    transition: transform 220ms var(--ease-out), visibility 0s linear 220ms;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .ws-rail.is-open { transform: none; visibility: visible; transition-delay: 0s; }
  .ws-rail__close { display: inline-grid; }
  .ws-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 60; background: var(--scrim); }
  .ws-menu { display: inline-grid; flex: none; }
  .ws-doors { padding-inline: 16px; }
  .ws-thread, .ws-welcome { padding-inline: 16px; }
  .ws-composer { padding-inline: 16px; }
}
@media (max-width: 639px) {
  .ws-door:not([aria-pressed="true"]) .ws-door__label { display: none; }
  .ws-door:not([aria-pressed="true"]) { padding-inline: 12px; min-width: 44px; justify-content: center; }
  .ws-door { min-height: 44px; }
  .ws-models span { display: none; }
  .ws-models { width: 44px; padding: 0; }
  .ws-welcome { padding-top: 32px; }
  .ws-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ws-tile { min-height: 132px; padding: 14px 12px; }
  .ws-tile small { font-size: 12.5px; }
  .ws-send__long { display: none; }
  .ws-send__short { display: inline; }
  .ws-send { padding-inline: 14px; }
  .ws-model { min-height: 44px; }
  .ws-model__price { display: none; }
  .ws-attach { width: 44px; height: 44px; }
  .ws-status { font-size: 13px; }
  .ws-chat__open { min-height: 44px; }
  .ws-chat__del { width: 44px; height: 44px; }
  .ws-card__link, .ws-foot__links a { min-height: 44px; }
  .pick-chip { min-height: 44px; }
  .pick-list { max-height: 46dvh; }
}
@media (max-width: 379px) {
  .ws-tiles { gap: 8px; }
  .ws-tile small { display: none; }
  .ws-tile { min-height: 104px; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-rail { transition: none; }
  .ws-tile, .ws-tile:hover { transform: none; }
}
