:root {
    --workspace-ivory: #f7f6f1;
    --workspace-paper: #fdfdf9;
    --workspace-sage: #e8ede7;
    --workspace-sage-deep: #d9e2dc;
    --workspace-navy: #17384c;
    --workspace-navy-deep: #102b3c;
    --workspace-teal: #28716e;
    --workspace-teal-dark: #1d5f5d;
    --workspace-ink: #14212e;
    --workspace-muted: #5e6d73;
    --workspace-border: #c4cec7;
    --workspace-border-strong: #9fb1a8;
    --workspace-danger: #a13a3a;
    --workspace-code: #112d3d;
    --workspace-shadow: 0 12px 30px rgba(23, 56, 76, 0.07);
    --workspace-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

body[data-api-view="console"],
body[data-api-view="playground"],
body[data-api-view="models"][data-api-model-mode="private"] {
    background: var(--workspace-ivory);
    color: var(--workspace-ink);
    overflow-x: clip;
}

body[data-api-view="console"] > .container,
body[data-api-view="playground"] > .container,
body[data-api-view="models"][data-api-model-mode="private"] > .container {
    width: 100%;
    max-width: none;
    padding-inline: clamp(18px, 4vw, 64px);
    background: var(--workspace-ivory);
}

body[data-api-view="console"] .top-bar,
body[data-api-view="playground"] .top-bar,
body[data-api-view="models"][data-api-model-mode="private"] .top-bar {
    width: min(100%, 1500px);
    margin-inline: auto;
    padding-block: 18px;
    border-bottom: 1px solid var(--workspace-border);
}

body[data-api-view="console"] .top-bar > div,
body[data-api-view="playground"] .top-bar > div,
body[data-api-view="models"][data-api-model-mode="private"] .top-bar > div {
    gap: 6px !important;
}

body[data-api-view="console"] .top-bar .logo img,
body[data-api-view="playground"] .top-bar .logo img,
body[data-api-view="models"][data-api-model-mode="private"] .top-bar .logo img {
    width: auto;
    height: 32px !important;
    filter: none !important;
}

body[data-api-view="console"] .top-bar .btn-ghost,
body[data-api-view="playground"] .top-bar .btn-ghost,
body[data-api-view="models"][data-api-model-mode="private"] .top-bar .btn-ghost,
body[data-api-view="console"] #consoleNavBtn,
body[data-api-view="playground"] #consoleNavBtn,
body[data-api-view="models"][data-api-model-mode="private"] #consoleNavBtn {
    min-height: 44px;
    padding: 10px 13px !important;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #526168;
    font-size: 0.82rem !important;
    font-weight: 650 !important;
    box-shadow: none;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, transform 120ms var(--workspace-ease-out);
}

body[data-api-view="console"] .top-bar [aria-current="page"],
body[data-api-view="playground"] .top-bar [aria-current="page"],
body[data-api-view="models"][data-api-model-mode="private"] .top-bar [aria-current="page"] {
    color: var(--workspace-navy);
    background: var(--workspace-sage);
    border-color: var(--workspace-border);
}

body[data-api-view="models"][data-api-model-mode="public"] .top-bar [aria-current="page"] {
    border-color: #bdc8c1;
    background: #e5ebe5;
    color: #14212e;
}

body[data-api-view="console"] #logoutBtn,
body[data-api-view="playground"] #logoutBtn,
body[data-api-view="models"][data-api-model-mode="private"] #logoutBtn {
    color: var(--workspace-navy);
    border-color: var(--workspace-border);
}

.api-primary-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.api-mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--workspace-border);
    border-radius: 9px;
    background: var(--workspace-paper);
    color: var(--workspace-navy);
    cursor: pointer;
}

.api-mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: center;
    transition: transform 170ms var(--workspace-ease-out), opacity 140ms ease;
}

.api-mobile-menu-btn:focus-visible {
    outline: 3px solid rgba(40, 113, 110, 0.32);
    outline-offset: 3px;
}

body[data-api-view] .top-bar #consoleNavBtn.dashboard-nav-btn {
    position: relative;
    border-color: var(--workspace-navy) !important;
    background: var(--workspace-navy) !important;
    color: #f8f7f2 !important;
    box-shadow: 0 7px 18px rgba(23, 56, 76, 0.18);
}

body[data-api-view] .top-bar #consoleNavBtn.dashboard-nav-btn::after {
    content: "";
    width: 5px;
    height: 5px;
    margin-left: 2px;
    border-radius: 50%;
    background: #8ec8bc;
    box-shadow: 0 0 0 3px rgba(142, 200, 188, 0.16);
}

body[data-api-view="console"] .top-bar #consoleNavBtn.dashboard-nav-btn[aria-current="page"] {
    border-color: var(--workspace-teal) !important;
    background: var(--workspace-navy-deep) !important;
    box-shadow: 0 0 0 3px rgba(40, 113, 110, 0.18), 0 9px 22px rgba(23, 56, 76, 0.22);
}

.developer-workspace,
.playground-workspace {
    width: min(100%, 1500px) !important;
    margin: 0 auto;
    padding: clamp(34px, 5vw, 72px) 0 64px;
    color: var(--workspace-ink);
}

.workspace-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 30px;
}

.workspace-eyebrow {
    margin: 0 0 9px;
    color: var(--workspace-teal);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.workspace-page-header h1 {
    margin: 0;
    color: var(--workspace-navy);
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(2.25rem, 4.3vw, 4.5rem);
    font-weight: 650;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

.workspace-page-header p:not(.workspace-eyebrow) {
    max-width: 670px;
    margin: 15px 0 0;
    color: var(--workspace-muted);
    font-size: clamp(0.95rem, 1.4vw, 1.08rem);
    line-height: 1.65;
}

.workspace-summary {
    display: flex;
    flex: 0 0 auto;
    gap: 28px;
    padding-bottom: 4px;
}

.workspace-summary-item {
    min-width: 90px;
}

.workspace-summary-item + .workspace-summary-item {
    padding-left: 28px;
    border-left: 1px solid var(--workspace-border);
}

.workspace-summary-label,
.workspace-metric-label,
.execution-label {
    display: block;
    color: #6d7c80;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-summary-value {
    display: block;
    margin-top: 5px;
    color: var(--workspace-navy);
    font-family: "Fira Code", monospace;
    font-size: 1.05rem;
}

.workspace-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.workspace-panel {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--workspace-border);
    border-radius: 16px;
    background: rgba(253, 253, 249, 0.92);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), var(--workspace-shadow);
}

