:root {
  --bg: #ffffff;
  --surface: #f9f7f0;
  --surface-2: rgba(249, 247, 240, .72);
  --surface-3: rgba(29, 45, 68, .08);
  --text: #1d2d44;
  --muted: rgba(29, 45, 68, .66);
  --line: rgba(29, 45, 68, .18);
  --line-strong: #1d2d44;
  --teal: #1d2d44;
  --blue: #1d2d44;
  --amber: #1d2d44;
  --rose: #1d2d44;
  --green: #1d2d44;
  --ink: #1d2d44;
  --shadow: 0 18px 48px rgba(29, 45, 68, .12);
  --shadow-soft: 0 8px 24px rgba(29, 45, 68, .08);
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Vazirmatn, IRANSans, Tahoma, Arial, sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; direction: ltr; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; min-width: 0; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-weight: 600; font-size: 11px; }
.brand-mark, .chat-app .brand .logo { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--ink); color: var(--surface); font-weight: 900; }
.brand-mark.logo-mark { background: #ffffff; border: 1px solid var(--line); overflow: hidden; }
.brand-mark.logo-mark img { width: 100%; height: 100%; object-fit: contain; padding: 5px; display: block; }
.btn, .button, .icon { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; gap: 8px; box-shadow: 0 1px 0 rgba(29, 45, 68, .04); }
.btn:hover, .button:hover, .icon:hover { background: rgba(249, 247, 240, .86); border-color: rgba(29, 45, 68, .28); }
.btn.primary, .button.primary { background: var(--teal); border-color: var(--teal); color: var(--surface); }
.btn.primary:hover, .button.primary:hover { background: #1d2d44; }
.btn.ghost { background: rgba(249, 247, 240, .68); }
.btn.danger, .button.danger { background: var(--surface); border-color: rgba(29, 45, 68, .3); color: var(--rose); }
.btn:disabled, .button:disabled { opacity: .55; cursor: not-allowed; }
.button.full, .btn.full { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; font-weight: 900; }
.icon-btn:hover { background: rgba(249, 247, 240, .86); border-color: rgba(29, 45, 68, .28); }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; color: var(--text); min-height: 34px; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 9px; background: var(--surface-3); color: var(--text); font-size: 12px; }
.pwa-install-popup { position: fixed; z-index: 70; left: 18px; bottom: 18px; width: min(390px, calc(100vw - 36px)); display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px 42px 12px 12px; border: 1px solid rgba(29,45,68,.16); border-radius: 16px; background: #ffffff; color: var(--text); box-shadow: 0 22px 64px rgba(29,45,68,.2); }
.pwa-install-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--ink); color: var(--surface); font-weight: 900; }
.pwa-install-copy { min-width: 0; display: grid; gap: 3px; line-height: 1.55; }
.pwa-install-copy b { font-size: 13px; }
.pwa-install-copy span { color: var(--muted); font-size: 12px; }
.pwa-install-action { min-height: 34px; border: 0; border-radius: 10px; background: var(--ink); color: var(--surface); padding: 0 13px; cursor: pointer; font-weight: 900; }
.pwa-install-action:hover { background: #152236; }
.pwa-install-close { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: rgba(29,45,68,.58); cursor: pointer; font-size: 18px; line-height: 1; }
.pwa-install-close:hover { background: rgba(29,45,68,.06); color: var(--text); }
.card, .auth-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-soft); padding: 18px; min-width: 0; }
.card h2, .card h3 { margin: 0 0 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }
.ok, .err, .notice { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.ok, .notice.success { background: rgba(249, 247, 240, .74); border-color: rgba(29, 45, 68, .24); color: var(--green); }
.err, .notice.error { background: rgba(249, 247, 240, .74); border-color: rgba(29, 45, 68, .28); color: var(--rose); }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--text); }
input, select, textarea { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; background: var(--surface); color: var(--text); }
textarea { min-height: 92px; resize: vertical; line-height: 1.8; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(29, 45, 68, .12); border-color: var(--blue); }
.prebox { white-space: pre-wrap; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; max-height: 420px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; margin-top: 10px; min-width: 980px; }
.table th, .table td { text-align: right; border-bottom: 1px solid var(--line); padding: 11px 10px; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 700; background: rgba(249, 247, 240, .7); }

