/* Client portal: the Switchboard / Fleet Desk design tokens. */
:root {
  --body-font: "Segoe UI", "Helvetica Neue", sans-serif;
  --display-font: Bahnschrift, "Aptos Display", "Segoe UI", sans-serif;
  --canvas: #171815; --surface: #20221e; --elevated: #292c26;
  --text: #f3f2e9; --muted: #b2b7a9; --border: #3c4135;
  --accent: #f4b860; --accent-ink: #282115; --accent-hover: #ffca7d;
  --selected: #f4b8600b; --accent-border: #9d7d4c; --focus: #f4b860;
  --disabled: #30332b; --warning: #ffcb8b; --code: #dedfcb;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 13px/1.5 var(--body-font); -webkit-font-smoothing: antialiased; }
/* The signed-in workspace and its dialogs read at the larger app size; sign-in keeps 13px. */
.shell, dialog { font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; background: transparent; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { border-radius: 5px; }
p, h1, h2, h3, figure { margin: 0; }
p { line-height: 1.65; }
h1, h2 { font-family: var(--display-font); }
h1, h2, h3 { text-wrap: balance; }
code, pre, .mono { font-family: Consolas, "SFMono-Regular", "Liberation Mono", monospace; font-variant-numeric: tabular-nums; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.clipboard-buffer { position: fixed; top: -1000px; left: -1000px; width: 1px; height: 1px; opacity: 0; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px 18px; color: var(--accent-ink); background: var(--accent); border-radius: 5px; }
.skip-link:focus { top: 12px; }
.boot { min-height: 100dvh; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 29px; font-weight: 750; letter-spacing: -1.3px; line-height: 1; width: fit-content; white-space: nowrap; }
.brand .brand-mark { width: 34px; height: 34px; stroke: none; }
.brand-period, .accent { color: var(--accent); }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; line-height: 1.7; }
.hint code { color: var(--code); }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.eyebrow svg { color: var(--accent); width: 14px; height: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; border: 1px solid var(--border); padding: 10px 16px; border-radius: 5px; font-size: 14px; font-weight: 550; transition: border-color .15s, background .15s, color .15s; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--elevated); border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled, .btn:disabled:hover { background: var(--disabled); border-color: var(--border); color: var(--muted); }
.btn-block { width: 100%; }
.btn-danger { color: var(--warning); }
.btn-small { min-height: 32px; padding: 6px 10px; font-size: 13px; }
.icon-button { width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 8px; border: 1px solid transparent; border-radius: 5px; }
.icon-button svg { width: 16px; height: 16px; }
.icon-button:hover { background: var(--elevated); border-color: var(--border); }
.text-link { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; color: var(--accent); font-size: 14px; }
.text-link svg { width: 14px; height: 14px; }
.text-link:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 4px; }
.stack { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; font-size: 14px; min-width: 0; }
input, select, textarea { min-height: 44px; width: 100%; border: 1px solid var(--border); background: var(--canvas); padding: 11px 13px; font-size: 14px; max-width: 100%; }
textarea { resize: vertical; min-height: 120px; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:hover, select:hover, textarea:hover { border-color: var(--accent-border); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
/* Text controls show one inset ring on focus instead of the detached global outline. */
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); background: var(--disabled); }
input[aria-invalid="true"] { border-color: var(--warning); }
input[aria-invalid="true"]:not([type="checkbox"]):not([type="radio"]):focus { border-color: var(--warning); box-shadow: inset 0 0 0 1px var(--warning); }
select { appearance: auto; padding-right: 18px; }
@supports (appearance: base-select) and selector(::picker(select)) {
  select, select::picker(select) { appearance: base-select; }
  select { display: flex; align-items: center; gap: 14px; padding-inline: 13px; }
  select::picker-icon { margin-left: auto; color: var(--muted); }
  select::picker(select) { border: 1px solid var(--border); background: var(--canvas); border-radius: 5px; padding: 0; margin-block: 5px; color: var(--text); max-height: 320px; overflow-y: auto; }
  option { padding: 8px 16px; border: 0; border-bottom: 1px solid transparent; color: var(--muted); }
  option:hover, option:focus, option:checked { background: var(--selected); color: var(--accent); border-bottom-color: var(--accent-border); }
}
.password-input { position: relative; display: flex; min-width: 0; }
.password-input input { padding-right: 44px; }
.password-input .icon-button { position: absolute; right: 4px; top: 4px; }
.field-head, .input-row, .action-row { display: flex; align-items: center; gap: 10px; }
.field-head { justify-content: space-between; }
.field-head .over { color: var(--warning); }
.input-row input { flex: 1; min-width: 0; }
.action-row { flex-wrap: wrap; }
.form-error { color: var(--warning); font-size: 13px; border-left: 2px solid var(--accent); padding: 10px 12px; background: var(--selected); }
.form-success { font-size: 14px; color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 20px; border: 1px solid var(--accent-border); background: var(--selected); color: var(--accent); border-radius: 4px; font-size: 12px; padding: 2px 7px; white-space: nowrap; }
.pill-muted { border-color: var(--border); background: var(--canvas); color: var(--muted); }
.badge-expiring { color: var(--warning); }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: currentColor; flex-shrink: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 22px; border-bottom: 1px solid var(--border); min-height: 66px; }
.panel-head h2, .panel-head h3 { font: 600 16px var(--body-font); }
.panel-head h2 > .panel-count { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 9px; }
.panel-head > svg { width: 17px; height: 17px; color: var(--accent); }
.panel-body { padding: 20px 22px; }

