:root {
  color-scheme: light;
  --paper: #f7f4ef;
  --surface: #fffdf9;
  --surface-strong: #ffffff;
  --ink: #211f1b;
  --muted: #736e65;
  --line: #ded8cf;
  --line-strong: #c9c0b5;
  --orange: #c95218;
  --orange-dark: #97340c;
  --orange-soft: #fff0e5;
  --green: #247252;
  --red: #ba3e36;
  --console: #171815;
  --console-raised: #20211e;
  --console-line: #393a35;
  --console-text: #f3f0e9;
  --console-muted: #a6a79f;
  --console-orange: #ff9b5d;
  --shadow: 0 16px 44px rgba(45, 39, 31, 0.09);
  --sans: "Figtree", "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 16px;
  top: -80px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

.topbar {
  min-height: 72px;
  padding: 12px clamp(18px, 3vw, 46px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 244, 239, .97);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.brand-name { font-size: 17px; letter-spacing: -.01em; }
.brand-name strong { color: var(--orange); }
.brand-divider { width: 1px; height: 28px; background: var(--line-strong); }
.product-name { color: var(--muted); font-size: 14px; }

.topbar-actions, .topbar-actions nav, .console-actions {
  display: flex;
  align-items: center;
}
.topbar-actions { gap: 20px; }
.topbar-actions nav { gap: 18px; }
.topbar-actions nav a {
  color: #5f5a52;
  font-size: 14px;
  text-decoration: none;
}
.topbar-actions nav a:hover { color: var(--orange-dark); }

.token-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.token-state i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aaa59d;
  box-shadow: 0 0 0 3px rgba(170, 165, 157, .15);
}
.token-state.ready { color: var(--green); }
.token-state.ready i { background: #34a06d; box-shadow: 0 0 0 3px rgba(52, 160, 109, .15); }
.token-state.expired { color: var(--red); }
.token-state.expired i { background: var(--red); }

.clear-button, .example-button, .add-button, .remove-button,
.console-actions button, .secret-control button {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}
.clear-button { min-height: 38px; padding: 0 13px; font-size: 13px; }

.workbench {
  height: calc(100vh - 72px);
  min-height: 660px;
  display: grid;
  grid-template-columns: minmax(470px, 42%) minmax(0, 58%);
  padding: 22px clamp(18px, 3vw, 46px) 30px;
  gap: 20px;
}

.form-panel, .console-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.form-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--surface);
}
.form-scroll { overflow: auto; padding: 26px 28px 18px; }

.panel-heading, .form-heading, .repeater-heading, .console-heading,
.history-section > header, .console-toolbar, .form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1, h2, h3, p { margin-top: 0; }
.panel-heading h1 { margin-bottom: 2px; font-size: 26px; line-height: 1.2; letter-spacing: -.03em; }
.panel-heading p, .form-heading p, .repeater-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.environment-label {
  padding: 4px 9px;
  border-radius: 999px;
  background: #e8f5ee;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.connection-fields {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #e5ddd2;
  border-radius: 11px;
  background: #fbf7f1;
}
.connection-fields h2 { margin-bottom: 13px; font-size: 14px; }
.privacy-note { margin: 11px 0 0; color: var(--muted); font-size: 12px; }

.field-grid { display: grid; gap: 13px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }
.field {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: #4f4a43;
  font-size: 13px;
  font-weight: 650;
}
.field > span:first-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; }
.field small { color: #918a80; font-size: 10px; font-weight: 500; }
.field b { color: var(--orange); }

.field input, .field select, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  background: var(--surface-strong);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 70px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #aaa39a; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(201, 82, 24, .12);
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(186, 62, 54, .1);
}

.secret-control { position: relative; display: block; }
.secret-control input { padding-right: 56px; }
.secret-control button {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 32px;
  padding: 0 9px;
  border-color: transparent;
  color: var(--orange-dark);
  font-size: 12px;
}