.site-top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 12px 20px; background: rgba(249, 247, 240, .88); border-bottom: 1px solid var(--line); box-shadow: 0 6px 18px rgba(29, 45, 68, .05); backdrop-filter: blur(14px); }
.header-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dashboard-toggle { width: 36px; height: 36px; display: inline-grid; place-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 11px; background: #ffffff; color: var(--text); cursor: pointer; padding: 8px; flex: 0 0 auto; }
.dashboard-toggle span { display: block; width: 16px; height: 2px; border-radius: 999px; background: currentColor; }
.top-nav, .accountbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top-nav a { padding: 9px 10px; border-radius: 7px; color: var(--muted); font-weight: 700; }
.top-nav a:hover { background: rgba(29, 45, 68, .07); color: var(--text); }

.arena-app .app-shell { min-height: 100vh; }
.arena-layout { display: grid; grid-template-columns: 292px minmax(0, 1fr); gap: 18px; padding: 18px; }
.history-panel { position: sticky; top: 78px; align-self: start; height: calc(100vh - 96px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 38; background: rgba(29,45,68,.18); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.dashboard-drawer { position: fixed; inset: 0 0 0 auto; z-index: 39; width: min(360px, calc(100vw - 28px)); background: #ffffff; border-left: 1px solid rgba(29,45,68,.12); box-shadow: -20px 0 60px rgba(29,45,68,.14); transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; overflow: hidden; }
.dashboard-drawer.open { transform: translateX(0); }
.drawer-head { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(29,45,68,.08); }
.drawer-nav { display: grid; gap: 8px; padding: 12px; border-bottom: 1px solid rgba(29,45,68,.08); }
.drawer-nav a, .drawer-nav button { min-height: 40px; display: flex; align-items: center; justify-content: flex-start; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); padding: 0 12px; cursor: pointer; font: inherit; }
.drawer-nav .btn.primary { justify-content: center; background: var(--ink); color: var(--surface); }
.drawer-history { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.wallet-mini { display: grid; gap: 4px; margin: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(249, 247, 240, .54); }
.wallet-mini b { font-size: 13px; }
.wallet-mini span { color: var(--muted); font-size: 12px; }
.history-list { overflow: auto; padding: 8px; display: grid; gap: 6px; }
.history-item { width: 100%; text-align: right; border: 1px solid transparent; border-radius: 7px; background: transparent; padding: 10px; cursor: pointer; display: grid; gap: 4px; color: var(--text); }
.history-item:hover, .history-item.active { background: rgba(249, 247, 240, .72); border-color: rgba(29, 45, 68, .22); }
.history-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item span { color: var(--muted); font-size: 11px; }
.arena-main { min-width: 0; display: grid; gap: 16px; }
.benchmark-hero, .bench-title { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding: 20px 4px 8px; }
.benchmark-hero h1, .bench-title h1 { margin: 0; max-width: 920px; font-size: clamp(28px, 4vw, 54px); line-height: 1.25; }
.hero-copy { max-width: 860px; margin: 12px 0 0; color: var(--muted); line-height: 1.9; font-size: 14px; }
.hero-metrics { display: grid; grid-template-columns: repeat(2, 150px); gap: 10px; }
.hero-metrics.compact { grid-template-columns: repeat(3, 130px); }
.hero-metrics span { min-height: 78px; display: grid; align-content: center; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-soft); }
.hero-metrics b { font-size: 20px; }
.hero-metrics small { color: var(--muted); }
.leader-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.leader-item { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.leader-item:hover { border-color: rgba(29, 45, 68, .34); box-shadow: var(--shadow-soft); }
.leader-item .rank { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 10px; background: rgba(249, 247, 240, .76); color: var(--blue); font-weight: 900; }
.leader-item b, .leader-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-item small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.arena-workspace { display: grid; gap: 14px; }
.workspace-head { display: flex; justify-content: space-between; align-items: end; gap: 14px; padding-top: 8px; }
.workspace-head h2 { margin: 0; font-size: 22px; }
.mode-tabs { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.mode-tabs button { border: 0; border-radius: 10px; background: transparent; padding: 7px 11px; cursor: pointer; color: var(--muted); font-weight: 800; font-size: 13px; }
.mode-tabs button.active { background: var(--ink); color: var(--surface); }
.lane-toolbar { display: flex; gap: 10px; align-items: start; }
.lane-selectors { flex: 0 1 auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.lane-picker { display: grid; grid-template-columns: minmax(120px, .55fr) minmax(160px, 1fr) 34px; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.model-picker { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.model-pill { min-width: 168px; max-width: 218px; height: 38px; display: grid; grid-template-columns: 24px minmax(0,1fr) 14px; align-items: center; gap: 7px; border: 1px solid rgba(29,45,68,.1); border-radius: 11px; background: var(--surface); color: var(--text); cursor: pointer; padding: 0 10px; font-size: 13px; text-align: left; direction: ltr; box-shadow: 0 8px 20px rgba(29,45,68,.05); }
.model-pill span:not(.model-avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-pill i { font-style: normal; color: rgba(29,45,68,.65); font-size: 15px; }
.model-remove { width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: rgba(29,45,68,.48); cursor: pointer; font-size: 15px; }
.model-remove:disabled { opacity: .25; cursor: not-allowed; }
.model-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 35; width: min(430px, calc(100vw - 36px)); display: none; padding: 12px; border: 1px solid rgba(29,45,68,.1); border-radius: 18px; background: #ffffff; box-shadow: 0 24px 70px rgba(29,45,68,.16); }
.model-picker.open .model-menu { display: grid; gap: 12px; }
.model-search-wrap { position: relative; display: block; color: rgba(29,45,68,.5); }
.model-search-wrap svg { position: absolute; right: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.model-search { min-height: 42px; border-radius: 12px; background: #ffffff; font-size: 14px; padding-right: 40px; }
.model-cats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.model-cats button { min-height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #ffffff; color: var(--text); cursor: pointer; font: inherit; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.model-cats button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.model-cats button.active { background: var(--surface); border-color: rgba(29,45,68,.18); }
.model-list { display: grid; gap: 5px; max-height: 330px; overflow: auto; }
.model-option { min-height: 48px; display: grid; grid-template-columns: 26px minmax(0,1fr) 22px; align-items: center; gap: 9px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; padding: 7px 9px; text-align: left; direction: ltr; font: inherit; }
.model-option:hover, .model-option.active { background: var(--surface); }
.model-option span { min-width: 0; display: grid; gap: 2px; }
.model-option b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.model-option small { color: var(--muted); }
.model-option em { color: #1f9d3a; font-style: normal; font-weight: 900; }
.empty-state { padding: 20px; text-align: center; color: var(--muted); }
.composer-card { background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 20px; box-shadow: 0 14px 40px rgba(29, 45, 68, .11); overflow: visible; }
.composer-card textarea { min-height: 108px; border: 0; border-radius: 20px 20px 0 0; outline: 0; background: transparent; padding: 20px 22px 10px; color: var(--text); font-size: 16px; line-height: 1.75; resize: vertical; }
.composer-card textarea::placeholder { color: rgba(29, 45, 68, .36); }
.composer-actions { direction: ltr; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px 12px; border-top: 0; background: transparent; }
.composer-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-tool { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; min-width: 38px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); cursor: default; padding: 0 11px; box-shadow: 0 2px 8px rgba(29, 45, 68, .04); font-size: 13px; }
.chat-tool.wide { min-width: 116px; }
.chat-tool svg, .send-arrow svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-tool.upcoming { opacity: .9; }
.chat-tool.upcoming::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px); padding: 5px 8px; border-radius: 9px; background: var(--text); color: var(--surface); font-size: 11px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s ease, transform .15s ease; box-shadow: 0 10px 24px rgba(29, 45, 68, .16); }
.chat-tool.upcoming:hover::after, .chat-tool.upcoming:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.status-text { direction: rtl; text-align: center; flex: 1; min-width: 120px; }
.send-arrow { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); cursor: pointer; box-shadow: 0 2px 8px rgba(29, 45, 68, .04); }
.send-arrow:hover { border-color: rgba(29, 45, 68, .36); background: rgba(249, 247, 240, .66); }
.send-arrow:disabled { opacity: .55; cursor: not-allowed; }
.status-text { color: var(--muted); min-height: 20px; }
.status-text.ok { color: var(--green); }
.status-text.err { color: var(--rose); }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.answer-card { min-height: 320px; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-soft); }
.answer-card.loading { outline: 2px solid rgba(29, 45, 68, .16); }
.answer-card.has-error { border-color: rgba(29, 45, 68, .34); }
.answer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: rgba(249, 247, 240, .45); }
.answer-head span { color: var(--muted); font-size: 12px; direction: ltr; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.answer-body { flex: 1; padding: 14px; line-height: 1.9; white-space: pre-wrap; overflow: auto; max-height: 520px; }
.answer-foot { border-top: 1px solid var(--line); background: rgba(249, 247, 240, .45); padding: 10px 14px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.conversation-feed { display: grid; gap: 10px; margin-bottom: 30px; }
.feed-row { display: flex; gap: 10px; align-items: flex-start; }
.feed-avatar { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: rgba(249, 247, 240, .72); border: 1px solid var(--line); color: var(--muted); font-weight: 900; flex: 0 0 auto; }
.feed-bubble { width: min(840px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; white-space: pre-wrap; line-height: 1.8; box-shadow: 0 6px 20px rgba(29, 45, 68, .05); }
.feed-row.user .feed-bubble { background: rgba(249, 247, 240, .54); border-color: rgba(29, 45, 68, .2); }
.feed-meta { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(29, 45, 68, .42); display: grid; place-items: center; padding: 18px; }
.modal-card { width: min(430px, 100%); background: var(--surface); border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(29, 45, 68, .24); padding: 16px; display: grid; gap: 13px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.dev-code { min-height: 24px; color: var(--blue); font-weight: 800; }
.login-card { position: relative; width: min(540px, calc(100vw - 36px)); padding: 34px 30px 30px; border-radius: 20px; background: #ffffff; border-color: rgba(29,45,68,.18); box-shadow: 0 34px 90px rgba(29,45,68,.16); justify-items: center; gap: 12px; }
.login-close { position: absolute; top: 14px; left: 14px; background: #ffffff; }
.login-logo { width: 46px; height: 46px; display: grid; place-items: center; color: #1d2d44; margin-bottom: 6px; }
.login-logo svg, .login-tabs svg, .login-submit svg, .login-input svg, .phone-preview svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.login-logo svg { width: 44px; height: 44px; stroke-width: 1.8; }
.login-logo img { width: 46px; height: 46px; object-fit: contain; display: block; }
.login-card h2 { margin: 0; color: #1d2d44; font-size: 28px; line-height: 1.3; font-weight: 900; }
.login-card p { margin: 0 0 12px; color: rgba(29,45,68,.58); font-size: 15px; }
.login-tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; border-radius: 14px; background: #f9f7f0; border: 1px solid rgba(29,45,68,.08); }
.login-tabs button { min-height: 46px; border: 0; border-radius: 12px; background: transparent; color: rgba(29,45,68,.58); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 800; }
.login-tabs button.active { background: #ffffff; color: #1d2d44; box-shadow: 0 4px 14px rgba(29,45,68,.12); }
.login-tabs button.disabled { cursor: not-allowed; opacity: .62; }
.login-step { width: 100%; display: grid; gap: 12px; }
.login-card .otp-step { display: none; }
.login-card.otp-active .phone-step { display: none; }
.login-card.otp-active .otp-step { display: grid; }
.login-input { position: relative; display: block; width: 100%; color: rgba(29,45,68,.56); }
.login-input svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); z-index: 1; }
.login-input input { min-height: 48px; border-radius: 14px; background: #f9f7f0; padding: 9px 48px 9px 14px; font-size: 16px; text-align: right; }
.login-input.strong input { border-color: rgba(29,45,68,.34); box-shadow: inset 0 0 0 2px rgba(29,45,68,.1); }
.login-submit { width: 100%; min-height: 52px; border: 0; border-radius: 13px; background: #1d2d44; color: #f9f7f0; cursor: pointer; font-size: 17px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.login-submit:hover { background: #152236; }
.phone-preview { width: 100%; min-height: 48px; display: grid; grid-template-columns: 42px 42px minmax(0,1fr) 30px; align-items: center; gap: 8px; color: rgba(29,45,68,.58); }
.phone-preview span { min-height: 42px; display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; border-radius: 13px; background: #f9f7f0; border: 1px solid rgba(29,45,68,.08); direction: ltr; }
.phone-preview .icon-btn { width: 42px; height: 42px; border-radius: 13px; background: #ffffff; font-size: 17px; }
.login-card .dev-code { width: 100%; text-align: center; color: rgba(29,45,68,.65); font-size: 12px; min-height: 18px; }
.package-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.package-btn { text-align: right; min-height: 76px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; padding: 12px; display: grid; gap: 4px; }
.package-btn:hover { border-color: var(--teal); background: rgba(249, 247, 240, .62); }
.package-btn b { font-size: 18px; }
.package-btn span { color: var(--muted); }

.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--bg); }
.install-shell { width: min(520px, 100%); }
.auth-card { padding: 28px; }
.auth-card h1, .auth-card h2 { margin: 16px 0 24px; font-size: 22px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 252px; background: var(--ink); color: var(--surface); padding: 20px 16px; display: flex; flex-direction: column; gap: 22px; }
[dir="rtl"] .sidebar { inset: 0 0 0 auto; }
.sidebar .brand small { color: rgba(249, 247, 240, .66); }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a, .logout { padding: 11px 12px; border-radius: 12px; color: rgba(249, 247, 240, .78); display: block; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(249, 247, 240, .11); color: var(--surface); }
.logout { margin-top: auto; color: var(--surface); }
.panelMain { width: calc(100% - 252px); margin-right: 252px; padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.topbar h1 { margin: 0 0 8px; font-size: 24px; }
.topbar p { margin: 0; color: var(--muted); }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow-soft); display: grid; gap: 8px; }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card b { font-size: 26px; }
.stat-card small { color: var(--muted); }
.provider-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.provider-card h3 { margin: 0; }
.model-editor-card { overflow: hidden; }
.model-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.model-editor-head h3 { margin: 0 0 6px; }
.model-editor-tools { display: grid; grid-template-columns: minmax(240px, 1fr) 190px 150px; gap: 10px; margin-bottom: 12px; align-items: end; }
.model-editor-wrap { max-height: 68vh; border: 1px solid var(--line); border-radius: 14px; background: #ffffff; }
.model-editor-table { min-width: 2760px; margin-top: 0; }
.model-editor-table thead th { position: sticky; top: 0; z-index: 2; background: #f9f7f0; box-shadow: 0 1px 0 var(--line); }
.model-editor-table td { background: #ffffff; }
.model-editor-table tr[hidden] { display: none; }
.model-editor-table input, .model-editor-table select { min-height: 36px; border-radius: 9px; padding: 6px 8px; background: #ffffff; }
.model-editor-table .num-input { width: 118px; direction: ltr; text-align: left; }
.model-editor-table .tiny-input { width: 86px; direction: ltr; text-align: left; }
.model-editor-table .mini-input { width: 150px; direction: ltr; text-align: left; }
.model-editor-table .endpoint-input { width: 310px; direction: ltr; text-align: left; }
.model-editor-table .model-name-input { min-width: 230px; }
.logo-cell { min-width: 230px; display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 8px; }
.model-logo-preview { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #ffffff; color: var(--muted); font-size: 11px; font-weight: 900; overflow: hidden; direction: ltr; }
.model-logo-preview img { width: 22px; height: 22px; object-fit: contain; display: block; }
.model-logo-preview img + span { display: none; }
.model-logo-preview.no-logo span { display: inline; }
.logo-upload-preview { width: 92px; height: 92px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 16px; background: #ffffff; overflow: hidden; }
.logo-upload-preview img { width: 82px; height: 82px; object-fit: contain; display: block; }
.logo-editor-table { min-width: 1260px; }
.logo-file-input { min-width: 220px; }
.rate-cards { margin-bottom: 0; }
.logs-table { min-width: 1320px; }
.log-json { min-width: 170px; }
.log-json summary { cursor: pointer; color: var(--text); font-weight: 800; }
.log-json pre { max-width: 560px; max-height: 280px; overflow: auto; margin: 8px 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff; direction: ltr; text-align: left; white-space: pre-wrap; font-size: 11px; line-height: 1.55; }
.center-cell { text-align: center !important; }
.center-cell input[type="checkbox"] { width: 18px; min-height: 18px; }
.advanced-json { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.advanced-json summary { cursor: pointer; font-weight: 800; color: var(--text); }
.json-editor { min-height: 520px; direction: ltr; text-align: left; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.inline-form { display: flex; gap: 8px; align-items: center; margin: 0; min-width: 250px; }
.inline-form input { min-width: 130px; }

.bench-page { background: var(--bg); color: var(--text); }
.bench-page .site-top { right: 0; left: 0; padding: 14px 28px; min-height: 68px; border-color: rgba(29,45,68,.08); background: rgba(255, 255, 255, .82); box-shadow: none; }
.bench-page .brand-mark { width: 38px; height: 38px; background: var(--ink); border-radius: 12px; }
.bench-page .brand b { font-size: 15px; }
.bench-page .brand small { font-size: 10px; color: var(--muted); }
.bench-main { display: grid; gap: 18px; padding: 22px; }
.bench-page .bench-title h1 { font-size: clamp(22px, 3vw, 34px); line-height: 1.35; }
.metric-strip { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: 10px; min-width: min(560px, 100%); }
.metric-strip span { position: relative; min-height: 86px; display: grid; align-content: center; gap: 4px; padding: 14px 16px; border: 1px solid rgba(29,45,68,.1); border-radius: 18px; background: linear-gradient(180deg, #ffffff, rgba(249,247,240,.7)); box-shadow: 0 16px 38px rgba(29,45,68,.08); overflow: hidden; }
.metric-strip span::before { content: ""; position: absolute; inset: 12px auto 12px 0; width: 4px; border-radius: 999px; background: var(--ink); opacity: .9; }
.metric-strip small { color: rgba(29,45,68,.58); font-weight: 800; }
.metric-strip b { color: var(--text); font-size: 25px; line-height: 1; }
.metric-strip em { color: rgba(29,45,68,.48); font-style: normal; font-size: 11px; }
.bench-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bench-card { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-soft); }
.bench-card .rank { grid-row: span 3; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: rgba(249, 247, 240, .74); color: var(--blue); font-weight: 900; }
.bench-card h3 { margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bench-card h3 { display: flex; align-items: center; gap: 8px; }
.bench-card p { margin: 0; color: var(--muted); }
.score-line { grid-column: 2; height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.score-line span { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.bench-mini { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.table-actions { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 10px; }
.table-actions h2 { margin: 0; }
.table-actions input { width: min(360px, 100%); }
.bench-table td:nth-child(2) { direction: ltr; text-align: left; }
.bench-filters { display: grid; grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(145px, 1fr)); gap: 10px; margin-bottom: 12px; }
.compare-panel { display: grid; gap: 12px; }
.compare-controls { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.compare-card { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 8px 10px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: #ffffff; padding: 14px; }
.compare-card h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-card p { margin: 0; color: var(--muted); }
.compare-card dl { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; margin: 8px 0 0; }
.compare-card dl div { display: grid; gap: 3px; border-radius: 10px; background: rgba(249,247,240,.6); padding: 8px; }
.compare-card dt { color: var(--muted); font-size: 11px; }
.compare-card dd { margin: 0; font-weight: 800; }
.provider-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.bench-table th, .bench-table td { height: 58px; }

@media (max-width: 1180px) {
  .leader-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .provider-grid, .bench-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); }
  .metric-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
  .bench-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compare-card dl { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .site-top { align-items: flex-start; flex-wrap: wrap; }
  .arena-layout { grid-template-columns: 1fr; padding: 12px; }
  .history-panel { position: fixed; z-index: 30; top: 67px; right: 12px; left: 12px; height: min(70vh, 620px); display: none; }
  .history-panel.open { display: flex; }
  .benchmark-hero, .bench-title { grid-template-columns: 1fr; }
  .lane-selectors, .result-grid { grid-template-columns: 1fr; }
  .lane-toolbar { flex-direction: column; }
  .lane-toolbar .btn { width: 100%; }
  .sidebar { position: static; width: 100%; min-height: auto; }
  .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panelMain { width: 100%; margin: 0; padding: 18px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .bench-filters, .compare-controls, .compare-grid, .metric-strip { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 13px; }
  .site-top { padding: 10px 12px; }
  .top-nav, .accountbar { width: 100%; }
  .accountbar .btn { flex: 1; padding: 0 8px; }
  .benchmark-hero h1, .bench-title h1 { font-size: 28px; }
  .leader-strip, .bench-grid { grid-template-columns: 1fr; }
  .hero-metrics, .hero-metrics.compact { grid-template-columns: 1fr 1fr; }
  .workspace-head, .table-actions { flex-direction: column; align-items: stretch; }
  .composer-actions { flex-wrap: wrap; }
  .composer-tools { flex: 1 1 100%; }
  .status-text { order: 3; flex-basis: 100%; text-align: right; }
  .mode-tabs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lane-picker { grid-template-columns: 1fr; }
  .lane-picker .icon-btn { width: 100%; }
  .package-grid { grid-template-columns: 1fr; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* PrismBench public UI */
.prism-app { background: var(--bg); color: var(--text); }
.prism-app .app-shell { padding-left: 0; }
[dir="rtl"] .prism-app .app-shell { padding-left: 0; padding-right: 0; }
.rail { display: none; position: fixed; inset: 0 auto 0 0; z-index: 25; width: 64px; border-right: 1px solid var(--line); background: rgba(249, 247, 240, .86); flex-direction: column; align-items: center; gap: 14px; padding: 14px 10px; backdrop-filter: blur(14px); }
[dir="rtl"] .rail { inset: 0 0 0 auto; border-right: 0; border-left: 1px solid var(--line); }
.rail-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--text); cursor: pointer; font-weight: 800; }
.rail-btn:hover, .rail-btn.active { border-color: var(--line); background: rgba(249, 247, 240, .72); }
.prism-app .site-top { right: 0; left: 0; padding: 14px 28px; min-height: 68px; border-color: rgba(29,45,68,.08); background: rgba(255, 255, 255, .82); box-shadow: none; }
[dir="rtl"] .prism-app .site-top { right: 0; left: 0; }
.prism-app .brand-mark { width: 38px; height: 38px; background: var(--ink); border-radius: 12px; }
.prism-app .brand b { font-size: 15px; }
.prism-app .brand small { font-size: 10px; color: var(--muted); }
.prism-app .top-nav a { font-size: 13px; color: var(--muted); padding: 8px 9px; }
.prism-app .btn { border-color: var(--line); border-radius: 12px; min-height: 36px; background: var(--surface); }
.prism-app .btn.primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.prism-app .header-actions { flex: 1 1 auto; justify-content: flex-start; }
.prism-app .arena-layout { display: block; padding: 18px 24px 18px; }
.prism-app .history-panel { position: fixed; top: 84px; right: 24px; z-index: 30; width: 330px; height: calc(100vh - 112px); display: none; border-color: var(--line); box-shadow: var(--shadow); }
[dir="rtl"] .prism-app .history-panel { right: 24px; left: auto; }
.prism-app .history-panel.open { display: flex; }
.prism-app .arena-main { width: min(1040px, 100%); margin: 0 auto; gap: 10px; }
.prism-app .benchmark-hero { grid-template-columns: minmax(0,1fr) 320px; align-items: center; min-height: 260px; padding: 34px 0 18px; }
.prism-app .benchmark-hero h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.22; max-width: 680px; color: var(--text); font-weight: 900; }
.prism-app .hero-copy { max-width: 700px; color: var(--muted); font-size: 13px; }
.prism-app .hero-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.prism-app .hero-metrics span { min-height: 72px; border-color: var(--line); box-shadow: var(--shadow-soft); background: var(--surface); }
.prism-app .leader-strip { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
.prism-app .leader-item { flex: 0 0 230px; border-color: var(--line); background: var(--surface); padding: 8px; }
.prism-app .leader-item .rank { order: 3; background: rgba(249, 247, 240, .82); color: var(--text); }
.model-avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; flex: 0 0 auto; background: rgba(249, 247, 240, .78); color: var(--text); border: 1px solid var(--line); font-size: 11px; font-weight: 900; direction: ltr; overflow: hidden; }
.model-avatar img { width: 17px; height: 17px; object-fit: contain; display: block; }
.model-avatar img + span { display: none; }
.model-avatar.no-logo span { display: inline; }
.prism-app .arena-workspace { margin-top: 0; }
.prism-app .workspace-head { align-items: center; padding-top: 2px; }
.prism-app .workspace-head h2 { font-size: 24px; line-height: 1.35; }
.prism-app .mode-tabs { border-color: var(--line); background: var(--surface); }
.prism-app .mode-tabs button { color: var(--muted); padding: 7px 11px; }
.prism-app .mode-tabs button.active { background: var(--ink); color: var(--surface); }
.prism-app .lane-toolbar { align-items: center; }
.prism-app .lane-selectors { display: flex; justify-content: flex-end; }
.prism-app .lane-picker { grid-template-columns: 28px minmax(120px,.55fr) minmax(170px,1fr) 34px; align-items: center; border-color: rgba(29,45,68,.12); background: #ffffff; box-shadow: none; }
.prism-app select, .prism-app input, .prism-app textarea { border-color: var(--line); background: var(--surface); color: var(--text); border-radius: 12px; }
.prism-app .composer-card { border-color: rgba(29,45,68,.2); background: #ffffff; box-shadow: 0 24px 70px rgba(29, 45, 68, .13); }
.prism-app .composer-card textarea { min-height: 74px; font-size: 15px; background: transparent; }
.prism-app .composer-actions { background: transparent; border-color: transparent; }
.prism-app .result-grid { margin-top: 4px; }
.prism-app .answer-card { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-soft); min-height: 280px; }
.prism-app .answer-head { background: rgba(249, 247, 240, .45); border-color: var(--line); }
.answer-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.answer-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prism-app .answer-foot { background: rgba(249, 247, 240, .45); border-color: var(--line); }
.install-page { background: var(--bg); }
.install-wrap { width: min(1080px, 100%); margin: 0 auto; padding: 34px 18px 60px; }
.install-hero { display: grid; gap: 10px; margin-bottom: 16px; }
.install-hero h1 { margin: 0; font-size: 30px; }
.install-hero p { margin: 0; color: var(--muted); max-width: 780px; line-height: 1.8; }
.install-card { display: grid; gap: 14px; }

/* AI-first home */
.ai-home { align-content: start; gap: 10px; min-height: auto; padding-top: clamp(10px, 3vh, 28px); }
.ai-intro { display: grid; justify-items: center; text-align: center; gap: 6px; margin: 0 auto; width: min(640px, 100%); }
.ai-intro h1 { margin: 0; color: var(--text); font-family: Vazirmatn, IRANSans, Tahoma, Arial, sans-serif; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.25; font-weight: 900; }
.control-dock { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; width: min(860px, 100%); margin: 0 auto; }
.control-dock .mode-tabs { box-shadow: 0 10px 28px rgba(29,45,68,.07); }
.control-dock .btn { min-height: 36px; box-shadow: 0 10px 28px rgba(29,45,68,.06); font-size: 13px; }
.model-dock { width: auto; margin: 0; padding: 0; justify-content: flex-start; flex-direction: row; direction: rtl; }
.header-model-dock { min-width: 0; }
.model-dock .lane-selectors { display: flex; justify-content: flex-start; direction: rtl; }
.model-dock .lane-picker { min-height: 50px; padding: 7px 9px; border-radius: 16px; }
.add-model-btn { height: 38px; border: 1px solid rgba(29,45,68,.1); border-radius: 11px; background: #ffffff; color: var(--text); padding: 0 11px; cursor: pointer; white-space: nowrap; font: inherit; font-size: 13px; box-shadow: 0 8px 20px rgba(29,45,68,.05); }
.add-model-btn:disabled { opacity: .45; cursor: not-allowed; }
.ai-home .composer-card { width: min(760px, 100%); margin: 2px auto 0; }
.ai-home .composer-card textarea { min-height: 78px; max-height: 120px; padding: 14px 18px 6px; resize: none; }
.ai-home .result-grid, .ai-home .conversation-feed { width: min(1040px, 100%); margin-left: auto; margin-right: auto; }
.app-footer { width: min(1040px, 100%); min-height: 38px; margin: 10px auto 0; padding: 8px 4px 0; border-top: 1px solid rgba(29,45,68,.08); color: rgba(29,45,68,.58); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.footer-stats { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.footer-stats span { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 4px 9px; border-radius: 999px; background: rgba(249,247,240,.58); border: 1px solid rgba(29,45,68,.08); color: rgba(29,45,68,.62); }
.footer-stats b { color: var(--text); font-size: 13px; }

@media (max-width: 980px) {
  .grid.two, .grid.three, .provider-grid { grid-template-columns: 1fr; }
  .panelMain { width: 100%; margin-right: 0; padding: 18px; }
  .sidebar { position: static; width: auto; min-height: auto; }
  .model-editor-head { display: grid; }
  .model-editor-tools { grid-template-columns: 1fr; }
  .prism-app .app-shell { padding-right: 0; padding-left: 0; }
  .rail { display: none; }
  .prism-app .site-top { right: 0; align-items: center; }
  .prism-app .brand small { display: none; }
  .prism-app .header-actions { order: 2; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  [dir="rtl"] .prism-app .site-top { right: 0; }
  .prism-app .benchmark-hero { grid-template-columns: 1fr; min-height: auto; padding-top: 18px; }
  .prism-app .history-panel, [dir="rtl"] .prism-app .history-panel { right: 12px; left: 12px; width: auto; }
  .ai-home { min-height: auto; padding-top: 16px; }
  .model-dock { justify-content: flex-start; }
  .model-dock .lane-selectors { justify-content: flex-start; flex-wrap: nowrap; }
  .model-picker { width: auto; flex: 0 0 auto; }
  .model-pill { width: 172px; max-width: 172px; }
  .app-footer { justify-content: center; text-align: center; }
}
@media (max-width: 640px) {
  .prism-app .arena-layout { padding: 10px 12px; }
  .prism-app .benchmark-hero h1 { font-size: 28px; }
  .prism-app .lane-selectors { display: flex; }
  .model-dock { flex-direction: row; }
  .add-model-btn { width: auto; flex: 0 0 auto; }
  .model-menu { right: auto; left: 0; }
  .ai-intro h1 { font-size: 25px; }
  .control-dock, .control-dock .mode-tabs, .control-dock .btn { width: 100%; }
  .composer-card textarea { font-size: 14px; padding: 12px 14px 6px; min-height: 70px; }
  .composer-actions { padding: 8px 10px 10px; gap: 8px; }
  .chat-tool { height: 36px; min-width: 36px; padding: 0 10px; }
  .chat-tool.wide { min-width: 108px; }
  .send-arrow { width: 36px; height: 36px; }
}

/* Chat workspace polish */
body.arena-app { height: 100dvh; overflow: hidden; }
body.arena-app .app-shell { height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.prism-app .site-top { flex: 0 0 auto; }
.prism-app .arena-layout { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 14px 24px 10px; }
.prism-app .arena-main { height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; }
.ai-home { min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.ai-home:not(.chat-active) { justify-content: center; padding-bottom: 8dvh; }
.ai-home.chat-active { padding-top: 0; gap: 8px; }
.ai-home.chat-active .ai-intro, .ai-home.chat-active .control-dock { display: none; }
.ai-home.chat-active .conversation-feed { order: 1; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 6px 3px 2px; align-content: start; scroll-behavior: smooth; }
.ai-home.chat-active > .result-grid { order: 2; flex: 0 1 auto; max-height: 46%; overflow: auto; padding: 1px 3px 4px; }
.ai-home.chat-active .composer-card { order: 3; flex: 0 0 auto; margin: 0 auto; box-shadow: 0 10px 34px rgba(29,45,68,.11); }
.ai-home.chat-active .composer-card textarea { min-height: 46px; max-height: 88px; padding: 11px 16px 4px; }
.ai-home.chat-active .composer-actions { padding: 6px 10px 9px; }
.ai-home.chat-active .status-text { min-width: 0; }
.app-footer { flex: 0 0 auto; margin-top: 0; padding-top: 6px; }
.result-grid.split-testing { grid-template-columns: repeat(2, minmax(0, 1fr)); animation: splitIn .28s ease both; }
@keyframes splitIn {
  from { opacity: 0; transform: translateY(8px); gap: 28px; }
  to { opacity: 1; transform: translateY(0); gap: 12px; }
}
.answer-card { border-radius: 14px; min-height: 220px; }
.answer-card.loading .answer-body { display: grid; place-items: center; }
.answer-loading { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.answer-loading i { width: 7px; height: 7px; border-radius: 999px; background: currentColor; animation: pulseDot 1s ease-in-out infinite; opacity: .45; }
.answer-loading i:nth-child(2) { animation-delay: .14s; }
.answer-loading i:nth-child(3) { animation-delay: .28s; }
@keyframes pulseDot {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-5px); opacity: .9; }
}
.answer-actions { min-width: 0; display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.answer-actions span { min-width: 0; max-width: 220px; }
.copy-btn { min-height: 28px; border: 1px solid rgba(29,45,68,.14); border-radius: 8px; background: #ffffff; color: var(--text); padding: 0 9px; cursor: pointer; font-size: 12px; font-weight: 800; white-space: nowrap; }
.copy-btn:hover { border-color: rgba(29,45,68,.34); background: rgba(249,247,240,.72); }
.rich-answer { white-space: normal; display: grid; gap: 10px; align-content: start; }
.answer-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.code-block { direction: ltr; text-align: left; border: 1px solid rgba(29,45,68,.12); border-radius: 12px; overflow: hidden; background: #111827; color: #e5e7eb; }
.code-head { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; background: #0b1220; color: #cbd5e1; font-size: 12px; }
.code-head .copy-btn { min-height: 24px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: #f8fafc; }
.code-block pre { margin: 0; padding: 13px; overflow: auto; max-height: 360px; line-height: 1.65; font-size: 12px; }
.feed-row { max-width: min(840px, 100%); }
.feed-row.user { justify-content: flex-start; margin-right: auto; }
.feed-row.user .feed-avatar { display: none; }
.feed-row.user .feed-bubble { width: auto; max-width: min(680px, 88%); margin-right: auto; border-radius: 18px 18px 5px 18px; background: #f4f4f4; box-shadow: none; }
.feed-row.assistant .feed-bubble { box-shadow: none; background: transparent; border-color: transparent; padding-right: 2px; }
.history-results { width: min(1040px, 100%); margin: 4px auto 8px; }
.toast-stack { position: fixed; z-index: 80; left: 18px; bottom: 18px; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.toast-item { transform: translateY(8px); opacity: 0; transition: opacity .18s ease, transform .18s ease; border: 1px solid rgba(29,45,68,.12); border-radius: 12px; background: #ffffff; color: var(--text); box-shadow: 0 18px 48px rgba(29,45,68,.14); padding: 11px 13px; line-height: 1.7; }
.toast-item.show { transform: translateY(0); opacity: 1; }
.toast-item.ok { border-color: rgba(31,157,58,.22); }
.toast-item.err { border-color: rgba(180,45,45,.24); color: #8a1f1f; }
.brand-mark.logo-mark, .prism-app .brand-mark.logo-mark { background: transparent; border: 0; box-shadow: none; }
.brand-mark.logo-mark img { padding: 0; }
.chat-tool { height: 30px; min-width: 30px; border-radius: 9px; padding: 0 7px; opacity: .52; box-shadow: none; }
.chat-tool.wide { min-width: 30px; }
.chat-tool.wide span { display: none; }
.chat-tool svg, .send-arrow svg { width: 17px; height: 17px; }

@media (max-width: 980px) {
  .prism-app .arena-layout { padding: 10px 12px 8px; }
  .prism-app .arena-main { gap: 6px; }
  .ai-home.chat-active > .result-grid { max-height: 44%; }
  .answer-actions span { max-width: 150px; }
}
@media (max-width: 640px) {
  .prism-app .site-top { min-height: auto; padding: 8px 10px; gap: 8px; }
  .pwa-install-popup { left: 10px; right: 10px; bottom: 10px; width: auto; grid-template-columns: 32px minmax(0,1fr) auto; gap: 8px; padding: 10px 38px 10px 10px; border-radius: 14px; }
  .pwa-install-icon { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
  .pwa-install-copy b { font-size: 12px; }
  .pwa-install-copy span { font-size: 11px; }
  .pwa-install-action { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 9px; }
  .pwa-install-close { top: 7px; right: 7px; width: 24px; height: 24px; }
  .brand { gap: 8px; }
  .brand-mark, .chat-app .brand .logo { width: 32px; height: 32px; border-radius: 9px; }
  .prism-app .brand b { font-size: 13px; }
  .dashboard-toggle { width: 32px; height: 32px; border-radius: 9px; }
  .prism-app .header-actions { gap: 7px; scrollbar-width: none; }
  .prism-app .header-actions::-webkit-scrollbar { display: none; }
  .model-pill { width: 146px; max-width: 146px; min-width: 146px; height: 34px; font-size: 12px; border-radius: 10px; }
  .model-avatar { width: 22px; height: 22px; }
  .model-remove { width: 20px; height: 20px; }
  .add-model-btn { height: 34px; border-radius: 10px; font-size: 12px; padding: 0 9px; }
  .ai-intro { margin-top: 10dvh; }
  .ai-home .composer-card { width: 100%; border-radius: 16px; }
  .ai-home .composer-card textarea { min-height: 56px; max-height: 92px; padding: 10px 12px 4px; font-size: 13px; line-height: 1.55; }
  .composer-actions { padding: 5px 8px 8px; gap: 6px; }
  .composer-tools { gap: 6px; }
  .chat-tool { height: 28px; min-width: 28px; border-radius: 8px; padding: 0 6px; }
  .chat-tool svg, .send-arrow svg { width: 15px; height: 15px; }
  .send-arrow { width: 30px; height: 30px; border-radius: 9px; }
  .ai-home.chat-active .composer-card textarea { min-height: 38px; max-height: 68px; }
  .result-grid, .result-grid.split-testing, .history-results { grid-template-columns: 1fr; }
  .ai-home.chat-active > .result-grid { max-height: 48%; }
  .answer-card { min-height: 180px; border-radius: 13px; }
  .answer-head { padding: 9px 10px; }
  .answer-body { padding: 11px; max-height: 320px; }
  .answer-foot { padding: 8px 10px; font-size: 11px; }
  .feed-bubble { font-size: 13px; }
  .feed-row.user .feed-bubble { max-width: 92%; }
  .app-footer { min-height: 30px; font-size: 10px; gap: 6px; padding-bottom: 2px; }
  .footer-stats { display: flex; justify-content: center; gap: 5px; }
  .footer-stats span { min-height: 24px; padding: 2px 7px; font-size: 10px; }
  .footer-stats b { font-size: 11px; }
  .toast-stack { left: 10px; right: 10px; bottom: 10px; width: auto; }
}