.workspace-panel-usage { grid-column: span 8; }
.workspace-panel-balance { grid-column: span 4; }
.workspace-panel-credentials { grid-column: span 8; }
.workspace-panel-quickstart { grid-column: span 4; }

.workspace-panel-inner {
    padding: clamp(20px, 2.5vw, 30px);
}

.workspace-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.workspace-panel-heading {
    min-width: 0;
}

.workspace-panel-heading h2,
.workspace-panel-heading h3 {
    margin: 0;
    color: var(--workspace-navy);
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.35rem, 2vw, 1.78rem);
    font-weight: 650;
    letter-spacing: -0.025em;
}

.workspace-panel-heading p {
    max-width: 630px;
    margin: 7px 0 0;
    color: var(--workspace-muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.workspace-panel-actions,
.workspace-filter-group,
.workspace-row-actions,
.playground-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.workspace-button,
.developer-workspace .btn-primary,
.developer-workspace .btn-secondary,
.developer-workspace .btn-danger,
.playground-workspace .btn-ghost,
.playground-workspace .btn-danger,
.playground-workspace .btn-run-playground,
.workspace-modal .btn-primary,
.workspace-modal .copy-btn,
.workspace-modal-close,
.terminal-action-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 9px;
    border: 1px solid var(--workspace-border-strong);
    background: var(--workspace-paper);
    color: var(--workspace-navy);
    font: 700 0.8rem "IBM Plex Sans", sans-serif;
    cursor: pointer;
    box-shadow: none;
    transition: transform 120ms var(--workspace-ease-out), color 150ms ease, background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.workspace-button-primary,
.developer-workspace .btn-primary,
.playground-workspace .btn-run-playground,
.workspace-modal .btn-primary {
    border-color: var(--workspace-navy);
    background: var(--workspace-navy);
    color: #fff;
}

.developer-workspace .btn-danger,
.playground-workspace .btn-danger {
    border-color: #d8b2ad;
    background: #fff9f7;
    color: var(--workspace-danger);
}

.workspace-button:active,
.developer-workspace button:active,
.playground-workspace button:active,
.workspace-modal button:active {
    transform: scale(0.97);
}

.workspace-button:disabled,
.developer-workspace button:disabled,
.playground-workspace button:disabled,
.workspace-modal button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    transform: none;
}

.workspace-select,
.workspace-input,
.playground-workspace .form-input,
.playground-textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--workspace-border-strong);
    border-radius: 9px;
    background: var(--workspace-paper);
    color: var(--workspace-ink);
    font: 500 0.86rem "IBM Plex Sans", sans-serif;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.workspace-select,
.playground-workspace .form-input {
    padding: 10px 36px 10px 12px;
}

.workspace-button:focus-visible,
.developer-workspace button:focus-visible,
.developer-workspace select:focus-visible,
.playground-workspace button:focus-visible,
.playground-workspace select:focus-visible,
.playground-workspace textarea:focus-visible,
.playground-workspace input:focus-visible,
.workspace-modal input:focus-visible,
.workspace-modal button:focus-visible {
    outline: 3px solid rgba(40, 113, 110, 0.32);
    outline-offset: 3px;
}

.workspace-select:focus,
.workspace-input:focus,
.playground-workspace .form-input:focus,
.playground-textarea:focus {
    border-color: var(--workspace-teal);
    box-shadow: 0 0 0 3px rgba(40, 113, 110, 0.12);
}

.usage-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 22px;
    border-block: 1px solid var(--workspace-border);
}

.workspace-metric {
    min-width: 0;
    padding: 17px 14px 17px 0;
}

.workspace-metric + .workspace-metric {
    padding-left: 18px;
    border-left: 1px solid var(--workspace-border);
}

.workspace-metric-value {
    display: block;
    margin-top: 7px;
    overflow: hidden;
    color: var(--workspace-navy);
    font-family: "Fira Code", monospace;
    font-size: clamp(1.08rem, 2vw, 1.35rem);
    font-weight: 650;
    text-overflow: ellipsis;
}

.workspace-metric-value.is-cost { color: var(--workspace-teal-dark); }

.usage-chart-frame {
    position: relative;
    height: 290px;
    padding: 15px;
    border: 1px solid #d1d9d3;
    border-radius: 12px;
    background: #fbfcf8;
}

.usage-chart-empty {
    position: absolute;
    inset: 15px;
    display: none;
    place-content: center;
    justify-items: center;
    gap: 12px;
    padding: 20px;
    border-radius: 9px;
    background: rgba(251, 252, 248, 0.94);
    color: var(--workspace-muted);
    font-size: 0.84rem;
    text-align: center;
}

.usage-chart-empty.is-visible { display: grid; }

.workspace-section-divider {
    margin: 24px 0;
    border: 0;
    border-top: 1px solid var(--workspace-border);
}

.workspace-subsection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.workspace-subsection-header h3 {
    margin: 0;
    color: var(--workspace-navy);
    font-size: 0.94rem;
}

.workspace-notice {
    display: none;
    margin-bottom: 18px;
    padding: 13px 14px;
    border: 1px solid #b9cbc2;
    border-radius: 10px;
    background: #edf3ed;
    color: #40585b;
    font-size: 0.8rem;
    line-height: 1.55;
}

.workspace-notice code { color: var(--workspace-navy); }

.surface-key-list {
    display: grid;
    gap: 10px;
}

.surface-key-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid #d2dad4;
    border-radius: 11px;
    background: #fafbf7;
}

.surface-key-name {
    color: var(--workspace-navy);
    font-size: 0.91rem;
    font-weight: 750;
}

