/* CCPOK Console: shared typography, spacing and interaction tokens. */
:root {
  color-scheme: light;
  --bg: #f6f7f9; --surface: #fff; --surface-strong: #fff; --surface-soft: #f8f9fb;
  --line: #e6e8ed; --line-strong: #c7cbd4; --text: #252932; --muted: #697180; --muted-2: #757e8d;
  --brand: #6e5bff; --brand-2: #5947de; --brand-soft: #efedff; --hover: #f2f3f6;
  --danger: #bd344b; --warning: #91621b; --success: #17845b;
  --font-body: 14px; --font-small: 12px; --font-section: 16px; --font-title: 22px; --font-stat: 28px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px;
  --control-height: 36px; --radius: 10px; --shadow: 0 16px 56px #18203324;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: var(--font-body); line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button, input, select, textarea { border: 1px solid var(--line-strong); background: var(--surface); }
button { cursor: pointer; }
button:disabled, [aria-busy="true"] { cursor: wait; opacity: .6; }
button:disabled { cursor: default; }
button, a, summary, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #6e5bff45; outline-offset: 2px; }
input, select, textarea { width: 100%; min-width: 0; min-height: var(--control-height); border-radius: 6px; padding: 7px 10px; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
input[type="checkbox"], input[type="radio"] { width: 16px; min-height: 16px; accent-color: var(--brand); }
select option { background: var(--surface); color: var(--text); }
textarea { min-height: 100px; resize: vertical; }
label { display: grid; gap: var(--space-2); min-width: 0; font-size: var(--font-body); color: var(--muted); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: var(--font-title); line-height: 1.4; font-weight: 650; }
h2, h3 { font-size: var(--font-section); line-height: 1.5; font-weight: 600; }
a { color: var(--brand); text-decoration: none; }
.hidden { display: none !important; }
.button, .btn-sm { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-height); padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--text); font-size: var(--font-body); line-height: 20px; font-weight: 500; white-space: nowrap; flex-shrink: 0; text-align: center; transition: background 150ms, border-color 150ms; }
.button:hover, .btn-sm:hover { background: var(--hover); border-color: #aeb5c2; }
.button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.button.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.button.danger, .btn-sm.danger { color: var(--danger); border-color: #efc6ce; background: #fff; }
.button.danger:hover, .btn-sm.danger:hover { background: #fff2f4; }
.button.ghost { background: transparent; border-color: transparent; }
.button.ghost:hover { background: var(--hover); }
.icon-button { width: var(--control-height); padding: 0; }
svg { display: block; flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.login-view { display: grid; min-height: 100dvh; place-items: center; padding: var(--space-6); }
.login-card { width: min(420px, 100%); padding: var(--space-8); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 36px #18203309; }
.brand-row { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-8); }
.brand-row strong { display: block; font-size: var(--font-section); font-weight: 650; }
.brand-row span:not(.brand-mark) { display: block; margin-top: 2px; font-size: var(--font-small); color: var(--muted); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; background: var(--brand); border-radius: 10px; color: #fff; font-weight: 700; font-size: 20px; }
.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 24px 12px 12px; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar .brand-row { padding: 0 12px; margin-bottom: 24px; }
.nav { display: grid; gap: 20px; overflow: auto; min-height: 0; padding-bottom: 16px; scrollbar-width: thin; }
.nav-section { display: grid; gap: 4px; }
.nav-label { padding: 0 12px 4px; font-size: var(--font-small); color: var(--muted-2); }
.nav-button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: var(--font-body); line-height: 24px; text-align: left; }
.nav-button:hover { background: var(--hover); color: var(--text); }
.nav-button.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-icon { width: 20px; height: 20px; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; padding: 16px 4px 0; margin-top: auto; border-top: 1px solid var(--line); }
.sidebar-footer > div { min-width: 0; flex: 1; }
.sidebar-footer strong { display: block; font-size: var(--font-small); }
.sidebar-footer div span { display: block; font-size: var(--font-small); color: var(--muted); }
.admin-avatar { display: grid; place-items: center; width: 32px; height: 32px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 50%; font-weight: 600; }
.workspace { min-width: 0; padding: 0 24px 32px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 88px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.page-heading { min-width: 0; margin-right: auto; }
.topbar p { font-size: var(--font-small); color: var(--muted); margin: 0 0 4px; }
.topbar h1 { margin: 0; }
.topbar-tools, .topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar-tools { justify-content: flex-end; }
.panel { display: none; }
.panel.active { display: grid; gap: 24px; }
.grid, .stack, .compact-list, .ledger-list { display: grid; gap: 16px; min-width: 0; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card, .card, .table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.metric-card, .card { padding: 20px; }
.metric-card span { display: block; font-size: var(--font-small); color: var(--muted); }
.metric-card strong { display: block; font-size: var(--font-stat); line-height: 1.5; margin: 8px 0 4px; font-weight: 650; font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.commerce-layout { display: grid; gap: 24px; }
.card-head, .drawer-head, .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.card-head > div, .drawer-head > div, .modal-head > div { min-width: 0; }
.card-head h2, .card-head h3, .drawer-head h2, .modal-head h2 { margin: 0; font-size: var(--font-section); }
.card-head p, .drawer-head p, .modal-head p { margin: 4px 0 0; font-size: var(--font-small); line-height: 1.6; color: var(--muted); }
.card-head select { width: auto; max-width: 200px; }
.toolbar, .collection-toolbar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input, .toolbar select { max-width: 240px; }
.collection-toolbar input { max-width: 360px; flex: 1; min-width: 180px; }
.collection-toolbar select { width: auto; min-width: 120px; }
.table-card { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.card > .table-card { border-radius: 6px; }
table, .policy-table { width: 100%; border-collapse: collapse; font-size: var(--font-body); }
th, td, .policy-table th, .policy-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: var(--font-body); line-height: 1.5; }
th, .policy-table th { color: var(--muted); font-size: var(--font-small); font-weight: 500; white-space: nowrap; background: var(--surface-soft); }
td { max-width: 360px; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-soft); }
tr.clickable { cursor: pointer; }
td strong { font-weight: 500; }
td input { min-width: 130px; }
.cell-actions, th.cell-actions, td.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions-inner, .list-actions, .card-actions, .split-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.cell-actions-inner { display: inline-flex; flex-wrap: nowrap; }
.card-actions, .split-actions { margin-top: 16px; }
.muted { color: var(--muted); }
.small, .field-note { font-size: var(--font-small); line-height: 1.5; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill, .tag { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 24px; padding: 2px 8px; border: 0; border-radius: 4px; background: var(--hover); color: var(--muted); font-size: var(--font-small); white-space: nowrap; }
.pill.green { background: #eaf7f1; color: #17784f; }
.pill.yellow { background: #fff5df; color: #8d6115; }
.pill.red, .tag-danger { background: #fdefef; color: var(--danger); }
.tag-brand { background: var(--brand-soft); color: var(--brand); }
.empty-state { display: grid; place-items: center; min-height: 160px; padding: 24px; color: var(--muted); font-size: var(--font-body); text-align: center; }
.message { margin: 12px 0 0; font-size: var(--font-body); line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.message:empty { display: none; }
.message.error { color: var(--danger); }
.message.ok, .message.success { color: var(--success); }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.list-item strong { display: block; margin-bottom: 4px; font-weight: 500; }
.list-item .small { display: block; }
.secret-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.secret-toggle { width: var(--control-height); min-width: var(--control-height); padding: 0; }
.load-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff8e8; border: 1px solid #eadbb4; border-radius: 8px; padding: 12px 16px; margin-bottom: 24px; color: #795724; }
.load-notice span { min-width: 0; overflow-wrap: anywhere; }
.collection-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--muted); font-size: var(--font-small); flex-wrap: wrap; }
.collection-pagination { display: flex; align-items: center; gap: 8px; }
.collection-pagination select { width: auto; font-size: var(--font-small); }
.collection-footer button { min-width: 36px; }
.filter-count { font-size: var(--font-small); color: var(--muted); }
.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 40; background: #17203255; }
.modal-backdrop { z-index: 50; }
.drawer { position: absolute; inset: 0 0 0 auto; width: min(860px, 100%); overflow: auto; background: var(--surface); box-shadow: var(--shadow); padding: 24px; overscroll-behavior: contain; }
.drawer-head { position: sticky; top: -24px; z-index: 2; background: var(--surface); padding: 20px 0; border-bottom: 1px solid var(--line); }
.drawer .split-actions { position: sticky; bottom: -24px; z-index: 2; background: var(--surface); padding: 16px 0 24px; border-top: 1px solid var(--line); }
.modal { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); padding: 24px; border-radius: 12px; box-shadow: var(--shadow); }
.dialog-open { overflow: hidden; }
.code-editor { font-family: ui-monospace, SFMono-Regular, monospace; font-size: var(--font-small); }
.mobile-nav-toggle, .mobile-nav-backdrop { display: none; }
#redeemCodesPanel .two-col { grid-template-columns: 1fr; }
#redeemBatchOutput { margin-top: 16px; }
#memberRows td:nth-child(3), #memberRows td:nth-child(4), #memberRows td:nth-child(5) { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Feature layouts share the same control, type and spacing scale. */
.detail-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 16px;
}
.detail-sections {
        display: grid;
        gap: 16px;
}
.detail-section {
        display: grid;
        gap: 8px;
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 16px; background: var(--surface-soft);
}
.detail-section h3 {
        margin: 0;
        font-size: var(--font-body);
}
.detail-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 8px;
}
.detail-grid div, .detail-stack {
        display: grid;
        gap: 4px;
}
.detail-grid strong, .detail-stack strong {
        font-size: var(--font-small);
        color: var(--muted);
}
.detail-grid span, .detail-stack span {
        font-size: var(--font-body);
        color: var(--text);
        word-break: break-word;
}
.detail-json {
        margin: 0;
        overflow: auto;
        border-radius: 6px;
        background: #0f172a;
        color: #e2e8f0;
        padding: 12px;
        font-size: var(--font-small);
        line-height: 1.5;
        white-space: pre-wrap;
        word-break: break-word;
}
.detail-output-list {
        display: grid;
        gap: 8px;
}
.detail-output-item {
        display: grid;
        gap: 4px;
        border: 1px solid var(--line);
        border-radius: 6px;
        background: rgba(15, 23, 42, 0.03);
        padding: 12px;
}
.form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
}
.form-grid .full {
        grid-column: 1 / -1;
}
.cover-preview {
        position: relative;
        overflow: hidden;
        width: 100%;
        min-height: 230px;
        border: 1px solid var(--line);
        border-radius: 6px;
        background: var(--surface-soft);
}
.cover-preview img, .cover-preview video {
        width: 100%;
        height: 100%;
        min-height: 230px;
        object-fit: cover;
        display: block;
}
.cover-preview .empty-cover {
        display: grid;
        min-height: 230px;
        place-items: center;
        color: var(--muted);
}
.supplier-group {
        display: grid;
        gap: 12px;
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 16px;
        background: var(--surface-soft);
}
.supplier-group-head {
        display: flex;
        align-items: start;
        justify-content: space-between;
        gap: 16px;
}
.supplier-summary-meta {
        display: grid;
        gap: 8px;
}
.supplier-title-row {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 8px;
}
.generation-text {
        max-width: 320px;
        line-height: 1.6;
        word-break: break-word;
        white-space: normal;
}
.generation-stack {
        display: grid;
        gap: 4px;
}
.generation-cost {
        display: grid;
        gap: 4px;
        min-width: 132px;
}
.generation-preview {
        display: grid;
        gap: 8px;
}
.generation-preview-frame {
        display: grid;
        place-items: center;
        overflow: hidden;
        width: 84px;
        height: 84px;
        border: 1px solid var(--line);
        border-radius: 6px;
        background: var(--surface-soft);
}
.generation-preview-frame img, .generation-preview-frame video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
}
.generation-preview audio {
        width: min(220px, 100%);
}
.supplier-title-row strong {
        display: block;
}
.supplier-inline-url {
        word-break: break-all;
}
.switch {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: var(--muted);
        font-size: var(--font-small);
        cursor: pointer;
        user-select: none;
}
.switch input {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
}
.switch-track {
        position: relative;
        flex: 0 0 auto;
        width: 42px;
        height: 24px;
        border: 1px solid var(--line);
        border-radius: 6px;
        transition:
          background 180ms ease,
          border-color 180ms ease; border-color: var(--line); background: var(--surface-soft);
}
.switch-track::after {
        content: "";
        position: absolute;
        top: 2px;
        left: 2px;
        width: 18px;
        height: 18px;
        border-radius: 6px;
        transition: transform 180ms ease; background: #fff; box-shadow: none;
}
.switch input:checked + .switch-track { border-color: transparent; background: var(--brand);
}
.switch input:checked + .switch-track::after {
        transform: translateX(18px);
}
.supplier-model-list {
        display: grid;
        gap: 8px;
}
.front-model-candidate-list {
        display: grid;
        gap: 8px;
}
.front-model-candidate {
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 12px;
        background: rgba(255, 255, 255, 0.028);
}
.front-model-candidate strong {
        display: block;
        margin-bottom: 4px;
}
.front-model-candidate-meta {
        display: grid;
        gap: 8px;
}
.supplier-connection-list {
        display: grid;
        gap: 12px;
}
.supplier-test-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 12px 12px;
        border: 1px solid var(--line);
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.025);
}
.supplier-test-dot {
        width: 10px;
        height: 10px;
        border-radius: 6px; background: var(--surface-soft);
}
.supplier-test-dot.green {
        background: var(--success);
        box-shadow: none;
}
.supplier-test-dot.yellow {
        background: var(--warning);
        box-shadow: none;
}
.supplier-test-dot.red {
        background: var(--danger);
        box-shadow: none;
}
.supplier-bundle-rows {
        display: grid;
        gap: 8px;
}
.supplier-model-row {
        display: grid;
        gap: 8px;
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 12px;
        background: var(--surface-soft);
}
.supplier-model-row-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
}
.supplier-model-row-title {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
}
.supplier-model-row-title strong {
        font-size: var(--font-body);
}
.supplier-model-row-title .muted {
        white-space: nowrap;
}
.supplier-model-row-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
}
.supplier-model-row-grid {
        display: grid;
        grid-template-columns:
          repeat(3, minmax(0, 1fr));
        gap: 8px;
        align-items: end;
}
.supplier-model-row-grid > label.is-wide {
        grid-column: 1 / -1;
}
.supplier-model-row-grid > label {
        min-width: 0;
        gap: 8px;
        font-size: var(--font-small);
}
.supplier-model-row-grid > label input, .supplier-model-row-grid > label select {
        padding: 9px 10px;
}
.supplier-model-row-grid > label.is-compact input, .supplier-model-row-grid > label.is-compact select {
        max-width: 96px;
}
.supplier-model-row-note {
        color: var(--muted);
        font-size: var(--font-small);
        line-height: 1.45;
}
.pricing-rule-editor {
        display: grid;
        gap: 8px;
}
.pricing-rule-list {
        display: grid;
        gap: 8px;
}
.pricing-rule-row {
        display: grid;
        gap: 8px;
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 12px;
        background: var(--surface-soft);
}
.pricing-rule-row-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
}
.pricing-rule-row-title {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
}
.pricing-rule-row-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        align-items: end;
}
.pricing-rule-row-grid > label {
        min-width: 0;
        gap: 8px;
        font-size: var(--font-small);
}
.pricing-rule-row-grid > label input, .pricing-rule-row-grid > label select {
        padding: 9px 10px;
}
.pricing-rule-row-note {
        color: var(--muted);
        font-size: var(--font-small);
        line-height: 1.45;
}
.front-model-parameter-editor {
        display: grid;
        gap: 12px;
}
.front-model-parameter-group {
        display: grid;
        gap: 8px;
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 12px;
        background: var(--surface-soft);
}
.front-model-parameter-head {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 12px;
}
.front-model-parameter-head strong {
        font-size: var(--font-body);
}
.front-model-parameter-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
}
.front-model-parameter-chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        padding: 0 12px;
        border-radius: 6px;
        border: 1px solid var(--line);
        background: var(--surface-soft);
        color: var(--muted);
        cursor: pointer;
        transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.front-model-parameter-chip.active { border-color: rgba(110, 91, 255, 0.40); background: rgba(110, 91, 255, 0.12); color: var(--brand);
}
.front-model-parameter-chip input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
}
.front-model-parameter-note {
        color: var(--muted);
        font-size: var(--font-small);
        line-height: 1.45;
}
.front-model-ratio-res-list {
        display: grid;
        gap: 8px;
}
.front-model-ratio-res-row {
        display: grid;
        grid-template-columns: 64px minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        padding: 8px 10px;
        border: 1px solid var(--line);
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.015);
}
.front-model-ratio-res-key {
        font-weight: 600;
        font-size: var(--font-body);
        color: var(--text);
}
.front-model-ratio-res-row .front-model-parameter-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
}
.front-model-ratio-res-row .front-model-parameter-chip {
        min-height: 28px;
        padding: 0 10px;
        font-size: var(--font-small);
}
.guide-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
}
.guide-card {
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 16px;
        background: var(--surface-soft);
}
.guide-card strong {
        display: block;
        margin-bottom: 8px;
}
.guide-card p {
        margin: 0;
        color: var(--muted);
        font-size: var(--font-small);
        line-height: 1.7;
}
.model-routing-list {
        display: grid;
        gap: 8px;
}
.model-routing-item {
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 16px;
        background: var(--surface-soft);
}
.model-routing-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
}
.model-routing-title {
        display: grid;
        gap: 8px;
}
.model-routing-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        margin-top: 12px;
}
.model-routing-cell {
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 12px 12px;
        background: var(--surface-soft);
}
.model-routing-cell span {
        display: block;
        margin-bottom: 4px;
        color: var(--muted-2);
        font-size: var(--font-small);
}
.model-routing-cell strong {
        display: block;
        font-size: var(--font-body);
        line-height: 1.5;
}
.model-routing-cell .muted.small {
        margin-top: 4px;
}
.section-label {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: var(--muted-2);
        font-size: var(--font-small);
        letter-spacing: 0.08em;
        text-transform: uppercase;
}
.mapping-note {
        margin-top: 12px;
}
.model-kind-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
}
.model-kind-button {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 40px;
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 0 14px;
        background: var(--surface-soft);
        color: var(--muted);
        cursor: pointer;
}
.model-kind-button.active { border-color: rgba(110, 91, 255, 0.40); background: rgba(110, 91, 255, 0.10); color: var(--brand);
}
.model-stage-grid {
        display: grid;
        gap: 16px;
}
.model-stage-card {
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 16px;
        background: var(--surface-soft);
}
.model-stage-card h3 {
        margin: 0;
        font-size: var(--font-section);
}
.model-stage-card p {
        margin: 6px 0 0;
        color: var(--muted);
        font-size: var(--font-small);
        line-height: 1.7;
}
.model-stage-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 16px;
}
.model-policy-sections {
        display: grid;
        gap: 16px;
}
.model-policy-section {
        display: grid; gap: 16px;
}
.model-policy-section-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 16px;
}
.model-policy-section-head p {
        display: none;
}
.model-policy-list {
        display: grid;
        gap: 8px;
}
.model-policy-list-row {
        display: grid;
        grid-template-columns: minmax(180px, 220px) minmax(180px, 1fr) 140px auto;
        align-items: center;
        gap: 12px;
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 12px 14px;
        background: var(--surface-soft);
}
.model-policy-list-row strong {
        display: block;
}
.model-policy-col {
        display: grid;
        gap: 4px;
        min-width: 0;
}
.model-policy-col-label {
        color: var(--muted-2);
        font-size: var(--font-small);
        letter-spacing: 0.04em;
        text-transform: uppercase;
}
.model-policy-col-value {
        color: #2b313d;
        font-size: var(--font-body);
        line-height: 1.5;
        min-width: 0;
}
.candidate-chip-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
}
.candidate-chip {
        display: inline-flex;
        align-items: center;
        min-height: 28px;
        border-radius: 6px;
        padding: 0 10px;
        font-size: var(--font-small); background: var(--hover); border: 1px solid var(--line); color: var(--muted);
}
.candidate-chip.disabled {
        opacity: 0.55;
}
.model-policy-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
}
.model-tree-list {
        display: grid;
        gap: 12px;
}
.model-tree-item {
        border: 1px solid var(--line);
        border-radius: 6px;
        background: var(--surface-soft);
        overflow: hidden;
}
.model-tree-item[open] {
        background: var(--surface-soft);
}
.model-tree-item > summary {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 16px 16px;
        cursor: pointer;
        list-style: none;
}
.model-tree-item > summary::-webkit-details-marker {
        display: none;
}
.model-tree-meta {
        display: grid;
        gap: 8px;
}
.model-tree-body {
        display: grid;
        gap: 12px;
        padding: 0 16px 16px;
}
.hint-box {
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 12px 14px;
        background: var(--surface-soft);
        color: var(--muted);
        font-size: var(--font-small);
        line-height: 1.7;
}
.field-note {
        display: block;
        color: var(--muted-2);
        font-size: var(--font-small);
        line-height: 1.6;
}
.select-readonly {
        opacity: 0.62;
}
.cell-strong { font-weight: 600; color: var(--text);
}
.cell-sub { margin-top: 3px; color: var(--muted-2); font-size: var(--font-small); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gen-content { display: grid; gap: 8px; max-width: 300px; min-width: 200px;
}
.gen-prompt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#generationRecordsPanel .generation-stack span:first-child, #generationRecordsPanel td { white-space: nowrap;
}
#generationRecordsPanel .gen-content, #generationRecordsPanel .gen-content * { white-space: normal;
}
#generationRecordsPanel .gen-prompt { white-space: nowrap;
}
.gen-thumb { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-soft); cursor: pointer; text-decoration: none; transition: border-color 160ms ease, box-shadow 160ms ease;
}
.gen-thumb:hover { border-color: var(--brand); box-shadow: none;
}
.gen-thumb img, .gen-thumb video { width: 100%; height: 100%; object-fit: cover; display: block;
}
.gen-thumb-audio { font-size: var(--font-section); color: var(--brand);
}
.gen-thumb-more { position: absolute; right: 3px; bottom: 3px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: var(--font-small); line-height: 16px;
}
.gen-thumb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: var(--font-section); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); pointer-events: none;
}
/* Shared controls stay aligned in dense editors. */
.supplier-model-row-grid > label input, .supplier-model-row-grid > label select,
.pricing-rule-row-grid > label input, .pricing-rule-row-grid > label select { min-height: var(--control-height); padding: 7px 10px; font-size: var(--font-body); }
.form-grid { gap: 16px; }
.supplier-group-head { align-items: center; }
.supplier-group-head > div:first-child, .supplier-summary-meta { min-width: 0; }
.supplier-title-row { flex-wrap: wrap; align-items: center; }
.supplier-inline-url { overflow-wrap: anywhere; }
.supplier-group { padding: 16px; background: var(--surface); }
.supplier-model-row-actions { flex-wrap: wrap; }
.model-policy-section { gap: 16px; }
.model-policy-section-head { margin-bottom: 0; align-items: center; }
.model-policy-sections { gap: 24px; }
.model-policy-section-head h3 { font-size: var(--font-section); }
.model-policy-section-head .section-label { display: none; }
.model-policy-section-head .button { white-space: nowrap; }
.model-policy-actions { align-items: center; }
.model-kind-button { border-radius: 6px; min-height: var(--control-height); font-size: var(--font-body); }
.front-model-parameter-chip { min-height: var(--control-height); font-size: var(--font-body); }
.front-model-ratio-res-row .front-model-parameter-chip { min-height: 32px; }
.front-model-parameter-chip:has(input:focus-visible), .switch:has(input:focus-visible) { outline: 3px solid #6e5bff45; outline-offset: 2px; }
.switch { min-height: var(--control-height); }
.switch-track { background: #c9cdd5; border-color: #c9cdd5; border-radius: 20px; }
.switch-track::after { border-radius: 50%; }
.cell-sub { max-width: 260px; }
.gen-content { max-width: 280px; }
.detail-grid { gap: 16px; }
@media (max-width: 1200px) { .two-col, .detail-layout { grid-template-columns: 1fr; } .supplier-group-head { align-items: flex-start; flex-wrap: wrap; } .pricing-rule-row-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 900px) {
 .app-shell { grid-template-columns: 1fr; }
 .sidebar { position: fixed; left: 0; z-index: 35; width: 224px; transform: translateX(-100%); transition: transform 180ms ease; }
 .nav-open .sidebar { transform: translateX(0); }
 .mobile-nav-toggle { display: inline-flex; }
 .mobile-nav-backdrop:not(.hidden) { display: block; position: fixed; inset: 0; background: #17203255; z-index: 34; }
 .workspace { padding: 0 16px 24px; }
 .topbar { min-height: 84px; gap: 12px; }
 .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
 .form-grid, .supplier-model-row-grid, .model-routing-grid, .guide-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
 .supplier-model-row-grid > label.is-wide { grid-column: 1 / -1; }
 .model-policy-list-row { grid-template-columns: 1fr; }
 .supplier-model-row-head { flex-wrap: wrap; }
 #refreshStatus { display: none; }
}
@media (max-width: 560px) {
 :root { --control-height: 40px; }
 input, select, textarea { font-size: 16px; }
 .button, .btn-sm { min-height: 40px; }
 .nav-button { min-height: 44px; }
 .topbar { flex-wrap: wrap; padding: 16px 0; }
 .topbar-tools { width: 100%; justify-content: flex-end; }
 .card, .metric-card { padding: 16px; }
 .card-head { flex-wrap: wrap; gap: 12px; }
 .toolbar > *, .toolbar input, .toolbar select { max-width: none; flex: 1 1 140px; }
 .collection-toolbar input { min-width: 0; width: 100%; flex-basis: 100%; }
 .collection-toolbar select { flex: 1; min-width: 0; }
 .collection-pagination { flex-wrap: wrap; }
 .form-grid, .pricing-rule-row-grid, .supplier-model-row-grid, .model-routing-grid, .guide-grid, .detail-grid { grid-template-columns: 1fr; }
 .drawer { padding: 16px; }
 .drawer-head { top: -16px; }
 .drawer .split-actions { bottom: -16px; padding-bottom: 16px; }
 .supplier-model-row-title { flex-wrap: wrap; }
 .list-item { flex-wrap: wrap; }
 .load-notice { align-items: flex-start; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.settings-disclosure { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.settings-disclosure > summary { cursor: pointer; font-size: var(--font-section); font-weight: 600; padding: 8px 0; }
.settings-disclosure > summary span { font-size: var(--font-small); color: var(--muted); font-weight: 400; margin-left: 12px; }
.settings-disclosure[open] > summary { margin-bottom: 16px; }
.settings-disclosure .model-policy-section-head { display: none; }
.model-policy-section + .model-policy-section { border-top: 1px solid var(--line); padding-top: 24px; }
.panel.active > .collection-toolbar { margin-bottom: -8px; }
.panel.active > .collection-footer { margin-top: -8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
