/* steady-api UI v15 — single final layer; loaded after legacy styles. */
.steady-brand-slot { position:relative !important; overflow:hidden !important; background:#fff !important; border:1px solid #e8ebf0 !important; box-shadow:0 1px 2px rgba(15,23,42,.06) !important; }
.steady-brand-slot > svg { display:none !important; }
.steady-brand-slot::before { content:none !important; }
.steady-brand-logo { position:absolute; inset:14px; display:block; width:calc(100% - 28px); height:calc(100% - 28px); background:var(--steady-brand-color); -webkit-mask:var(--steady-brand-image) center/contain no-repeat; mask:var(--steady-brand-image) center/contain no-repeat; }
.steady-picker-brand { display:block; width:20px; height:20px; flex:0 0 20px; background:var(--steady-brand-color); -webkit-mask:var(--steady-brand-image) center/contain no-repeat; mask:var(--steady-brand-image) center/contain no-repeat; }
.steady-model-option-brand { display:block; width:18px; height:18px; flex:0 0 18px; background:var(--steady-brand-color); -webkit-mask:var(--steady-brand-image) center/contain no-repeat; mask:var(--steady-brand-image) center/contain no-repeat; }
img.steady-brand-logo { object-fit:contain; background:transparent; -webkit-mask:none; mask:none; }

/* Keep the compact text-model list directly below its trigger. */
@media (min-width: 900px) {
  [data-steady-model-picker-menu="true"] { position:absolute !important; top:calc(100% + 8px) !important; right:auto !important; left:50% !important; bottom:auto !important; z-index:90 !important; width:288px !important; max-width:288px !important; transform:translateX(-50%) !important; margin:0 !important; padding:8px !important; }
  [data-steady-model-picker-menu="true"] > div { max-height:min(52vh,430px) !important; }
  [data-steady-model-picker-menu="true"] button { min-height:38px !important; padding:8px 10px !important; }
  [data-steady-model-picker-menu="true"] button[hidden] { display:none !important; }
}

button[data-steady-model-card] { min-height:96px; padding:12px !important; border:1px solid #e7e9ef !important; border-radius:16px !important; background:#fff !important; box-shadow:0 1px 2px rgba(15,23,42,.03); }
button[data-steady-model-card]:hover { border-color:#cbd5e1 !important; box-shadow:0 8px 22px rgba(15,23,42,.07); }
/* Every card has one fixed geometry: icon column + title, provider and price rows. */
button[data-steady-model-card] > .flex.items-center.gap-3 { width:100%; min-width:0; align-items:flex-start !important; }
button[data-steady-model-card] .steady-card-icon { width:60px !important; height:60px !important; flex:0 0 60px !important; margin-top:0; }
button[data-steady-model-card] .steady-card-content { display:grid; grid-template-rows:20px 1fr 20px; align-content:start; height:60px; min-width:0; padding:1px 34px 0 0; }
button[data-steady-model-card][data-steady-has-description="true"] .steady-card-content { grid-template-rows:20px 20px 20px; }
button[data-steady-model-card] .steady-card-content > .truncate.text-sm.font-bold { align-self:start; overflow:hidden; line-height:20px !important; text-overflow:ellipsis; white-space:nowrap; }
button[data-steady-model-card] .steady-card-content > .mt-0\\.5.text-\\[11px\\] { align-self:start; margin-top:0 !important; overflow:hidden; color:#718096 !important; font-size:11px !important; line-height:17px !important; text-overflow:ellipsis; white-space:nowrap; }
button[data-steady-model-card][data-steady-has-description="false"] .steady-card-content > .mt-0\\.5.text-\\[11px\\] { display:none; }
.steady-card-pricing { display:flex; align-items:center; align-self:end; min-width:0; gap:3px; margin:0; white-space:nowrap; }
/* Price, currency and unit are a single, non-shrinking token.  The old
   min-width:0 let flexbox shrink only the trailing /1M on long decimals. */
.steady-price-item { display:inline-flex; flex:0 0 auto; align-items:baseline; justify-content:flex-start; gap:2px; min-width:max-content; padding:4px 5px; border-radius:6px; background:#f3f6fb; color:#718096; font-size:9px; line-height:1; }
.steady-price-item i { font-style:normal; white-space:nowrap; }
.steady-price-item b { color:#26364a; font-size:10px; font-weight:750; white-space:nowrap; }
.steady-price-item small { color:#8994a4; font-size:9px; line-height:1; white-space:nowrap; }
.steady-price-item { background:#eaf3ff; border:1px solid #d4e6ff; color:#3674bf; }
.steady-price-item b { color:#155da9; }
.steady-price-item small { color:#5f91c7; }
.steady-card-multiplier { position:absolute; top:10px; right:10px; display:inline-flex; align-items:center; min-width:25px; height:19px; justify-content:center; padding:0 5px; border-radius:6px; background:#eef4ff; color:#396bcc; font-size:10px; font-weight:750; line-height:1; }

/* The reference catalogue is admin-only and deliberately has the same fixed geometry as enabled cards. */
/* The enabled-model list and the retired reference heading share a parent.
 * Never hide that parent, even if an older cached script left the marker. */
html:not([data-steady-admin="true"]) [data-steady-reference-catalog] { display: revert !important; }
html:not([data-steady-admin="true"]) [data-steady-reference-card="true"] { display:none !important; }
[data-steady-reference-card="true"] { min-height:96px; padding:12px !important; border:1px solid #e7e9ef !important; border-radius:16px !important; background:#fff !important; box-shadow:0 1px 2px rgba(15,23,42,.03); }
[data-steady-reference-card="true"] .steady-card-icon,[data-steady-reference-card="true"] > .steady-brand-slot { width:60px !important; height:60px !important; flex:0 0 60px !important; margin:0 !important; }
[data-steady-reference-card="true"] .steady-card-content { display:grid; grid-template-rows:20px 1fr 20px; align-content:start; height:60px; min-width:0; padding:1px 34px 0 0; }
[data-steady-reference-card="true"][data-steady-has-description="true"] .steady-card-content { grid-template-rows:20px 20px 20px; }
[data-steady-reference-card="true"] .steady-card-content > .truncate.text-sm.font-bold { align-self:start; overflow:hidden; line-height:20px !important; text-overflow:ellipsis; white-space:nowrap; }
[data-steady-reference-card="true"] .steady-card-content > [class*="mt-0"] { align-self:start; margin-top:0 !important; overflow:hidden; color:#718096 !important; font-size:11px !important; line-height:17px !important; text-overflow:ellipsis; white-space:nowrap; }
[data-steady-reference-card="true"] .steady-card-pricing { display:flex; }
.steady-reference-add { position:absolute; top:10px; right:10px; display:inline-flex; width:24px; height:24px; align-items:center; justify-content:center; border:1px solid #cbd9ff; border-radius:7px; background:#eef4ff; color:#396bcc; font-size:20px; font-weight:500; line-height:1; transition:background .15s ease,transform .15s ease; }
.steady-reference-add:hover { background:#dfeaff; transform:scale(1.05); }
[data-steady-callable-models="true"] { border-color:#e5e9f2 !important; background:linear-gradient(180deg,#fff 0%,#fbfcff 100%) !important; }
[data-steady-callable-models="true"] h2 { display:flex; align-items:center; gap:7px; color:#172033 !important; }
[data-steady-callable-models="true"] h2::before { content:'✓'; display:inline-flex; width:18px; height:18px; align-items:center; justify-content:center; border-radius:50%; background:#eaf3ff; color:#356ee9; font-size:12px; font-weight:800; }
[data-steady-callable-models="true"] h2 + div { display:flex !important; flex-wrap:wrap; gap:7px !important; min-height:30px; }
[data-steady-callable-models="true"] h2 + div > span { display:inline-flex !important; min-height:28px; max-width:210px; align-items:center; border:1px solid #d8e7ff !important; border-radius:8px !important; background:#eef5ff !important; padding:5px 9px !important; color:#245d9e !important; font-size:12px !important; font-weight:650; line-height:1.15; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
[data-steady-callable-models="true"] .steady-callable-empty { margin:0; color:#718096; font-size:12px; line-height:28px; }
.steady-card-actions,.steady-model-card-controls { position:absolute; top:10px; right:10px; bottom:auto; opacity:0; pointer-events:none; transition:opacity .15s ease; }
button[data-steady-model-card]:hover .steady-card-actions,button[data-steady-model-card]:hover .steady-model-card-controls,button[data-steady-model-card]:focus-within .steady-card-actions,button[data-steady-model-card]:focus-within .steady-model-card-controls { opacity:1; pointer-events:auto; }
button[data-steady-model-card]:hover .steady-card-multiplier,button[data-steady-model-card]:focus-within .steady-card-multiplier { opacity:0; }
/* 倍率徽章显示在卡片右上角的原生 badge 上：steady-ui-user-fix 会保留这个 span 并把
 * 真实倍率写进 data-steady-overlay，这里负责把它渲染出来（走 ::after，不碰 React
 * 文本节点，避免 removeChild 找不到旧节点）。
 * 藏掉 bundle 硬编码的 "1x" 用 -webkit-text-fill-color 而不是 color:transparent：
 * 后者会把 color 的计算值也变成透明，而 priceLine 是「先加 class 再读
 * getComputedStyle(badge).color」——读到的透明值写进 --steady-mult-color 后
 * ::after 也跟着透明，徽章照样看不见。text-fill-color 只改填充，color 保持品牌色，
 * 文字照常占位、徽章宽度不变。
 * 9/9 曾以「倍率已在价格行显示」为由隐藏这个 span，但 priceLine 只渲染输入/输出
 * 价格、从未包含倍率 —— 结果右上角和价格行两边都看不到倍率。 */
button[data-steady-model-card] > span.absolute.right-2.top-2[data-steady-overlay] { color:var(--steady-mult-color,currentColor) !important; -webkit-text-fill-color:transparent !important; }
/* ::after 必须把 -webkit-text-fill-color 还原：它会被继承，否则伪元素里的倍率
 * 文字跟着父元素一起变透明（底色块在、字不见）。 */
button[data-steady-model-card] > span.absolute.right-2.top-2[data-steady-overlay]::after { content:attr(data-steady-overlay); color:var(--steady-mult-color,currentColor); -webkit-text-fill-color:currentColor; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; pointer-events:none; }
/* 倍率配色规则：≤0.1x 红、其余蓝。
 * bundle 原文是 `${u===0?"bg-rose-50 text-rose-600":"bg-blue-50 text-blue-600"}`，
 * u 是列表下标 ⇒ 只有排第一的卡是红的，跟倍率无关（gpt-6-astra 因品牌排序排第一才红）。
 * 这里改成纯按倍率判断：以后新增模型只要倍率 ≤0.1 自动变红，不用再改代码。
 * 选择器覆盖 "0.1x" 与 "0.0…x"（0.01~0.09），两者合起来正好是 ≤0.1。
 * --steady-mult-color 是 priceLine 写的行内样式，必须 !important 才压得住；
 * ::after 也直接给 color，不依赖自定义属性的级联。 */
button[data-steady-model-card] > span.absolute.right-2.top-2[data-steady-multiplier="0.1x"],
button[data-steady-model-card] > span.absolute.right-2.top-2[data-steady-multiplier^="0.0"] { background-color:#fff1f2 !important; color:#e11d48 !important; --steady-mult-color:#e11d48 !important; }
button[data-steady-model-card] > span.absolute.right-2.top-2[data-steady-multiplier="0.1x"]::after,
button[data-steady-model-card] > span.absolute.right-2.top-2[data-steady-multiplier^="0.0"]::after { color:#e11d48 !important; }
/* 反向兜底：>0.1x 一律蓝，抹掉「第一张卡必红」的下标副作用。 */
button[data-steady-model-card] > span.absolute.right-2.top-2[data-steady-multiplier]:not([data-steady-multiplier="0.1x"]):not([data-steady-multiplier^="0.0"]) { background-color:#eff6ff !important; color:#2563eb !important; --steady-mult-color:#2563eb !important; }
button[data-steady-model-card] > span.absolute.right-2.top-2[data-steady-multiplier]:not([data-steady-multiplier="0.1x"]):not([data-steady-multiplier^="0.0"])::after { color:#2563eb !important; }
.steady-price-badge { display:none !important; }

/* 卡片图标「重复堆叠」——两个覆盖层各自往同一个图标槽里画了一个 logo。
 * A) steady-ui-user-fix-*.js 注入真实子元素 .steady-brand-logo（DOM 里看得见）；
 * B) model-plaza-display-auth-*.js 用 .steady-brand-slot::after 伪元素画同一个标
 *    （不在 DOM 里，所以数 DOM 元素永远查不出来）。
 * B 的守卫是跨脚本契约 `slot.dataset.steadyBrand !== brand.name`，那个 dataset 是 A
 * 写的：A 先跑则 B 跳过（正常）；B 抢跑（或 React 重建卡片令 dataset 短暂丢失）则 B
 * 开火，并注入它自己的样式表 —— 该规则对全页所有 .steady-brand-slot 一次性生效，
 * 于是每张卡都叠成两个图标。刷新＝重掷骰子，故表现为「刷新下又好了」。
 * 这里只压制「A 已经画过、B 又画一遍」的情况；A 没画时 B 照常显示，不会出现空图标。
 * :has() 需 Chrome/Edge 105+、Safari 15.4+、Firefox 121+；老浏览器整条规则被丢弃，
 * 退回现状，无害。 */
.steady-brand-slot:has(> .steady-brand-logo)::after { content:none !important; }
/* The static renderer may place its action spans for every role: hide first, then reveal only after API-confirmed admin status. */
.steady-card-actions,.steady-model-card-controls { display:none !important; }
html[data-steady-admin="true"] .steady-card-actions,html[data-steady-admin="true"] .steady-model-card-controls { display:inline-flex !important; }

main:has(#prompt-textarea) > div { padding-bottom:11.5rem !important; }
div[data-steady-user-message] { padding-top:12px !important; padding-bottom:12px !important; }
.steady-user-column { width:auto !important; min-width:0 !important; max-width:min(72vw,42rem) !important; flex:0 1 auto !important; align-items:flex-end !important; }
.steady-user-column > div { width:auto !important; min-width:0 !important; align-self:flex-end !important; }
div.steady-user-bubble.rounded-br-md[class*="bg-"] { display:inline-block !important; width:fit-content !important; min-width:0 !important; min-height:0 !important; max-width:100% !important; padding:8px 13px !important; border:0 !important; border-radius:14px !important; background:#f1f1f1 !important; color:#202124 !important; box-shadow:none !important; }
div.steady-user-bubble.rounded-br-md[class*="bg-"] .markdown,div.steady-user-bubble.rounded-br-md[class*="bg-"] .markdown * { color:#202124 !important; }
div.steady-user-bubble.rounded-br-md[class*="bg-"] .markdown-body p { margin:0 !important; }
.steady-sent-image { border:0 !important; background:transparent !important; padding:0 !important; }
.steady-sent-image > img { display:block !important; width:auto !important; height:auto !important; max-width:min(320px,62vw) !important; max-height:360px !important; border-radius:14px !important; object-fit:contain !important; }
.steady-sent-image > div { display:none !important; }
div.steady-user-bubble.steady-image-only.rounded-br-md[class*="bg-"] { padding:0 !important; background:transparent !important; }
div.w-full.rounded-2xl.rounded-bl-md { border:0 !important; border-radius:0 !important; background:transparent !important; box-shadow:none !important; padding:.2rem 0 !important; }
[class*="max-w-[85%]"][class*="items-start"] { max-width:min(100%,52rem) !important; }
main .steady-avatar.steady-brand-slot { width:2.5rem !important; height:2.5rem !important; margin-right:.75rem !important; border-radius:12px !important; }
/* Match the legacy renderer's exact class chain so its 32px rule cannot win. */
main div.steady-avatar.mr-2\.5.mt-1.flex.h-7.w-7.shrink-0.items-center.justify-center.rounded-full.steady-brand-slot { width:2.5rem !important; height:2.5rem !important; }
main .steady-avatar .steady-brand-logo { inset:6px; width:calc(100% - 12px); height:calc(100% - 12px); }

/* Conversation history is a compact list, not a loading skeleton. */
[data-testid="convo-item"] { height:42px !important; margin:2px 0 !important; border-radius:10px !important; }
[data-testid="convo-item"] .relative.flex-1.grow.overflow-hidden.whitespace-nowrap > .pointer-events-none { display:none !important; }
[data-testid="convo-item"] .relative.flex-1.grow.overflow-hidden.whitespace-nowrap { padding-right:6px !important; font-size:14px !important; line-height:20px !important; }
[data-testid="convo-item"].bg-surface-active-alt { background:#eef4ff !important; }
[data-testid="convo-item"].bg-surface-active-alt::before { background:#4779ff !important; }
[data-testid="convo-item"]:hover { background:#f6f8fc !important; }

@media (prefers-color-scheme:dark) { button[data-steady-model-card]{background:#171c28!important;border-color:#2b3240!important}.steady-price-item{background:#252c38;color:#aab4c3}.steady-price-item b{color:#e5eaf1}.steady-price-item small{color:#8e9aac}.steady-user-bubble{background:#2b2d31!important;color:#f1f3f4!important}div.steady-user-bubble.rounded-br-md[class*="bg-"] .markdown,div.steady-user-bubble.rounded-br-md[class*="bg-"] .markdown *{color:#f1f3f4!important} }