.surface-key-meta {
    margin-top: 3px;
    color: #68767a;
    font-family: "Fira Code", monospace;
    font-size: 0.72rem;
    overflow-wrap: anywhere;
}

.surface-key-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 9px;
    color: #58696d;
    font-size: 0.76rem;
    line-height: 1.45;
}

.surface-key-detail.is-linked { color: var(--workspace-teal-dark); font-weight: 650; }

.empty-keys-state {
    min-height: 112px;
    display: grid;
    place-items: center;
    padding: 22px;
    border: 1px dashed var(--workspace-border-strong);
    border-radius: 11px;
    background: #fafbf7;
    color: var(--workspace-muted);
    font-size: 0.84rem;
    line-height: 1.5;
    text-align: center;
}

.empty-keys-state.is-error {
    border-color: #d8b2ad;
    background: #fff8f6;
    color: var(--workspace-danger);
}

.empty-keys-state p {
    max-width: 520px;
    margin: 0 auto 13px;
}

.balance-amount {
    margin: 16px 0 8px;
    color: var(--workspace-teal-dark);
    font-family: "Fira Code", monospace;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 650;
    letter-spacing: -0.05em;
}

.balance-caption {
    color: var(--workspace-muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.wallet-reveal {
    display: none;
    gap: 13px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--workspace-border);
}

.wallet-reveal.is-open { display: grid; }

#walletToggleChevron {
    transition: transform 180ms var(--workspace-ease-out);
}

#walletToggleChevron.is-open { transform: rotate(180deg); }

.amount-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.developer-workspace .preset-amount-btn,
.workspace-modal .preset-amount-btn {
    min-height: 50px;
    border: 1px solid var(--workspace-border);
    border-radius: 9px;
    background: #f7f8f4;
    color: var(--workspace-navy);
    font: 700 0.96rem "Fira Code", monospace;
    cursor: pointer;
    transition: transform 120ms var(--workspace-ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.developer-workspace .preset-amount-btn.active,
.workspace-modal .preset-amount-btn.active {
    border-color: var(--workspace-teal);
    background: var(--workspace-sage);
    color: var(--workspace-teal-dark);
}

.allowance-list {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.allowance-item {
    padding: 14px;
    border: 1px solid var(--workspace-border);
    border-radius: 12px;
    background: #f8f9f5;
}

.allowance-item.is-primary {
    border-color: #7fa9a5;
    background: #edf2ec;
    box-shadow: inset 3px 0 0 var(--workspace-teal);
}

.allowance-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--workspace-navy);
    font-size: 0.82rem;
}

.allowance-heading span {
    color: var(--workspace-teal-dark);
    font-family: "Fira Code", monospace;
    font-size: 0.72rem;
    font-weight: 700;
}

.allowance-track {
    height: 6px;
    margin: 10px 0;
    overflow: hidden;
    border-radius: 999px;
    background: #dce4df;
}

.allowance-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--workspace-teal);
    transition: width 180ms var(--workspace-ease);
}

.allowance-item p {
    margin: 0;
    color: #526469;
    font-size: 0.76rem;
    line-height: 1.5;
}

.workspace-billing-note {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    padding: 15px 16px;
    border: 1px solid #c4d1c8;
    border-left: 3px solid var(--workspace-teal);
    border-radius: 10px;
    background: #f3f6f1;
}

.workspace-billing-note-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.workspace-billing-note-heading a {
    color: var(--workspace-teal-dark);
    font-size: 0.75rem;
    font-weight: 750;
}

.workspace-billing-note h3 {
    margin: 0;
    color: var(--workspace-navy);
    font-size: 0.92rem;
    letter-spacing: -0.015em;
}

.workspace-billing-note p {
    margin: 0;
    color: var(--workspace-muted);
    font-size: 0.78rem;
    line-height: 1.55;
}

.api-billing-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
}

.api-billing-summary h2 {
    margin: 8px 0 10px;
    color: var(--workspace-navy);
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.api-billing-summary p {
    max-width: 760px;
    margin: 0;
    color: var(--workspace-muted);
    line-height: 1.65;
}

.api-billing-summary-actions {
    display: grid;
    gap: 8px;
    min-width: 180px;
}

@media (max-width: 720px) {
    .api-billing-summary { grid-template-columns: 1fr; }
    .api-billing-summary-actions { min-width: 0; }
}

.quickstart-copy {
    margin: 0 0 16px;
    color: var(--workspace-muted);
    font-size: 0.84rem;
    line-height: 1.6;
}

.quickstart-copy a { color: var(--workspace-teal-dark); font-weight: 700; }

.quickstart-code {
    margin: 0;
    overflow: auto;
    padding: 17px;
    border: 1px solid #315064;
    border-radius: 11px;
    background: var(--workspace-code);
    color: #dbe8ea;
    font: 0.73rem/1.65 "Fira Code", monospace;
    tab-size: 2;
}

.playground-layout {
    display: grid;
    grid-template-columns: minmax(270px, 350px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

#playgroundScreenNew .playground-layout {
    display: grid !important;
    grid-template-columns: minmax(270px, 350px) minmax(0, 1fr) !important;
    gap: 22px !important;
    align-items: start !important;
    margin-bottom: 0 !important;
}

#playgroundScreenNew .playground-settings,
#playgroundScreenNew .playground-main {
    width: 100% !important;
    padding: clamp(20px, 2.5vw, 28px) !important;
    border: 1px solid var(--workspace-border) !important;
    border-radius: 16px !important;
    background: rgba(253, 253, 249, 0.94) !important;
    color: var(--workspace-ink) !important;
    box-shadow: var(--workspace-shadow) !important;
}

#playgroundScreenNew .playground-settings .card-title {
    margin: 0;
    color: var(--workspace-navy);
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.45rem !important;
    font-weight: 650;
}

#playgroundScreenNew .playground-settings .card-title svg { display: none; }

#playgroundScreenNew .form-group { margin-bottom: 0 !important; }

