/* ==========================================================================
   ZephAI extras — workspace switcher, real forms, studio surfaces, tables.
   Loaded after app.css and uses the same tokens.
   ========================================================================== */

/* ---------- workspace switcher (shared console shell) ---------- */
.ws-switcher { padding: 10px 12px 4px; }
.ws-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--r-md); padding: 8px 10px; cursor: pointer;
  color: var(--text); text-align: left; font-family: inherit;
}
.ws-trigger:hover { border-color: var(--border-strong); background: var(--surface-3); }
.ws-trigger--static { cursor: default; }
.ws-avatar {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-strong); font-weight: 700;
  font-family: var(--font-display); font-size: .85rem; flex: none; overflow: hidden;
}
.ws-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ws-avatar--sm { width: 26px; height: 26px; font-size: .75rem; }
.ws-avatar--staff { background: var(--ink); color: var(--brand); }
.ws-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.15; }
.ws-copy strong { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-copy em { font-style: normal; font-size: .68rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-list { max-height: 300px; overflow: auto; padding: 4px 0; }
.ws-list form { margin: 0; }
.ws-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px;
  border: 0; background: none; cursor: pointer; color: var(--text); text-align: left; font-family: inherit;
}
.ws-item:hover { background: var(--surface-2); }
.ws-item.is-active { background: var(--brand-soft); }
.ws-check { color: var(--brand-strong); margin-left: 4px; }
.ws-foot { display: flex; justify-content: space-between; align-items: center; }
.ws-menu { padding: 6px 0 2px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.ws-menu form { margin: 0; }
.menu-item .menu-tail { margin-left: auto; font-size: .7rem; color: var(--text-3); }
.lang-inline { display: flex; gap: 8px; align-items: center; }
.select--xs { padding: 4px 24px 4px 8px; font-size: .72rem; height: 26px; }

/* ---------- app flash + forms ---------- */
.flash-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.flash-stack .alert { margin: 0; }
.auth-flash { position: fixed; top: 16px; right: 16px; z-index: 80; width: min(420px, calc(100vw - 32px)); display: grid; gap: 8px; }
.form-error, .errorlist { color: var(--danger); font-size: .75rem; margin: 4px 0 0; padding: 0; list-style: none; }
.is-invalid, .input.is-invalid, .textarea.is-invalid, .select.is-invalid { border-color: var(--danger) !important; }
.field-error { display: flex; gap: 6px; align-items: center; color: var(--danger); font-size: .74rem; margin-top: 5px; }
.form-alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--danger); background: var(--danger-soft); border-radius: var(--r-md); color: var(--danger); font-size: .82rem; }
.form-alert--ok { border-color: var(--ok); background: var(--brand-soft); color: var(--brand-strong); }
.auth-page .auth-form .form-alert { margin-bottom: 14px; }
.field-hint.is-error { color: var(--danger); }
.field-hint.is-ok { color: var(--brand-strong); }

/* ---------- buttons/loading ---------- */
.btn.is-loading { pointer-events: none; opacity: .7; position: relative; }
.btn.is-loading::after {
  content: ''; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: z-spin .7s linear infinite; margin-left: 6px; display: inline-block; vertical-align: -2px;
}
@keyframes z-spin { to { transform: rotate(360deg); } }

/* ---------- generic console page helpers ---------- */
.split-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.split-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; }
.stack-4 { display: grid; gap: 16px; }
.stack-5 { display: grid; gap: 20px; }

/* Toolbar chips */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 4px 10px; font-size: .72rem; color: var(--text-2); cursor: pointer; }
.filter-chip.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }

/* key reveal + copy */
.key-reveal { display: flex; align-items: center; gap: 8px; background: var(--surface-inset); border: 1px dashed var(--border-strong); border-radius: var(--r-md); padding: 10px 12px; }
.key-reveal code { font-family: var(--font-mono); font-size: .78rem; overflow: auto; flex: 1; white-space: nowrap; }