/* Sign-in: one centred column, one focused form. */
.auth-page { min-height: 100dvh; }
.auth-main { position: relative; display: flex; flex-direction: column; min-height: 100dvh; padding: 36px 48px 24px; }
.auth-main:focus { outline: none; }
.auth-top-link { align-self: flex-end; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; min-height: 34px; }
.auth-top-link svg { width: 14px; height: 14px; }
.auth-top-link:hover { color: var(--accent); }
.auth-card { width: min(100%,380px); margin: auto; padding-block: 48px; }
.auth-card .eyebrow { margin-bottom: 15px; }
.auth-card h1 { font-size: 32px; font-weight: 600; letter-spacing: -1px; line-height: 1.25; }
.auth-card .auth-subtitle { margin-top: 12px; margin-bottom: 30px; color: var(--muted); font-size: 13px; }
.auth-card .btn-block { justify-content: space-between; }
.auth-foot { display: flex; justify-content: center; gap: 6px; color: var(--muted); font-size: 10px; }
.auth-foot > * + *::before { content: "·"; margin-right: 6px; }
.auth-foot a:hover { color: var(--accent); }
.auth-mobile-brand { position: absolute; left: 48px; top: 36px; }
/* Sign-in panels (sign-in, sign-up, forgot, reset) and the optional controls. */
.auth-panel h1:focus { outline: none; }
.form-info { font-size: 13px; color: var(--text); border-left: 2px solid var(--accent); padding: 10px 12px; background: var(--selected); margin-bottom: 18px; overflow-wrap: anywhere; }
.auth-extras { display: grid; gap: 18px; margin-top: 18px; }
.auth-extras:empty { display: none; }
.auth-google { display: grid; gap: 18px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.auth-card .btn-google { justify-content: center; }
.btn-google svg { width: 18px; height: 18px; stroke: none; }
.auth-forgot { display: flex; justify-content: center; }
.auth-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 6px; color: var(--muted); font-size: 13px; }
.auth-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 16px; row-gap: 4px; }
.auth-row > .auth-switch { justify-content: flex-start; }
.auth-row > .auth-forgot { margin-left: auto; }
.auth-panel > .auth-switch { margin-top: 18px; }
.text-button { display: inline-flex; align-items: center; min-height: 32px; padding: 0; border: 0; color: var(--accent); font-size: 13px; }
.text-button:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 4px; }