#playgroundScreenNew .form-label {
    display: block;
    margin-bottom: 7px !important;
    color: #52656a !important;
    font-size: 0.72rem !important;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#playgroundScreenNew .form-input {
    min-height: 44px;
    padding: 10px 36px 10px 12px !important;
    border-color: var(--workspace-border-strong) !important;
    background: var(--workspace-paper) !important;
    color: var(--workspace-ink) !important;
}

#playgroundScreenNew #groundingGroup,
#playgroundScreenNew #groundingGroup + div {
    border-color: #e1e6e1 !important;
}

#playgroundScreenNew #groundingGroup > div > span:first-child,
#playgroundScreenNew #groundingGroup + div > div > span:first-child {
    color: var(--workspace-navy);
}

#playgroundScreenNew #groundingGroup > div > span:last-child,
#playgroundScreenNew #groundingGroup + div > div > span:last-child {
    color: var(--workspace-muted) !important;
    line-height: 1.4;
}

.playground-settings,
.playground-main {
    min-width: 0;
}

.playground-settings {
    position: static;
    display: grid;
    gap: 18px;
}

/* Full-width playground: settings are anchored in a deliberate control rail. */
#playgroundScreenNew.playground-workspace {
    width: 100% !important;
    max-width: none;
    flex-direction: column;
}

#playgroundScreenNew .playground-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
}

#playgroundScreenNew .playground-settings {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: stretch;
    gap: 14px 16px;
}

#playgroundScreenNew .playground-settings .card-title {
    grid-column: 1 / -1;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--workspace-border);
}

#playgroundScreenNew .setting-slot {
    min-width: 0;
    margin: 0 !important;
}

#playgroundScreenNew .setting-slot-key,
#playgroundScreenNew .setting-slot-model,
#playgroundScreenNew .setting-slot-temperature {
    grid-column: span 4;
}

#playgroundScreenNew .setting-slot-grounding,
#playgroundScreenNew .setting-slot-streaming {
    grid-column: span 6;
    min-height: 76px;
    padding: 12px 14px;
    border: 1px solid #d8dfda !important;
    border-radius: 10px;
    background: #f7f9f5;
}

#playgroundScreenNew .temperature-control {
    align-content: start;
    padding: 0;
}

#playgroundScreenNew .playground-main {
    width: 100% !important;
    min-height: 0;
}

@media (max-width: 900px) {
    #playgroundScreenNew .setting-slot-key,
    #playgroundScreenNew .setting-slot-model { grid-column: span 6; }
    #playgroundScreenNew .setting-slot-temperature { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
    #playgroundScreenNew .setting-slot-key,
    #playgroundScreenNew .setting-slot-model,
    #playgroundScreenNew .setting-slot-temperature,
    #playgroundScreenNew .setting-slot-grounding,
    #playgroundScreenNew .setting-slot-streaming { grid-column: 1 / -1; }
}

.settings-group {
    display: grid;
    gap: 17px;
}

.settings-label,
.playground-field-label {
    display: block;
    margin-bottom: 7px;
    color: #52656a;
    font-size: 0.73rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.settings-secondary {
    display: grid;
    gap: 2px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--workspace-border);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 62px;
    padding: 9px 0;
    border-bottom: 1px solid #e1e6e1;
}

.setting-row-copy strong {
    display: block;
    color: var(--workspace-navy);
    font-size: 0.83rem;
}

.setting-row-copy span {
    display: block;
    margin-top: 3px;
    color: var(--workspace-muted);
    font-size: 0.7rem;
    line-height: 1.4;
}

.temperature-control {
    display: grid;
    gap: 8px;
    padding: 12px 0 16px;
}

.temperature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#tempValueDisplay {
    color: var(--workspace-teal-dark);
    font: 700 0.8rem "Fira Code", monospace;
}

#playgroundTemp { width: 100%; accent-color: var(--workspace-teal); cursor: pointer; }

.playground-main.workspace-panel { overflow: visible; }

#playgroundScreenNew .playground-main > div:first-child {
    display: flex !important;
    flex-direction: column;
    gap: 21px !important;
}

#playgroundScreenNew .prompt-section { order: 1; }
#playgroundScreenNew .system-section { order: 2; }
#playgroundScreenNew .playground-actions { order: 3; }

#playgroundScreenNew .section-title {
    color: var(--workspace-navy);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#playgroundScreenNew .section-title svg { display: none; }

.playground-editor {
    display: grid;
    gap: 21px;
}

.playground-section {
    display: grid;
    gap: 10px;
}

.playground-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.playground-field-label { margin: 0; }

.playground-helper {
    margin: 4px 0 0;
    color: var(--workspace-muted);
    font-size: 0.75rem;
}

.preset-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.preset-pill,
.prompt-pill {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--workspace-border);
    border-radius: 999px;
    background: #f7f8f4;
    color: #536569;
    font: 650 0.7rem "IBM Plex Sans", sans-serif;
    cursor: pointer;
    transition: transform 120ms var(--workspace-ease-out), color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.preset-pill.active,
.prompt-pill.active {
    border-color: var(--workspace-teal);
    background: var(--workspace-sage);
    color: var(--workspace-teal-dark);
}

.playground-textarea {
    min-height: 145px;
    resize: vertical;
    padding: 14px 15px;
    line-height: 1.6;
}

.system-textarea { min-height: 105px; }

.playground-actions {
    justify-content: flex-end;
    padding-top: 2px;
}

.response-section {
    margin-top: 25px;
    padding-top: 24px;
    border-top: 1px solid var(--workspace-border);
}

#playgroundScreenNew .response-section {
    display: flex !important;
    flex-direction: column;
    gap: 12px !important;
    margin-top: 25px;
    padding-top: 24px !important;
    border-top: 1px solid var(--workspace-border) !important;
}

#playgroundScreenNew .terminal-dots { display: none; }

.response-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.response-heading-row h2 {
    margin: 0;
    color: var(--workspace-navy);
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.45rem;
}