/* settings workbench */
.settings-stack { display: grid; gap: 20px; }
.settings-section { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.settings-section__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.settings-section__head h3 { margin: 0 0 3px; font-size: .95rem; display: flex; gap: 8px; align-items: center; }
.settings-section__head p { margin: 0; color: var(--text-2); font-size: .78rem; }
.settings-section__body { padding: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .col-span-2 { grid-column: span 2; }
.form-grid .col-span-3 { grid-column: span 3; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.field label { display: block; margin-bottom: 6px; font-size: .76rem; font-weight: 600; color: var(--text-2); }

/* media library */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.media-tile { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.media-tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--surface-3); }
.media-tile-body { padding: 8px 10px; font-size: .72rem; }
.media-tile-body strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- studio (pages, banners, emails) ---------- */
.studio-body { background: var(--bg); min-height: 100vh; }
.studio-app { min-height: 100vh; display: flex; flex-direction: column; }
.studio-topbar { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 40; }
.studio-topbar__left, .studio-topbar__right, .studio-topbar__center { display: flex; align-items: center; gap: 8px; }
.studio-topbar__center { margin-left: auto; }
.studio-topbar__right { margin-left: auto; }
.studio-topbar__center + .studio-topbar__right { margin-left: 0; }
.studio-mark { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); font-family: var(--font-display); font-size: .68rem; font-weight: 700; }
.studio-live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .68rem; padding: 4px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-strong); border: 1px solid var(--border); }
.studio-divider { width: 1px; height: 22px; background: var(--border); }
.studio-icon-btn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--text-2); cursor: pointer; }
.studio-icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.studio-icon-btn.is-active { background: var(--brand-soft); color: var(--brand-strong); }
.studio-btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 6px 11px; font-size: .74rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.studio-btn:hover { background: var(--surface-2); }
.studio-btn--primary { background: var(--brand); border-color: var(--brand); color: #07130d; }
.studio-btn--primary:hover { background: var(--brand-strong); }
.studio-btn--secondary { background: var(--surface-2); }
.studio-btn--ghost { border-color: transparent; background: none; }
.studio-btn--sm { padding: 4px 8px; font-size: .7rem; }
.studio-page-trigger { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 5px 9px; cursor: pointer; color: var(--text); font-family: inherit; }
.studio-page-trigger__icon { width: 24px; height: 24px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; }
.studio-page-trigger__copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.studio-page-trigger__copy span { font-size: .6rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.studio-page-trigger__copy strong { font-size: .78rem; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-main { flex: 1; display: grid; grid-template-columns: 46px 300px minmax(0, 1fr) 320px; min-height: 0; }
.studio-rail { border-right: 1px solid var(--border); background: var(--surface); padding: 8px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.studio-rail__btn { width: 32px; height: 32px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--text-3); cursor: pointer; }
.studio-rail__btn:hover { color: var(--text); background: var(--surface-2); }
.studio-rail__btn.is-active { background: var(--brand-soft); color: var(--brand-strong); border-color: var(--border); }
.studio-rail__spacer { flex: 1; }
.studio-panel { border-right: 1px solid var(--border); background: var(--surface); overflow: auto; }
.studio-panel__view { display: none; padding: 14px; }
.studio-panel__view.is-active { display: block; }
.studio-panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.studio-panel__head h2 { margin: 2px 0 0; font-size: 1rem; }
.studio-kicker { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.studio-panel__meta { display: flex; justify-content: space-between; font-size: .66rem; color: var(--text-3); margin-bottom: 10px; }
.studio-section-list { display: grid; gap: 6px; }
.studio-section-card { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: var(--surface); cursor: pointer; }
.studio-section-card:hover { border-color: var(--border-strong); }
.studio-section-card.is-selected { border-color: var(--brand); background: var(--brand-soft); }
.studio-section-card__ico { width: 26px; height: 26px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); flex: none; }
.studio-section-card__copy { flex: 1; min-width: 0; }
.studio-section-card__copy strong { display: block; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-section-card__copy small { font-size: .63rem; color: var(--text-3); }
.studio-section-card__tools { display: flex; gap: 2px; }
.studio-section-card__tools button { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 3px; border-radius: 4px; }
.studio-section-card__tools button:hover { background: var(--surface-3); color: var(--text); }
.studio-add-large { width: 100%; margin-top: 10px; border: 1px dashed var(--border-strong); background: none; border-radius: 8px; padding: 14px; color: var(--text-2); font-size: .75rem; cursor: pointer; }
.studio-add-large:hover { border-color: var(--brand); color: var(--brand-strong); }
.studio-canvas { background: var(--surface-3); display: flex; flex-direction: column; min-width: 0; }
.studio-canvas__bar { height: 36px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 12px; font-size: .68rem; color: var(--text-2); background: var(--surface); }
.studio-canvas__url { font-family: var(--font-mono); }
.studio-canvas__hint { margin-left: auto; color: var(--text-3); }
.studio-canvas__draft { color: var(--warn); }
.studio-frame-wrap { flex: 1; overflow: auto; padding: 18px; display: flex; justify-content: center; align-items: flex-start; }
.studio-frame { width: min(100%, 1200px); height: calc(100vh - 60px - 36px - 36px); background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.08); transition: width .2s ease; }
.studio-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.studio-inspector { border-left: 1px solid var(--border); background: var(--surface); overflow: auto; }
.studio-inspector__empty { padding: 40px 22px; text-align: center; color: var(--text-2); }
.studio-inspector__empty-icon { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); font-size: 1.1rem; }
.studio-inspector__empty h3 { margin: 0 0 6px; color: var(--text); font-size: .95rem; }
.studio-inspector__empty p { margin: 0 0 16px; font-size: .76rem; }
.studio-tip { font-size: .7rem; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; text-align: left; }
.studio-inspector-body { padding: 14px; }
.studio-field { margin-bottom: 12px; }
.studio-field label { display: block; font-size: .68rem; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.studio-field .input, .studio-field .textarea, .studio-field .select { font-size: .78rem; }
.studio-popover { position: absolute; top: 48px; left: 0; z-index: 60; width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.16); }
.studio-popover__search { display: flex; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.studio-popover__search input { border: 0; background: none; outline: none; flex: 1; color: var(--text); font-size: .76rem; }
.studio-popover__scroll { max-height: 240px; overflow: auto; padding: 4px; }
.studio-popover__footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding: 8px; }
.studio-link { font-size: .7rem; color: var(--brand-strong); }
.studio-modal { position: fixed; inset: 0; z-index: 100; background: rgba(5,10,8,.55); display: grid; place-items: center; padding: 20px; }
.studio-modal__panel { width: min(860px, 100%); max-height: min(80vh, 720px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.studio-modal__head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.studio-modal__head h2 { margin: 2px 0 0; font-size: 1.05rem; }
.studio-modal__body { padding: 18px; overflow: auto; }
.studio-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.studio-library-card { border: 1px solid var(--border); border-radius: 9px; padding: 12px; background: var(--surface); text-align: left; cursor: pointer; }
.studio-library-card:hover { border-color: var(--brand); }
.studio-library-card i { color: var(--brand-strong); margin-bottom: 8px; font-size: 1rem; }
.studio-library-card strong { display: block; font-size: .78rem; margin-bottom: 3px; }
.studio-library-card small { color: var(--text-3); font-size: .68rem; line-height: 1.35; display: block; }
.studio-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: grid; gap: 8px; }
.studio-toast { background: var(--ink); color: #eaf5ee; border-radius: 8px; padding: 9px 12px; font-size: .76rem; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.studio-segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.studio-segmented button { border: 0; background: var(--surface); padding: 5px 8px; color: var(--text-3); cursor: pointer; }
.studio-segmented button.is-active { background: var(--brand-soft); color: var(--brand-strong); }
.studio-save-state { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; color: var(--text-3); }
.studio-save-state.is-dirty { color: var(--warn); }

/* banner studio */
.banner-studio { display: grid; grid-template-columns: 250px minmax(0, 1fr) 390px; gap: 0; border: 1px solid var(--border); border-top: 0; background: var(--surface); }
.banner-studio__rail { border-right: 1px solid var(--border); padding: 12px; max-height: 72vh; overflow: auto; }
.banner-studio__rail-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.banner-search { display: flex; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; color: var(--text-3); background: var(--surface-2); margin-bottom: 10px; }
.banner-search input { border: 0; background: none; outline: none; font-size: .72rem; flex: 1; color: var(--text); }
.banner-template-list { display: grid; gap: 8px; }
.banner-template-option { display: flex; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px; cursor: pointer; text-align: left; color: var(--text); font-family: inherit; }
.banner-template-option:hover, .banner-template-option.is-active { border-color: var(--brand); background: var(--brand-soft); }
.banner-template-option__preview { width: 76px; height: 44px; border-radius: 5px; overflow: hidden; background: var(--surface-3); flex: none; }
.banner-template-option__preview iframe { width: 220%; height: 220%; transform: scale(.4545); transform-origin: 0 0; border: 0; pointer-events: none; }
.banner-template-option__copy { min-width: 0; }
.banner-template-option__copy strong { display: block; font-size: .7rem; }
.banner-template-option__copy small { font-size: .62rem; color: var(--text-3); }
.banner-studio__form { padding: 18px; overflow: auto; max-height: 72vh; }
.banner-studio__form .settings-section { margin-bottom: 14px; }
.banner-studio__preview { border-left: 1px solid var(--border); padding: 14px; background: var(--surface-2); }
.banner-preview-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.banner-preview-shell { background: #0a0e0d; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.banner-preview-shell iframe { width: 100%; height: 460px; border: 0; display: block; background: #fff; }
.banner-preview-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: .68rem; color: var(--text-3); margin-top: 8px; }
.banner-studio__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 10px 14px; background: var(--surface); }
.banner-studio__bar-actions { display: flex; gap: 6px; align-items: center; }
.banner-status { display: inline-flex; gap: 6px; align-items: center; font-size: .7rem; }
.banner-status--live { color: var(--brand-strong); }
.banner-status--scheduled { color: var(--info); }
.banner-status--paused, .banner-status--draft { color: var(--text-3); }
.banner-color-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.banner-color-grid input[type=color] { width: 100%; height: 32px; border: 1px solid var(--border); border-radius: 6px; background: none; }
.banner-swatches { display: flex; gap: 4px; margin-top: 4px; }
.banner-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); background: var(--swatch); cursor: pointer; }
.banner-choice-row, .banner-style-grid, .banner-segmented, .banner-publish-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.banner-choice, .banner-style-card { border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 6px 9px; font-size: .7rem; cursor: pointer; color: var(--text); font-family: inherit; }
.banner-choice.is-active, .banner-style-card.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.banner-style-card { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.banner-style-card small { color: var(--text-3); font-size: .62rem; }
.banner-style-card__swatch { width: 100%; height: 20px; border-radius: 4px; background: linear-gradient(90deg, var(--brand), var(--info)); }
.banner-control-block { margin-bottom: 12px; }
.banner-savebar { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); padding: 10px 14px; background: var(--surface); font-size: .7rem; color: var(--text-3); }
.banner-native-select { display: none; }
.banner-schedule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.banner-counter { font-size: .62rem; color: var(--text-3); }
.banner-toast { position: fixed; bottom: 18px; right: 18px; background: var(--ink); color: var(--brand); padding: 10px 14px; border-radius: 8px; font-size: .76rem; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; }
.banner-toast.is-visible { opacity: 1; }
.banner-form-section .dash-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.banner-form-section .dash-form__full { grid-column: span 2; }
.banner-form-section label > span { display: block; font-size: .7rem; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }

/* email studio */
.email-studio { background: #eef1ef; }
.email-editor-shell { display: grid; grid-template-columns: 240px 1fr 360px; min-height: calc(100vh - 60px); }
.email-editor-shell.is-raw { grid-template-columns: 240px 1fr; }
.email-rail { background: var(--surface); border-right: 1px solid var(--border); padding: 14px; overflow: auto; }
.email-section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.email-section-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 10px 8px; text-align: center; cursor: pointer; color: var(--text-2); font-size: .68rem; font-family: inherit; }
.email-section-btn:hover { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-soft); }
.email-section-btn i { display: block; margin-bottom: 5px; font-size: .95rem; }
.email-canvas { padding: 24px; display: flex; justify-content: center; align-items: flex-start; overflow: auto; }
.email-preview-frame { width: min(100%, 640px); height: calc(100vh - 130px); background: #fff; border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 12px 40px rgba(0,0,0,.08); overflow: hidden; }
.email-preview-frame iframe { width: 100%; height: 100%; border: 0; }
.email-inspector { background: var(--surface); border-left: 1px solid var(--border); padding: 14px; overflow: auto; }
.email-section-list { display: grid; gap: 6px; margin-bottom: 14px; }
.email-section-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; cursor: pointer; font-size: .72rem; background: var(--surface); }
.email-section-row.is-selected { border-color: var(--brand); background: var(--brand-soft); }
.email-section-row.is-dragging { opacity: .45; }
.email-section-row.is-hidden { opacity: .55; }
.email-section-row .tools { margin-left: auto; display: flex; gap: 2px; }
.email-section-row .tools button { border: 0; background: none; color: var(--text-3); cursor: pointer; }