.endpoint-tabs {
  margin: 22px 0 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
}
.endpoint-tabs button {
  min-width: 0;
  min-height: 54px;
  padding: 8px 5px 11px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.endpoint-tabs button span { display: block; margin-bottom: 2px; color: #b4ada4; font-size: 10px; }
.endpoint-tabs button[aria-selected="true"] { border-bottom-color: var(--orange); color: var(--orange-dark); }
.endpoint-tabs button[aria-selected="true"] span { color: var(--orange); }

.endpoint-form { padding: 24px 0 12px; }
.endpoint-form[hidden] { display: none; }
.form-heading { align-items: flex-start; margin-bottom: 20px; }
.form-heading h2 { margin-bottom: 3px; font-size: 19px; letter-spacing: -.02em; }
.form-heading > code {
  padding: 6px 8px;
  border-radius: 6px;
  background: #f0ece5;
  color: #655e55;
  font: 11px/1.3 var(--mono);
  white-space: nowrap;
}

.fixed-value, .token-help {
  padding: 13px 14px;
  border-radius: 8px;
  background: #f3efe8;
}
.fixed-value { margin-bottom: 14px; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; }
.fixed-value code, .token-help code { color: var(--orange-dark); font: 12px var(--mono); }
.token-help { margin-top: 15px; }
.token-help strong { font-size: 13px; }
.token-help p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.records-panel { min-height: 440px; }
.records-heading { margin-bottom: 16px; }
.records-context {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e1d8cd;
  border-radius: 10px;
  background: #e1d8cd;
}
.records-context > span {
  min-width: 0;
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  background: #fbf7f1;
}
.records-context small { color: var(--muted); font-size: 10px; }
.records-context strong { overflow: hidden; color: #3e3933; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.records-filters {
  margin-top: 18px;
  display: flex;
  align-items: end;
  gap: 12px;
}
.records-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.records-filters select {
  min-height: 38px;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: none;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 12px;
}
.records-filters select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(201, 82, 24, .12); }
.records-count { margin-left: auto; padding-bottom: 9px; color: var(--muted); font-size: 11px; }

.records-state {
  min-height: 230px;
  padding: 52px 24px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}
.records-state strong { font-size: 15px; }
.records-state p { max-width: 42ch; margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.records-error strong, .records-error p { color: var(--red); }
.loading-mark {
  width: 28px;
  height: 28px;
  margin-bottom: 13px;
  border: 3px solid #eadfd4;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: records-spin .7s linear infinite;
}
@keyframes records-spin { to { transform: rotate(360deg); } }

.records-table-wrap { margin-top: 14px; overflow-x: auto; }
.records-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}
.records-table th {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
}
.records-table th:nth-child(1) { width: 88px; }
.records-table th:nth-child(3) { width: 82px; }
.records-table th:nth-child(4) { width: 128px; }
.records-table th:nth-child(5) { width: 68px; }
.records-table td { padding: 13px 8px; border-bottom: 1px solid #ebe5dc; vertical-align: middle; }
.records-table tbody tr:hover { background: #fbf7f1; }
.record-time { display: grid; gap: 1px; color: #4d4841; font-variant-numeric: tabular-nums; }
.record-time small { color: var(--muted); font-size: 10px; }
.record-summary { display: grid; gap: 2px; min-width: 0; }
.record-summary strong { color: #403b35; font-size: 12px; }
.record-summary span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.record-summary em { color: var(--orange-dark); font-size: 10px; font-style: normal; }
.status-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  padding: 3px 7px;
  align-items: center;
  border: 1px solid #dcd5ca;
  border-radius: 999px;
  background: #f4f0e9;
  color: #5c564e;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge.accepted, .status-badge.synced, .status-badge.sandbox-validated {
  border-color: #bcd8c9;
  background: #edf7f1;
  color: var(--green);
}
.status-badge.processing, .status-badge.needs-mapping {
  border-color: #e9cbb5;
  background: var(--orange-soft);
  color: var(--orange-dark);
}
.status-badge.failed { border-color: #ebc4c0; background: #fff0ee; color: var(--red); }
.record-view-button, .records-pagination button, .record-back {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 700;
}
.record-view-button { padding: 0 9px; white-space: nowrap; }
.records-pagination {
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.records-pagination button { padding: 0 11px; }
.records-pagination span { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.records-security-note { margin: 16px 0 0; color: #8b847a; font-size: 10px; text-align: right; }

.record-detail { padding-top: 2px; }
.record-back { margin-bottom: 16px; padding: 0 10px; }
.record-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.record-detail-header > div { min-width: 0; }
.record-detail-header > div > span { color: var(--orange-dark); font-size: 11px; font-weight: 750; }
.record-detail-header h3 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.02em; }
.record-meta {
  margin: 16px 0 0;
  padding: 12px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.record-meta > div { min-width: 0; display: grid; gap: 2px; }
.record-meta dt { color: var(--muted); font-size: 10px; }
.record-meta dd { margin: 0; overflow-wrap: anywhere; color: #423d36; font-size: 12px; font-variant-numeric: tabular-nums; }
.record-data-section { padding-top: 22px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title h3 { margin: 0; font-size: 14px; }
.section-title span { color: var(--muted); font-size: 10px; }
.readable-data { margin-top: 10px; display: grid; gap: 14px; }
.data-group { display: grid; gap: 8px; }
.data-group > h4 { margin: 0; color: #544e47; font-size: 12px; }
.data-group-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 18px;
  border: 1px solid #e5ddd2;
  border-radius: 9px;
  background: #fbf8f3;
}
.data-field { min-width: 0; display: grid; gap: 2px; }
.data-field dt { color: var(--muted); font-size: 10px; }
.data-field dd { margin: 0; overflow-wrap: anywhere; color: #332f2a; font-size: 12px; }
.processing-steps { margin: 10px 0 0; padding: 0; list-style: none; }
.processing-steps li {
  min-height: 48px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #ebe5dc;
}
.processing-steps li:first-child { border-top: 0; }
.step-mark {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf7f1;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}
.step-mark.pending { background: var(--orange-soft); color: var(--orange-dark); }
.step-mark.failed { background: #fff0ee; color: var(--red); }
.step-copy { min-width: 0; display: grid; gap: 1px; }
.step-copy strong { font-size: 12px; }
.step-copy span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.step-status { color: var(--muted); font-size: 10px; }
.step-error { grid-column: 2 / -1; margin: -3px 0 0; color: var(--red); font-size: 10px; }
.record-raw-data { margin-top: 20px; border-top: 1px solid var(--line); }
.record-raw-data summary { padding: 15px 0; color: #4d4841; cursor: pointer; font-size: 12px; font-weight: 700; }
.record-raw-data summary span { margin-left: 6px; color: var(--muted); font-size: 10px; font-weight: 400; }
.record-raw-data pre { margin: 0; padding: 13px; overflow: auto; border-radius: 8px; background: #262722; color: #ebe8e1; font: 10px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.nested-data-group { display: grid; gap: 8px; margin: 8px 0 14px 18px; padding-left: 12px; border-left: 2px solid #e3c9ac; }
.nested-data-group > strong { color: var(--ink); font-size: 11px; }

.repeater-heading { margin: 22px 0 10px; }
.repeater-heading h3 { margin: 0; font-size: 14px; }
.add-button { min-height: 36px; padding: 0 11px; color: var(--orange-dark); font-size: 12px; }
.repeater-list { display: grid; gap: 10px; }
.repeater-row {
  position: relative;
  border: 1px solid #e4ddd4;
  border-radius: 10px;
  background: #faf8f4;
}
.cage-row {
  display: grid;
  grid-template-columns: 28px minmax(105px, 1fr) minmax(105px, 1fr) minmax(118px, .9fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
}
.row-number {
  align-self: center;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 800;
}
.remove-button { min-height: 38px; padding: 0 9px; color: var(--red); font-size: 12px; }
.prescription-row { padding: 14px; }
.row-title { margin-bottom: 13px; display: flex; align-items: center; gap: 8px; }
.row-title strong { font-size: 13px; }
.row-title .remove-button { margin-left: auto; }
.prescription-mode-fields,
.prescription-schedule { margin-top: 12px; }
.infusion-fields {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e3c9ac;
  border-radius: 9px;
  background: #fffaf3;
}
.infusion-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.infusion-heading strong { color: var(--ink); font-size: 13px; }
.infusion-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.infusion-calculation-note { margin: 9px 0 12px; color: var(--muted); font-size: 11px; }
.infusion-component-list { display: grid; gap: 8px; }
.infusion-component-row {
  display: grid;
  grid-template-columns: 28px minmax(128px, .8fr) minmax(155px, 1.4fr) minmax(100px, .8fr) minmax(105px, .8fr) auto;
  align-items: end;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.component-number {
  align-self: center;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #eef6f1;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}
.remove-component-button { min-height: 38px; padding: 0 9px; color: var(--red); font-size: 12px; }

.optional-fields { margin-top: 18px; border-top: 1px solid var(--line); }
.optional-fields summary { padding: 16px 0 10px; cursor: pointer; color: #504b44; font-weight: 700; }
.optional-fields summary span { margin-left: 7px; color: var(--muted); font-size: 12px; font-weight: 400; }
.optional-grid { padding-top: 7px; }

.form-actions {
  min-height: 82px;
  padding: 14px 28px;
  justify-content: flex-start;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, .98);
}
.form-actions button { min-height: 46px; padding: 0 19px; border-radius: 8px; font-weight: 750; }
.example-button { background: white; }
.send-button { border: 1px solid var(--orange); background: var(--orange); color: white; }
.send-button:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.form-actions p { margin: 0 0 0 auto; max-width: 230px; color: var(--muted); font-size: 12px; text-align: right; }
.form-actions p.error { color: var(--red); }
.form-actions p.success { color: var(--green); }

.console-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-color: #31322e;
  background: var(--console);
  color: var(--console-text);
  box-shadow: 0 18px 50px rgba(26, 25, 21, .24);
}
.console-toolbar {
  min-height: 58px;
  padding: 10px 17px;
  border-bottom: 1px solid var(--console-line);
  background: #1c1d1a;
}
.request-address { min-width: 0; display: flex; align-items: center; gap: 10px; }
.request-address span {
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(255, 155, 93, .14);
  color: var(--console-orange);
  font: 700 11px var(--mono);
}
.request-address code { overflow: hidden; color: var(--console-text); font: 12px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.console-actions { gap: 12px; }
.sensitive-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--console-muted); font-size: 11px; white-space: nowrap; }
.sensitive-toggle input { accent-color: var(--console-orange); }
.console-actions button {
  min-height: 34px;
  padding: 0 10px;
  border-color: #55564f;
  color: var(--console-text);
  font: 11px var(--sans);
}

.console-grid { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.request-console, .response-console { min-width: 0; min-height: 0; overflow: auto; }
.request-console { border-right: 1px solid var(--console-line); }
.console-heading { min-height: 49px; padding: 10px 17px; border-bottom: 1px solid var(--console-line); }
.console-heading h2 { margin: 0; font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.console-heading > span, .console-heading > div > span:last-child, .history-section > header > span { color: var(--console-muted); font-size: 10px; }
.response-heading > div { display: flex; align-items: center; gap: 8px; }
.response-status { padding: 3px 6px; border-radius: 4px; color: var(--console-muted); font: 700 10px var(--mono); }
.response-status.success { background: rgba(60, 171, 113, .16); color: #76dfa9; }
.response-status.error { background: rgba(239, 91, 80, .15); color: #ff9289; }
.response-status.pending { background: rgba(255, 155, 93, .13); color: var(--console-orange); }

.console-section { padding: 14px 17px; border-bottom: 1px solid var(--console-line); }
.console-section h3, .history-section h3 { margin: 0 0 9px; color: var(--console-muted); font: 700 9px var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.console-section pre { margin: 0; overflow: auto; color: var(--console-text); font: 11px/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.console-section pre code { font: inherit; }
.body-section { min-height: 230px; }
.body-code { color: #dfe0d8 !important; }
.response-headers-section { min-height: 100px; }

.history-section { padding: 14px 17px 22px; }
.history-section > header { align-items: baseline; }
.history-section ol { margin: 0; padding: 0; list-style: none; }
.history-section li { padding: 8px 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; border-top: 1px solid #30312d; color: #d0d0c9; font: 10px var(--mono); }
.history-section li:first-child { border-top: 0; }
.history-section li span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-section li.success span:last-child { color: #76dfa9; }
.history-section li.error span:last-child { color: #ff9289; }
.history-section .history-empty { display: block; color: var(--console-muted); }

.toast {
  position: fixed;
  z-index: 20;
  right: 28px;
  bottom: 28px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 15px;
  border-radius: 9px;
  background: #292924;
  color: white;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .25);
  font-size: 13px;
}

.success-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(38, 32, 25, .28);
}
.success-dialog::backdrop {
  background: rgba(28, 26, 22, .48);
  backdrop-filter: blur(2px);
}
.success-dialog-card { padding: 32px 30px 26px; text-align: center; }
.success-dialog-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f5ee;
  color: var(--green);
  font-size: 30px;
  font-weight: 800;
}
.success-dialog h2 { margin-bottom: 8px; font-size: 24px; letter-spacing: -.02em; }
.success-dialog p { margin-bottom: 24px; color: var(--muted); font-size: 14px; }
.success-dialog-actions { display: flex; justify-content: center; gap: 10px; }
.success-dialog-actions button {
  min-height: 44px;
  padding: 0 17px;
  border-radius: 8px;
  font-weight: 750;
}
.dialog-secondary-button { border: 1px solid var(--line-strong); background: white; color: var(--ink); }
.dialog-primary-button { border: 1px solid var(--orange); background: var(--orange); color: white; }
.dialog-primary-button:hover { background: var(--orange-dark); border-color: var(--orange-dark); }

button:hover:not(:disabled) { filter: brightness(.97); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(201, 82, 24, .35);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .topbar-actions nav { display: none; }
  .workbench {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .form-panel { min-height: 720px; }
  .console-panel { min-height: 720px; }
}

@media (max-width: 720px) {
  .topbar { min-height: 64px; padding: 10px 15px; }
  .brand-divider, .product-name, .token-state { display: none; }
  .topbar-actions { gap: 10px; }
  .topbar-actions nav { display: none; }
  .clear-button { display: block; min-height: 38px; padding-inline: 10px; }
  .workbench { padding: 12px; gap: 12px; }
  .form-panel, .console-panel { border-radius: 10px; }
  .form-scroll { padding: 20px 16px 12px; }
  .panel-heading h1 { font-size: 22px; }
  .connection-fields { padding: 14px; }
  .two-columns { grid-template-columns: 1fr; }
  .endpoint-tabs { grid-template-columns: repeat(2, 1fr); }
  .form-heading { display: block; }
  .form-heading > code { display: inline-block; margin-top: 10px; white-space: normal; }
  .cage-row { grid-template-columns: 28px 1fr; align-items: center; }
  .cage-row .field, .cage-row .remove-button { grid-column: 2; }
  .infusion-heading { align-items: stretch; flex-direction: column; }
  .add-component-button { width: 100%; }
  .infusion-component-row { grid-template-columns: 28px minmax(0, 1fr); align-items: center; }
  .infusion-component-row .field,
  .infusion-component-row .remove-component-button { grid-column: 2; }
  .form-actions { padding: 13px 16px; flex-wrap: wrap; }
  .form-actions p { order: 3; width: 100%; max-width: none; margin: 0; text-align: left; }
  .console-toolbar { align-items: flex-start; flex-direction: column; }
  .console-actions { width: 100%; justify-content: space-between; }
  .console-grid { grid-template-columns: 1fr; }
  .request-console { border-right: 0; border-bottom: 1px solid var(--console-line); }
  .console-panel { min-height: 1050px; }
  .body-section { min-height: 180px; }
  .toast { right: 16px; bottom: 16px; }
  .success-dialog-card { padding: 26px 20px 20px; }
  .success-dialog-actions { flex-direction: column-reverse; }
  .success-dialog-actions button { width: 100%; }
  .records-context { grid-template-columns: 1fr; }
  .records-filters { align-items: stretch; flex-wrap: wrap; }
  .records-filters label { flex: 1 1 130px; }
  .records-count { width: 100%; margin: 0; padding: 0; }
  .records-table, .records-table tbody, .records-table tr, .records-table td { display: block; width: 100%; }
  .records-table thead { display: none; }
  .records-table tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .records-table td { padding: 4px 0; border: 0; }
  .records-table td:nth-child(3), .records-table td:nth-child(4) { display: inline-block; margin-right: 5px; }
  .records-table td:last-child { padding-top: 9px; }
  .record-view-button { width: 100%; min-height: 42px; }
  .records-pagination { justify-content: space-between; }
  .records-security-note { text-align: left; }
  .record-meta, .data-group-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