.terminal-container {
    overflow: hidden;
    border: 1px solid #284a5d;
    border-radius: 12px;
    background: var(--workspace-code);
    box-shadow: inset 0 1px rgba(255,255,255,0.04);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.terminal-header {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 10px 8px 15px;
    border-bottom: 1px solid rgba(221, 236, 238, 0.13);
    background: #163547;
}

.terminal-title {
    color: #a9c1c7;
    font: 700 0.67rem "Fira Code", monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.terminal-action-btn {
    min-height: 34px;
    padding: 7px 10px;
    border-color: rgba(220, 235, 237, 0.25);
    background: transparent;
    color: #e3eeee;
    font-size: 0.7rem;
}

.terminal-body {
    min-height: 260px;
    max-height: 520px;
    overflow: auto;
    padding: clamp(18px, 3vw, 28px);
    color: #dfeaec;
    font: 0.82rem/1.75 "Fira Code", monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    tab-size: 2;
}

.playground-running-border,
.terminal-container:has(.playground-running-border) {
    border-color: #6eb8ad !important;
    box-shadow: 0 0 0 3px rgba(70, 147, 139, 0.18);
}

.execution-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-top: 12px;
    border: 1px solid var(--workspace-border);
    border-radius: 11px;
    background: #f6f8f4;
    opacity: 0.68;
    transition: opacity 150ms ease;
}

#playgroundScreenNew .playground-stats-grid.execution-summary {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 0 !important;
    margin-top: 0;
}

#playgroundScreenNew .execution-summary .stat-mini-card {
    min-width: 0;
    min-height: 64px;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    padding: 11px 12px;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
}

#playgroundScreenNew .execution-summary .stat-mini-card + .stat-mini-card {
    border-left: 1px solid var(--workspace-border) !important;
}

#playgroundScreenNew .execution-summary .stat-mini-lbl {
    color: #6d7c80;
    font-size: 0.63rem;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

#playgroundScreenNew .execution-summary .stat-mini-val {
    max-width: 100%;
    overflow: hidden;
    color: var(--workspace-navy);
    font-family: "Fira Code", monospace !important;
    font-size: 0.72rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.execution-item {
    min-width: 0;
    padding: 12px 13px;
}

.execution-item + .execution-item { border-left: 1px solid var(--workspace-border); }

.execution-value {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: var(--workspace-navy);
    font: 650 0.75rem "Fira Code", monospace;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#statCost { color: var(--workspace-teal-dark); }
#statSessionFails { color: var(--workspace-danger); }

.switch-container { flex: 0 0 auto; }

.playground-workspace .slider-switch {
    background: #b8c4be;
    border-color: #aab8b1;
}

.playground-workspace .switch-container input:checked + .slider-switch {
    background: var(--workspace-teal);
}

.workspace-modal.modal-overlay {
    padding: 20px;
    background: rgba(16, 43, 60, 0.44);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms var(--workspace-ease-out), visibility 180ms var(--workspace-ease-out);
}

.workspace-modal.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.workspace-modal .modal-box {
    position: relative;
    width: min(100%, 500px);
    max-width: 500px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: clamp(24px, 4vw, 34px);
    border: 1px solid var(--workspace-border);
    border-radius: 16px;
    background: var(--workspace-paper);
    color: var(--workspace-ink);
    box-shadow: 0 24px 80px rgba(14, 40, 56, 0.25);
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: transform 200ms var(--workspace-ease-out), opacity 180ms var(--workspace-ease-out);
}

.workspace-modal.active .modal-box {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.workspace-modal .modal-title,
.workspace-modal h3 {
    margin: 0;
    color: var(--workspace-navy);
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.65rem;
    font-weight: 650;
}

.workspace-modal-copy {
    margin: 9px 0 20px;
    color: var(--workspace-muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

.workspace-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    padding: 0;
    background: transparent;
}

.workspace-modal .new-key-display {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    padding: 11px;
    border: 1px solid var(--workspace-border);
    border-radius: 10px;
    background: #f3f6f1;
}

.workspace-modal #displayedApiKey {
    overflow: auto;
    color: var(--workspace-navy);
    font: 0.76rem/1.5 "Fira Code", monospace;
    white-space: nowrap;
}

.workspace-modal .warning-box {
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid #dec5a7;
    border-left: 3px solid #9b6b35;
    border-radius: 8px;
    background: #fff9ef;
    color: #6d5131;
    font-size: 0.78rem;
    line-height: 1.5;
}

.workspace-modal .modal-primary-action { width: 100%; }

.finnhub-key-modal-box { width: min(100%, 540px) !important; }

.developer-terms-gate {
    z-index: 22000;
    background: rgba(16, 43, 60, 0.58);
}

.developer-terms-gate-box {
    width: min(100%, 620px) !important;
    max-width: 620px !important;
    padding: 30px !important;
    border-color: #91aaa0 !important;
    box-shadow: 0 28px 80px rgba(16, 43, 60, 0.28) !important;
}

.developer-terms-gate-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 14px;
    border: 1px solid #9fbab0;
    border-radius: 13px;
    background: var(--workspace-sage);
    color: var(--workspace-teal-dark);
}

.developer-terms-gate-box h2 {
    margin: 0;
    color: var(--workspace-navy);
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.7rem, 4vw, 2.25rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.developer-terms-gate-copy {
    margin: 12px 0 18px;
    color: var(--workspace-muted);
    font-size: 0.96rem;
    line-height: 1.65;
}

.developer-terms-gate-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.developer-terms-gate-links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--workspace-border);
    border-radius: 999px;
    color: var(--workspace-teal-dark);
    background: #f7f8f4;
    font-size: 0.78rem;
    font-weight: 750;
}

.developer-terms-gate-summary {
    display: grid;
    gap: 9px;
    margin-bottom: 18px;
    padding: 15px 16px;
    border: 1px solid #c9d5cc;
    border-left: 3px solid var(--workspace-teal);
    border-radius: 10px;
    background: #edf2ec;
}

