:root {
  --primary: #2157e0;
  --primary-hover: #1843b3;
  --background: #f4f6fa;
  --surface: #ffffff;
  --ink: #1b2a44;
  --muted: #5b6b85;
  --border: #d6dce6;
  --navy: #15213a;
  --success: #157347;
  --danger: #b42318;
  --warning: #8a5a0b;
  --soft: #f7f9fc;
  --blue-soft: #edf3ff;
  --green-soft: #eaf6ef;
  --red-soft: #fff1ef;
  --amber-soft: #fdf5e6;
  --font-sans: "Noto Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Noto Sans Mono", ui-monospace, monospace;
  --radius-control: 6px;
  --radius-panel: 10px;
  --control-height: 40px;
  --page-max: 1240px;
  --scrollbar-thumb: #a2aec0;
  --scrollbar-track: #eef1f6;
  --scrollbar-hover: #7788a3;
  --scrollbar-active: #526681;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--background);
  scrollbar-gutter: stable;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: auto;
  scroll-padding-block: 24px 110px;
}
* {
  box-sizing: border-box;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: 2px solid var(--scrollbar-track);
  border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-hover);
}
*::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-active);
}
body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
a,
button,
input,
select,
textarea,
summary,
[tabindex] {
  scroll-margin-block: 24px 120px;
}
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 2px solid #c8d8ff;
  outline-offset: 1px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.7px;
  margin-bottom: 10px;
}
h2 {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 12px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}
p {
  line-height: 1.65;
  color: var(--muted);
}
small {
  color: var(--muted);
  font-size: 12px;
}
code,
pre,
.order,
.number {
  font-family: var(--font-mono);
}
code {
  font-size: 0.9em;
}
[hidden] {
  display: none !important; /* Native hidden must win over component display rules. */
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  padding: 12px;
  background: var(--surface);
  z-index: 100;
}
.skip-link:focus {
  top: 12px;
}
.btn,
button {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
.btn:hover,
button:not(:disabled):hover {
  background: var(--soft);
  border-color: #aab7cd;
  text-decoration: none;
}
.btn:active,
button:not(:disabled):active {
  background: #e8eef8;
}
.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.primary:hover,
button.primary:not(:disabled):hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: white;
}
.danger {
  color: var(--danger);
}
.primary-danger {
  color: white;
  background: var(--danger);
  border-color: var(--danger);
}
button.primary-danger:not(:disabled):hover {
  color: white;
  background: #8f1d14;
}
.small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}
.full {
  width: 100%;
}
.text-link {
  color: var(--primary);
  font-weight: 600;
}
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.icon-button {
  padding: 9px;
  min-width: 38px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
button[aria-busy="true"] {
  position: relative;
  color: transparent;
  opacity: 0.75;
}
button[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: white;
  font-weight: 700;
  font-size: 25px;
  letter-spacing: -0.8px;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  background: #3d6bf2;
  border-radius: 9px;
  color: white;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 23px;
  line-height: 1;
}
.brand-sub {
  font-size: 9px;
  letter-spacing: 0.17em;
  color: #a6b5d0;
  margin-top: 6px;
}
#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 228px;
  background: var(--navy);
  color: #c9d3e6;
  padding: 26px 12px 18px;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
}
#sidebar .brand {
  padding: 0 10px 28px;
}
.workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #1a2844;
  border: 1px solid #304160;
  border-radius: 8px;
  font-size: 13px;
  color: white;
}
.workspace small {
  display: block;
  color: #acb9d0;
  font-size: 10px;
}
.workspace-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #2d3f66;
  flex-shrink: 0;
}
.nav-label {
  padding: 27px 14px 10px;
  color: #a6b5d0;
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 600;
}
#mainNav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 11px 13px;
  margin-bottom: 4px;
  border-radius: 7px;
  color: #c9d3e6;
  font-size: 13px;
}
#mainNav a:hover {
  background: #1d2e4c;
  color: white;
  text-decoration: none;
}
#mainNav a.active {
  color: white;
  background: #25365c;
  box-shadow: inset 3px 0 #638dff;
}
#mainNav .icon {
  color: #a7b8d5;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 24px;
}
.mode {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  border-top: 1px solid #304160;
  font-size: 11px;
}
.mode i,
.badge i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}
.mode i {
  color: #e9b44c;
}
#logout {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: #1d2b49;
  border-color: transparent;
  color: white;
  padding: 12px;
}
#logout:hover {
  background: #293b5d;
}
#logout small {
  display: block;
  color: #acb9d0;
  font-size: 11px;
}
#logout b {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.avatar {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}
#logout .avatar {
  background: #2d3f66;
  color: white;
}
.main-shell {
  margin-left: 228px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
}
#breadcrumbs {
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}
#breadcrumbs ol {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
  flex-wrap: wrap;
}
#breadcrumbs li + li::before {
  content: "/";
  color: #8897ad;
  padding-right: 10px;
}
#breadcrumbs a {
  color: var(--muted);
}
#breadcrumbs [aria-current] {
  color: var(--ink);
  font-weight: 600;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.environment {
  border: 1px solid #ebd5a9;
  color: var(--warning);
  background: var(--amber-soft);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  white-space: nowrap;
}
#menuToggle {
  display: none;
}
#main {
  flex: 1;
  min-width: 0;
  padding: 36px 40px 48px;
}
#page {
  max-width: var(--page-max);
  margin: auto;
  min-height: 350px;
}
#page:focus {
  outline: none;
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-heading p {
  margin: 0;
  font-size: 14px;
  max-width: 700px;
}
.page-heading .actions {
  flex-shrink: 0;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  margin-bottom: 24px;
  min-width: 0;
}
.panel-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-header h2 {
  margin: 0;
  font-size: 16px;
}
.panel-body {
  padding: 24px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  padding: 20px;
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.stat-icon {
  color: var(--primary);
  display: flex;
}
.stat strong {
  display: block;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin: 16px 0 6px;
}
.stat small {
  font-size: 11px;
}
.stat.warning .stat-icon {
  color: var(--warning);
}
.stat.success .stat-icon {
  color: var(--success);
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  gap: 24px;
}
.columns > * {
  min-width: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  color: var(--muted);
  background: #edf0f5;
  white-space: nowrap;
}
.badge.active,
.badge.sent,
.badge.complete {
  background: var(--green-soft);
  color: var(--success);
}
.badge.pending,
.badge.submitted,
.badge.running {
  background: var(--blue-soft);
  color: var(--primary);
}
.badge.review,
.badge.warnings {
  background: var(--amber-soft);
  color: var(--warning);
}
.badge.failed,
.badge.interrupted {
  background: var(--red-soft);
  color: var(--danger);
}
.table-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-align: left;
  background: var(--soft);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 16px 20px;
  border-bottom: 1px solid #e8ecf2;
  max-width: 360px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #f8faff;
}
td small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}
td strong {
  font-weight: 600;
}
.customer {
  display: flex;
  gap: 10px;
  align-items: center;
}
.customer .avatar {
  background: #eef1f6;
  color: #526681;
}
.number {
  display: inline-block;
  background: var(--blue-soft);
  color: #244d9b;
  border: 1px solid #d7e2f7;
  border-radius: 4px;
  padding: 3px 7px;
  margin: 2px;
  font-size: 12px;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.empty {
  padding: 56px 24px;
  min-height: 300px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.empty-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--primary);
  border-radius: 12px;
  margin-bottom: 16px;
}
.empty h3 {
  font-size: 17px;
}
.empty p {
  max-width: 470px;
  font-size: 13px;
  margin-bottom: 20px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.filters label {
  flex: 1;
  min-width: 145px;
  margin: 0;
  font-size: 12px;
}
.filters .search {
  flex: 2;
  min-width: 250px;
}
.tabs {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  white-space: nowrap;
}
.tabs a {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 12px 2px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tabs a.active {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.notice {
  padding: 13px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #ebd5a9;
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--warning);
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0 22px;
}
.notice.info {
  background: var(--blue-soft);
  color: #244d9b;
  border-color: #ccdaf6;
}
.notice .icon {
  margin-top: 2px;
}
#notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  max-width: min(480px, calc(100vw - 32px));
  padding: 14px 18px;
  border: 1px solid #c2d0e6;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 24px #15213a20;
  font-size: 13px;
  white-space: pre-wrap;
}
#notice[data-tone="error"] {
  color: var(--danger);
  border-color: #e5b6b1;
}
#notice[data-tone="success"] {
  color: var(--success);
  border-color: #b9d9c7;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 28px;
}
.field small {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}
.field div {
  overflow-wrap: anywhere;
}
.field.wide {
  grid-column: 1/-1;
}
.list-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}
.list-line:last-child {
  border: 0;
}
.list-line small {
  display: block;
  margin-top: 5px;
}
.quick-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-size: 13px;
}
.quick-link:hover {
  background: var(--soft);
  text-decoration: none;
}
.quick-link span {
  display: flex;
  gap: 12px;
  align-items: center;
}
.break {
  white-space: normal;
  overflow-wrap: anywhere;
}
pre {
  padding: 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  max-height: 480px;
  font-size: 12px;
  line-height: 1.8;
}
summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  padding: 10px 0;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 22px;
  min-width: 0;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: var(--control-height);
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
}
input::placeholder,
textarea::placeholder {
  color: #74839a;
}
input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
  margin: 2px 0;
}
input[type="file"] {
  padding: 20px;
  border-style: dashed;
  background: var(--soft);
}
input[type="file"]::file-selector-button {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--primary);
  margin-right: 12px;
  cursor: pointer;
}
textarea,
.resize-none {
  resize: none;
  min-height: 120px;
}
.check-label {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
}
.check-label small {
  display: block;
  font-weight: 400;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}