/* data table polish (uses existing .table) */
.table-wrap { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.table-scroll { overflow: auto; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.table-toolbar .search { min-width: 220px; }
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort] .sort-ind { opacity: .3; margin-left: 4px; }
.table th.is-sorted .sort-ind { opacity: 1; }
.cell-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-link { color: inherit; }
.row-link:hover { color: var(--brand-strong); }

/* activity feed */
.feed { display: grid; }
.feed-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: 0; }
.feed-ico { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; font-size: .78rem; }
.feed-body { min-width: 0; }
.feed-body p { margin: 0; font-size: .78rem; }
.feed-body span { font-size: .68rem; color: var(--text-3); }
.feed-time { margin-left: auto; font-size: .66rem; color: var(--text-3); white-space: nowrap; }

/* toast helper + empty inline */
.inline-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; text-align: center; color: var(--text-3); }
.inline-empty i { font-size: 1.2rem; opacity: .6; }
.inline-empty strong { color: var(--text-2); font-size: .82rem; }
.inline-empty p { margin: 0; font-size: .72rem; }

/* auth enhancements */
.auth-page .auth-form { width: 100%; }
.auth-form .field { margin-bottom: 0; }
.auth-form .field .label { margin-bottom: 0; font-size: var(--fs-sm); }
.auth-social { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-meta { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; }
.otp-row { display: flex; gap: 6px; }
.otp-row input { width: 100%; text-align: center; font-family: var(--font-mono); font-size: 1rem; letter-spacing: .08em; }

/* responsive */
@media (max-width: 1280px) {
  .studio-main { grid-template-columns: 46px 270px minmax(0,1fr); }
  .studio-inspector { display: none; }
  .banner-studio { grid-template-columns: 220px 1fr 340px; }
}
@media (max-width: 1080px) {
  .studio-main { grid-template-columns: 46px 260px minmax(0,1fr); }
  .studio-topbar__center { display: none; }
  .banner-studio { grid-template-columns: 1fr; }
  .banner-studio__rail, .banner-studio__preview { border: 0; border-top: 1px solid var(--border); }
  .banner-studio__preview iframe { height: 320px; }
  .email-editor-shell { grid-template-columns: 1fr; }
  .email-rail, .email-inspector { border: 0; border-top: 1px solid var(--border); }
  .form-grid--3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .studio-main { grid-template-columns: 1fr; }
  .studio-rail { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--border); padding: 6px; }
  .studio-rail__spacer { display: none; }
  .studio-panel { border-right: 0; }
  .studio-inspector { display: none; }
  .studio-frame { height: 60vh; }
  .form-grid, .form-grid--3, .split-2, .split-main { grid-template-columns: 1fr; }
  .col-span-2, .col-span-3 { grid-column: auto; }
  .banner-studio__bar { flex-direction: column; align-items: stretch; }
  .banner-studio__bar-actions { flex-wrap: wrap; }
}

/* public banner slots */
.banner-floating { position: fixed; right: 18px; bottom: 18px; z-index: 45; width: min(340px, calc(100vw - 36px)); border-radius: var(--r-lg); padding: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.banner-floating-close { position: absolute; top: 6px; right: 6px; color: inherit; }
.banner-modal .modal-box { max-width: 460px; }
.announcement--outline { background: var(--surface) !important; color: var(--text) !important; border-bottom: 1px solid var(--border); }

/* Banner studio: let the form use the full page, preview stays in view */
.banner-studio { align-items: start; }
.banner-studio__rail { position: sticky; top: 60px; max-height: calc(100vh - 76px); }
.banner-studio__preview { position: sticky; top: 60px; }
.banner-studio__form { max-height: none; overflow: visible; }
@media (max-width: 1080px) {
  .banner-studio__rail, .banner-studio__preview { position: static; max-height: none; }
}
.banner-choice, .banner-style-card, .banner-segmented button { display: inline-flex; align-items: center; gap: 6px; }
.banner-segmented button { justify-content: center; }
.banner-choice-row { align-items: stretch; }

/* App consoles are workbenches: never hide content behind a scroll reveal. */
body[data-shell="app"] [data-reveal] { opacity: 1 !important; transform: none !important; }

.banner-dirty { color: var(--warn); font-size: .7rem; font-weight: 600; }

.email-raw-panel { width: min(100%, 980px); display: flex; flex-direction: column; gap: 10px; }
.email-raw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.email-raw-input { width: 100%; min-height: calc(100vh - 190px); resize: vertical; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text); padding: 16px; font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: .78rem; line-height: 1.6; }