.developer-terms-gate-summary p {
    margin: 0;
    color: var(--workspace-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.developer-terms-gate-summary strong { color: var(--workspace-navy); }

.developer-terms-gate-check {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 0 0 16px;
    color: var(--workspace-navy);
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.5;
    cursor: pointer;
}

.developer-terms-gate-check input {
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--workspace-teal);
}

.developer-terms-gate-error {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid #d8a9a2;
    border-left: 3px solid #a4483c;
    border-radius: 8px;
    background: #fff4f1;
    color: #7b2c24;
    font-size: 0.82rem;
}

.developer-terms-gate-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.developer-terms-gate-actions .workspace-button-primary { flex: 1 1 230px; }
.developer-terms-gate-actions .workspace-button:not(.workspace-button-primary) { flex: 0 1 120px; }

.finnhub-key-form {
    display: grid;
    gap: 17px;
}

.workspace-form-field {
    display: grid;
    gap: 7px;
}

.workspace-form-field label {
    color: var(--workspace-navy);
    font-size: 0.78rem;
    font-weight: 750;
}

.workspace-form-field .workspace-input {
    padding: 11px 12px;
    font-size: 0.9rem;
}

.workspace-form-field p {
    margin: 0;
    color: var(--workspace-muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

.finnhub-reuse-control {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 14px;
    border: 1px solid #d5ddd7;
    border-radius: 10px;
    background: #f6f8f4;
    cursor: pointer;
}

.finnhub-reuse-control strong,
.finnhub-reuse-control small { display: block; }
.finnhub-reuse-control strong { color: var(--workspace-navy); font-size: 0.8rem; }
.finnhub-reuse-control small { margin-top: 3px; color: var(--workspace-muted); font-size: 0.71rem; line-height: 1.4; }
.finnhub-reuse-control input { width: 19px; height: 19px; accent-color: var(--workspace-teal); }

.workspace-form-error {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #dfbbb6;
    border-radius: 8px;
    background: #fff8f6;
    color: var(--workspace-danger);
    font-size: 0.78rem;
    line-height: 1.45;
}

.workspace-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding-top: 2px;
}

.billing-amounts { margin: 22px 0 18px; }

#globalToast.toast {
    min-width: min(360px, calc(100vw - 32px));
    max-width: 440px;
    padding: 13px 16px;
    border: 1px solid var(--workspace-border-strong);
    border-radius: 10px;
    background: var(--workspace-paper);
    color: var(--workspace-navy);
    box-shadow: 0 18px 46px rgba(16, 43, 60, 0.18);
    transform: translate(-50%, 12px);
    opacity: 0;
    transition: transform 180ms var(--workspace-ease-out), opacity 160ms var(--workspace-ease-out);
}

#globalToast.toast.active {
    transform: translate(-50%, 0);
    opacity: 1;
}

#globalToast.toast-success { border-left: 4px solid var(--workspace-teal); }
#globalToast.toast-error { border-left: 4px solid var(--workspace-danger); }

/* Signed-in catalog uses the same editorial card language as the public model page. */
body[data-api-view="models"][data-api-model-mode="private"] #modelsScreenNew {
    width: min(100%, 1500px) !important;
    margin: 0 auto;
    padding: clamp(34px, 5vw, 72px) 0 64px;
    color: var(--workspace-ink);
    flex-direction: column;
}

body[data-api-view="models"][data-api-model-mode="private"] #modelsScreenNew > div:first-child {
    display: flex;
    align-items: flex-end !important;
    justify-content: space-between;
    gap: 28px;
    padding-bottom: 28px !important;
    border-bottom: 1px solid var(--workspace-border) !important;
}

body[data-api-view="models"][data-api-model-mode="private"] #modelsScreenNew > div:first-child h2 {
    margin: 0 !important;
    color: var(--workspace-navy) !important;
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(2.3rem, 4.4vw, 4.5rem) !important;
    font-weight: 650 !important;
    letter-spacing: -0.045em !important;
    line-height: 0.98;
}

body[data-api-view="models"][data-api-model-mode="private"] #modelsScreenNew > div:first-child p {
    max-width: 680px;
    margin: 14px 0 0 !important;
    color: var(--workspace-muted) !important;
    font-size: 1rem !important;
    line-height: 1.62;
}

body[data-api-view="models"][data-api-model-mode="private"] #modelsScreenNew > div:first-child > button {
    min-height: 44px;
    padding: 10px 14px !important;
    border: 1px solid var(--workspace-border-strong) !important;
    border-radius: 9px !important;
    background: var(--workspace-paper);
    color: var(--workspace-navy);
    transition: transform 120ms var(--workspace-ease-out), background-color 150ms ease, border-color 150ms ease;
}