/* Client shell and information hierarchy mirror Fleet Desk. */
.client-sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 236px; padding: 29px 18px 18px; background: var(--canvas); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; }
.client-sidebar .brand { margin-inline: 10px; margin-bottom: 25px; }
.workspace-tag { margin: 0 10px 32px; }
.nav-group { color: var(--muted); font-size: 13px; margin: 25px 12px 10px; }
.nav-group:first-child { margin-top: 0; }
.client-nav { display: grid; gap: 5px; }
.client-nav a, .sidebar-logout { display: flex; align-items: center; gap: 12px; min-height: 44px; border: 1px solid transparent; border-radius: 5px; padding: 10px 12px; color: var(--muted); width: 100%; }
.client-nav a svg, .sidebar-logout svg { width: 18px; height: 18px; }
.client-nav a:hover, .sidebar-logout:hover { background: var(--surface); color: var(--text); }
.nav-close, .nav-backdrop { display: none; }
.client-nav a[aria-current="page"] { border-color: var(--accent-border); background: var(--selected); color: var(--accent); }
.nav-count { margin-left: auto; font-size: 13px; }
.sidebar-bottom { margin-top: auto; padding-top: 40px; }
.client-profile { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 20px 4px 0; border-top: 1px solid var(--border); }
.client-profile:hover { color: var(--accent); }
.client-profile > div { flex: 1; min-width: 0; }
.client-profile strong { display: block; font-size: 14px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-profile small { display: block; color: var(--muted); font-size: 12px; }
.client-profile > svg { margin-left: auto; width: 14px; height: 14px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--elevated); color: var(--accent); font-size: 13px; flex-shrink: 0; }
.client-main { margin-left: 236px; min-width: 0; }
.topbar { min-height: 68px; padding: 10px 32px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--border); }
.breadcrumb { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; min-width: 0; }
.breadcrumb > svg { width: 14px; height: 14px; }
.breadcrumb strong { color: var(--text); font-weight: 500; }
.breadcrumb strong:focus { outline: none; }
.topbar .action-row { flex-shrink: 0; }
.menu-button { display: none; }
.content { padding: 28px 32px 24px; max-width: 1800px; margin-inline: auto; }
.content:focus { outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { font-size: 32px; letter-spacing: -1px; line-height: 1.25; font-weight: 600; }
.page-heading p { font-size: 15px; color: var(--muted); margin-top: 8px; }
.page-heading .eyebrow { margin-top: 0; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-block: 1px solid var(--border); margin-bottom: 28px; }
.stat { padding: 23px 26px; min-width: 0; border-right: 1px solid var(--border); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; }
.stat-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.stat-label svg { color: var(--accent); width: 17px; height: 17px; }
.stat-value { font: 550 32px/1.2 var(--display-font); letter-spacing: -1px; margin-block: 11px 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-note { color: var(--muted); font-size: 12px; min-height: 15px; }
.overview-bottom { display: grid; grid-template-columns: minmax(0,1fr); gap: 20px; margin-top: 20px; align-items: start; }
.port-list { display: grid; }
.port-summary { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr) auto; align-items: center; gap: 20px; padding: 22px; border-bottom: 1px solid var(--border); }
.port-summary:last-child { border: 0; }
.port-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.port-icon { display: grid; place-items: center; width: 34px; height: 40px; border: 1px solid var(--border); border-radius: 5px; color: var(--accent); flex-shrink: 0; }
.port-icon svg { width: 19px; height: 19px; }
.port-identity h3 { font: 600 15px var(--body-font); margin-bottom: 6px; }
.port-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.port-connection { display: grid; gap: 7px; min-width: 0; }
.port-connection code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.port-connection span { color: var(--muted); font-size: 12px; }
.port-summary .action-row { justify-content: flex-end; gap: 6px; }
.console-head { display: flex; align-items: center; gap: 9px; padding: 18px 22px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--border); }
.console-head > svg { width: 17px; height: 17px; color: var(--accent); }
.console-head code { margin-left: auto; font-size: 12px; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; padding: 18px 22px 0; }
.segmented button { min-height: 34px; padding: 6px 10px; border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.segmented button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-border); background: var(--selected); }
.segmented button:hover { color: var(--accent); }
.code-box { position: relative; margin: 18px 22px; border: 1px solid var(--border); border-radius: 5px; background: var(--canvas); min-width: 0; }
.code-box pre { margin: 0; padding: 20px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.9; color: var(--code); }
.code-box .copy-code { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--border); }
.code-box .copy-code button { min-height: 28px; padding: 3px 6px; font-size: 12px; }
.console-note { padding: 0 22px 20px; font-size: 13px; color: var(--muted); }
.profile-view { display: grid; gap: 14px; }
.exit-card { display: flex; gap: 13px; padding: 20px 22px; border-top: 1px solid var(--border); }
.exit-card > svg { color: var(--accent); width: 18px; height: 18px; }
.exit-card h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 5px; }
.exit-card p { font-size: 13px; color: var(--muted); }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.search-field { flex: 1; min-width: 200px; position: relative; }
.search-field > svg { position: absolute; width: 16px; height: 16px; top: 14px; left: 13px; color: var(--muted); }
.search-field input { padding-left: 39px; }
.filter-field { min-width: 132px; }
/* On #proxies the search and filters sit in the top bar between the breadcrumb and the actions. */
.topbar > .toolbar { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; gap: 8px; margin: 0; }
.topbar > .breadcrumb { flex-shrink: 0; }
.topbar > .toolbar .search-field { min-width: 140px; }
.table-wrap { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
th { color: var(--muted); font-size: 12px; font-weight: 500; padding: 16px 15px; white-space: nowrap; background: var(--canvas); border-bottom: 1px solid var(--border); }
td { padding: 21px 15px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--selected); }
/* Auto layout at 100% of .table-wrap: credentials take the spare width, Actions keeps its buttons' width. */
.proxy-table { min-width: 900px; }
.proxy-table th:nth-child(4) { width: 32%; }
.proxy-table th:nth-child(7) { text-align: right; }
.proxy-table th:nth-child(n+5), .proxy-table td:nth-child(n+5) { white-space: nowrap; }
.proxy-table td:first-child { white-space: nowrap; }
.proxy-table td strong, .billing-table td strong { font-size: 14px; font-weight: 550; }
.cell-stack { display: grid; gap: 6px; justify-items: start; }
.cell-stack small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.cell-stack .cooldown { color: var(--accent); }
.cell-stack .rotation-summary[title] { width: 18ch; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; }
.proxy-credentials { display: flex; align-items: center; gap: 6px; contain: inline-size; min-width: 140px; }
.proxy-credentials code { font-size: 12px; min-width: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.table-actions { display: grid; grid-template-columns: repeat(4,auto); gap: 5px; width: max-content; margin-left: auto; }
.table-actions .btn { min-height: 30px; font-size: 12px; padding: 5px 8px; white-space: nowrap; }
.table-actions .btn:nth-child(2):not(:disabled) { color: var(--accent); border-color: var(--accent-border); }
.copy-ip { border: 0; display: inline-flex; align-items: center; gap: 5px; font: 12px Consolas, monospace; padding: 4px 0; }
.copy-ip svg { width: 11px; height: 11px; color: var(--muted); }
.copy-ip:hover { color: var(--accent); }
.table-foot { padding: 14px 22px; display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.notice { padding: 14px 18px; margin-bottom: 22px; border: 1px solid var(--accent-border); background: var(--selected); border-radius: 5px; font-size: 14px; color: var(--warning); }
.verify-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; padding: 12px 18px; margin-bottom: 22px; border: 1px solid var(--accent-border); background: var(--selected); border-radius: 5px; font-size: 14px; }
.verify-banner p { min-width: 0; flex: 1 1 260px; overflow-wrap: anywhere; }
.empty-state { text-align: center; padding: 45px 22px; }
.empty-state > svg { width: 28px; height: 28px; color: var(--accent); margin: 0 auto 17px; display: block; }
.empty-state h3 { font-size: 18px; margin-bottom: 10px; }
.empty-state p, p.empty-state { font-size: 14px; color: var(--muted); max-width: 380px; margin-inline: auto; }
.empty-state .btn { margin-top: 20px; }
.billing-table { min-width: 560px; }
.billing-note { margin-top: 20px; }
.billing-table th:last-child, .billing-table td:last-child { text-align: right; white-space: nowrap; }
/* Billing top row: Buy proxies and the order summary, 50/50 (.grid-2), stacked at 800px. */
#buy-panel[hidden] + .billing-note { margin-top: 0; }
.grid-2.buy-row { align-items: stretch; }
/* The custom offer card (D83): above the buy row, highlighted by an accent border. */
.offer-panel { margin-bottom: 24px; }
.offer-card { border-color: var(--accent-border); box-shadow: inset 3px 0 0 var(--accent); }
.offer-card h2:focus, .offer-card h3:focus { outline: none; }
.offer-card h3 { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.offer-card .buy-summary { max-width: 560px; }
.buy-summary #offer-total { font: 600 20px var(--display-font); color: var(--text); }
.buy-summary-card h3 { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.buy-summary-card h3:focus, .buy-card h2:focus { outline: none; }
.buy-summary { display: grid; gap: 10px; margin: 0; font-size: 14px; }
.buy-summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; min-width: 0; }
.buy-summary dt { color: var(--muted); }
.buy-summary dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.buy-summary-row:last-child { padding-top: 10px; border-top: 1px solid var(--border); }
.buy-summary #buy-total { font: 600 20px var(--display-font); color: var(--text); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper .stepper-button { width: 44px; padding: 0; flex-shrink: 0; }
.stepper output { min-width: 28px; text-align: center; font: 600 16px var(--display-font); font-variant-numeric: tabular-nums; }
.choice-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice-group legend { font-size: 14px; padding: 0; margin-bottom: 9px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 5px; background: var(--canvas); cursor: pointer; min-width: 0; }
.choice:has(input:checked) { border-color: var(--accent-border); background: var(--selected); }
.choice input[type="radio"] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 3px 0 0; border: 0; accent-color: var(--accent); flex: 0 0 16px; }
.choice-text { display: grid; gap: 3px; min-width: 0; font-size: 14px; }
.choice-text strong { font-weight: 550; }
.choice-text .hint { font-size: 12px; line-height: 1.5; }
.choice-disabled { cursor: not-allowed; opacity: .6; }
.buy-quote { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
/* "Save X%" beside a period label (D40). */
.choice-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.save-pill { min-height: 18px; padding: 1px 6px; font-size: 11px; font-weight: 550; }
/* The coupon field (D52): on a daily or weekly period it stays visible, greyed out. */
.coupon-field .input-row .btn { flex-shrink: 0; }
.coupon-field input { text-transform: uppercase; }
.coupon-field input[readonly] { color: var(--accent); border-color: var(--accent-border); background: var(--selected); }
.coupon-field.coupon-off > label { color: var(--muted); }
.coupon-field.coupon-off input, .coupon-field.coupon-off .btn { cursor: not-allowed; }
.buy-summary .buy-coupon-row dd { color: var(--accent); }
.orders-table { min-width: 640px; }
.orders-table td code { color: var(--code); font-size: 13px; white-space: nowrap; }
.cell-title { display: block; }
.cell-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.order-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.orders-table tr:has(+ .order-note) td { border-bottom: 0; }
.order-note td { padding-top: 0; color: var(--warning); font-size: 13px; }
.notice-warn { border-color: var(--warning); }
/* Automatic renewals (Item 5b-2): the head link, the notice and the pills. */
.panel-head:has(> #manage-paypal:not([hidden])) { flex-wrap: wrap; gap: 10px 12px; }
.panel-head:has(> #manage-paypal:not([hidden])) > h2 { margin-right: auto; }
.subscription-notice { margin: 16px 22px 0; }
.sub-actions .pill + .btn { margin-left: 8px; }
.order-tag { white-space: nowrap; }
.onboarding { margin-bottom: 22px; }
.onboarding h2 { font: 600 18px var(--body-font); margin-bottom: 8px; }
.onboarding p { color: var(--muted); font-size: 14px; }
.onboarding-steps { margin: 14px 0 18px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; align-items: start; }
.account-grid { max-width: 1000px; }
/* Account activity (Item 5c): full width under the account panels; the table scrolls inside .table-wrap. */
.account-activity { max-width: 1000px; margin-top: 24px; }
.activity-hint { padding-bottom: 0; }
.activity-table { min-width: 560px; }
.activity-table td { padding-block: 14px; }
.activity-table .activity-when { white-space: nowrap; color: var(--muted); font-size: 13px; }
.activity-table .activity-event { overflow-wrap: anywhere; }
.activity-table .activity-ip { white-space: nowrap; font-size: 13px; }
.activity-table th:first-child { width: 28%; }
.activity-table th:last-child { width: 24%; }
.account-activity > .empty-state { padding-block: 32px 40px; }
.activity-error { margin: 16px 22px 20px; }
.activity-more { justify-content: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 15px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.screen-grid { margin-top: 24px; }
.knowledge-search { display: block; width: min(100%,600px); }
.faq-list summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; font-size: 14px; font-weight: 550; }
summary::-webkit-details-marker { display: none; }
.faq-list summary > svg { width: 15px; height: 15px; color: var(--muted); }
details[open] > summary > svg { transform: rotate(90deg); }
.faq-list details + details { border-top: 1px solid var(--border); }
.faq-list details > div { padding: 0 22px 22px; font-size: 14px; color: var(--muted); }
.faq-list details p + p { margin-top: 12px; }
.faq-list code { font-size: 13px; overflow-wrap: anywhere; }
.faq-list summary:hover { color: var(--accent); }
.inline-note { display: flex; align-items: flex-start; gap: 12px; color: var(--muted); margin: 24px 0; font-size: 14px; }
.inline-note > svg { width: 17px; height: 17px; color: var(--accent); margin-top: 2px; }
.page-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 15px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.footer-links { display: flex; gap: 6px; }
.footer-links > * + *::before { content: "·"; margin-right: 6px; }
.page-footer a:hover { color: var(--accent); }

/* Native dialogs provide focus containment and an inert background. */
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0; width: min(500px,calc(100% - 32px)); max-height: calc(100dvh - 40px); overscroll-behavior: contain; }
dialog::backdrop { background: #0009; backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; gap: 15px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.dialog-head > div { min-width: 0; }
.dialog-head h2 { font-size: 24px; line-height: 1.25; letter-spacing: -.5px; }
.dialog-head h2:focus { outline: none; }
.dialog-head p { font-size: 12px; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
.dialog-head .icon-button { margin-left: auto; flex-shrink: 0; }
.dialog-body { padding: 24px; }
.confirm-dialog .action-row { justify-content: flex-end; }
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(620px,100%); max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border-right: 0; }
.drawer .dialog-head { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.drawer-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.drawer-tabs button { flex: 1; white-space: nowrap; min-height: 36px; padding: 8px 10px; border: 1px solid transparent; color: var(--muted); font-size: 13px; }
.drawer-tabs button[aria-selected="true"] { border-color: var(--accent-border); background: var(--selected); color: var(--accent); }
.drawer-tabs button:hover { color: var(--accent); }
.drawer-body { padding: 24px; }
.drawer-body h3 { font-size: 17px; font-weight: 550; }
.drawer-body .notice { margin-bottom: 20px; }
.drawer .code-box { margin: 0; }
.drawer .segmented { padding: 0; }
.drawer .console-note { padding: 0; }
.dialog-status { font-size: 13px; color: var(--accent); padding: 10px 12px; background: var(--selected); border: 1px solid var(--accent-border); border-radius: 5px; margin-bottom: 16px; }
.dialog-status-error { color: var(--warning); }
.log-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.log-stat { padding: 16px; border: 1px solid var(--border); border-radius: 5px; }
.log-stat strong { display: block; font: 500 26px var(--display-font); margin-top: 7px; }
.log-list { list-style: none; padding: 0; margin: 0; }
.log-list li { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.log-list li:last-child { border: 0; }
.log-list .log-host { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.log-list small { color: var(--muted); }
.toast { position: fixed; bottom: 24px; left: calc(50% + 118px); transform: translateX(-50%); z-index: 80; background: var(--elevated); border: 1px solid var(--accent-border); padding: 13px 18px; border-radius: 6px; font-size: 14px; box-shadow: 0 8px 24px #0003; max-width: min(480px,calc(100% - 32px)); }
.toast-error { color: var(--warning); }
#view-login:not([hidden]) ~ .toast { left: 50%; }
body:has(dialog[open]) { overflow: hidden; }

/* API keys */
.keys-grid { margin-bottom: 24px; }
.scope-set { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; }
.scope-set legend { padding: 0; margin-bottom: 7px; font-size: 14px; }
.scope-option { display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 5px; background: var(--canvas); cursor: pointer; min-width: 0; }
.scope-option:hover { border-color: var(--accent-border); }
.scope-option:has(input:checked) { border-color: var(--accent-border); background: var(--selected); }
.scope-option input { width: 18px; height: 18px; min-height: 18px; margin: 3px 0 0; padding: 0; flex-shrink: 0; accent-color: var(--accent); }
.scope-option > span { display: grid; gap: 3px; min-width: 0; }
.scope-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.scope-title strong { font-size: 14px; font-weight: 550; }
.scope-title code { font-size: 12px; color: var(--code); }
.api-sample { display: grid; gap: 8px; min-width: 0; }
.api-sample h3 { font-size: 13px; font-weight: 500; color: var(--muted); }
.code-sample { margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 5px; background: var(--canvas); color: var(--code); font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.keys-table { min-width: 720px; }
.keys-table td { padding-block: 16px; }
.keys-table td:nth-child(2), .keys-table td:nth-child(n+4) { white-space: nowrap; }
.keys-table td:first-child { overflow-wrap: anywhere; }
.keys-table td strong { font-size: 14px; font-weight: 550; }
.keys-table .cell-action { text-align: right; }
/* Keeps the sr-only Revoke header inside the scrolling table on narrow screens. */
.keys-table th:last-child { position: relative; }
.scope-list { display: flex; flex-wrap: wrap; gap: 5px; }
.token-box { display: block; padding: 14px 16px; border: 1px solid var(--accent-border); border-radius: 5px; background: var(--canvas); color: var(--code); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; word-break: break-all; user-select: all; }
.key-dialog { width: min(560px,calc(100% - 32px)); }
.key-dialog .action-row { justify-content: flex-end; }

/* Support tickets */
.ticket-list { display: grid; }
.ticket-item { display: grid; gap: 5px; width: 100%; text-align: left; padding: 15px 22px; border: 0; border-bottom: 1px solid var(--border); border-left: 2px solid transparent; border-radius: 0; min-width: 0; }
.ticket-item:hover { background: var(--elevated); }
.ticket-item[aria-pressed="true"] { background: var(--selected); border-left-color: var(--accent); }
.ticket-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ticket-ref { font-size: 12px; color: var(--muted); }
.ticket-subject { font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.ticket-item .hint { font-size: 12px; }
.ticket-thread { display: grid; gap: 18px; padding: 20px 22px; border-top: 1px solid var(--border); min-width: 0; }
.ticket-thread-head { display: grid; gap: 6px; min-width: 0; }
.ticket-thread-head h3 { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.ticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.ticket-messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticket-message { padding: 13px 15px; border: 1px solid var(--border); border-radius: 5px; background: var(--canvas); min-width: 0; }
.ticket-from-support { border-color: var(--accent-border); background: var(--selected); }
.ticket-message-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-bottom: 6px; font-size: 13px; }
.ticket-message-head .hint { font-size: 12px; }
.ticket-message-text { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-thread .notice { margin-bottom: 0; }

@media (max-width: 1320px) {
  /* Tighter cells and action buttons keep 1280px free of horizontal scroll at the larger type. */
  .proxy-table th, .proxy-table td { padding-inline: 8px; }
  .table-actions { gap: 4px; }
  .table-actions .btn { padding-inline: 6px; gap: 6px; }
  .proxy-credentials { min-width: 112px; }
}
@media (max-width: 1200px) {
  .auth-main { padding-inline: 32px; }
  .auth-mobile-brand { left: 32px; }
  .port-summary { grid-template-columns: minmax(0,1fr) auto; gap: 14px; }
  .port-connection { grid-column: 1; grid-row: 2; padding-left: 47px; }
  .port-summary .action-row { grid-column: 2; grid-row: 1 / span 2; }
  .stat { padding-inline: 18px; }
}
@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; }
  .topbar > .toolbar { order: 1; flex-basis: 100%; flex-wrap: wrap; }
}
@media (max-width: 800px) {
  .client-sidebar { transform: translateX(-100%); transition: transform .18s ease-out; }
  .nav-open .client-sidebar { transform: translateX(0); }
  .nav-close { display: flex; position: absolute; right: 10px; top: 27px; }
  .nav-backdrop { display: block; position: fixed; z-index: 19; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: #0009; }
  .client-main { margin-left: 0; }
  .topbar { padding-inline: 20px; }
  .content { padding: 26px 20px 20px; }
  .menu-button { display: inline-flex; }
  .toast { left: 50%; }
  .auth-main { padding: 24px 28px; }
  .auth-mobile-brand { left: 28px; top: 24px; }
  .auth-card { padding-block: 64px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .content { padding-inline: 16px; }
  .topbar { padding: 10px 16px; gap: 6px; }
  .topbar .breadcrumb > span, .topbar .breadcrumb > svg { display: none; }
  .topbar .btn { padding-inline: 10px; font-size: 13px; }
  .topbar .refresh-label { display: none; }
  .breadcrumb { gap: 7px; }
  .page-heading { align-items: flex-start; margin-bottom: 22px; }
  .page-heading h1 { font-size: 28px; }
  .page-heading p { font-size: 14px; }
  .page-heading .pill { display: none; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat { padding: 18px 13px; }
  .stat:nth-child(odd) { padding-left: 0; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .stat-value { font-size: 28px; }
  .stat-label { font-size: 13px; }
  .panel-head, .panel-body { padding-inline: 18px; }
  .subscription-notice { margin-inline: 18px; }
  /* The activity rows stack, each cell under its column name (data-label). */
  .activity-table { min-width: 0; }
  .activity-table thead { display: none; }
  .activity-table tr { display: grid; gap: 6px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
  .activity-table tbody tr:last-child { border-bottom: 0; }
  .activity-table td { display: grid; grid-template-columns: minmax(0,104px) minmax(0,1fr); gap: 10px; padding: 0; border: 0; white-space: normal; }
  .activity-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-family: var(--body-font); }
  .activity-table .activity-when, .activity-table .activity-ip { white-space: normal; overflow-wrap: anywhere; }
  .activity-error { margin-inline: 18px; }
  .ticket-item { padding-inline: 18px; }
  .ticket-thread { padding-inline: 18px; }
  .key-dialog .action-row { justify-content: stretch; }
  .key-dialog .action-row .btn { flex: 1 1 auto; }
  .port-summary { padding: 18px; grid-template-columns: minmax(0,1fr); }
  .port-connection { padding-left: 47px; }
  .port-summary .action-row { grid-column: 1; grid-row: auto; justify-content: flex-start; padding-left: 47px; }
  .port-summary .btn { min-height: 36px; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; min-width: 0; }
  .filter-field { min-width: 0; }
  .table-actions .btn, .proxy-credentials .icon-button { min-height: 40px; }
  .table-foot { flex-wrap: wrap; }
  .console-head, .code-box pre { padding-inline: 16px; }
  .code-box { margin-inline: 18px; }
  .segmented { padding-inline: 18px; }
  .console-note { padding-inline: 18px; }
  .exit-card { padding-inline: 18px; }
  .drawer .dialog-head, .drawer-body { padding: 20px; }
  .dialog-head h2 { font-size: 21px; }
  .drawer-tabs { padding-inline: 16px; }
  .auth-main { padding-inline: 24px; }
  .auth-mobile-brand { left: 24px; font-size: 26px; }
  .auth-mobile-brand .brand-mark { width: 30px; height: 30px; }
  .auth-top-link { font-size: 10px; gap: 4px; }
  .auth-card { padding-top: 66px; }
  .auth-card .auth-subtitle { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