.translation-item { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-bottom: 10px; }
.translation-item > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 14px; list-style: none; }
.translation-item > summary::-webkit-details-marker { display: none; }
.translation-item[open] > summary { border-bottom: 1px solid var(--border); }
.translation-meta { display: block; font-size: .68rem; color: var(--text-3); margin-top: 2px; }
.translation-form { padding: 14px; }

.banner-studio.rail-hidden { grid-template-columns: 0 minmax(0, 1fr) 390px; }
.banner-studio.rail-hidden .banner-studio__rail { display: none; }
@media (max-width: 980px) { .banner-studio.rail-hidden { grid-template-columns: 1fr; } }

.studio-resource-list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }

/* ---------- rich studio section collection ---------- */
.bento-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.bento-card { display: flex; flex-direction: column; min-height: 220px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.bento-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand); }
.bento-card:nth-child(1) { grid-column: span 2; background: linear-gradient(145deg, var(--brand-soft), var(--surface) 70%); }
[data-theme="dark"] .bento-card:nth-child(1) { background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 20%, var(--surface)), var(--surface) 70%); }
.bento-card:nth-child(2) { grid-column: span 2; }
.bento-card:nth-child(5) { grid-column: span 2; }
.pull-quote { margin: 0; padding: 34px 38px; border-left: 3px solid var(--brand); background: var(--surface); border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.pull-quote p { font-family: var(--font-display); font-size: clamp(1.4rem, 2.4vw, 2.1rem); line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 18px; }
.pull-quote footer { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-xs); color: var(--text-3); }
.pull-quote footer strong { color: var(--text); font-size: var(--fs-sm); }
.logo-cloud { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.logo-cloud__item { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 18px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text-2); font-weight: 650; }
.logo-cloud__item i { color: var(--brand-text); }
.gallery-mosaic { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 220px; gap: 16px; }
.gallery-mosaic__item { position: relative; overflow: hidden; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; }
.gallery-mosaic__item:nth-child(1) { grid-column: span 3; grid-row: span 2; }
.gallery-mosaic__item:nth-child(2), .gallery-mosaic__item:nth-child(3) { grid-column: span 3; }
.gallery-mosaic__item img { width: 100%; flex: 1; min-height: 0; object-fit: cover; }
.gallery-mosaic__placeholder { flex: 1; min-height: 120px; display: grid; place-items: center; color: var(--brand-text); font-size: 1.6rem; background: linear-gradient(135deg, var(--brand-soft), var(--surface-2)); }
.gallery-mosaic__item figcaption { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); font-size: var(--fs-xs); color: var(--text-3); }
.gallery-mosaic__item figcaption strong { color: var(--text); font-size: var(--fs-sm); }
@media (max-width: 980px) {
  .bento-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento-card:nth-child(1) { grid-column: span 2; }
  .logo-cloud { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 200px; }
  .gallery-mosaic__item:nth-child(1), .gallery-mosaic__item:nth-child(2), .gallery-mosaic__item:nth-child(3) { grid-column: span 1; grid-row: span 1; }
}
@media (max-width: 620px) {
  .bento-grid, .logo-cloud { grid-template-columns: 1fr; }
  .bento-card:nth-child(1), .bento-card:nth-child(2) { grid-column: span 1; }
  .pull-quote { padding: 24px; }
}

/* Staff data manager forms: flex avoids grid content-sizing quirks in long forms. */
.data-form-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.data-form-grid .field { flex: 1 1 calc(50% - 8px); min-width: min(100%, 260px); }
.data-form-grid .field.wide { flex-basis: 100%; }
.data-form-grid .check { flex-basis: 100%; }
@media (max-width: 760px) { .data-form-grid .field { flex-basis: 100%; } }

.email-thumbnail-preview { display: block; width: 100%; max-height: 180px; object-fit: cover; border: 1px solid var(--border); border-radius: var(--r-md); margin-top: 10px; }

/* ---------- checklist panels (keys, support, vendor, careers) ---------- */
.check-list { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }
.check-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; }
.check-list li > i {
  width: 18px; height: 18px; flex: none; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong);
  font-size: .58rem;
}