body[data-api-view="models"][data-api-model-mode="private"] #modelsScreenNew > div:nth-child(2) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px !important;
    width: 100%;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip {
    display: flex !important;
    flex-direction: column !important;
    min-height: 460px;
    padding: 29px !important;
    gap: 22px !important;
    border: 1px solid #c4cdc5 !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.42) !important;
    color: var(--workspace-ink);
    cursor: default;
    box-shadow: none !important;
    transform: none !important;
    transition: border-color 180ms ease, background-color 180ms ease !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip.featured {
    border-color: #7c9b91 !important;
    background: #edf2ed !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip.deep {
    border-color: var(--workspace-navy) !important;
    background: var(--workspace-navy) !important;
    color: var(--workspace-ivory);
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip.legacy {
    min-height: 390px;
    background: #f0f1ec !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip-left {
    width: 100%;
    min-width: 0;
    flex: 1;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip-left > div:first-child > div:first-child {
    align-items: flex-start !important;
    justify-content: space-between;
    margin-bottom: 0 !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip img {
    order: 2;
    box-sizing: border-box;
    width: 56px !important;
    height: 56px !important;
    padding: 3px;
    border: 1px solid var(--workspace-navy) !important;
    border-radius: 10px !important;
    background: var(--workspace-navy);
    object-fit: cover;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip h4 {
    margin: 0 !important;
    color: var(--workspace-navy) !important;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.9rem !important;
    font-weight: 650 !important;
    letter-spacing: -0.05em !important;
    line-height: 1;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip.deep h4 {
    color: var(--workspace-ivory) !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip-left > div:first-child span:not([role="img"]) {
    display: block;
    margin-top: 8px;
    color: var(--workspace-teal) !important;
    font: 700 0.69rem "Fira Code", monospace !important;
    letter-spacing: 0.035em;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip.deep .model-strip-left > div:first-child span:not([role="img"]) {
    color: #aed4cb !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip-left p {
    max-width: 560px;
    margin: 25px 0 22px !important;
    color: #53636b !important;
    font-size: 0.89rem !important;
    line-height: 1.62 !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip.deep .model-strip-left p {
    color: rgba(247, 246, 240, 0.78) !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip-left > div:last-child {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px !important;
    margin-top: auto;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip .btn-primary,
body[data-api-view="models"][data-api-model-mode="private"] .model-strip .btn-ghost {
    min-height: 44px;
    padding: 10px 13px !important;
    border: 1px solid var(--workspace-border-strong) !important;
    border-radius: 7px !important;
    background: transparent;
    color: var(--workspace-navy) !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip .btn-primary {
    border-color: var(--workspace-navy) !important;
    background: var(--workspace-navy) !important;
    color: var(--workspace-ivory) !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip.deep .btn-primary {
    border-color: var(--workspace-ivory) !important;
    background: var(--workspace-ivory) !important;
    color: var(--workspace-navy) !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip.deep .btn-ghost {
    border-color: rgba(247, 246, 240, 0.5) !important;
    color: var(--workspace-ivory) !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip-right {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1px !important;
    padding: 1px 0 0 !important;
    border: 0 !important;
    border-top: 1px solid #d2d9d2 !important;
    background: #d2d9d2;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip.deep .model-strip-right {
    border-top-color: rgba(247, 246, 240, 0.22) !important;
    background: rgba(247, 246, 240, 0.2);
}

body[data-api-view="models"][data-api-model-mode="private"] .model-spec-cell {
    min-width: 0;
    min-height: 67px;
    justify-content: flex-start;
    padding: 12px 14px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fffefa !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip.featured .model-spec-cell {
    background: #f5f8f3 !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip.deep .model-spec-cell {
    background: var(--workspace-navy) !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-spec-label {
    margin-bottom: 5px;
    color: #5d706e !important;
    font: 700 0.62rem "Fira Code", monospace;
    letter-spacing: 0.04em;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-spec-value {
    color: var(--workspace-navy) !important;
    font-size: 0.8rem !important;
    line-height: 1.4;
    white-space: normal;
}

body[data-api-view="models"][data-api-model-mode="private"] .model-strip.deep .model-spec-label { color: #9fc7bc !important; }
body[data-api-view="models"][data-api-model-mode="private"] .model-strip.deep .model-spec-value { color: var(--workspace-ivory) !important; }

body[data-api-view="models"][data-api-model-mode="private"] #modelsScreenNew > div:nth-child(2) > div[style*="text-align: center"] {
    grid-column: 1 / -1;
    margin: 4px 0 !important;
}

body[data-api-view="models"][data-api-model-mode="private"] .show-more-expander-btn {
    min-height: 44px;
    margin: 0 auto;
    padding: 10px 16px;
    border: 1px solid var(--workspace-border-strong);
    border-radius: 8px;
    background: var(--workspace-paper);
    color: var(--workspace-navy);
    transition: transform 120ms var(--workspace-ease-out), background-color 150ms ease, border-color 150ms ease;
}

body[data-api-view="models"][data-api-model-mode="private"] #moreModelsContainer {
    grid-column: 1 / -1;
    width: 100%;
}

@media (max-width: 900px) {
    body[data-api-view="models"][data-api-model-mode="private"] #modelsScreenNew > div:nth-child(2) {
        grid-template-columns: minmax(0, 1fr);
    }

    body[data-api-view="models"][data-api-model-mode="private"] .model-strip { min-height: 0; }
}

@media (max-width: 620px) {
    body[data-api-view="models"][data-api-model-mode="private"] #modelsScreenNew > div:first-child {
        align-items: stretch !important;
        flex-direction: column;
    }

    body[data-api-view="models"][data-api-model-mode="private"] #modelsScreenNew > div:first-child > button { width: 100%; }
    body[data-api-view="models"][data-api-model-mode="private"] .model-strip { padding: 22px !important; }
    body[data-api-view="models"][data-api-model-mode="private"] .model-strip-right { grid-template-columns: 1fr !important; }
    body[data-api-view="models"][data-api-model-mode="private"] .model-strip .btn-primary,
    body[data-api-view="models"][data-api-model-mode="private"] .model-strip .btn-ghost { width: 100%; }

    body[data-api-view="models"][data-api-model-mode="private"] .model-strip-left > div:last-child {
        align-items: stretch !important;
        flex-direction: column;
    }

    .workspace-modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-modal-actions .workspace-button { width: 100%; }
}

@media (hover: hover) and (pointer: fine) {
    body[data-api-view="console"] .top-bar .btn-ghost:hover,
    body[data-api-view="playground"] .top-bar .btn-ghost:hover,
    body[data-api-view="models"][data-api-model-mode="private"] .top-bar .btn-ghost:hover,
    .workspace-button:hover,
    .developer-workspace .btn-secondary:hover,
    .playground-workspace .btn-ghost:hover {
        border-color: var(--workspace-border-strong);
        background: var(--workspace-sage);
        color: var(--workspace-navy);
    }

    .workspace-button-primary:hover,
    .developer-workspace .btn-primary:hover,
    .playground-workspace .btn-run-playground:hover,
    .workspace-modal .btn-primary:hover {
        border-color: var(--workspace-navy-deep);
        background: var(--workspace-navy-deep);
        color: #fff;
    }

    .preset-pill:hover,
    .prompt-pill:hover { border-color: var(--workspace-border-strong); color: var(--workspace-navy); }
}

@media (max-width: 1100px) {
    .workspace-panel-usage,
    .workspace-panel-balance,
    .workspace-panel-credentials,
    .workspace-panel-quickstart { grid-column: span 12; }
    .playground-layout { grid-template-columns: minmax(0, 1fr); }
    #playgroundScreenNew .playground-layout { grid-template-columns: minmax(0, 1fr) !important; }
    .execution-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #playgroundScreenNew .playground-stats-grid.execution-summary { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .execution-item:nth-child(4) { border-left: 0; }
    .execution-item:nth-child(n+4) { border-top: 1px solid var(--workspace-border); }
    #playgroundScreenNew .execution-summary .stat-mini-card:nth-child(4) { border-left: 0 !important; }
    #playgroundScreenNew .execution-summary .stat-mini-card:nth-child(n+4) { border-top: 1px solid var(--workspace-border) !important; }
}

@media (max-width: 820px) {
    body[data-api-view="console"] .top-bar,
    body[data-api-view="playground"] .top-bar,
    body[data-api-view="models"][data-api-model-mode="private"] .top-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    body[data-api-view="console"] .top-bar > div,
    body[data-api-view="playground"] .top-bar > div,
    body[data-api-view="models"][data-api-model-mode="private"] .top-bar > div {
        width: 100%;
        flex-wrap: wrap;
        overflow: visible;
        justify-content: flex-start;
    }

    .workspace-page-header { align-items: flex-start; flex-direction: column; }
    .workspace-summary { width: 100%; }
    .workspace-panel-balance,
    .workspace-panel-quickstart,
    .workspace-panel-credentials { grid-column: span 12; }
    .playground-layout { grid-template-columns: 1fr; }
    #playgroundScreenNew .playground-layout { grid-template-columns: 1fr !important; }
    .playground-settings { position: static; }
    .surface-key-item { grid-template-columns: 1fr; }
    .workspace-row-actions { justify-content: flex-start; }
}

@media (max-width: 600px) {
    body[data-api-view="console"] > .container,
    body[data-api-view="playground"] > .container,
    body[data-api-view="models"][data-api-model-mode="private"] > .container { padding-inline: 14px; }

    .developer-workspace,
    .playground-workspace { padding-top: 30px; }
    .workspace-page-header h1 { font-size: 2.5rem; }
    .workspace-summary { gap: 18px; }
    .workspace-summary-item + .workspace-summary-item { padding-left: 18px; }
    .workspace-panel-inner { padding: 18px; }
    .workspace-panel-header,
    .playground-section-header { align-items: flex-start; flex-direction: column; }
    .allowance-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
    .allowance-item { padding: 13px; }
    .preset-badges { justify-content: flex-start; }
    .workspace-filter-group { width: 100%; }
    .workspace-filter-group .workspace-select { flex: 1 1 140px; }
    .usage-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workspace-metric:nth-child(3) { border-left: 0; }
    .workspace-metric:nth-child(n+3) { border-top: 1px solid var(--workspace-border); }
    .usage-chart-frame { height: 250px; }
    .execution-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #playgroundScreenNew .playground-stats-grid.execution-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .execution-item:nth-child(3), .execution-item:nth-child(5) { border-left: 0; }
    .execution-item:nth-child(n+3) { border-top: 1px solid var(--workspace-border); }
    .execution-item:nth-child(4) { border-left: 1px solid var(--workspace-border); }
    #playgroundScreenNew .execution-summary .stat-mini-card:nth-child(3),
    #playgroundScreenNew .execution-summary .stat-mini-card:nth-child(5) { border-left: 0 !important; }
    #playgroundScreenNew .execution-summary .stat-mini-card:nth-child(n+3) { border-top: 1px solid var(--workspace-border) !important; }
    #playgroundScreenNew .execution-summary .stat-mini-card:nth-child(4) { border-left: 1px solid var(--workspace-border) !important; }
    .terminal-body { min-height: 230px; }
    #playgroundScreenNew .form-input,
    #playgroundScreenNew .playground-textarea { font-size: 16px !important; }
}

@media (max-width: 820px) {
    body[data-api-view] .top-bar,
    .top-bar {
        position: relative;
        z-index: 40;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        flex-direction: initial;
        gap: 12px;
    }

    .top-bar .logo { padding-top: 0; }

    .api-mobile-menu-btn { display: inline-flex; }

    .api-primary-nav {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        left: 0;
        display: flex !important;
        width: 100% !important;
        padding: 10px;
        align-items: stretch;
        flex-direction: column;
        gap: 5px !important;
        border: 1px solid var(--workspace-border);
        border-radius: 12px;
        background: rgba(253, 253, 249, 0.98);
        box-shadow: 0 22px 55px rgba(16, 43, 60, 0.2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px) scale(0.985);
        transform-origin: top center;
        pointer-events: none;
        transition: transform 190ms var(--workspace-ease-out), opacity 160ms var(--workspace-ease-out), visibility 190ms;
    }

    .top-bar.is-menu-open .api-primary-nav {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .top-bar.is-menu-open .api-mobile-menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .top-bar.is-menu-open .api-mobile-menu-btn span:nth-child(2) { opacity: 0; }
    .top-bar.is-menu-open .api-mobile-menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    .api-primary-nav > .btn-ghost,
    .api-primary-nav > .btn-primary {
        width: 100%;
        min-height: 46px;
        justify-content: flex-start !important;
        padding: 10px 12px !important;
        text-align: left;
    }

    .api-primary-nav #logoutBtn {
        margin-top: 4px;
        background: #f4f5f0;
    }

    body[data-api-view] .top-bar #consoleNavBtn.dashboard-nav-btn {
        min-height: 50px;
        margin-block: 2px;
    }
}

@media (hover: hover) and (pointer: fine) {
    body[data-api-view] .top-bar #consoleNavBtn.dashboard-nav-btn:hover {
        border-color: var(--workspace-teal) !important;
        background: var(--workspace-navy-deep) !important;
        transform: translateY(-1px);
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-api-view="console"] *,
    body[data-api-view="playground"] *,
    .workspace-modal *,
    #globalToast { transition: none !important; animation: none !important; scroll-behavior: auto !important; }

    .api-primary-nav,
    .api-mobile-menu-btn span { transition: none !important; }
}
