:root {
  --yellow: #ffe600;
  --yellow-dark: #d7c000;
  --ink: #24272d;
  --muted: #626874;
  --line: #e5e7eb;
  --surface: #ffffff;
  --background: #f4f5f7;
  --success: #16834a;
  --danger: #c73535;
  --shadow: 0 18px 50px rgba(36, 39, 45, 0.08);
}

/* Product workspace: operational table first; configuration stays available. */
body { background: #f6f7f9; }
.page { width: min(1480px, calc(100% - 48px)); padding: 20px 0 48px; }
.topbar { padding-bottom: 20px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: #24354b; color: white; font-size: 14px; }
.brand small { font-size: 12px; }
.api-status { font-size: 12px; padding: 7px 11px; }
.compact-access { margin: 0 0 28px; padding: 12px 16px; border: 1px solid #e3e7ec; border-radius: 12px; background: #fff; display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.compact-access strong { display: block; font-size: 13px; }
.compact-access small { display: block; margin-top: 3px; color: #687383; font-size: 12px; }
.compact-access .key-control { width: min(430px, 50%); }
.compact-access .key-control input { min-height: 36px; border-radius: 7px; font-size: 13px; }
.compact-access .button { min-height: 36px; white-space: nowrap; font-size: 12px; border-radius: 7px; }
.catalog-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.catalog-heading .eyebrow { font-size: 11px; letter-spacing: .08em; color: #6e7b8b; margin: 0 0 7px; }
.catalog-heading h1 { max-width: none; margin: 0 0 8px; font-size: 28px; letter-spacing: -.035em; line-height: 1.2; }
.catalog-heading p:not(.eyebrow) { margin: 0; color: #687383; font-size: 13px; max-width: 700px; }
.catalog-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.catalog-toolbar .button { min-height: 38px; padding: 0 13px; border-radius: 8px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.catalog-toolbar .button.primary { color: white; background: #24354b; }
.catalog-toolbar .button.primary:hover { background: #314b6b; }
.upload-button { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.upload-button input { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; }
.upload-button:focus-within { outline: 2px solid #6585ae; outline-offset: 3px; }
.catalog-context { display: flex; gap: 20px; justify-content: space-between; align-items: center; color: #7a8491; font-size: 12px; margin: 0 0 8px; }
.catalog-context > span { overflow-wrap: anywhere; }
.catalog-link { position: static; color: #3e587b; background: transparent; border: 0; padding: 6px 0; font-size: 12px; white-space: nowrap; }
.catalog-message { margin: 8px 0 12px; color: #687383; font-size: 13px; }
.catalog-message.error { color: #b42318; }
.catalog-table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e1e6ed; border-radius: 12px; }
.catalog-table { width: 100%; min-width: 1100px; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.catalog-table th { background: #f8f9fb; color: #6b7482; font-size: 11px; font-weight: 650; text-align: right; padding: 14px 12px; border-bottom: 1px solid #e4e8ee; line-height: 1.45; }
.catalog-table th span { font-weight: 400; color: #8993a0; }
.catalog-table th:first-child { width: 106px; text-align: center; }
.catalog-table th:nth-child(2) { width: 205px; text-align: left; }
.catalog-table th:nth-child(3), .catalog-table th:nth-child(4) { width: 100px; }
.catalog-table th:nth-child(5), .catalog-table th:nth-child(6) { width: 82px; }
.catalog-table th:nth-child(7) { width: 120px; }
.catalog-table th:nth-child(8), .catalog-table th:nth-child(9) { width: 102px; }
.catalog-table th:last-child { width: 150px; text-align: right; }
.catalog-table td { padding: 15px 12px; border-bottom: 1px solid #eef0f4; vertical-align: middle; text-align: right; font-variant-numeric: tabular-nums; }
.catalog-table tr:last-child td { border-bottom: 0; }
.catalog-table tr.catalog-detail-row td { text-align: left; padding: 0; }
.catalog-table .catalog-empty { padding: 52px 20px; text-align: center; color: #8a939f; }
.catalog-identity { text-align: left !important; }
.catalog-sku { display: block; font-size: 13px; font-weight: 650; color: #24354b; overflow-wrap: anywhere; }
.catalog-mlb { display: block; margin-top: 4px; color: #87919e; font-size: 11px; }
.catalog-title { display: block; color: #87919e; font-size: 11px; margin-top: 5px; line-height: 1.45; }
.catalog-table input[type=number] { display: inline-block; width: 100%; max-width: 88px; min-height: 34px; border: 1px solid #e2e7ee; border-radius: 6px; background: #fff; color: #344257; text-align: right; padding: 5px 7px; font-size: 12px; }
.catalog-table input[type=number]:focus { border-color: #7b97bb; outline: 2px solid #e1eaf6; }
.catalog-row-actions { display: flex; gap: 7px; justify-content: flex-end; flex-wrap: wrap; }
.catalog-row-actions button { font-size: 11px; min-height: 30px; padding: 5px 8px; border-radius: 6px; border: 1px solid #dfe5ed; color: #52647d; background: #fff; }
.catalog-row-actions button.catalog-save { background: #edf2f8; border-color: #dce5f1; color: #2f4d73; }
.catalog-row-actions button:disabled { opacity: .4; cursor: not-allowed; }
.catalog-toggle-cell { text-align: center !important; }
.catalog-switch { position: relative; width: 38px; height: 22px; display: inline-block; vertical-align: middle; cursor: pointer; }
.catalog-switch input { width: 38px; height: 22px; margin: 0; position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; }
.catalog-switch-track { display: block; width: 38px; height: 22px; border-radius: 20px; background: #c8d0db; pointer-events: none; transition: background .15s; }
.catalog-switch-track::after { content: ''; width: 16px; height: 16px; position: absolute; top: 3px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0002; transition: transform .15s; }
.catalog-switch input:checked + .catalog-switch-track { background: #3a6b55; }
.catalog-switch input:checked + .catalog-switch-track::after { transform: translateX(16px); }
.catalog-switch input:focus-visible + .catalog-switch-track { outline: 2px solid #6585ae; outline-offset: 3px; }
.catalog-switch input:disabled + .catalog-switch-track { opacity: .5; }
.catalog-toggle-label { display: block; margin-top: 5px; color: #84909f; font-size: 10px; letter-spacing: .04em; }
.catalog-profit { color: #327450; }
.catalog-loss { color: #bb493d; }
.catalog-outside-target { color: #8a6100; }
.catalog-tag { display: inline-block; padding: 4px 7px; margin-top: 5px; border-radius: 5px; font-size: 10px; font-weight: 700; line-height: 1.35; }
.catalog-tag-warning { color: #795500; background: #fff0c2; border: 1px solid #efdaa1; }
.catalog-tag-info { color: #24566c; background: #edf5fa; border: 1px solid #ccdde8; }
.catalog-fixed-rebate { color: #24566c; }
.catalog-estimate { display: block; margin-top: 4px; color: #9b7c45; font-size: 10px; }
.catalog-quote-note { display: block; margin-top: 5px; font-size: 10px; color: #8993a0; line-height: 1.3; }
.catalog-promotion-reason { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.catalog-detail { margin: 0; background: #f8fafc; padding: 16px 20px; border-top: 1px solid #edf1f5; }
.catalog-detail p { margin: 0 0 8px; color: #687383; font-size: 12px; }
.catalog-detail p.catalog-notice { color: #795500; }
.catalog-timing-details { display: grid; gap: 10px; margin: 16px 0; }
.catalog-timing-details > h4 { margin: 0; color: #344257; font-size: 13px; }
.catalog-timing-card { padding: 12px 14px; border: 1px solid #e1e6ed; border-radius: 8px; background: #fff; overflow-wrap: anywhere; }
.catalog-timing-card > strong { display: block; margin-bottom: 6px; font-size: 12px; color: #344257; }
.catalog-timing-date { display: grid; gap: 3px; padding: 8px 0; border-top: 1px solid #edf1f5; font-size: 11px; color: #546173; }
.catalog-timing-date > small { color: #687383; }
.catalog-detail pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; margin: 0; color: #546173; font-size: 11px; }
.catalog-paired-offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.catalog-offer-card { padding: 14px 16px; border: 1px solid #e1e6ed; border-radius: 9px; background: #fff; min-width: 0; }
.catalog-offer-card h4 { margin: 0 0 6px; color: #344257; font-size: 13px; }
.catalog-offer-card p { overflow-wrap: anywhere; }
.catalog-offer-card dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 16px; margin: 12px 0 0; font-size: 12px; }
.catalog-offer-card dt { color: #687383; }
.catalog-offer-card dd { margin: 0; color: #344257; text-align: right; font-variant-numeric: tabular-nums; }
.catalog-footer { display: flex; justify-content: space-between; gap: 20px; color: #8a939f; margin: 13px 2px 27px; font-size: 11px; line-height: 1.5; }
.audit-panel-body { padding: 0 19px 18px; display: grid; gap: 12px; }
.audit-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.audit-event { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid #e6ebf1; border-radius: 8px; background: #fafbfc; }
.audit-event strong { font-size: 13px; color: #24354b; }
.audit-event span, .audit-event small { font-size: 12px; color: #5f6b7a; }

.workspace-details { margin-top: 14px; background: #fff; border: 1px solid #e1e6ed; border-radius: 12px; }
.workspace-details > summary { display: flex; gap: 16px; align-items: center; padding: 17px 19px; color: #344257; cursor: pointer; list-style: none; }
.workspace-details > summary::before { content: '+'; color: #8390a2; font-size: 18px; width: 15px; }
.workspace-details[open] > summary::before { content: '−'; }
.workspace-details > summary span { font-size: 13px; font-weight: 650; }
.workspace-details > summary small { color: #87919e; font-size: 12px; }
.workspace-details > .grid { padding: 0 18px 18px; }
.workspace-details .card { border-radius: 10px; box-shadow: none; }
.workspace-details .account-card { min-height: 0; }
.workspace-details .test-lab { border: 0; padding: 20px; margin: 0; }
#automation-slot .hourly-automation { margin: 0; border: 0; padding: 0 20px 20px; background: #fff; }
.workspace-details .hourly-heading h3 { font-size: 16px; }
.workspace-details .hourly-heading p { max-width: 900px; font-size: 12px; }
.notice { font-size: 12px; color: #84909f; margin-top: 24px; }
@media (max-width: 900px) {
  .catalog-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .catalog-footer { flex-direction: column; gap: 4px; }
  .workspace-details > summary { flex-wrap: wrap; gap: 7px 12px; }
  .workspace-details > summary small { margin-left: 27px; flex-basis: 100%; }
}
@media (max-width: 600px) {
  .page { width: calc(100% - 24px); padding-top: 14px; }
  .compact-access { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px; }
  .compact-access .key-control { width: 100%; }
  .catalog-heading h1 { font-size: 25px; }
  .catalog-toolbar { width: 100%; }
  .catalog-toolbar .button { flex: 1; }
  .catalog-context { align-items: flex-start; flex-direction: column; gap: 3px; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 5%, rgba(255, 230, 0, 0.22), transparent 24rem),
    var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 28px;
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--yellow);
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: var(--muted); }

.api-status {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 0.88rem;
}
.api-status.online { color: var(--success); border-color: rgba(22, 131, 74, 0.3); }
.api-status.error { color: var(--danger); border-color: rgba(199, 53, 53, 0.3); }

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
  padding: 64px 0 42px;
}

.eyebrow, .step {
  color: #756900;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 { max-width: 760px; margin: 10px 0 18px; font-size: clamp(2.4rem, 7vw, 5.6rem); line-height: 0.96; letter-spacing: -0.06em; }
h2 { margin: 7px 0 10px; font-size: 1.45rem; letter-spacing: -0.025em; }
p { line-height: 1.6; }
.lead { max-width: 720px; margin: 0; color: var(--muted); font-size: 1.08rem; }
code { font-family: "Cascadia Code", Consolas, monospace; }

.phase-badge {
  display: grid;
  place-items: center;
  width: 150px;
  aspect-ratio: 1;
  border: 1px solid var(--yellow-dark);
  border-radius: 50%;
  background: var(--yellow);
  text-align: center;
}
.phase-badge strong { font-size: 3rem; line-height: 1; }
.phase-badge span { max-width: 90px; font-size: 0.8rem; font-weight: 700; }

.grid { display: grid; grid-template-columns: 0.88fr 1.12fr; gap: 20px; }
.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card-heading p { margin: 0; color: var(--muted); }

.check-list { display: grid; gap: 13px; margin: 26px 0; padding: 0; list-style: none; }
.check-list li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.check-list li span { width: 12px; height: 12px; border: 2px solid #a8adb7; border-radius: 50%; }
.check-list li.ok { color: var(--ink); }
.check-list li.ok span { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 3px white; }

.callback-box { position: relative; padding: 16px; border-radius: 16px; background: #f7f7f8; }
.callback-box + .callback-box { margin-top: 12px; }
.callback-box > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 0.78rem; }
.callback-box code { display: block; overflow-wrap: anywhere; padding-right: 52px; font-size: 0.82rem; }
.text-button { position: absolute; right: 14px; bottom: 13px; border: 0; background: none; color: #665b00; font-weight: 800; }

.account-card { min-height: 420px; display: flex; flex-direction: column; }
.account-profile { display: grid; grid-template-columns: auto 1fr; gap: 20px; margin: 24px 0; }
.avatar { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 20px; background: var(--yellow); font-size: 1.3rem; font-weight: 900; }
dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; }
dl div { min-width: 0; }
dt { color: var(--muted); font-size: 0.76rem; }
dd { margin: 3px 0 0; overflow-wrap: anywhere; font-weight: 750; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 24px; }
.button { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font-weight: 800; }
.button.primary { background: var(--yellow); color: #302c00; }
.button.primary:hover { background: #f3da00; }
.button.secondary { border-color: var(--line); background: white; color: var(--ink); }
.button.danger { border-color: rgba(199, 53, 53, 0.25); background: #fff5f5; color: var(--danger); }
.button:disabled { cursor: wait; opacity: 0.55; }
.hint { margin: 18px 0 0; color: var(--muted); font-size: 0.82rem; }

.access-card { display: grid; grid-template-columns: 1fr minmax(280px, 0.75fr); align-items: center; gap: 30px; margin-top: 20px; }
.access-card p { margin: 0; color: var(--muted); }
.key-control { display: flex; gap: 9px; }
.key-control input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }

.test-lab { margin-top: 20px; overflow: hidden; }
.test-lab-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.test-lab-heading p { max-width: 720px; margin: 0; color: var(--muted); }
.read-only-badge {
  flex: none;
  padding: 9px 12px;
  border: 1px solid rgba(22, 131, 74, 0.28);
  border-radius: 999px;
  background: #effaf4;
  color: var(--success);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.test-controls { display: grid; grid-template-columns: minmax(250px, 1fr) auto; align-items: end; gap: 12px; margin-top: 26px; }
.test-controls label { color: var(--muted); font-size: 0.78rem; font-weight: 750; }
.test-controls input {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f7f8;
  padding: 0 14px;
  color: var(--ink);
  font-family: "Cascadia Code", Consolas, monospace;
}
.test-status { margin: 18px 0 10px; color: var(--muted); font-size: 0.88rem; }
.calibration-form { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.calibration-heading h3, .calibration-results > h3 { margin: 0 0 6px; font-size: 1.12rem; letter-spacing: -0.02em; }
.calibration-heading p { margin: 0 0 20px; color: var(--muted); font-size: 0.88rem; }
.margin-policy-card { margin: 0 0 24px; padding: 22px; border: 1px solid #d7c74e; border-radius: 18px; background: linear-gradient(120deg, #fffde9, #fff 75%); }
.margin-policy-card legend { padding: 0 9px; color: #5f5500; font-size: 0.92rem; font-weight: 850; }
.margin-policy-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.margin-policy-fields label { min-width: 0; color: var(--ink); font-size: 0.9rem; font-weight: 800; }
.margin-policy-fields input { display: block; width: 100%; min-height: 66px; margin-top: 9px; padding: 10px 16px; border: 1px solid #cfc488; border-radius: 12px; background: white; color: var(--ink); font-size: 1.8rem; font-weight: 800; }
.margin-policy-fields input:focus { outline: 3px solid rgba(215, 192, 0, 0.25); outline-offset: 2px; }
.margin-policy-fields small { display: block; margin-top: 8px; color: var(--muted); font-size: 0.75rem; font-weight: 450; line-height: 1.5; }
.margin-policy-card > p { margin: 16px 0 0; font-size: 0.8rem; color: #645d2d; }
.checkbox-control { display: flex; align-items: flex-start; gap: 11px; font-size: 0.86rem; font-weight: 700; line-height: 1.55; }
.checkbox-control input { flex: none; width: 19px; height: 19px; margin: 2px 0 0; accent-color: #8b7900; cursor: pointer; }
.margin-policy-card > .checkbox-control { margin-top: 20px; padding-top: 18px; border-top: 1px solid #e7dfb7; }
.margin-policy-card > .estimated-risk-note { color: #845e00; font-size: 0.76rem; }
.pricebot-plan { margin-top: 24px; padding: 22px; border: 1px solid #dfd093; border-radius: 18px; background: #fffdf4; }
.pricebot-plan-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pricebot-plan-heading h3 { margin: 7px 0 0; font-size: 1.12rem; }
.plan-expiry { color: var(--muted); font-size: 0.75rem; }
.pricebot-plan-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 12px; margin-top: 18px; }
.pricebot-selected-card { display: grid; gap: 7px; padding: 16px; border: 1px solid #ded7bb; border-radius: 12px; background: white; overflow-wrap: anywhere; }
.pricebot-selected-card > strong { font-size: 0.88rem; }
.pricebot-selected-card > small { color: var(--muted); font-size: 0.73rem; }
.pricebot-selected-card > span { font-size: 0.85rem; font-weight: 750; }
.pricebot-authorizations { display: grid; gap: 14px; margin-top: 22px; padding-top: 20px; border-top: 1px solid #e5dcb8; }
.pricebot-authorizations .button { justify-self: start; }
.pricebot-authorizations .button.danger:not(:disabled) { background: #b32b2b; color: white; border-color: #b32b2b; }
.pricebot-authorizations .button:disabled { cursor: not-allowed; }
.pricebot-authorizations .calibration-note { margin: 0; }
.pricebot-execution-results { margin-top: 18px; font-size: 0.83rem; overflow-wrap: anywhere; }
.pricebot-execution-results > p { margin: 8px 0; }
.calibration-scenario { margin: 0 0 20px; padding: 12px 14px; border: 1px solid #e8df9d; border-radius: 10px; background: #fffced; color: #645d2d; font-size: 0.84rem; }
.calibration-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.calibration-modes label { min-width: 0; color: var(--muted); font-size: 0.77rem; font-weight: 750; }
.calibration-modes select { display: block; width: 100%; min-height: 44px; margin-top: 7px; padding: 0 11px; border: 1px solid #d6dae0; border-radius: 10px; background: white; color: var(--ink); }
.calibration-modes select:focus { outline: 3px solid rgba(215, 192, 0, 0.22); outline-offset: 1px; border-color: #9e8e00; }
.calibration-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 14px; }
.calibration-fields label { min-width: 0; color: var(--muted); font-size: 0.77rem; font-weight: 750; }
.calibration-fields label > span { color: var(--danger); }
.calibration-fields input { display: block; width: 100%; min-height: 44px; margin-top: 7px; border: 1px solid #d6dae0; border-radius: 10px; background: white; padding: 0 11px; color: var(--ink); }
.calibration-fields input::placeholder { color: #7d8490; font-size: 0.76rem; font-weight: 400; }
.calibration-fields input:focus { outline: 3px solid rgba(215, 192, 0, 0.22); outline-offset: 1px; border-color: #9e8e00; }
.calibration-fields input[readonly] { background: #f2f4f6; color: var(--muted); }
.calibration-fields input:disabled { background: #f2f4f6; color: var(--muted); opacity: 1; }
.field-note { display: block; margin-top: 6px; font-weight: 400; line-height: 1.5; }
.calibration-note { margin: 14px 0 0; color: var(--muted); font-size: 0.81rem; }
.calibration-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 20px; }
.calibration-actions > span { color: var(--muted); font-size: 0.79rem; }
.calibration-results { margin: 24px 0; border-top: 1px solid var(--line); padding-top: 24px; }
.calibration-results > .calibration-note { margin-top: 6px; }
.item-comparison { margin-top: 24px; }
.item-comparison + .item-comparison { border-top: 1px solid var(--line); padding-top: 24px; }
.item-comparison > h4 { margin: 0; font-family: "Cascadia Code", Consolas, monospace; font-size: 1rem; }
.comparison-sku { margin: 5px 0 0; color: var(--muted); font-size: 0.84rem; }
.automatic-cost-summary { margin-top: 14px; padding: 15px; border: 1px solid #d7e3f1; border-radius: 12px; background: #f6f9fd; }
.automatic-cost-summary > strong { display: block; font-size: 0.84rem; }
.automatic-cost-summary dl { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 13px; }
.automatic-cost-summary > small { display: block; margin-top: 12px; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.cost-alert { margin: 14px 0; padding: 12px 14px; border: 1px solid #edcece; border-radius: 10px; background: #fff5f5; color: #9c3030; font-size: 0.84rem; line-height: 1.6; }
.comparison-error { color: var(--danger); font-size: 0.78rem; }
.minimum-price { margin: 10px 0 16px; font-size: 0.88rem; }
.recommendation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.recommendation-card { padding: 18px; border: 1px solid #cee5d7; border-radius: 14px; background: #f5fbf7; }
.recommendation-card.recommendation-fallback { border-color: #ead7a3; background: #fffbf0; }
.recommendation-card h4 { margin: 0 0 6px; font-size: 0.92rem; }
.recommendation-description { margin: 0; color: var(--muted); font-size: 0.78rem; }
.recommendation-name { margin: 14px 0 9px; font-size: 0.83rem; font-weight: 750; overflow-wrap: anywhere; }
.campaign-dates { display: block; margin: 6px 0 10px; color: var(--muted); font-size: 0.73rem; line-height: 1.5; }
.price-evaluation > strong, .price-evaluation > span, .price-evaluation > small { display: block; }
.recommendation-card .price-evaluation > strong { font-size: 1.65rem; letter-spacing: -0.04em; }
.price-evaluation > span { margin-top: 4px; font-size: 0.8rem; font-weight: 750; }
.price-evaluation > small { margin-top: 4px; color: var(--muted); font-size: 0.75rem; }
.price-evaluation > .rebate-status { margin-top: 8px; padding: 7px 9px; border-radius: 6px; background: #f4f5f7; font-size: 0.72rem; font-weight: 500; line-height: 1.5; }
.price-evaluation > .rebate-applied { color: #126c3d; background: #e7f6ed; }
.price-evaluation > .rebate-unconfirmed { color: #7a5a00; background: #fff7dc; }
.rebate-projection { margin: 10px 0 12px; padding: 12px; border: 1px solid #cddff1; border-radius: 9px; background: #f0f7ff; }
.rebate-projection > strong, .rebate-projection > span, .rebate-projection > small { display: block; }
.rebate-projection > strong { color: #24527c; font-size: 0.76rem; }
.rebate-projection > .estimated-margin { margin-top: 6px; color: #174f7e; font-size: 0.9rem; font-weight: 800; }
.rebate-projection > small { margin-top: 6px; color: #405b73; font-size: 0.73rem; line-height: 1.5; }
.rebate-projection > .projection-policy { font-weight: 650; }
.rebate-projection > .projection-caution { padding-top: 9px; border-top: 1px solid #cddff1; }
.rebate-calculation { display: grid; gap: 5px; margin-top: 9px; padding: 9px; border-radius: 7px; background: #f4f5f7; }
.rebate-calculation > small, .rebate-calculation > strong { color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.rebate-calculation > strong { color: var(--ink); font-weight: 750; }
.projected-fee-breakdown summary { color: #24527c; }
.active-promotion-review { margin-top: 22px; padding: 18px; border: 1px solid #d7e3f1; border-radius: 14px; background: #f6f9fd; }
.active-promotion-review > h5 { margin: 0; font-size: 0.96rem; }
.active-promotion-review > .calibration-note { margin-top: 7px; }
.active-promotion-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-top: 17px; }
.active-promotion-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.active-promotion-card > h6 { margin: 0; font-size: 0.88rem; overflow-wrap: anywhere; }
.active-promotion-card > .price-evaluation { margin-top: 13px; }
.cost-breakdown { margin-top: 10px; font-size: 0.73rem; }
.cost-breakdown summary { color: #665b00; cursor: pointer; font-weight: 750; }
.cost-breakdown[open] summary { margin-bottom: 9px; }
.cost-breakdown-row { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; color: var(--muted); }
.cost-breakdown-row strong { color: var(--ink); white-space: nowrap; font-size: inherit; }
.cost-breakdown-row:last-child { margin-top: 4px; border-top: 1px solid var(--line); color: var(--ink); }
.quote-detail { margin: 8px 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.margin-approved { color: var(--success); }
.margin-fallback { color: #8c6500; }
.margin-blocked { color: var(--danger); }
.price-evaluation > .margin-decision-badge { display: inline-block; margin-top: 7px; padding: 3px 6px; border-radius: 5px; font-size: 0.65rem; font-weight: 750; line-height: 1.4; }
.margin-decision-badge.target_reached { color: #126c3d; background: #e7f6ed; }
.margin-decision-badge.minimum_fallback { color: #7a5a00; background: #fff1c8; }
.margin-decision-badge.below_minimum { color: #a62a2a; background: #fff0f0; }
.comparison-counts { margin: 17px 0 10px; color: var(--muted); font-size: 0.82rem; }
.comparison-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.comparison-table { width: 100%; min-width: 880px; border-collapse: collapse; text-align: left; font-size: 0.82rem; }
.comparison-table th { padding: 13px; background: #f4f5f7; color: var(--muted); font-size: 0.74rem; font-weight: 750; }
.comparison-table td { padding: 15px 13px; vertical-align: top; border-top: 1px solid var(--line); }
.comparison-table td:first-child { width: 24%; }
.comparison-table td:last-child { width: 22%; }
.comparison-table td > strong, .comparison-table td > small { display: block; }
.comparison-table td > small { margin-top: 6px; color: var(--muted); line-height: 1.5; font-size: 0.73rem; overflow-wrap: anywhere; }
.comparison-muted { color: var(--muted); font-size: 0.82rem; }
.simulation-status { display: inline-block; padding: 5px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 800; }
.simulation-status.approved { color: #126c3d; background: #e7f6ed; }
.simulation-status.blocked { color: #a62a2a; background: #fff0f0; }
.simulation-status.manual_review { color: #7a5a00; background: #fff7dc; }
.simulation-status.minimum_fallback { color: #7a5a00; background: #fff1c8; }
.json-heading { margin: 24px 0 12px; font-size: 0.9rem; }
.json-viewer {
  min-height: 220px;
  max-height: 560px;
  margin: 0;
  overflow: auto;
  border: 1px solid #343944;
  border-radius: 16px;
  background: #171a20;
  padding: 20px;
  color: #d9fbe8;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  tab-size: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hourly-automation { margin: 30px 0 24px; padding: 24px; border: 1px solid #c8d9eb; border-radius: 16px; background: #f6f9fd; }
.hourly-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.hourly-heading h3 { margin: 7px 0; }
.hourly-heading p { margin: 8px 0 0; color: var(--muted); font-size: 0.85rem; }
.hourly-badge { flex-shrink: 0; padding: 7px 10px; border-radius: 30px; background: #e7ebf0; color: #4d5866; font-size: 0.73rem; font-weight: 800; }
.hourly-badge.enabled { color: #126c3d; background: #e0f3e8; }
.hourly-scope-control { margin-top: 22px; }
.hourly-scope-control label { display: block; color: var(--muted); font-size: 0.77rem; font-weight: 750; }
.hourly-scope-control select { display: block; width: 100%; min-height: 44px; margin-top: 7px; padding: 8px 11px; border: 1px solid #c8d3df; border-radius: 10px; color: var(--ink); background: white; }
.hourly-scope-control select:focus { outline: 3px solid #cfdef0; outline-offset: 1px; }
.hourly-metadata { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 18px; margin-top: 22px; padding: 18px 0; border-top: 1px solid #d7e3f1; border-bottom: 1px solid #d7e3f1; }
.hourly-metadata dd { overflow-wrap: anywhere; font-size: 0.8rem; }
.hourly-authorizations { display: grid; gap: 14px; margin-top: 22px; }
.hourly-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; }
.hourly-report:not(:empty) { margin-top: 22px; padding-top: 18px; border-top: 1px solid #d7e3f1; }
.hourly-report { font-size: 0.81rem; overflow-wrap: anywhere; }
.hourly-report h4 { margin: 0 0 8px; }
.hourly-report p { margin: 8px 0; }
.hourly-review-warning { color: #a62a2a; }
.hourly-no-promotion { color: #795500; }
.notice { margin-top: 20px; padding: 22px 26px; border-left: 5px solid var(--yellow-dark); border-radius: 4px 18px 18px 4px; background: #fffbe2; }
.notice p { margin: 5px 0 0; color: #645d2d; }

.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(420px, calc(100% - 48px)); padding: 14px 18px; border-radius: 14px; background: var(--ink); color: white; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }

@media (max-width: 800px) {
  .hero, .grid, .access-card { grid-template-columns: 1fr; }
  .phase-badge { display: none; }
  .hero { padding-top: 38px; }
  dl { grid-template-columns: 1fr; }
  .key-control { flex-direction: column; }
  .test-lab-heading { flex-direction: column; }
  .test-controls { grid-template-columns: 1fr; }
  .calibration-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .automatic-cost-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hourly-heading { flex-direction: column; }
  .hourly-metadata { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .card { padding: 20px; }
  .calibration-fields, .calibration-modes, .recommendation-grid { grid-template-columns: 1fr; }
  .calibration-actions { align-items: stretch; flex-direction: column; }
  .margin-policy-fields { grid-template-columns: 1fr; }
  .margin-policy-card, .pricebot-plan { padding: 16px; }
  .pricebot-plan-heading { flex-direction: column; }
  .pricebot-authorizations .button { width: 100%; justify-self: stretch; }
  .hourly-automation { padding: 16px; }
  .hourly-actions { align-items: stretch; flex-direction: column; }
}

/* Override the legacy laboratory shell without removing its diagnostics. */
body { background: #f6f7f9; }
body .page { width: min(1480px, calc(100% - 48px)); padding: 20px 0 48px; }
body .topbar { padding-bottom: 20px; }
body .topbar { flex-wrap: wrap; gap: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar-actions .ads-shortcut { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 13px; border-radius: 8px; font-size: 12px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.topbar-actions .ads-shortcut:hover { background: #edf2f8; border-color: #cbd6e3; }
.topbar-actions .ads-shortcut:focus-visible { outline: 2px solid #6585ae; outline-offset: 3px; }
body .brand-mark { width: 38px; height: 38px; border-radius: 10px; background: #24354b; color: #fff; font-size: 14px; }
body .api-status { font-size: 12px; padding: 7px 11px; }
.access-card.compact-access { display: flex; margin: 0 0 28px; padding: 12px 16px; gap: 18px; }
.compact-access .key-control { display: flex; flex-direction: row; gap: 8px; }
.notice { background: transparent; border: 0; border-radius: 0; padding: 0 2px; }
.notice strong { color: #748193; font-weight: 500; }
.notice p { color: #87919e; }
@media (max-width: 600px) {
  body .page { width: calc(100% - 24px); padding-top: 14px; }
  .access-card.compact-access { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .compact-access .key-control { width: 100%; }
}

/* Interface branch: operational denser layout */
body {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(circle at 88% -10%, rgba(255, 230, 0, 0.18), transparent 28rem),
    linear-gradient(180deg, #eef1f5 0%, #f6f7f9 36%, #f6f7f9 100%);
}
code, .json-viewer, .catalog-mlb, .test-controls input {
  font-family: "IBM Plex Mono", "Cascadia Code", Consolas, monospace;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ops-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid #e1e6ed;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  animation: ops-fade-in .28s ease-out;
}
.ops-summary-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.ops-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f4f8;
  color: #52647d;
  font-size: 12px;
}
.ops-chip strong { color: #24354b; font-size: 14px; }
.ops-chip-warn { background: #fff6df; color: #7a5a00; }
.ops-chip-warn strong { color: #7a5a00; }
.ops-chip-danger { background: #fff0f0; color: #a62a2a; }
.ops-chip-danger strong { color: #a62a2a; }
.ops-summary-run { margin: 0; color: #87919e; font-size: 12px; white-space: nowrap; }

.review-banner {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid #f0c2c2;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff7f7, #fff);
  animation: ops-fade-in .32s ease-out;
}
.review-banner-copy strong { display: block; color: #a62a2a; font-size: 14px; }
.review-banner-copy p { margin: 4px 0 0; color: #7a3b3b; font-size: 13px; }
.review-banner-list { display: grid; gap: 10px; margin-top: 12px; }
.review-banner-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #f0d4d4;
  border-radius: 10px;
  background: #fff;
}
.review-banner-item p { margin: 0; color: #687383; font-size: 12px; }
.review-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-banner-actions .button { min-height: 34px; font-size: 12px; border-radius: 8px; }

.routine-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 14px;
  padding: 12px 16px;
  border: 1px solid #d7e3f1;
  border-radius: 12px;
  background: #f6f9fd;
}
.routine-strip-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.routine-strip-label { font-size: 12px; font-weight: 700; color: #52647d; letter-spacing: .04em; text-transform: uppercase; }
.routine-strip-meta { color: #687383; font-size: 12px; }
.routine-strip-meta strong { color: #344257; font-weight: 650; }
.routine-strip-actions { display: flex; align-items: center; gap: 10px; }
.routine-strip-actions .button { min-height: 34px; font-size: 12px; border-radius: 8px; }
.routine-strip-open { position: static; }

.access-panel {
  margin: 0 0 22px;
  border: 1px solid #e3e7ec;
  border-radius: 12px;
  background: #fff;
}
.access-panel > summary {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}
.access-panel > summary::-webkit-details-marker { display: none; }
.access-panel > summary span { font-size: 13px; font-weight: 650; color: #344257; }
.access-panel > summary small { color: #87919e; font-size: 12px; }
.access-panel-body { padding: 0 16px 14px; }
.access-panel .key-control { width: min(430px, 100%); display: flex; gap: 8px; }
.access-panel .key-control input { min-height: 36px; border-radius: 7px; font-size: 13px; border: 1px solid #e2e7ee; padding: 0 12px; }
.access-panel .button { min-height: 36px; font-size: 12px; border-radius: 7px; }

.catalog-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(140px, .8fr));
  gap: 10px;
  margin: 0 0 12px;
}
.catalog-search input,
.catalog-filter select {
  display: block;
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  border: 1px solid #e1e6ed;
  border-radius: 8px;
  background: #fff;
  padding: 0 11px;
  color: #344257;
  font-size: 13px;
}
.catalog-filter { color: #6b7482; font-size: 11px; font-weight: 650; }
.catalog-table-ops { min-width: 1280px; }
.catalog-table-ops th:nth-child(7),
.catalog-table-ops th:nth-child(8) { width: 150px; text-align: right; }
.catalog-table-ops th:nth-child(9) { width: 160px; text-align: left; }
.catalog-table-ops td { padding: 11px 10px; }
.catalog-offer-cell { vertical-align: top !important; }
.catalog-offer-price { display: block; color: #24354b; font-size: 13px; }
.catalog-offer-metrics {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
  color: #546173;
  font-size: 11px;
}
.catalog-offer-empty { color: #9aa3af; }
.catalog-offer-rebate .catalog-offer-price { font-weight: 700; }
.catalog-status-cell { text-align: left !important; }
.catalog-status-stack { display: grid; gap: 4px; justify-items: start; }
.catalog-tag-status { color: #24566c; background: #edf5fa; border: 1px solid #ccdde8; }
.catalog-tag-reason { color: #24566c; background: #f3f7fb; border: 1px solid #d5e1ec; }
.catalog-quote-age { display: block; margin-top: 2px; color: #8993a0; font-size: 10px; }
.catalog-quote-stale { color: #a62a2a; font-weight: 650; }
.catalog-mlb-link { color: #3e587b; text-decoration: none; }
.catalog-mlb-link:hover { text-decoration: underline; }
.catalog-row-review { background: #fffaf6; }
.catalog-row-review td { border-bottom-color: #f0e2d4; }
.catalog-offer-primary { border-color: #c8d9eb; box-shadow: inset 3px 0 0 #3e587b; }
.catalog-offer-secondary { opacity: .96; }
.catalog-history { margin: 14px 0; }
.catalog-history h4 { margin: 0 0 8px; font-size: 13px; color: #344257; }
.catalog-history-list { margin: 0; padding-left: 18px; color: #546173; font-size: 12px; line-height: 1.55; }
.catalog-lag-note { border-left: 3px solid #c8d9eb; padding-left: 10px; }

.hourly-result-line { margin: 10px 0 4px; color: #344257; font-weight: 650; }
.hourly-result-details { margin: 0 0 10px; }
.hourly-result-details summary {
  cursor: pointer;
  color: #3e587b;
  font-size: 12px;
  font-weight: 650;
}
.hourly-result-details[open] summary { margin-bottom: 6px; }

@keyframes ops-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .ops-summary, .routine-strip { flex-direction: column; align-items: flex-start; }
  .catalog-controls { grid-template-columns: 1fr; }
  .review-banner-actions .button { flex: 1; }
}
@media (max-width: 600px) {
  .routine-strip-actions { width: 100%; }
  .routine-strip-actions .button { flex: 1; }
  .access-panel .key-control { flex-direction: column; }
}