.full-field {
  grid-column: 1/-1;
}
.field-hint,
label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
}
.form-layout {
  max-width: 1080px;
}
.form-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  background: var(--soft);
  border-radius: 0 0 10px 10px;
}
.form-error {
  margin: 20px 24px;
  padding: 12px 16px;
  background: var(--red-soft);
  color: var(--danger);
  border: 1px solid #e5b6b1;
  border-radius: 6px;
}
.field-error {
  display: block;
  color: var(--danger);
  font-size: 12px;
  font-weight: 400;
}
[aria-invalid="true"] {
  border-color: var(--danger);
}
.secret-control,
.search-control {
  display: flex;
  align-items: stretch;
  min-width: 0;
  position: relative;
}
.secret-control input {
  border-radius: 6px 0 0 6px;
}
.secret-control button {
  border-radius: 0 6px 6px 0;
  border-left: 0;
  font-size: 12px;
  padding: 8px 12px;
  color: var(--muted);
  background: var(--soft);
  flex-shrink: 0;
}
.search-control input {
  padding-right: 38px;
}
.search-control button {
  position: absolute;
  inset: 1px 1px 1px auto;
  min-height: 0;
  width: 36px;
  border: 0;
  background: transparent;
  font-size: 20px;
  padding: 0;
}
.wizard {
  max-width: 1080px;
}
.stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  overflow-x: auto;
}
.stepper .step {
  display: flex;
  justify-content: flex-start;
  text-align: left;
  gap: 9px;
  min-height: 80px;
  padding: 15px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  white-space: nowrap;
}
.stepper .step.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  background: #fafcff;
}
.stepper b {
  font-size: 13px;
  font-weight: 600;
  display: block;
}
.stepper small {
  font-size: 11px;
  font-weight: 400;
  display: block;
  margin-top: 3px;
}
.step-number {
  flex-shrink: 0;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #edf0f5;
  color: var(--muted);
  font-size: 12px;
}
.active .step-number {
  background: var(--primary);
  color: white;
}
.visited .step-number {
  background: var(--green-soft);
  color: var(--success);
}
.wizard-body {
  padding: 28px;
}
.step-heading {
  margin-bottom: 26px;
}
.step-heading h2 {
  margin: 0 0 6px;
  outline: none;
}
.step-heading p {
  margin: 0;
  max-width: 760px;
  font-size: 14px;
}
.wizard-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #f9fafc;
  border-top: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  padding: 16px 28px;
}
.wizard-footer > div:first-child {
  font-size: 12px;
  color: var(--ink);
}
.wizard-footer small {
  display: block;
  font-size: 11px;
  margin-top: 3px;
}
.connection-action {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.connection-status {
  color: var(--muted);
  font-size: 12px;
}
.connection-result {
  min-height: 30px;
  font-size: 13px;
}
.connection-result:empty {
  min-height: 0;
}
.helper-panel {
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  margin-top: 20px;
}
.helper-panel p {
  margin: 4px 0 0;
  font-size: 13px;
}
.integration-panel {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
}
.integration-panel > header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}
.integration-panel h3 {
  margin: 0 0 3px;
  font-size: 16px;
}
.integration-panel header p {
  margin: 0;
  font-size: 12px;
}
.integration-mark {
  width: 36px;
  height: 36px;
  background: var(--blue-soft);
  color: var(--primary);
  font-weight: 700;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.integration-mark.hubspot {
  background: #fff1e9;
  color: #a84b21;
}
.mapping-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--muted);
}
.mapping-toolbar button {
  font-size: 12px;
}
.mapping-header,
.map-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(220px, 1.35fr) minmax(
      150px,
      1fr
    );
  gap: 14px;
  align-items: start;
}
.mapping-header {
  padding: 11px 12px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  color: var(--muted);
}
.mapping-group {
  margin-top: 24px;
}
.mapping-group h3 {
  padding-bottom: 10px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.map-row {
  padding: 16px 12px;
  border-bottom: 1px solid #e8ecf2;
}
.map-row label {
  margin: 0;
}
.map-label b {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.map-label small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  margin-top: 3px;
}
.map-row input {
  font-family: var(--font-mono);
  font-size: 12px;
}
.map-row select {
  padding-left: 8px;
  font-size: 12px;
}
.mapping-state {
  font-size: 11px;
  color: var(--muted);
}
.mapping-state.mapped {
  color: var(--success);
}
.mapping-origin {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.mapping-origin > label:first-child select {
  background: var(--soft);
  height: 34px;
  min-height: 34px;
}
.mapping-origin [data-source-picker],
.extra-row [data-source-picker] {
  font-family: var(--font-mono);
  width: 100%;
}
.mapping-origin input:not([hidden]) {
  margin-top: 6px;
}
.mapping-result {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  background: var(--soft);
  border-radius: var(--radius-control);
}
.mapping-format {
  font-size: 11px;
  line-height: 1.5;
}
#mappingSuggestions:not(:empty) {
  padding: 18px;
  border: 1px solid #ccdaf6;
  background: #f8faff;
  border-radius: 8px;
  margin: 16px 0;
}
#mappingSuggestions .notice {
  margin-top: 0;
}
#mappingSuggestions small {
  display: block;
}
.extra-section {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.extra-section summary {
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}
.extra-section summary span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 12px;
}
.extra-content {
  padding-top: 16px;
}
.extra-content > p {
  font-size: 13px;
}
.extra-content > small {
  display: block;
  margin-top: 12px;
}
.extra-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  gap: 12px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.extra-row > button {
  margin-top: 27px;
}
.extra-row label {
  margin: 0;
  font-size: 12px;
}
.extra-row small {
  font-size: 10px;
}
.schedule-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.schedule-options label {
  max-width: 240px;
}
.hour-shortcuts {
  display: flex;
  gap: 8px;
}
.hour-shortcuts button {
  min-height: 32px;
  padding: 4px 12px;
}
.review-title {
  margin: 28px 0 14px;
}
.review-list {
  border: 1px solid var(--border);
  border-radius: 8px;
}
.review-list > div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.review-list > div:last-child {
  border: 0;
}
.review-list b {
  font-weight: 500;
}
.review-list span {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.review-list button {
  border-color: transparent;
  color: var(--primary);
  padding: 6px;
  min-height: 32px;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  color: var(--ink);
  box-shadow: 0 18px 60px #111e3240;
  overflow: auto;
}
dialog::backdrop {
  background: #15213a88;
}
.dialog-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.dialog-head h2 {
  margin: 0;
  font-size: 19px;
}
.dialog-body {
  padding: 24px;
}
.dialog-footer {
  padding: 18px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--soft);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
}
.dialog-destination {
  padding: 16px;
  background: var(--soft);
  border-radius: 8px;
  margin-bottom: 20px;
}
.dialog-destination b,
.dialog-destination small {
  display: block;
  overflow-wrap: anywhere;
}
.dialog-destination b {
  margin: 5px 0;
}
.dialog-error,
#actionError,
#loginError {
  color: var(--danger);
  font-size: 13px;
}
.main-shell > footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 40px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}
#login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--surface);
}
.login-story {
  padding: 48px 60px;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  min-height: 100vh;
}
.login-story h1 {
  font-size: 44px;
  line-height: 1.25;
  margin: 22px 0;
}
.login-story p,
.login-story small,
.login-story .eyebrow {
  color: #b2c2dc;
}
.login-story p {
  max-width: 360px;
}
.login-steps {
  display: flex;
  gap: 30px;
  color: #9eb7e3;
  margin-top: 32px;
}
.login-steps b {
  display: block;
  font-size: 13px;
  margin-top: 6px;
  color: white;
}
.login-access {
  display: grid;
  place-items: center;
  padding: 40px;
}
.login-box {
  width: 100%;
  max-width: 380px;
}
.login-box h2 {
  font-size: 28px;
  margin: 16px 0 12px;
}
.login-box p {
  margin-bottom: 28px;
}
.login-foot {
  display: block;
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
}
.loading {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 1200px) {
  #main {
    padding: 28px 24px;
  }
  .topbar {
    padding-inline: 24px;
  }
  .columns {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    gap: 12px;
  }
  .stepper .step {
    gap: 6px;
    padding: 14px 8px;
  }
  .stepper small {
    font-size: 10px;
  }
  .map-row,
  .mapping-header {
    grid-template-columns: minmax(120px, 0.8fr) minmax(190px, 1.2fr) minmax(
        140px,
        1fr
      );
  }
  .mapping-header span:last-child {
    display: block;
  }
  .mapping-state {
    margin-top: 0;
  }
}
@media (max-width: 900px) {
  #sidebar {
    transform: translateX(-100%);
    visibility: hidden;
  }
  body.menu-open #sidebar {
    transform: translateX(0);
    visibility: visible;
  }
  body.menu-open {
    overflow: hidden;
  }
  #overlay {
    position: fixed;
    inset: 0;
    background: #15213a77;
    border: 0;
    z-index: 35;
    border-radius: 0;
  }
  body.menu-open #overlay {
    display: block !important; /* Drawer overlay is hidden by default; opened by body state. */
  }
  .main-shell {
    margin-left: 0;
  }
  #menuToggle {
    display: inline-flex;
  }
  .topbar {
    height: 64px;
    padding-inline: 16px;
    gap: 10px;
  }
  .topbar-right {
    gap: 6px;
  }
  .small-avatar {
    display: none;
  }
  #breadcrumbs ol {
    gap: 6px;
    font-size: 11px;
  }
  #breadcrumbs li + li::before {
    padding-right: 6px;
  }
  #breadcrumbs li:first-child {
    display: none;
  }
  #breadcrumbs li:nth-child(2)::before {
    display: none;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stepper {
    grid-template-columns: repeat(5, minmax(145px, 1fr));
  }
  .stepper .step {
    padding: 12px;
    min-height: 70px;
  }
  .wizard-footer {
    position: static;
  }
  .extra-row {
    grid-template-columns: 1fr 1fr;
  }
  .extra-row > button {
    margin: 0;
    justify-self: start;
    align-self: end;
  }
  .login-story {
    padding: 32px;
  }
  .login-story h1 {
    font-size: 34px;
  }
}
@media (max-width: 600px) {
  #main {
    padding: 24px 16px 32px;
  }
  h1 {
    font-size: 26px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  .page-heading p {
    font-size: 13px;
  }
  .topbar-right #refresh {
    display: none;
  }
  .environment {
    font-size: 10px;
    padding: 4px 7px;
  }
  .stat {
    padding: 16px;
  }
  .stat strong {
    font-size: 28px;
  }
  .stat-top {
    font-size: 11px;
  }
  .stat-icon {
    display: none;
  }
  .panel-header,
  .panel-body,
  .wizard-body {
    padding: 20px 16px;
  }
  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .filters {
    padding: 16px;
  }
  .filters .search {
    min-width: 100%;
  }
  .pagination {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }
  .tabs {
    gap: 18px;
  }
  .panel-header {
    flex-wrap: wrap;
  }
  .mapping-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .mapping-header {
    display: none;
  }
  .map-row {
    grid-template-columns: 1fr;
    padding: 16px 0;
    gap: 8px;
  }
  .mapping-state {
    grid-column: 1;
    margin-top: 0;
  }
  .map-label b {
    font-size: 13px;
  }
  .map-label small {
    font-size: 11px;
  }
  .extra-row {
    grid-template-columns: 1fr;
  }
  .extra-section summary span {
    display: block;
    margin: 6px 0 0;
  }
  .integration-panel {
    padding: 16px;
  }
  .wizard-footer {
    padding: 16px;
    flex-wrap: wrap;
  }
  .wizard-footer .actions {
    width: 100%;
    justify-content: space-between;
  }
  .review-list > div {
    grid-template-columns: 1fr auto;
    gap: 6px;
  }
  .review-list span {
    grid-row: 2;
  }
  .review-list button {
    grid-column: 2;
    grid-row: 1/3;
  }
  .form-footer {
    flex-wrap: wrap;
    padding: 16px;
  }
  .form-error {
    margin: 16px;
  }
  .main-shell > footer {
    padding: 18px 16px;
  }
  .main-shell > footer span {
    display: none;
  }
  #login {
    grid-template-columns: 1fr;
  }
  .login-story {
    display: none;
  }
  .login-access {
    min-height: 100vh;
    padding: 28px;
  }
  .dialog-head,
  .dialog-body,
  .dialog-footer {
    padding: 18px;
  }
  .dialog-footer {
    flex-wrap: wrap;
  }
  #notice {
    right: 16px;
    bottom: 16px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important; /* Accessibility preference overrides animation recipes. */
  }
}
@media (forced-colors: active) {
  * {
    scrollbar-color: auto;
  }
  :focus-visible {
    outline-color: Highlight;
  }
  .badge,
  .notice,
  .step-number {
    border: 1px solid CanvasText;
  }
}