/* ---------- notification preference rows ---------- */
.pref-row { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.pref-row:first-child { padding-top: 2px; }
.pref-row:last-of-type { border-bottom: 0; padding-bottom: 4px; }
.pref-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pref-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.pref-row-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
.pref-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.pref-switch-label { font-size: var(--fs-xs); color: var(--text-3); }
.pref-digest { display: grid; gap: 5px; min-width: 0; }
.pref-digest .label { margin: 0; font-size: var(--fs-2xs); }
.pref-digest .select { width: 100%; background-position: calc(100% - 16px) 14px, calc(100% - 11px) 14px; }
.pref-digest .select--sm { background-position: calc(100% - 16px) 13px, calc(100% - 11px) 10px; }

/* ---------- member identity cells ---------- */
.member-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.member-cell > .avatar { flex: none; }
.member-identity { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.member-identity .cell-main, .member-identity .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- image uploader ---------- */
.uploader { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface-2); transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.uploader.is-dragover { border-color: var(--brand); background: var(--brand-soft); }
.uploader-preview { width: 72px; height: 72px; flex: none; overflow: hidden; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; }
.uploader--round .uploader-preview { border-radius: 50%; }
.uploader--cover .uploader-preview { width: 180px; height: 92px; }
.uploader-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uploader--contain .uploader-preview img { object-fit: contain; padding: 7px; background: var(--surface); }
.uploader--dark .uploader-preview { background: #0b1410; border-color: #25352c; }
.uploader-fallback { display: grid; place-items: center; width: 100%; height: 100%; background: var(--brand-soft); color: var(--brand-strong); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.uploader-fallback i { font-size: 1.25rem; }
.uploader-body { flex: 1; min-width: 0; display: grid; gap: 7px; }
.uploader-title { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.uploader-body .field-hint { margin: 0; }
.uploader-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.uploader-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.uploader-clear-input { position: absolute; opacity: 0; pointer-events: none; }
.uploader-name { margin: 0; font-size: var(--fs-2xs); color: var(--text-3); min-height: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 620px) {
  .pref-row-grid { grid-template-columns: 1fr; }
  .uploader { align-items: flex-start; flex-direction: column; }
  .uploader--cover .uploader-preview { width: 100%; height: 150px; }
}

/* ---------- generic file inputs (studio media, banner imports) ---------- */
.input[type="file"] { padding: 6px; height: auto; cursor: pointer; color: var(--text-3); font-size: var(--fs-xs); }
.input[type="file"]::file-selector-button {
  margin-right: 10px; padding: 6px 12px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
}
.input[type="file"]::file-selector-button:hover { border-color: var(--border-strong); background: var(--surface-3); }

/* Compact native color swatches (workspace and theme editors). */
.input[type="color"] { width: 72px; max-width: 100%; height: 42px; padding: 4px; cursor: pointer; }

/* Filter toolbars: keep search, selects and buttons on one row. */
.table-toolbar .select { width: auto; min-width: 150px; flex: 0 1 auto; }
.table-toolbar .btn { flex: none; }

/* Secondary text stays on its own line in list rows and tables. */
.cell-sub { display: block; font-size: var(--fs-2xs); color: var(--text-3); font-weight: 400; }

/* ---------- public header account menu ---------- */
.header-user { flex: none; }
.header-user-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px;
  padding: 0 10px 0 5px; border: 1px solid var(--border); border-radius: var(--r-full);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.header-user-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.header-user-btn[aria-expanded='true'] { border-color: var(--brand); background: var(--brand-soft); }
.header-user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.header-user-meta strong { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); font-weight: 650; }
.header-user-meta em { font-style: normal; font-size: 0.64rem; color: var(--text-3); }
.header-user-btn .fa-angle-down { color: var(--text-3); }
@media (max-width: 1140px) { .header-user-meta { display: none; } }
@media (max-width: 560px) { .header-user-btn { width: 40px; padding: 0; justify-content: center; } .header-user-btn .fa-angle-down { display: none; } }

/* The workspace menu must stay inside the sidebar instead of being clipped. */
.ws-switcher > .popover { width: calc(var(--sidebar-w) - 26px); min-width: 0; }
.ws-switcher .ws-item { padding-inline: 10px; }
.ws-switcher .ws-foot { gap: 8px; }
.ws-switcher .ws-foot .link-btn { white-space: nowrap; }

/* Grid forms: the vertical rhythm comes from the grid gap, not adjacent margins. */
.form-grid > .field + .field,
.data-form-grid > .field + .field { margin-top: 0; }

/* Compact select controls inside table rows keep a usable hit target. */
.select--table { width: auto; min-width: 132px; height: 42px; font-size: var(--fs-xs); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 15px; }

/* Staff data index: masonry-style columns avoid holes between unequal groups. */
.data-groups { columns: 2; column-gap: 20px; }
.data-groups > .panel { display: inline-block; width: 100%; margin: 0 0 20px; break-inside: avoid; vertical-align: top; }
@media (max-width: 900px) { .data-groups { columns: 1; } }

/* Dashboard rows: stretch cards to the tallest sibling so no empty gutters appear. */
.dash-grid { align-items: stretch; }
.dash-grid > .panel { display: flex; flex-direction: column; }
.dash-grid > .panel > .panel-body { flex: 1; }

/* Theme + language popover */
.popover--theme { min-width: 270px; padding: 8px; }
.popover--theme .theme-option { padding: 9px 10px; }
.popover--theme .theme-language { padding: 10px 8px 4px; }
.theme-language .popover-title { padding: 0 2px 6px; margin: 0; }
.theme-language .lang-inline { display: grid; gap: 6px; }
.theme-language .select { width: 100%; }

/* Upload CTAs: keep icon and label on the control's optical centreline. */
.uploader-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1; min-height: 34px; padding-block: 0; }

/* Design tokens: grouped palette with swatches and a live component preview. */
.token-preview { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--r-lg); background: linear-gradient(135deg, var(--brand-soft), transparent 60%), var(--surface); margin-bottom: 22px; }
.token-preview-copy { display: grid; gap: 6px; justify-items: start; }
.token-preview-title { font-family: var(--font-display); font-size: var(--fs-xl); letter-spacing: -0.03em; line-height: 1.1; }
.token-preview-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.token-preview-input { min-width: 120px; color: var(--text-3); }
.token-groups { display: grid; gap: 22px; }
.token-group { border-top: 1px solid var(--border); padding-top: 18px; }
.token-group:first-child { border-top: 0; padding-top: 0; }
.token-group-head { margin-bottom: 12px; }
.token-group-head h3 { font-family: var(--font-display); font-size: var(--fs-md); letter-spacing: -0.01em; margin: 0; }
.token-group-head p { margin: 2px 0 0; color: var(--text-3); font-size: var(--fs-xs); }
.token-color-row { display: flex; align-items: center; gap: 10px; }
.token-color-row .input { flex: 1; min-width: 0; font-family: var(--font-mono); text-transform: lowercase; }
.token-swatch { width: 42px; height: 42px; flex: none; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--swatch, var(--surface)); box-shadow: inset 0 0 0 2px var(--surface); }
.token-group--css .textarea { font-family: var(--font-mono); font-size: var(--fs-xs); }
@media (max-width: 900px) { .token-preview { align-items: flex-start; flex-direction: column; } }

/* Studio lists: icon or cover thumbnail before the page/post title. */
.studio-thumb { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); overflow: hidden; }
.studio-thumb img { width: 100%; height: 100%; object-fit: cover; }
.studio-thumb--brand { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand-soft-2); }
.studio-thumb--info { background: var(--info-soft); color: var(--info); }
.studio-thumb--purple { background: var(--purple-soft); color: var(--purple); }
.studio-thumb--warn { background: var(--warn-soft); color: var(--warn); }
.studio-thumb--muted { background: var(--surface-3); color: var(--text-3); }

