:root {
  --canvas: #f5f6f8;
  --white: #fff;
  --ink: #222431;
  --muted: #595e70;
  --border: #e1e3ea;
  --purple: #594487;
  --purple-dark: #493772;
  --purple-soft: #f0ecf6;
  --good: #137550;
  --good-bg: #e9f7ef;
  --bad: #a53451;
  --bad-bg: #fff0f3;
  --wait: #8a5608;
  --wait-bg: #fff5df;
  --shadow: none;
  font: 15px/1.5 "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 290px; }
h1, h2, h3, p, dl, ol, ul, pre { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .54; }
a { color: var(--purple-dark); }
code, .number { font: .9em/1.55 "IBM Plex Mono", Consolas, monospace; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid #8c65ef; outline-offset: 3px; }
.dot { display: inline-block; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.auth-screen { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: 24px; background: var(--canvas); }
.auth-card { width: min(100%, 440px); border: 1px solid var(--border); border-radius: 10px; padding: clamp(23px, 6vw, 33px); background: var(--white); }
.auth-card h1 { font-size: clamp(1.4rem, 5vw, 1.65rem); margin: 16px 0 19px; line-height: 1.12; }
.auth-card form { display: grid; }
.auth-card input { margin: 6px 0 14px; }
.auth-card .primary { margin: 7px 0 4px; }
.auth-card .form-message { min-height: 1.5em; }

.wordmark { display: flex; align-items: center; gap: 0; white-space: nowrap; color: var(--ink); font-size: 1.53rem; font-weight: 400; letter-spacing: -.035em; line-height: 1; }
.wordmark > span:last-child { color: var(--purple); }
.brand-icon { display: block; width: 34px; height: 34px; margin-right: 9px; padding: 2px; border-radius: 8px; background: #fff; object-fit: contain; }
.app-shell { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; align-self: start; min-height: 100vh; min-height: 100dvh; max-height: 100dvh; overflow-y: auto; padding: 21px 12px 16px; border-right: 1px solid #252834; background: #252834; }
.sidebar-brand { padding: 2px 10px 23px; }
.brand-caption { display: block; margin-top: 10px; color: var(--muted); font-size: .8rem; font-weight: 500; letter-spacing: .025em; }
.navigation { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 7px; min-height: 35px; width: 100%; padding: 0 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #dce0ea; font-size: .88rem; font-weight: 500; text-align: left; white-space: nowrap; }
.nav-item:hover { background: #333746; color: #fff; }
.navigation a.nav-item { text-decoration: none; }
.nav-item[aria-current="page"] { border-color: #50476a; color: #fff; background: #39344a; box-shadow: inset 2px 0 #b6a3db; }

.topbar { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 24px; background: #fff; border-bottom: 1px solid var(--border); }
.topbar-left, .account { display: flex; min-width: 0; align-items: center; gap: 12px; }
.topbar-left { flex-wrap: wrap; }
.merchant-context { max-width: 100%; gap: 6px; }
.merchant-context span { color: var(--muted); white-space: nowrap; }
.merchant-context code { min-width: 0; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-access { margin-top: 15px; font-size: .84rem; }
.login-access summary { cursor: pointer; }
.login-access p { margin-block: 8px; color: var(--muted); }
.connection-steps { margin: 0; padding: 0 17px 13px 38px; font-size: .88rem; }
.connection-steps li + li { margin-top: 6px; }
.account { justify-content: flex-end; }
.account-text { min-width: 0; display: grid; text-align: right; line-height: 1.25; }
.account-text strong, .account-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text strong { font-size: .91rem; }
.account-text small { color: var(--muted); font-size: .76rem; margin-top: 4px; }
.main-body { width: 100%; max-width: 1480px; padding: 22px 24px 34px; margin-inline: auto; }
.page { display: grid; gap: 16px; }
.section-header { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 14px; }
h1 { font-size: clamp(1.6rem, 4vw, 1.95rem); line-height: 1.1; font-weight: 500; letter-spacing: -.043em; }
.section-header p { margin-top: 7px; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; min-height: 37px; border: 1px solid transparent; border-radius: 8px; background: #fff; color: var(--ink); font-size: .86rem; font-weight: 500; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.button.primary { min-height: 42px; padding: 10px 15px; color: #fff; background: var(--purple); border-color: var(--purple); }
.button.primary:not(:disabled):hover { border-color: var(--purple-dark); background: var(--purple-dark); }
.button.secondary { border-color: #e5dff0; color: #514671; }
.button.quiet { color: #514671; }
.button.secondary:not(:disabled):hover, .button.quiet:not(:disabled):hover, .icon-button:not(:disabled):hover { background: #f5f1ff; color: var(--purple-dark); border-color: #e4d8fb; }
.button.compact { min-height: 29px; padding: 5px 8px; font-size: .79rem; }
.plus { line-height: .7; font-size: 1.3rem; font-weight: 480; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric, .card { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.metric { padding: 8px 12px; min-height: 64px; }
.metric p { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); font-weight: 500; }
.metric strong { display: block; margin-top: 3px; font-size: 1.4rem; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
h2 { font-size: 1.16rem; line-height: 1.25; font-weight: 500; letter-spacing: -.021em; }
h3 { font-size: 1rem; font-weight: 500; letter-spacing: -.015em; }
.card-header, .table-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; }
.table-scroll { overflow-x: auto; }
.orders-table { width: 100%; min-width: 600px; text-align: left; border-collapse: collapse; }
.orders-table th { padding: 10px 14px; border-block: 1px solid #efedf4; background: #faf9fd; color: var(--muted); font-weight: 500; font-size: .79rem; white-space: nowrap; }
.orders-table td { padding: 8px 12px; border-bottom: 1px solid #efedf4; font-size: .86rem; }
.orders-table th:first-child, .orders-table td:first-child { padding-left: 17px; }
.orders-table th:last-child, .orders-table td:last-child { padding-right: 17px; }

.orders-table tbody tr:hover { background: #faf8fe; }
.orders-table td.empty { padding: 32px 17px; color: var(--muted); text-align: center; }
.order-link { padding: 2px 0; border: none; color: var(--purple-dark); background: transparent; text-align: left; }
.order-link:hover { text-decoration: underline; }
.table-footer { min-height: 54px; padding-block: 10px; color: var(--muted); font-size: .83rem; }
.pagination { display: flex; align-items: center; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; border-radius: 99px; padding: 4px 8px; background: #f0edf7; color: #564a6d; font-size: .77rem; font-weight: 500; line-height: 1.25; }
.pill .dot { width: 5px; height: 5px; flex-basis: 5px; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.wait { background: var(--wait-bg); color: var(--wait); }
.mode { font-size: .8rem; color: var(--muted); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.key-values > div { display: grid; grid-template-columns: minmax(100px, .85fr) minmax(0, 1.5fr); gap: 8px 12px; align-items: baseline; padding: 12px 17px; border-top: 1px solid #efedf4; }
.key-values dt { color: var(--muted); font-size: .87rem; }
.key-values dd { min-width: 0; margin: 0; font-size: .9rem; font-weight: 500; overflow-wrap: anywhere; }
#connection-key > button { display: block; margin-block-start: 10px; }
.key-values dd small { display: block; margin-top: 4px; font-size: .81rem; font-weight: 450; color: var(--muted); }
#copy-url { margin-top: 4px; }
.scenario-list { list-style: none; padding: 0; }
.scenario-list li, .resource-list a { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid #efedf4; min-height: 47px; padding: 10px 17px; font-size: .88rem; }
.scenario-list code { font-size: .82rem; padding: 3px 6px; color: #5938a3; background: #f3edff; border-radius: 5px; }
.resource-list a { text-decoration: none; font-weight: 500; }
.resource-list a:hover { background: #f8f5ff; }
.resource-list a span { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.command-card pre { margin: 0 17px 10px; overflow-x: auto; padding: 14px 16px; border-radius: 9px; background: #242039; color: #f6f2ff; }
.command-card pre code { overflow-wrap: normal; }
.command-card .form-message { margin: 0 17px 10px; }

label { display: block; font-size: .84rem; font-weight: 500; }
input, select { width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border: 1px solid #ded9eb; border-radius: 8px; background: #fff; color: var(--ink); }
input:disabled, select:disabled { background: #f7f5fb; color: #59516e; cursor: default; opacity: 1; }
input:focus, select:focus { border-color: #8b66dc; }
.form-message { color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
.form-message.error, .notice.error { color: var(--bad); }
.notice { padding: 10px 12px; border-radius: 8px; background: #f5f0ff; color: #594284; font-size: .84rem; }
.notice.error { background: var(--bad-bg); }
#global-message { margin-bottom: 14px; }
.orders-card .notice { margin: 0 17px 10px; }

.modal { width: min(530px, calc(100% - 28px)); max-height: calc(100% - 30px); padding: 0; color: var(--ink); border: 1px solid var(--border); border-radius: 17px; box-shadow: 0 18px 75px #21104342; }
.modal::backdrop { background: #1d122d62; }
.modal-header { display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.48rem; }
.modal-header code { display: block; margin-top: 5px; color: var(--muted); }
.icon-button { width: 33px; height: 33px; min-height: auto; padding: 0; border-color: var(--border); color: var(--muted); font-size: 1.25rem; }
.modal-body { display: grid; gap: 13px; padding: 16px 20px; }
.test-fields { display: grid; grid-template-columns: minmax(95px, 1fr) minmax(155px, 1.35fr); gap: 10px; }
.test-fields label { margin-bottom: 5px; }
.preview { display: grid; gap: 3px; padding: 9px 11px; border-radius: 8px; background: #f8f5fe; }
.preview > span, .field-caption { color: var(--muted); font-size: .8rem; font-weight: 500; }
.preview code { color: #5637a7; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.detail-modal { width: min(800px, calc(100% - 28px)); }
#payment-json-items details { padding: 10px 0; border-bottom: 1px solid var(--line); }
#payment-json-items summary { cursor: pointer; overflow-wrap: anywhere; }
#payment-json-items pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow-y: auto; margin: 10px 0; }
.detail-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 11px; }
.detail-summary > div { display: grid; gap: 4px; align-content: start; padding: 9px 11px; border-radius: 9px; background: #f8f5fe; }
.detail-summary strong { font-size: 1.02rem; overflow-wrap: anywhere; }
.detail-values { margin: 6px 0 0; }
.detail-values > div { padding: 7px 0; }
.detail-block { padding-top: 10px; }
.detail-block p { margin-top: 5px; color: var(--muted); font-size: .84rem; }
.inline-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.events { list-style: none; padding: 0; margin-top: 7px; }
.events li { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; padding: 8px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; }
.events > li > .pill, .event-status { margin-left: auto; }
.event-status { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; }
.event-evidence { flex: 1 1 100%; display: grid; gap: 3px; margin: 0; }
.event-evidence > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 8px; }
.event-evidence dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.empty-event { color: var(--muted); }
 
@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 188px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .topbar, .main-body { padding-inline: 21px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 660px) {
  .app-shell { display: block; }
  .sidebar { position: static; min-height: auto; max-height: none; overflow-y: visible; gap: 10px; padding: 14px 12px 9px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 0 2px; }
  .brand-caption { margin-top: 0; }
  .navigation { display: flex; gap: 4px; }
  .nav-item { width: auto; min-height: 36px; padding: 4px 7px; gap: 6px; font-size: .82rem; }
  .nav-icon { transform: scale(.8); }
  .topbar { min-height: 53px; padding: 7px 12px; }
  .main-body { padding: 20px 12px 30px; }
  .page { gap: 15px; }
  .metric-grid { gap: 8px; }
  .metric { min-height: 60px; padding: 7px 10px; }
  .metric strong { font-size: 1.55rem; }
  .section-header { align-items: start; }
  .section-header .button { min-height: 36px; padding: 8px 10px; }
}

@media (max-width: 350px) {
  .nav-icon { display: none; }
  .account-text small { display: none; }
  .test-fields { grid-template-columns: 1fr; }
  .table-footer, .card-header, .key-values > div { padding-inline: 10px; }
}

.auth-product { margin-top: 10px; color: var(--muted); font-size: .82rem; font-weight: 500; }
.auth-card h1 { margin-top: 24px; }
.sidebar .wordmark { color: #fff; }
.sidebar .wordmark > span:last-child { color: #fff; }
.sidebar .brand-caption { color: #cacddb; }
.admin-nav { display: grid; gap: 10px; margin-top: 14px; }

.mode-menu { position: relative; z-index: 3; }
.mode-trigger { display: inline-flex; align-items: center; gap: 8px; min-height: 33px; padding: 5px 9px; border: 1px solid #ded7eb; border-radius: 6px; background: #f6f3f9; color: var(--purple-dark); font-size: .82rem; font-weight: 500; white-space: nowrap; cursor: pointer; list-style: none; }
.mode-trigger::-webkit-details-marker { display: none; }
.mode-trigger .dot { width: 6px; height: 6px; flex-basis: 6px; }
.chevron { width: 6px; height: 6px; margin: -2px 1px 0 3px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.mode-menu[open] .chevron { margin-top: 3px; transform: rotate(225deg); }
.mode-popover { position: absolute; top: calc(100% + 7px); left: 0; width: min(260px, calc(100vw - 24px)); padding: 6px; border: 1px solid #e6dfef; border-radius: 11px; background: #fff; box-shadow: 0 13px 32px #26174320; }
.mode-popover .form-message:not(:empty) { padding: 7px 8px 5px; }
.mode-option { display: grid; width: 100%; gap: 3px; min-height: 35px; padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; font-size: .87rem; }
.mode-option:hover:not(:disabled), .mode-option[aria-pressed="true"] { background: var(--purple-soft); color: var(--purple-dark); }
.mode-option small { color: var(--muted); font-size: .76rem; }
.mode-option:disabled { opacity: 1; color: #615a70; }

.account { gap: 5px; }
.account-button { justify-content: flex-end; gap: 8px; min-width: 0; padding: 4px 7px; border: 1px solid transparent; }
.account-button:hover, .account-button[aria-current="page"] { border-color: #e9dff9; background: #f8f4ff; }
.account-initial { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; background: #eee6fa; color: var(--purple-dark); font-size: .89rem; font-weight: 500; }
.account-text { text-align: left; }
.account-text strong { color: var(--ink); }
.account-text small { margin-top: 3px; font-weight: 500; }

.orders-table .time-cell { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.orders-table .amount-cell { text-align: right; white-space: nowrap; }
.orders-table.with-partner { min-width: 870px; }
.orders-table .order-link { display: grid; gap: 1px; min-width: 0; line-height: 1.3; }
.orders-table .order-link code { font-weight: 500; }
.internal-id { display: block; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font: .72rem/1.35 "IBM Plex Mono", Consolas, monospace; white-space: nowrap; }
.admin-table { min-width: 635px; }
.api-key-table { min-width: 580px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.danger-text { color: var(--bad) !important; }
.button.primary.danger { background: #ad3451; border-color: #ad3451; box-shadow: none; }
.button.primary.danger:not(:disabled):hover { background: #8e2941; border-color: #8e2941; }
.card-notice { margin: 0 17px 10px; }

.profile-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.profile-form { display: grid; gap: 9px; padding: 0 17px 16px; }
.profile-form > button { justify-self: start; margin-top: 4px; }
.profile-form input, .form-label select, .form-grid input { display: block; margin-top: 5px; }
.field-help { color: var(--muted); font-size: .8rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.secondary-text { color: var(--muted); font-size: .87rem; }
.credential-value { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid #e9e4f2; border-radius: 8px; background: #faf8fd; }
.credential-value span { display: block; margin-bottom: 3px; color: var(--muted); font-size: .78rem; font-weight: 500; }
.credential-value code { color: var(--ink); user-select: all; }

@media (max-width: 1000px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 660px) {
  .sidebar .navigation { overflow-x: auto; padding: 1px 0 4px; scrollbar-width: thin; }
  .admin-nav { display: flex; gap: 4px; margin: 0 0 0 4px; padding: 0 0 0 4px; border-left: 1px solid #4b505f; }
  .account-button { padding-inline: 4px; }
  .account-initial { width: 26px; height: 26px; flex-basis: 26px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 350px) {
  .account-initial { display: none; }
}

.nav-group { display: grid; gap: 2px; }
.nav-heading { display: block; padding: 2px 10px 3px; color: #bcc0ce; font-size: .75rem; font-weight: 500; }
.header-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.catalog-table { min-width: 450px; }
#catalog[data-section="routes"] .catalog-table { min-width: 840px; }
.catalog-table th, .catalog-table td { vertical-align: top; }
.catalog-secondary { display: block; margin-top: 2px; color: var(--muted); font-size: .75rem; line-height: 1.35; overflow-wrap: anywhere; }
.catalog-link { text-align: left; }
.catalog-fields label { min-width: 0; }
#catalog .card-notice { margin-top: 10px; }
#order-direction { margin-top: 4px; }
.catalog-table thead th { border-top: 0; }

@media (max-width: 660px) {
  .nav-group { display: flex; gap: 4px; padding: 0 0 0 4px; }
  .nav-group + .nav-group { border-left: 1px solid #4b505f; }
  .nav-heading { display: none; }
}

.live-form .test-fields { grid-template-columns: minmax(0, 1fr); }
#live-qr { display: block; width: 100%; min-height: 82px; margin-top: 5px; padding: 8px 9px; border: 1px solid #dedde5; border-radius: 6px; color: var(--ink); background: #fff; resize: vertical; font: .86rem/1.45 "IBM Plex Mono", Consolas, monospace; }
#live-qr:disabled { color: var(--muted); background: #f6f6f8; }

/* Keep text emphasis restrained across native controls and semantic headings. */
strong, b { font-weight: 500; }
.nav-item, .brand-caption, .auth-product, .nav-heading { font-weight: 400; }
h1, h2, h3 { letter-spacing: -.015em; }


.payment-grid { display: grid; grid-template-columns: minmax(270px, .85fr) minmax(0, 1.2fr); align-items: start; gap: 16px; }
.operations-form { display: grid; gap: 10px; padding: 0 13px 13px; }
.operations-form input, .operations-form select, #limit-form input, #limit-form select { display: block; margin-top: 4px; }
.operations-form textarea, #adapter-control-reason { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid #ded9eb; border-radius: 6px; background: #fff; color: var(--ink); resize: vertical; font: .85rem/1.45 "IBM Plex Mono", Consolas, monospace; }
.operations-form textarea:read-only { background: #f6f6f8; color: var(--muted); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.quote-footer { display: grid; gap: 9px; padding: 12px 13px; border-top: 1px solid var(--border); }
.quote-limit-section > h3 { padding: 11px 17px 6px; border-top: 1px solid var(--border); }
.quote-violations { display: grid; gap: 5px; list-style: none; padding: 0 17px 6px; color: var(--bad); font-size: .83rem; }
.quote-violations:empty { padding-bottom: 0; }
.quote-card > .key-values dd { font-weight: 400; }
.quote-card .key-values code { font-size: .82rem; }
.limits-table { min-width: 900px; }
.limits-table th { white-space: normal; }
.limits-table th:first-child { min-width: 145px; }
.limits-table td { vertical-align: top; }
.rates-table th { white-space: normal; }
.rates-table td { vertical-align: top; }
#rate-form input, #rate-form select { display: block; margin-top: 4px; }
#limits .card-notice { margin-top: 10px; }
#limit-dialog .modal-body { gap: 11px; }

@media (max-width: 1050px) {
  .payment-grid { grid-template-columns: minmax(0, 1fr); }
}

.payment-lookup { display: flex; flex-wrap: wrap; gap: 9px; align-items: end; padding: 10px 13px; }
.payment-lookup label { width: min(360px, 100%); flex: 1 1 220px; }
.payment-lookup input { display: block; margin-top: 4px; }
.payment-lookup .field-help { flex: 1 1 100%; }


.overview-actions { display:flex; flex-wrap:wrap; gap:7px; }
.routing-overview-table { min-width:1050px; }
.routing-overview-table td { vertical-align:top; }
.filter-bar { display:flex; flex-wrap:wrap; align-items:end; gap:10px; padding:11px 13px; }
.filter-bar label { flex:1 1 145px; min-width:130px; }
.filter-bar .filter-search { flex-basis:180px; }
.filter-bar input,.filter-bar select { display:block; margin-top:4px; }
.filter-bar .header-actions { margin-left:auto; }
.nav-heading.nav-item { font-size:.84rem; min-height:31px; padding-top:4px; padding-bottom:4px; }
.user-scope-section { border-top:1px solid var(--border); padding-top:9px; }
.user-scope-section > summary { cursor:pointer; font-size:.88rem; font-weight:500; }
.user-scope-section .field-help { margin-top:7px; }
.scope-axis { min-width:0; margin:9px 0 0; padding:9px; border:1px solid var(--border); border-radius:6px; }
.scope-axis legend { padding:0 4px; font-size:.82rem; }
.scope-axis > select { min-height:34px; }
.tab-visibility > label { display: inline-grid; gap: 4px; margin-right: 8px; }
.tab-visibility .field-help { margin-top: 8px; }
.tab-visibility input:disabled + span { color: var(--muted); }
.tab-preview { margin-top: 3px; font-size: .8rem; overflow-wrap: anywhere; }
.scope-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin-top:8px; max-height:210px; overflow:auto; }
.checkbox-label { display:flex; gap:7px; align-items:start; font-size:.79rem; line-height:1.4; overflow-wrap:anywhere; font-weight:400; }
.checkbox-label input { flex:0 0 15px; width:15px; min-height:15px; height:15px; margin:2px 0 0; }
.audit-help { padding:0 13px 10px; color:var(--muted); font-size:.79rem; }
@media(max-width:660px) {
  .nav-heading.nav-item { display:flex; }
  .filter-bar label { min-width:110px; }
  .scope-choices { grid-template-columns:minmax(0,1fr); }
  .topbar-left { gap: 6px; }
  .merchant-context span { display: none; }
}

.history-status { margin:0 13px 10px; color:var(--muted); font-size:.79rem; overflow-wrap:anywhere; }
.history-status.warning { padding:7px 9px; border-radius:5px; color:var(--wait); background:var(--wait-bg); }
.order-origin { display:block; margin-bottom:3px; color:var(--muted); font-size:.73rem; line-height:1.25; }
.order-payee { display:block; max-width:32ch; margin-top:3px; color:var(--ink); font-size:.8rem; line-height:1.35; overflow-wrap:anywhere; }
.order-subline { display:block; margin-top:3px; color:var(--muted); font-size:.76rem; line-height:1.35; overflow-wrap:anywhere; }
.orders-table .amount-cell .order-subline { white-space:normal; }

.automation-table { min-width:900px; }
.connection-details { margin-top:5px; font-size:.79rem; color:var(--muted); }
.connection-details summary { cursor:pointer; }
.automation-table td { vertical-align:top; }
#automation-live-opt-in { padding:8px; border:1px solid var(--border); border-radius:5px; }
#profile-directory-form > label > input,#profile-directory-form > label > select,#automation-form label > select { display:block; margin-top:4px; }

.detail-technical { margin-top:12px; padding-top:10px; border-top:1px solid var(--border); }
.detail-technical > summary { cursor:pointer; font-size:.86rem; color:var(--muted); }
