/* Shared application components. The marketing page has its own layout. */
:root {
  --surface-soft: #f3f5ef;
  --accent: var(--brand-lime, #c5ee70);
  --control-radius: 11px;
  --surface-radius: 20px;
}

body { -webkit-font-smoothing: antialiased; }
main, dialog { line-height: 1.5; }
main a { color: var(--green); }
:is(main, dialog) :is(button, input, select, textarea) { font-family: inherit; }
:is(main, dialog) button { min-height: 44px; border-radius: var(--control-radius); font-size: .875rem; font-weight: 600; transition: background .16s, border-color .16s, box-shadow .16s; }
:is(main, dialog) button.primary { background: var(--ink); border-color: var(--ink); color: white; padding: 12px 18px; }
:is(main, dialog) button.primary:hover:not(:disabled) { background: #344334; border-color: #344334; color: white; }
:is(main, dialog) :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { min-height: 46px; border-radius: var(--control-radius); color: var(--ink); }
:is(main, dialog) :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):hover { border-color: #b5beb0; }
:is(main, dialog) :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid #64834b; outline-offset: 3px; }
:is(main, dialog) input[type="checkbox"], :is(main, dialog) input[type="radio"] { accent-color: var(--green); }
.panel, .tokens-panel, .api-app { border-radius: var(--surface-radius); box-shadow: 0 4px 20px #17201b03; }
.eyebrow { font-size: 10px; letter-spacing: .14em; }
.hint, .muted { line-height: 1.6; }
.library-link, .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.tabs, .catalog-tabs, .view-toggle { border-radius: 12px; background: var(--surface-soft); gap: 4px; padding: 5px; }
.tabs .tab, .catalog-tabs button, .view-toggle button { border-radius: 8px; font-size: .8rem; padding: 10px 13px; }
.tabs .tab.active, .catalog-tabs button.active, .view-toggle button.active { background: white; color: var(--ink); box-shadow: 0 2px 6px #17201b09; }
.model-dialog, .catalog-dialog, dialog.case-list-dialog { border-radius: 24px; padding: 30px; max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 24px 100px #17201b30; }
.model-dialog::backdrop, .catalog-dialog::backdrop { background: #17201b66; backdrop-filter: blur(6px); }
.model-dialog h2, .catalog-dialog h2 { margin: 0 0 10px; font-size: 1.5rem; letter-spacing: -.04em; line-height: 1.2; }
.model-dialog-actions, .dialog-actions { gap: 10px; padding-top: 10px; flex-wrap: wrap; }
.model-dialog .field-label { font-size: .85rem; }
.model-dialog input { padding: 12px 14px; }
.sign-in-action { min-height: 44px; border-radius: 11px; background: var(--ink); }
button.uninstall-confirm { background: var(--red); border-color: var(--red); color: white; }
.empty-state { background: var(--surface-soft); border-radius: 20px; padding: 56px 24px; }
.empty-state h2 { font-size: 1.4rem; letter-spacing: -.035em; }

/* App library and the shared catalog. */
main.catalog-main, #calculator { width: min(1440px, calc(100% - 80px)); }
.catalog-main { max-width: 1280px; padding-top: 48px; gap: 32px; }
.catalog-heading { padding: 0; }
.catalog-heading h1, .launcher-heading h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.055em; line-height: 1.1; margin: 8px 0 14px; }
.catalog-heading > p:last-child, .launcher-intro { max-width: 650px; color: var(--muted); font-size: .95rem; line-height: 1.7; margin: 0; }
.catalog-toolbar { padding-inline: 0; padding-bottom: 24px; }
.catalog-search input { min-height: 48px; background: white; border-radius: 12px; padding-left: 16px; }
.asset-grid { gap: 20px; }
.asset-card { border-radius: 20px; padding: 26px; transition: border-color .18s, box-shadow .18s; }
.asset-card:hover { border-color: #b5bfa9; box-shadow: 0 8px 24px #17201b06; }
.asset-card h2, .publishing-section .asset-card h3 { font-size: 1.15rem; letter-spacing: -.035em; }
.asset-card .asset-title-button { min-height: 0; }
.asset-author { font-size: .75rem; }
.asset-description { color: var(--muted); font-size: .85rem; line-height: 1.7; }
.asset-badge { border-radius: 6px; background: var(--surface-soft); color: #506347; font-size: .68rem; }
.asset-actions { gap: 8px; }
.asset-actions button { font-size: .8rem; }
.asset-actions a.primary, .calculator-app-card .asset-actions a.primary { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 11px 16px; border: 1px solid var(--ink); border-radius: 11px; background: var(--ink); color: white; font-size: .8rem; }
.calculator-app-card .asset-actions a.primary:hover { background: #344334; }
.calculator-launcher { width: min(1280px, 100%); margin-top: 48px; }
.launcher-heading { align-items: center; margin-bottom: 34px; }
.launcher-actions .library-link { background: var(--ink); color: white; padding: 12px 18px; border-radius: 11px; font-size: .8rem; text-decoration: none; }
.launcher-actions .library-link:hover { background: #344334; }
.calculator-launcher .launcher-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr)); }
.calculator-app-card, .asset-card.calculator-app-card.own-app { background: white; border-color: var(--line); }
.calculator-app-card:hover { transform: none; box-shadow: 0 8px 24px #17201b06; }
.calculator-app-icon { width: 54px; height: 54px; border-radius: 16px; margin-bottom: 26px; color: #344c27; background: #e8f0d9; box-shadow: none; font-size: 1.05rem; }
.calculator-app-icon[data-tone="1"] { color: #3d5472; background: #eaf0f7; }
.calculator-app-icon[data-tone="2"] { color: #68527c; background: #f0ebf6; }
.calculator-app-icon[data-tone="3"] { color: #4e602f; background: var(--accent); }
.calculator-app-icon[data-tone="4"] { color: #705448; background: #f4ece4; }
.app-uninstall { width: 44px; height: 44px; }
.app-loading-spinner { width: 56px; height: 56px; border-width: 4px; border-color: var(--surface-soft); border-top-color: var(--green); }

/* A starting point for a new Calculator App. */
.editor-getting-started { width: min(1040px, 100%); margin: 16px auto 0; }
.editor-start-heading { margin-bottom: 32px; }
.editor-start-heading h1 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.055em; line-height: 1.12; margin: 12px 0 16px; }
.editor-start-heading > p:last-child { color: var(--muted); max-width: 640px; margin: 0; }
.editor-start-blank { display: flex; align-items: center; gap: 22px; padding: 26px 30px; border: 1px solid #d8e4c7; border-radius: 20px; background: #edf4e3; }
.editor-start-icon { display: grid; place-items: center; width: 52px; height: 52px; flex-shrink: 0; border-radius: 15px; color: #4e602f; background: #e8f0d9; }
.editor-start-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.editor-start-blank .editor-start-icon { background: var(--accent); }
.editor-start-blank h2 { margin: 0 0 6px; font-size: 1.1rem; letter-spacing: -.025em; }
.editor-start-blank p { margin: 0; color: var(--muted); font-size: .85rem; }
.editor-start-blank button { flex-shrink: 0; margin-left: auto; background: white; }
.editor-start-blank button span { margin-left: 12px; }
.editor-start-section-heading { margin: 36px 0 20px; }
.editor-start-section-heading h2 { margin: 0 0 8px; font-size: 1.15rem; letter-spacing: -.03em; }
.editor-start-section-heading p { margin: 0; color: var(--muted); font-size: .85rem; }
.editor-start-templates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.editor-template-card { display: flex; flex-direction: column; min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.editor-template-card:nth-child(2) .editor-start-icon { color: #3d5472; background: #eaf0f7; }
.editor-template-card:nth-child(3) .editor-start-icon { color: #705448; background: #f4ece4; }
.editor-template-card h3 { margin: 24px 0 10px; font-size: 1.15rem; letter-spacing: -.03em; }
.editor-template-description { flex: 1; margin: 0 0 24px; color: var(--muted); font-size: .85rem; line-height: 1.7; }
.editor-template-detail { margin: 0 0 20px; color: var(--muted); font-size: .72rem; }
.editor-template-card button { width: 100%; }
.editor-start-help { margin: 24px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
@media (max-width: 760px) {
  .editor-start-blank { flex-wrap: wrap; padding: 24px; gap: 18px; }
  .editor-start-blank > div { flex: 1; min-width: 160px; }
  .editor-start-blank button { width: 100%; margin-left: 0; }
  .editor-start-templates { grid-template-columns: 1fr; }
  .editor-template-card { padding: 24px; }
}

/* Calculator workspace. Keep reports and large collections inside their panes. */
#calculator { gap: 20px; padding-bottom: 56px; }
.calculator-return { margin: 18px 0 0; }
.calculator-return .library-link { color: var(--muted); font-size: .78rem; font-weight: 500; }
#calculation-panel { display: grid; gap: 24px; padding: 0; border: 0; background: transparent; box-shadow: none; }
#calculation-panel > :is(.setup-panel, .reports-panel, .output-panel) { min-width: 0; margin: 0; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.calculator-input-heading { gap: 24px; margin-bottom: 24px; }
.current-model-heading { display: grid; align-content: start; gap: 12px; }
.current-model-heading h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 650; line-height: 1.13; letter-spacing: -.05em; }
.workspace-eyebrow { margin: 0; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.current-model-heading .model-mode-badge { width: fit-content; font-size: .65rem; }
.input-heading-actions { width: 100%; margin: 0; justify-content: space-between; gap: 12px; }
.calculator-input-heading .setup-tabs { flex: 1; margin: 0; justify-content: flex-start; }
.case-actions { flex: 0 0 auto; background: var(--surface-soft); border: 0; padding: 4px; }
.case-actions button { width: 44px; height: 44px; min-height: 44px; }
.case-actions svg { width: 19px; height: 19px; }
.case-status:empty { display: none; }
.input-fields, .run-option-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 22px 18px; margin-top: 0; }
.field-label { gap: 8px; font-size: .8rem; font-weight: 600; }
.input-meta { font-size: .66rem; font-weight: 400; }
.input-control-wrap { width: 100%; min-height: 48px; border-radius: 11px; background: #fafbf8; padding-right: 14px; transition: border-color .16s, box-shadow .16s; }
.input-control-wrap:hover { border-color: #b5beb0; }
.input-control-wrap:focus-within { border-color: #64834b; box-shadow: 0 0 0 3px #c5ee7033; }
.input-control-wrap input { min-height: 46px; padding: 12px 14px; font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.input-control-wrap span { font-size: .72rem; font-weight: 500; }
.field-label select, .structured-field input:not([type="hidden"]), .run-option-fields input { width: 100%; background: #fafbf8; padding: 12px 14px; }
.run-controls { flex-wrap: wrap; gap: 14px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.run-controls .update-results { min-height: 48px; }
.run-controls .status { flex: 1 1 220px; font-size: .72rem; line-height: 1.65; }
.run-controls .status[data-state="success"] { color: var(--green); }
.structured-input-editor, .curve-editor { padding: 20px; border-color: var(--line); border-radius: 16px; background: var(--surface-soft); }
.structured-input-editor > legend, .curve-editor legend { font-size: .85rem; }
.structured-input-fields { gap: 18px; }
.input-card-list { gap: 16px; }
.input-card, .scenario-card { border-radius: 14px; padding: 20px; background: white; box-shadow: none; }
.input-card-header h3, .scenario-card-header h3 { font-size: .9rem; letter-spacing: -.02em; }
.structured-nested-object, .structured-nested-collection { background: white; border-color: var(--line); border-radius: 12px; padding: 16px; }
.input-card-remove, .scenario-delete { min-height: 44px; }
.scenario-delete { width: 44px; height: 44px; }
.curve-point-headings, .curve-point-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; }
.curve-remove-point { width: 44px; height: 46px; }
.curve-interpolation { flex-wrap: wrap; }
.scenario-input-option { min-height: 48px; border-color: var(--line); padding: 12px; }
.scenario-input-option:has(input:checked) { background: var(--surface-soft); border-color: #a0b58b; }
.reports-panel > .panel-title { align-items: flex-start; margin-bottom: 26px; gap: 12px; }
.panel-title h2 { font-size: 1.65rem; letter-spacing: -.045em; line-height: 1.2; }
#result-date { font-size: .7rem; padding: 5px 9px; border-radius: 6px; background: var(--surface-soft); }
.metric-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: 12px; margin: 0 0 28px; }
.metric-card { align-content: start; gap: 14px; padding: 20px; border-radius: 14px; background: var(--surface-soft); border-color: transparent; }
.metric-card:first-child { background: var(--ink); color: white; }
.metric-card span { white-space: normal; overflow: visible; font-size: .7rem; line-height: 1.5; }
.metric-card:first-child span { color: #d5decd; }
.metric-card strong { font-size: clamp(1.35rem, 2vw, 1.8rem); letter-spacing: -.055em; font-weight: 600; line-height: 1.2; }
#reports > .tabs { width: fit-content; max-width: 100%; margin-bottom: 28px; }
.report-heading { align-items: center; flex-wrap: wrap; gap: 18px; margin: 26px 0 20px; }
.report-heading h2 { font-size: 1.1rem; letter-spacing: -.025em; }
.report-heading p { font-size: .75rem; line-height: 1.6; }
.report-controls { flex-wrap: wrap; gap: 12px; }
.inline-control { min-width: 0; font-size: .7rem; }
.inline-control select { max-width: 100%; padding: 9px 12px; font-size: .8rem; }
.metric-report-group { min-width: 0; margin: 24px 0; }
.metric-report-group h3, .focused-series h3 { margin-bottom: 12px; font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
.model-output-table-wrap, .tokens-table-wrap, .case-table-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; overscroll-behavior-x: contain; }
.model-output-table-wrap table { min-width: 620px; }
.model-output-table-wrap th[scope="row"] { min-width: 180px; }
th, td { padding: 14px 16px; border-bottom-color: #ebeee6; }
thead th { font-size: .63rem; font-weight: 600; letter-spacing: .065em; background: var(--surface-soft); }
tbody :is(td, th) { font-size: .78rem; }
tbody th { font-weight: 500; }
tbody tr:hover > :is(td, th) { background: #f6f8f1; }
tbody tr:last-child > :is(td, th) { border-bottom: 0; }
.chart-toggle-cell label { min-width: 44px; min-height: 44px; }
.model-output-chart, .report-chart, .liquidity-chart { min-width: 0; max-height: 300px; margin: 16px 0; }
.model-output-line, .liquidity-balance-line { stroke: #4e7540; }
.model-output-point, .liquidity-point { stroke: #4e7540; }
.liquidity-bar.positive { fill: #b0cd7e; }
.liquidity-bar.negative { fill: #d59682; }
.report-table-chart { padding: 18px; border-radius: 14px; background: #fafbf8; }
#reports .report-chart-legend, #reports .liquidity-legend { font-size: .72rem; gap: 10px 18px; }
.run-error { color: #8b3029; background: #fff3ee; border: 1px solid #e8c2b7; box-shadow: none; font-size: .9rem; font-weight: 500; }
.output-panel summary { font-size: .8rem; }

/* Editor chrome, without changing code/highlight alignment. */
.calculator-library { margin-top: 0; padding: 24px 28px; }
.calculator-library .current-model-heading { margin: 0; }
.calculator-library .library-status { font-size: .72rem; }
.editor-panel { padding: 26px; }
.editor-summary { justify-content: flex-start; gap: 12px; font-size: .9rem; }
.editor-summary::before { content: ""; width: 8px; height: 8px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(-45deg); transition: transform .16s; }
.editor-panel[open] .editor-summary::before { content: ""; transform: rotate(45deg); }
.editor-content { grid-template-columns: 250px minmax(0, 1fr); gap: 26px; margin-top: 26px; }
.module-options .empty { padding: 0; font-size: .75rem; text-align: left; }
.module-panel { padding: 18px; background: var(--surface-soft); border-radius: 14px; }
.module-choice { background: white; border-radius: 10px; font-size: .8rem; }
.module-choice:has(input:checked) { background: #eef5e4; border-color: #a9bf8c; }
.editor-file-toolbar { padding: 8px; border-radius: 12px; background: var(--surface-soft); }
.editor-file-tab.active { border-color: var(--line); color: var(--ink); }
.editor-file-actions button { width: 36px; height: 36px; min-height: 36px; }
button.primary.editor-run-model { width: 44px; height: 44px; min-height: 44px; flex-basis: 44px; padding: 0; background: var(--accent); color: var(--ink); border-color: var(--accent); }
.editor-shell { background: #1c241f; border-color: #1c241f; border-radius: 14px; }
.editor-shell .syntax-highlight, .editor-shell textarea { padding: 22px; font: 13px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; }
.editor-shell .syntax-highlight { color: #e1e8dc; }
.editor-shell textarea { color: transparent; -webkit-text-fill-color: transparent; caret-color: #c5ee70; }
.editor-shell textarea:focus-visible { outline-offset: -3px; }
.tok-keyword { color: #c6b2ed; }
.tok-string { color: #c5dc96; }
.tok-number { color: #e9be86; }
.tok-comment { color: #9ba89d; }
.tok-property { color: #9fc4e3; }
.tok-api-token { color: #91d1bd; }
.tok-identifier { color: #e1e8dc; }
.tok-punctuation { color: #b4c0b4; }
.calculator-preview-heading { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 16px 0 0; }

/* Account, publishing and integrations. */
.tokens-panel, .api-app { padding: 30px; }
.tokens-panel > h2 { font-size: 1.25rem; letter-spacing: -.035em; }
.tokens-table { margin-top: 0; }
.tokens-table-wrap { margin-top: 24px; }
.credit-wallet { border-radius: 16px; background: var(--ink); color: white; padding: 26px; }
.credit-wallet span, .credit-wallet small { color: #d5decd; }
.credit-wallet strong { font-size: 2.3rem; font-weight: 600; letter-spacing: -.05em; }
.credit-wallet button.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.credit-metric { border-radius: 14px; background: var(--surface-soft); border: 0; }
.credit-metric strong { font-weight: 600; letter-spacing: -.04em; }
.application-flag { padding: 22px 0; }
.switch-track { background: #d8dfd1; }
.developer-switch input:checked + .switch-track { background: #54753f; }
.api-endpoint { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.api-endpoint code { font-size: .75rem; }
.api-method { border-radius: 5px; padding: 6px 8px; }
.api-app-heading h2 { font-size: 1.3rem; letter-spacing: -.035em; }
.api-central-page .swagger-ui .opblock { border-radius: 10px; }
.publication-variant, .credit-price-fields, .pat-app { border-radius: 14px; background: var(--surface-soft); padding: 20px; }

@media (min-width: 1180px) {
  body[data-model-mode="run"] #calculation-panel { grid-template-columns: 340px minmax(0, 1fr); align-items: start; }
  body[data-model-mode="run"] #model-inputs-panel { padding: 26px; }
  body[data-model-mode="run"] .calculator-input-heading .current-model-heading { flex: 0 0 100%; }
  body[data-model-mode="run"] .calculator-input-heading .setup-tabs { width: 100%; flex: 0 0 100%; }
  body[data-model-mode="run"] .calculator-input-heading .setup-tabs .tab { font-size: .7rem; padding-inline: 9px; }
  body[data-model-mode="run"] .input-heading-actions { gap: 14px; }
  body[data-model-mode="run"] .input-fields { grid-template-columns: 1fr; }
  body[data-model-mode="run"] .field-label { gap: 5px; }
  body[data-model-mode="run"] .input-fields { gap: 16px; }
  body[data-model-mode="run"] .structured-input-editor { padding: 14px; }
  body[data-model-mode="run"] #calculation-panel > .output-panel { grid-column: 1 / -1; }
  /* Complex collections benefit from the full canvas. */
  body[data-model-mode="run"] #calculation-panel:has(.structured-input-editor, .curve-editor) { grid-template-columns: 1fr; }
  body[data-model-mode="run"] #calculation-panel:has(.structured-input-editor, .curve-editor) .input-fields { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  body[data-model-mode="run"] #calculation-panel:has(.structured-input-editor, .curve-editor) .setup-tabs { width: auto; flex: 0 1 auto; }
}
@media (max-width: 1179px) {
  .calculator-input-heading .current-model-heading { flex-basis: 100%; }
}
@media (max-width: 800px) {
  main.catalog-main, #calculator { width: calc(100% - 32px); }
  .catalog-main, .calculator-launcher { padding-top: 0; margin-top: 28px; }
  .launcher-heading { margin-bottom: 24px; }
  .editor-content { grid-template-columns: minmax(0, 1fr); }
  .module-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
  #calculation-panel { gap: 16px; }
  #calculation-panel > :is(.setup-panel, .reports-panel, .output-panel), .tokens-panel, .api-app, .editor-panel { padding: 22px; border-radius: 16px; }
  .reports-panel { overflow: visible; }
  .reports-panel > .panel-title { flex-direction: row; flex-wrap: wrap; }
  .report-heading { align-items: flex-start; }
  .tabs { display: flex; flex-wrap: wrap; }
  .tabs .tab { flex: 0 0 auto; }
  .inline-control:has([data-model-series]) { flex-wrap: wrap; white-space: normal; width: 100%; }
  .inline-control [data-model-series] { width: 100%; }
  :is(main, dialog) :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { font-size: 16px; }
  .editor-shell textarea, .editor-shell .syntax-highlight { font: 16px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; }
  .editor-files { flex: 1 1 100%; }
  .editor-file-toolbar { flex-wrap: wrap; }
  .editor-file-actions button { min-height: 44px; width: 44px; height: 44px; }
  .editor-file-tab { max-width: 100%; flex-wrap: wrap; }
  .editor-file-tab > button { overflow-wrap: anywhere; }
  .structured-input-editor, .curve-editor { padding: 16px; }
  .scenario-heading { gap: 16px; }
  .model-dialog, .catalog-dialog, dialog.case-list-dialog { padding: 24px; }
}
@media (max-width: 480px) {
  main.catalog-main, #calculator { width: calc(100% - 24px); }
  .catalog-toolbar { align-items: stretch; }
  .catalog-tabs { flex-wrap: wrap; }
  .catalog-tabs button { flex: 1; padding-inline: 10px; font-size: .75rem; }
  .asset-card { padding: 24px; }
  .launcher-heading { gap: 22px; }
  #calculation-panel > :is(.setup-panel, .reports-panel, .output-panel), .tokens-panel, .api-app, .editor-panel { padding: 18px; }
  .calculator-input-heading { gap: 20px; }
  .input-heading-actions { gap: 12px; }
  .calculator-input-heading .setup-tabs { flex-basis: 100%; justify-content: space-between; }
  .calculator-input-heading .setup-tabs .tab { flex: 1; padding-inline: 8px; font-size: .72rem; }
  .case-actions { margin-left: auto; }
  .input-fields, .run-option-fields { grid-template-columns: 1fr; }
  .run-controls .update-results { width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { padding: 16px; gap: 14px; }
  .metric-card strong { font-size: 1.3rem; }
  .metric-card span { font-size: .64rem; }
  #reports > .tabs { width: 100%; margin-bottom: 24px; }
  .report-controls { width: 100%; }
  .report-controls .inline-control { flex: 1; }
  .report-controls .inline-control select { flex: 1; min-width: 0; }
  .report-table-chart { padding: 12px; }
  .input-card { padding: 16px; }
  .input-card-header { align-items: flex-start; }
  .structured-nested-object, .structured-nested-collection { padding: 12px; }
  .curve-point-row input { padding-inline: 8px; }
  .curve-point-headings { display: none; }
  .curve-point-row { grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
  .curve-point-row::before, .curve-point-row::after { color: var(--muted); font-size: .65rem; }
  .curve-point-row::before { content: attr(data-date-label); grid-column: 1 / -1; grid-row: 1; }
  .curve-point-row > input { grid-column: 1 / -1; grid-row: 2; }
  .curve-point-row::after { content: attr(data-value-label); grid-column: 1; grid-row: 3; }
  .curve-point-row .curve-value-wrap { min-width: 0; grid-column: 1; grid-row: 4; }
  .curve-point-row .curve-remove-point { grid-column: 2; grid-row: 4; }
  .model-dialog-actions button, .dialog-actions button { flex: 1; }
  .credit-wallet { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(main, dialog) *, .switch-track, .switch-track::after { transition: none; animation: none; }
}