/* Media library: clickable tiles, favourite state, right drawer and previews. */
.media-tile { position: relative; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.media-tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.media-tile.is-favorite { border-color: var(--warn); }
.media-tile-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.media-tile-file { aspect-ratio: 4/3; display: grid; place-items: center; gap: 8px; background: var(--surface-3); color: var(--text-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; }
.media-drawer-preview { width: 100%; max-height: 320px; object-fit: contain; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); }
.media-drawer-preview--file { display: grid; place-items: center; min-height: 180px; color: var(--text-3); }
.drawer--right { right: 0; left: auto; transform: translateX(102%); border-inline-end: 0; border-inline-start: 1px solid var(--border); }
.drawer--right.is-open { transform: translateX(0); }

/* Shared media-library picker used by every /space/ image upload. */
.media-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 52vh; overflow: auto; margin-top: 12px; }
.media-library-card { display: grid; gap: 4px; padding: 8px; text-align: left; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.media-library-card:hover { border-color: var(--brand); background: var(--brand-soft); }
.media-library-card img, .media-library-file { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); }
.media-library-card strong { font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-library-card small { color: var(--text-3); font-size: 0.66rem; }

/* MCP instructions textarea spacing */
textarea#mcpInstructions { margin-bottom: 12px; }

/* AI Studio draft cards */
.assistant-draft { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.assistant-draft:last-child { border-bottom: 0; }
.assistant-draft__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.assistant-draft__output { margin-top: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.65; white-space: pre-wrap; }

/* Public model comparison */
.compare-select-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.compare-picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.compare-picker-foot p { display: flex; align-items: center; gap: 6px; margin: 0; }
.compare-pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.compare-pick { display: flex; flex-direction: column; height: 100%; min-width: 0; }
.compare-pick-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.compare-pick-top .chip { margin-bottom: 0; }
.compare-pick-id { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.compare-pick-id > div { min-width: 0; }
.compare-pick-id .model-name { overflow-wrap: anywhere; }
.compare-pick-summary { margin-top: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.compare-pick .tag-row { margin-top: 10px; min-height: 50px; align-content: flex-start; }
.compare-pick-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.compare-pick-stats > div { min-width: 0; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.compare-pick-stats span { display: block; font-size: var(--fs-2xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.compare-pick-stats strong { display: block; margin-top: 2px; font-family: var(--font-display); font-size: var(--fs-sm); letter-spacing: -0.01em; }
.compare-pick-meta { display: flex; flex-wrap: wrap; gap: 6px 13px; margin-top: 12px; font-size: var(--fs-2xs); color: var(--text-3); }
.compare-pick-meta span { display: inline-flex; align-items: center; gap: 5px; }
.compare-pick-meta i { color: var(--brand-text); }
.compare-pick-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 16px; }
.compare-pick-actions .btn-primary { flex: 1; justify-content: center; }
.compare-winner-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.compare-winner-grid .metric { min-width: 0; }
.compare-winner-grid .metric-value { font-size: clamp(1.45rem, 2vw, 1.8rem); }
.compare-winner-grid .metric-value small { margin-left: 2px; }
.compare-winner-grid .metric-foot { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-winner-grid .metric-foot a { color: var(--text); font-weight: 600; }
.compare-winner-grid .metric-foot span { display: block; margin-top: 2px; color: var(--text-3); }
.compare-models .cmp-col { min-width: 190px; vertical-align: top; }
.compare-matrix { overflow: visible; }
.compare-matrix .compare-facts-scroll { overflow: visible; }
.compare-models { table-layout: fixed; min-width: 720px; }
.compare-models thead th { white-space: normal; overflow-wrap: anywhere; }
.compare-models th:first-child { width: 22%; }
.compare-matrix thead th { position: sticky; top: var(--header-h); z-index: 2; background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--border); }
.compare-matrix tbody tr[hidden] { display: none; }
.compare-offer-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.compare-offer-toolbar .filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.compare-offer-toolbar .select { width: auto; min-width: 150px; }
.compare-offer-toolbar [data-offer-count] { margin-left: auto; white-space: nowrap; }
@media (max-width: 900px) {
  .compare-matrix .compare-facts-scroll { overflow-x: auto; }
  .compare-matrix thead th { position: static; box-shadow: none; }
}
.compare-models .is-best { background: var(--brand-soft); color: var(--brand-text); font-weight: 700; }
.compare-section td { background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding-block: 10px; }
.compare-section i { color: var(--brand); margin-right: 6px; }
.compare-chart-grid { align-items: stretch; }
.compare-offers .table { min-width: 1080px; }
.compare-offers .provider-name { min-width: 180px; }
@media (max-width: 1180px) { .compare-winner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) { .compare-select-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .compare-pick-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .compare-select-grid { grid-template-columns: 1fr; } .compare-winner-grid { grid-template-columns: 1fr; } .compare-picker-foot { align-items: stretch; } .compare-picker-foot .btn { justify-content: center; } }

/* Long-form documentation article */
.doc-prose { font-size: var(--fs-sm); line-height: 1.8; color: var(--text-2); }
.doc-prose > :first-child { margin-top: 0; }
.doc-prose h2 { font-family: var(--font-display); font-size: var(--fs-2xl); letter-spacing: -0.02em; color: var(--text); margin: 34px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); scroll-margin-top: calc(var(--header-h) + 24px); }
.doc-prose h3 { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--text); margin: 26px 0 8px; scroll-margin-top: calc(var(--header-h) + 24px); }
.doc-prose h4 { color: var(--text); margin: 20px 0 6px; }
.doc-prose p { margin: 10px 0; }
.doc-prose .lead { font-size: var(--fs-lg); color: var(--text-2); line-height: 1.65; }
.doc-prose ul, .doc-prose ol { padding-left: 22px; margin: 12px 0; display: grid; gap: 7px; }
.doc-prose li::marker { color: var(--brand); }
.doc-prose code.inline-code { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xs); padding: 2px 6px; font-family: var(--font-mono); font-size: .82em; color: var(--brand-text); }
.doc-prose .code { margin: 16px 0; position: relative; }
.doc-prose .code-body { position: relative; }
.doc-prose .code-body pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.doc-prose .doc-copy { position: absolute; top: 8px; right: 8px; opacity: .75; }
.doc-prose .doc-copy:hover { opacity: 1; }
.doc-prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: var(--fs-xs); }
.doc-prose th { text-align: left; background: var(--surface-2); color: var(--text); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.doc-prose td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-prose blockquote { margin: 18px 0; padding: 14px 18px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--text-2); }
.doc-prose .alert { margin: 18px 0; }
.doc-prose hr { margin: 28px 0; }
.doc-prose img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.docs-toc a { line-height: 1.45; }
.docs-toc hr { border: 0; border-top: 1px solid var(--border); }
@media (max-width: 1100px) { .docs-toc { display: none; } }

/* ==========================================================================
   Public benchmarks & rankings
   ========================================================================== */
.bench-filter { flex-wrap: wrap; }
.bench-filter .filter-chips { flex-wrap: wrap; }
.bench-filter .input-group { max-width: 440px; }
.bench-group { margin-top: 30px; }
.bench-group:first-of-type { margin-top: 0; }
.bench-group-head { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 12px; }
.bench-group-ico { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; flex: none; }
.bench-group-head h2 { font-size: 1.15rem; letter-spacing: -0.02em; }
.bench-group-head p { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; max-width: 70ch; }
.bench-group-head > .chip { margin-left: auto; flex: none; }
.bench-panel { overflow: hidden; }
.bench-list { display: flex; flex-direction: column; }
.bench-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px 150px 40px; gap: 18px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); transition: background-color var(--dur) var(--ease); }
.bench-row:last-child { border-bottom: 0; }
.bench-row:hover { background: var(--surface-2); }
.bench-title { display: flex; align-items: center; gap: 10px; }
.bench-title a { color: var(--text); font-weight: 700; font-size: var(--fs-sm); letter-spacing: -0.01em; }
.bench-title a:hover { color: var(--brand-text); }
.bench-title a i { color: var(--text-3); font-size: 0.62rem; margin-left: 3px; }
.bench-ico { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; flex: none; font-size: var(--fs-sm); }
.bench-main > p { color: var(--text-3); font-size: var(--fs-xs); line-height: 1.65; margin-top: 5px; max-width: 64ch; }
.bench-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; color: var(--text-3); font-size: var(--fs-2xs); }
.bench-meta i { color: var(--text-3); margin-right: 3px; }
.bench-podium { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
.bench-podium .chip { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bench-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); display: inline-block; margin-right: 2px; }
.bench-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bench-label { display: flex; align-items: center; gap: 5px; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); font-weight: 650; }
.bench-label i { color: var(--brand-text); }
.bench-value { font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bench-value:hover { color: var(--brand-text); }
.bench-score { font-family: var(--font-display); font-size: var(--fs-lg); letter-spacing: -0.03em; line-height: 1.15; color: var(--text); }
.bench-score small { font-size: var(--fs-2xs); color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.bench-bar { display: block; height: 4px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 2px; }
.bench-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--cyan)); border-radius: inherit; }
.bench-note { font-size: var(--fs-2xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bench-open { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); transition: all var(--dur) var(--ease); }
.bench-open:hover { background: var(--brand); color: var(--text-invert); border-color: var(--brand); }
.champion-panel .panel-head { border-bottom: 0; }
.champion-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.champion-card { display: flex; align-items: center; gap: 11px; padding: 14px 15px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); position: relative; }
.champion-card:first-child { border-color: var(--brand); background: var(--brand-soft); }
.champion-rank { position: absolute; top: 10px; right: 12px; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xs); color: var(--text-3); }
.champion-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.champion-body a { color: var(--text); font-size: var(--fs-sm); }
.champion-body a:hover { color: var(--brand-text); }
.champion-body .text-xs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.champion-score { margin-left: auto; text-align: right; flex: none; }
.champion-score strong { display: block; font-family: var(--font-display); font-size: var(--fs-lg); letter-spacing: -0.03em; }
.champion-score span { display: block; font-size: 0.6rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; }
.api-grid { align-items: start; }
.api-list { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.api-list li { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.api-list li span { font-size: var(--fs-xs); color: var(--text-3); }
.bench-detail-grid { grid-template-columns: minmax(0, 2.3fr) minmax(300px, 1fr); align-items: start; }
.bench-leaderboard .table { min-width: 720px; }
.bench-leaderboard .table-foot { border-radius: 0; }
.bench-top-row { background: var(--brand-soft); }
.bench-rank { width: 28px; height: 28px; border-radius: var(--r-sm); display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: var(--fs-2xs); font-weight: 700; }
.bench-rank--top { background: var(--brand); color: var(--text-invert); }
[data-theme='dark'] .bench-rank--top { color: #04140d; }
.bench-score-cell { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.bench-score-cell .bench-bar { width: 96px; }
.bench-distribution { display: flex; flex-direction: column; gap: 7px; }
.bench-dist-row { display: grid; grid-template-columns: 52px 1fr 24px; align-items: center; gap: 8px; }
.bench-dist-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bench-dist-bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.bench-related { display: flex; flex-direction: column; gap: 2px; }
.bench-related a { display: flex; align-items: center; gap: 9px; padding: 8px 0; color: var(--text); border-bottom: 1px solid var(--border); }
.bench-related li:last-child a { border-bottom: 0; }
.bench-related a > span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bench-related a strong { font-size: var(--fs-xs); }
.bench-related a em { font-style: normal; font-size: var(--fs-2xs); color: var(--text-3); }
.bench-related a > i { margin-left: auto; color: var(--text-3); font-size: 0.65rem; }
.bench-related .feed-ico { width: 30px; height: 30px; }

/* Rankings */
.rank-filter { flex-wrap: wrap; }
.rank-filter .filter-chips { flex-wrap: wrap; }
.rank-change { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.rank-change-ico { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none; border-radius: var(--r-md); }
.rank-change-ico.ico-ok { background: var(--ok-soft); color: var(--ok); }
.rank-change-ico.ico-warn { background: var(--warn-soft); color: var(--warn); }
.rank-change-body { flex: 1; min-width: 0; }
.rank-change-body strong { display: block; font-family: var(--font-display); font-size: var(--fs-sm); letter-spacing: -0.01em; }
.rank-change-body p { margin-top: 3px; font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; }
@media (max-width: 560px) { .rank-change { align-items: flex-start; } .rank-change .chip { display: none; } }
.rank-sort { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.rank-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.rank-podium-card { padding: 16px 17px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.rank-podium-card--first { border-color: var(--brand); background: linear-gradient(135deg, var(--brand-soft), var(--surface)); }
.rank-podium-top { display: flex; align-items: center; gap: 8px; }
.rank-podium-top .chip { margin-left: auto; }
.rank-medal { font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 700; color: var(--brand-text); }
.rank-podium-name { display: block; margin-top: 11px; font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.025em; color: var(--text); }
.rank-podium-name:hover { color: var(--brand-text); }
.rank-podium-metric { display: flex; align-items: baseline; gap: 6px; margin-top: 10px; }
.rank-podium-metric strong { font-family: var(--font-display); font-size: var(--fs-2xl); letter-spacing: -0.04em; line-height: 1; }
.rank-podium-metric span { font-size: var(--fs-2xs); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; }
.rank-podium-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; font-size: var(--fs-2xs); color: var(--text-3); }
.rank-main-grid { grid-template-columns: minmax(0, 1fr) 318px; gap: 18px; align-items: start; }
.rank-table-panel .table { min-width: 980px; }
.rank-table-panel .table-foot { border-radius: 0; }
.rank-aside { display: flex; flex-direction: column; }
.rank-share { display: block; width: 100%; max-width: 100px; height: 3px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.rank-share i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.rank-share--wide { max-width: 120px; }
.rank-spark { display: inline-flex; align-items: flex-end; gap: 2px; width: 62px; height: 24px; }
.rank-spark i { flex: 1; min-height: 2px; border-radius: 1px; background: var(--brand); opacity: 0.72; }
.rank-side-list { display: flex; flex-direction: column; }
.rank-side-list li { border-bottom: 1px solid var(--border); }
.rank-side-list li:last-child { border-bottom: 0; }
.rank-side-list a { display: flex; align-items: center; gap: 9px; padding: 9px 0; color: var(--text); }
.rank-side-list a > span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rank-side-list a strong { font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-side-list a em { font-style: normal; font-size: var(--fs-2xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-side-list a > .delta, .rank-side-list a > .chip, .rank-side-list a > .mono { margin-left: auto; flex: none; }
.rank-side-list .model-ico { width: 30px; height: 30px; flex: none; }

@media (max-width: 1200px) {
  .bench-row { grid-template-columns: minmax(0, 1fr) 130px 130px 130px 34px; gap: 14px; }
  .rank-main-grid { grid-template-columns: 1fr; }
  .rank-aside { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .rank-aside .panel.mt-4 { margin-top: 0; }
}
@media (max-width: 900px) {
  .bench-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bench-main { grid-column: 1 / -1; }
  .bench-open { display: none; }
  .bench-detail-grid { grid-template-columns: 1fr; }
  .champion-grid { grid-template-columns: 1fr; }
  .rank-podium { grid-template-columns: 1fr; }
  .rank-aside { grid-template-columns: 1fr; }
  .rank-sort { margin-left: 0; }
}
@media (max-width: 620px) {
  .bench-row { grid-template-columns: 1fr 1fr; gap: 14px 18px; }
  .bench-main { grid-column: 1 / -1; }
  .bench-stat:last-of-type { grid-column: 1 / -1; }
  .bench-group-head { flex-wrap: wrap; }
  .bench-group-head > .chip { margin-left: 52px; }
  .bench-title { align-items: flex-start; }
  .bench-title a { overflow-wrap: anywhere; }
  .rank-podium-top .chip { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ==========================================================================
   Model detail workbench
   ========================================================================== */
.model-hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.model-hero-stat { min-width: 0; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.model-hero-stat-label { display: block; font-size: var(--fs-2xs); letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-hero-stat strong { display: block; margin-top: 3px; font-family: var(--font-display); font-size: var(--fs-xl); letter-spacing: -0.03em; line-height: 1.05; }
.model-hero-stat-foot { display: block; margin-top: 2px; font-size: var(--fs-2xs); color: var(--text-3); }
.model-hero-cta-rail { display: flex; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.model-hero-cta-rail .icon-btn { flex: 1; width: auto; height: 36px; border-color: var(--border); background: var(--surface-2); }
.model-hero-cta-rail .icon-btn:hover { border-color: var(--border-strong); background: var(--surface-3); }
.model-snapshot { display: flex; flex-direction: column; }
.model-snapshot .stat-label { margin-bottom: 5px; }
.model-snapshot-value { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
.model-snapshot-value small { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: 0; font-weight: 500; }
.model-snapshot .link-btn { margin-top: auto; }
.provider-name { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.provider-name > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.provider-name strong { font-size: var(--fs-xs); white-space: nowrap; }
.provider-ico { width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; font-size: var(--fs-xs); }
.provider-table td { vertical-align: top; }
.provider-table .cell-sub { white-space: normal; }
.uptime-value { color: var(--ok); font-weight: 650; }
.uptime-strip { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; }
.uptime-cell { height: 28px; border-radius: 3px; display: block; }
.uptime-cell--ok { background: var(--ok); opacity: .9; }
.uptime-cell--warn { background: var(--warn); opacity: .9; }
.uptime-cell--danger { background: var(--danger); opacity: .9; }
.eval-index-card { display: flex; flex-direction: column; }
.eval-index-card h3 { font-size: var(--fs-sm); }
.eval-index-score { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.03em; margin-top: 5px; }
.eval-index-score small { font-size: var(--fs-2xs); color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.eval-index-card .bench-bar { margin-top: auto; }
.app-card { display: flex; flex-direction: column; color: var(--text); }
.app-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.app-card h3 { font-size: var(--fs-sm); }
.app-card .text-sm { line-height: 1.55; }
.rank-position { display: flex; align-items: center; gap: 14px; }
.rank-position-number { font-family: var(--font-display); font-size: var(--fs-4xl); font-weight: 700; letter-spacing: -0.05em; line-height: 1; color: var(--brand-text); }
.rank-position-copy { display: flex; flex-direction: column; gap: 3px; }
.rank-position-copy strong { font-family: var(--font-display); font-size: var(--fs-lg); letter-spacing: -0.02em; }
.rank-position-copy span { font-size: var(--fs-xs); color: var(--text-3); }
.model-link-list { display: flex; flex-direction: column; }
.model-link-list li { border-bottom: 1px solid var(--border); }
.model-link-list li:last-child { border-bottom: 0; }
.model-link-list a { display: flex; align-items: center; gap: 9px; padding: 9px 0; color: var(--text); }
.model-link-list a > span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.model-link-list a strong { font-size: var(--fs-xs); }
.model-link-list a em { font-style: normal; color: var(--text-3); font-size: var(--fs-2xs); }
.model-link-list a > i { margin-left: auto; color: var(--text-3); font-size: .62rem; }
.model-mini { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text); background: var(--surface); }
.model-mini:hover { border-color: var(--border-strong); background: var(--surface-2); }
.model-mini > span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.model-mini strong { font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-mini em { font-style: normal; color: var(--text-3); font-size: var(--fs-2xs); }
.model-mini > i { margin-left: auto; color: var(--text-3); font-size: .62rem; }
.model-explore .section-head { margin-bottom: 24px; }
.model-vendor-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.model-tabs .tabs { gap: 0; }
.tabs--model { position: relative; flex-wrap: wrap; row-gap: 0; }
.tabs--model .tab { padding-inline: 13px; }
.tabs--model .tab .chip { margin-left: 5px; }
.model-tabs [data-tab-jump] { cursor: pointer; }

@media (max-width: 1100px) {
  .model-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .model-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uptime-strip { grid-template-columns: repeat(15, minmax(0, 1fr)); }
  .uptime-cell { height: 20px; }
  .model-hero .card-title-row h1 { width: 100%; }
  .rank-position-number { font-size: var(--fs-3xl); }
}

/* Rankings category leaders */
.category-leader-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.category-leader-grid .panel + .panel { margin-top: 0; }
.category-leader { padding: 0; overflow: hidden; min-width: 0; }
.category-leader-head { display: flex; align-items: center; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.category-leader-head > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.category-leader-head h3 { font-size: var(--fs-xs); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-leader-head span { font-size: var(--fs-2xs); color: var(--text-3); }
.category-leader-head .link-btn { margin-left: auto; flex: none; white-space: nowrap; }
.category-leader-list { display: flex; flex-direction: column; }
.category-leader-list li { border-bottom: 1px solid var(--border); }
.category-leader-list li:last-child { border-bottom: 0; }
.category-leader-list a { display: flex; align-items: center; gap: 7px; padding: 9px 13px; color: var(--text); }
.category-leader-list a > span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.category-leader-list strong { font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-leader-list em { font-style: normal; color: var(--text-3); font-size: var(--fs-2xs); white-space: nowrap; }
.category-leader-list a > .text-2xs { margin-left: auto; flex: none; }
.rank-mini { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text-3); font-family: var(--font-mono); font-size: .58rem; flex: none; }
@media (max-width: 1279px) and (min-width: 761px) {
  .category-leader-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .category-leader:last-child:nth-child(3n+2) { grid-column: span 2; }
}
@media (max-width: 760px) and (min-width: 541px) {
  .category-leader-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-leader:last-child:nth-child(odd) { grid-column: span 2; }
}
@media (max-width: 540px) { .category-leader-grid { grid-template-columns: 1fr; } }

.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0 22px 18px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-2xs); color: var(--text-3); }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }

.model-hero .card { display: flex; flex-direction: column; gap: 9px; }

@media (min-width: 981px) {
  section.section--tight:has(> .container > .crumbs) { padding-top: 2rem; }
}
