/* Nexus Administration — internal operations console.
   Tokens follow the Nexus Retail palette (src/Components/Utils/Constants/Colors.cs); no web fonts or inline styling. */

:root {
    color-scheme: light;
    --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

    --bg: #f3f5f8;
    --surface: #ffffff;
    --surface-sunken: #f7f9fb;
    --surface-hover: #f0f4f8;
    --border: #e1e6ed;
    --border-strong: #c7d0dc;
    --text: #0f1c2e;
    --text-muted: #4a586b;
    --text-subtle: #647286;

    --brand: #003366;
    --brand-hover: #00284f;
    --brand-soft: #e6eef7;
    --on-brand: #ffffff;
    --link: #1d5c9c;
    --focus: #2a6da8;
    --focus-ring: 0 0 0 3px rgb(42 109 168 / 0.3);

    --success: #00695b;
    --success-bg: #e6f3f0;
    --success-border: #b5dcd4;
    --warning: #8a5300;
    --warning-bg: #fff4e1;
    --warning-border: #f0d19c;
    --danger: #b3261e;
    --danger-bg: #fdeeed;
    --danger-border: #f2c3c0;
    --info: #005a80;
    --info-bg: #e8f2f8;
    --info-border: #bddbeb;

    --env-production: #b45309;
    --env-production-bg: #fff3e6;
    --env-production-border: #f5cfa3;
    --env-test: #5b3fd0;
    --env-test-bg: #f1edff;
    --env-test-border: #d7cdfb;

    --appbar-bg: #03213f;
    --appbar-text: #c9d7e8;
    --appbar-text-strong: #ffffff;
    --appbar-hover: rgb(255 255 255 / 0.08);
    --appbar-border: rgb(255 255 255 / 0.12);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgb(15 28 46 / 0.05);
    --shadow: 0 1px 2px rgb(15 28 46 / 0.04), 0 8px 24px rgb(15 28 46 / 0.06);
    --content-width: 1240px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #0a111c;
        --surface: #111a28;
        --surface-sunken: #0d1522;
        --surface-hover: #172335;
        --border: #213047;
        --border-strong: #324560;
        --text: #e6ecf5;
        --text-muted: #a9b6c8;
        --text-subtle: #8a98ad;

        --brand: #2d6db0;
        --brand-hover: #3a7cc2;
        --brand-soft: rgb(45 109 176 / 0.18);
        --link: #86b6ea;
        --focus: #86b6ea;
        --focus-ring: 0 0 0 3px rgb(134 182 234 / 0.35);

        --success: #5ccab6;
        --success-bg: rgb(0 117 102 / 0.18);
        --success-border: rgb(92 202 182 / 0.35);
        --warning: #f2b760;
        --warning-bg: rgb(199 124 0 / 0.16);
        --warning-border: rgb(242 183 96 / 0.35);
        --danger: #f59d97;
        --danger-bg: rgb(217 54 54 / 0.16);
        --danger-border: rgb(245 157 151 / 0.35);
        --info: #86c6e8;
        --info-bg: rgb(0 90 128 / 0.22);
        --info-border: rgb(134 198 232 / 0.35);

        --env-production: #f4ac62;
        --env-production-bg: rgb(180 83 9 / 0.2);
        --env-production-border: rgb(244 172 98 / 0.4);
        --env-test: #b8a8ff;
        --env-test-bg: rgb(91 63 208 / 0.24);
        --env-test-border: rgb(184 168 255 / 0.4);

        --appbar-bg: #060d17;
        --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
        --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font-sans);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 16px; line-height: 1.35; font-weight: 650; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon {
    width: 18px; height: 18px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 20; padding: 8px 14px; border-radius: var(--radius); background: var(--surface); }
.skip-link:focus { top: 12px; }

/* App bar */
.appbar {
    position: sticky; top: 0; z-index: 10;
    background: var(--appbar-bg); color: var(--appbar-text);
    border-bottom: 3px solid transparent;
}
body[data-environment="production"] .appbar { border-bottom-color: var(--env-production); }
body[data-environment="test"] .appbar { border-bottom-color: var(--env-test); }
.appbar-inner {
    max-width: var(--content-width); margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; gap: 28px; min-height: 60px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--appbar-text-strong); font-weight: 650; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 20px; }
.brand-product { color: var(--appbar-text); font-weight: 400; }
.nav { display: flex; gap: 4px; align-self: stretch; }
.nav a {
    display: inline-flex; align-items: center; gap: 8px; padding: 0 12px;
    color: var(--appbar-text); font-size: 14px; font-weight: 550; white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -3px;
}
.nav a:hover { color: var(--appbar-text-strong); text-decoration: none; background: var(--appbar-hover); }
.nav a[aria-current="page"] { color: var(--appbar-text-strong); border-bottom-color: #71b8ee; }
.nav .icon { width: 16px; height: 16px; opacity: 0.85; }
.appbar-end { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.account { display: flex; align-items: center; gap: 10px; color: var(--appbar-text-strong); font-size: 14px; }
.avatar {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: rgb(255 255 255 / 0.14); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.account-role { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--appbar-text); }
.appbar .btn-ghost { color: var(--appbar-text); }
.appbar .btn-ghost:hover { color: #fff; background: var(--appbar-hover); }

/* Language switch */
.lang { display: inline-flex; padding: 2px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.appbar .lang { border-color: var(--appbar-border); background: transparent; }
.lang button {
    border: 0; background: transparent; color: var(--text-muted); cursor: pointer;
    font: 600 12px/1 var(--font-sans); letter-spacing: 0.04em; padding: 6px 10px; border-radius: 999px;
}
.appbar .lang button { color: var(--appbar-text); }
.lang button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.appbar .lang button[aria-pressed="true"] { background: rgb(255 255 255 / 0.16); color: #fff; }
.lang button:not([aria-pressed="true"]):hover { color: var(--text); }
.appbar .lang button:not([aria-pressed="true"]):hover { color: #fff; }

/* Page */
.page { max-width: var(--content-width); margin: 0 auto; padding: 32px 24px 96px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header-titles { display: grid; gap: 8px; min-width: 0; }
.page-header-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-lede { color: var(--text-muted); max-width: 64ch; }
.page-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.breadcrumb { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-muted); }
.breadcrumb .icon { width: 16px; height: 16px; }
.stack { display: grid; gap: 20px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 38px; padding: 0 14px; border-radius: var(--radius);
    border: 1px solid transparent; font: 600 14px/1 var(--font-sans); white-space: nowrap;
    cursor: pointer; text-decoration: none; transition: background-color 120ms, border-color 120ms, color 120ms;
}
.btn:hover { text-decoration: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; min-height: 42px; }

/* Environment */
.env {
    display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 999px;
    font-size: 12px; font-weight: 650; border: 1px solid; white-space: nowrap;
}
.env::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.env-production { color: var(--env-production); background: var(--env-production-bg); border-color: var(--env-production-border); }
.env-test { color: var(--env-test); background: var(--env-test-bg); border-color: var(--env-test-border); }
.env-db { font-family: var(--font-mono); font-weight: 500; opacity: 0.85; }

.segmented {
    display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px;
    background: var(--surface-sunken); border: 1px solid var(--border);
}
.segmented a, .segmented label {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 7px;
    color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.segmented a:hover, .segmented label:hover { color: var(--text); text-decoration: none; }
.segmented a[aria-current="page"], .segmented input:checked + label {
    background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(15 28 46 / 0.12);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 1px; }
.field .segmented { justify-self: start; }
.segmented .dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-production { background: var(--env-production); }
.dot-test { background: var(--env-test); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-header-titles { display: grid; gap: 2px; }
.card-header-titles p { color: var(--text-muted); font-size: 13.5px; }
.card-title { display: inline-flex; align-items: center; gap: 10px; }
.card-title .icon { color: var(--text-subtle); }
.card-body { padding: 22px; }
.card-body.flush { padding: 0; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-sunken); border-radius: 0 0 var(--radius-lg) var(--radius-lg); font-size: 13.5px; color: var(--text-muted); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.span-2 { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .field-label { font-size: 13px; font-weight: 600; color: var(--text); }
.field-optional { font-weight: 400; color: var(--text-subtle); }
.field-help { font-size: 12.5px; color: var(--text-subtle); }
.field-error { font-size: 12.5px; color: var(--danger); font-weight: 550; }
.field-error:empty, .field-validation-valid { display: none; }
.input {
    width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--radius);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    font: inherit; font-size: 14.5px; transition: border-color 120ms, box-shadow 120ms;
}
.input::placeholder { color: var(--text-subtle); opacity: 0.8; }
.input:hover { border-color: var(--text-subtle); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: var(--focus-ring); }
.input[readonly] { background: var(--surface-sunken); color: var(--text-muted); }
.input.input-validation-error { border-color: var(--danger); }
.input.input-validation-error:focus { box-shadow: 0 0 0 3px rgb(179 38 30 / 0.2); }
.input.mono { font-family: var(--font-mono); font-size: 14px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
.input-icon { position: relative; flex: 1; min-width: 0; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.secret {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius);
    background: var(--surface-sunken); border: 1px dashed var(--border-strong);
    font-family: var(--font-mono); font-size: 14px; overflow-wrap: anywhere; user-select: all;
}
.secret .icon { color: var(--text-subtle); }
.connection-preview {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius);
    background: var(--surface-sunken); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-muted);
}
.connection-preview code { color: var(--text); overflow-wrap: anywhere; }
.connection-preview .icon { color: var(--text-subtle); }

/* Callouts */
.callout {
    display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
    border: 1px solid var(--info-border); background: var(--info-bg); color: var(--text); font-size: 14px;
}
.callout > .icon { margin-top: 1px; color: var(--info); }
.callout strong { display: block; margin-bottom: 2px; }
.callout p { color: var(--text-muted); }
.callout-success { background: var(--success-bg); border-color: var(--success-border); }
.callout-success > .icon { color: var(--success); }
.callout-warning { background: var(--warning-bg); border-color: var(--warning-border); }
.callout-warning > .icon { color: var(--warning); }
.callout-danger { background: var(--danger-bg); border-color: var(--danger-border); }
.callout-danger > .icon { color: var(--danger); }
.validation-summary-valid { display: none; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.http-warning { display: none; }
.form:has(#Protocol-Http:checked) .http-warning { display: flex; }

/* Pills */
.pill {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
    font-size: 12px; font-weight: 650; line-height: 18px; white-space: nowrap;
    background: var(--surface-sunken); color: var(--text-muted); border: 1px solid var(--border);
}
.pill .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.pill-success { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.pill-warning { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-border); }
.pill-danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.pill-info { color: var(--info); background: var(--info-bg); border-color: var(--info-border); }
.pill-brand { color: var(--link); background: var(--brand-soft); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Toolbar + tables */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; flex: 1; min-width: min(100%, 320px); max-width: 520px; }
.toolbar-count { margin-left: auto; font-size: 13px; color: var(--text-subtle); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left; font-size: 12px; font-weight: 600; color: var(--text-subtle);
    padding: 10px 16px; background: var(--surface-sunken); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-hover); }
.table tr.is-highlighted td { background: var(--success-bg); }
.table .cell-primary { display: grid; gap: 2px; }
.table .cell-primary a, .table .cell-primary strong { font-weight: 600; color: var(--text); }
.table .cell-primary a:hover { color: var(--link); }
.table .cell-secondary { font-size: 12.5px; color: var(--text-subtle); font-family: var(--font-mono); }
.table .cell-actions { text-align: right; width: 1%; white-space: nowrap; }
.table .mono { color: var(--text); }
.table-footnote { padding: 12px 16px; font-size: 13px; color: var(--text-subtle); border-top: 1px solid var(--border); }

/* Empty + status pages */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 24px; }
.empty-icon {
    display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
    background: var(--brand-soft); color: var(--link); margin-bottom: 4px;
}
.empty-icon .icon { width: 22px; height: 22px; }
.empty p { color: var(--text-muted); max-width: 46ch; }
.empty .btn { margin-top: 8px; }
.status-page { max-width: 520px; margin: 8vh auto 0; }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.editor-main { display: grid; gap: 20px; min-width: 0; }
.editor-aside { position: sticky; top: 84px; display: grid; gap: 16px; }
.editor-actions {
    position: sticky; bottom: 0; z-index: 5; grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: flex-end; gap: 12px;
    margin: 0 -24px; padding: 14px 24px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px); border-top: 1px solid var(--border);
}
.editor-actions .editor-actions-note { margin-right: auto; font-size: 13px; color: var(--text-subtle); display: inline-flex; align-items: center; gap: 8px; }

/* Probe */
.probe { display: grid; gap: 14px; }
.probe-summary { display: flex; gap: 12px; align-items: flex-start; }
.probe-summary-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; }
.probe-summary-icon .icon { width: 18px; height: 18px; stroke-width: 2.4; }
.probe-success .probe-summary-icon { background: var(--success-bg); color: var(--success); }
.probe-warning .probe-summary-icon { background: var(--warning-bg); color: var(--warning); }
.probe-danger .probe-summary-icon { background: var(--danger-bg); color: var(--danger); }
.probe-summary strong { display: block; font-size: 14.5px; }
.probe-summary p { font-size: 13px; color: var(--text-muted); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.step { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 12px; font-size: 13.5px; }
.step + .step { border-top: 1px solid var(--border); }
.step-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; }
.step-icon .icon { width: 12px; height: 12px; stroke-width: 3; }
.step-passed .step-icon { background: var(--success-bg); color: var(--success); }
.step-warning .step-icon { background: var(--warning-bg); color: var(--warning); }
.step-failed .step-icon { background: var(--danger-bg); color: var(--danger); }
.step-skipped .step-icon { background: var(--surface-sunken); color: var(--text-subtle); }
.step-skipped { color: var(--text-subtle); }
.step-value { color: var(--text-muted); text-align: right; }
.step-failed .step-value { color: var(--danger); font-weight: 600; }
.step-warning .step-value { color: var(--warning); font-weight: 600; }
.probe-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text-subtle); }

/* Definition lists */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 20px; margin: 0; font-size: 14px; }
.facts dt { color: var(--text-subtle); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.permissions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.permissions li { display: flex; gap: 10px; align-items: baseline; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* Sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background:
    radial-gradient(1200px 500px at 50% -10%, var(--brand-soft), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-panel { padding: 32px; display: grid; gap: 22px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); }
.auth-brand img { width: 40px; height: 20px; }
.auth-heading { display: grid; gap: 6px; }
.auth-heading p { color: var(--text-muted); font-size: 14px; }
.auth-form { display: grid; gap: 16px; }
.auth-foot { margin: 18px auto 0; max-width: 360px; font-size: 12.5px; color: var(--text-subtle); text-align: center; }
.auth-foot .icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }

/* Responsive */
@media (max-width: 1080px) {
    .editor { grid-template-columns: minmax(0, 1fr); }
    .editor-aside { position: static; }
}
@media (max-width: 760px) {
    .appbar { position: static; }
    .appbar-inner { flex-wrap: wrap; gap: 4px 12px; padding: 10px 16px 0; min-height: 0; }
    .appbar-end { gap: 8px; }
    .nav { order: 3; width: calc(100% + 16px); overflow-x: auto; min-height: 44px; margin: 0 -8px; }
    .account { display: none; }
    .appbar .btn-ghost span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .page { padding: 20px 16px 96px; }
    .page-header { align-items: flex-start; }
    h1 { font-size: 22px; }
    .form-grid, .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .span-2 { grid-column: auto; }
    .card-header, .card-body { padding: 16px; }
    .editor-actions { margin: 0 -16px; padding: 12px 16px; }
    .editor-actions .editor-actions-note { display: none; }
    .editor-actions .btn { flex: 1; }
    .toolbar-count { margin-left: 0; width: 100%; }
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .table-stack tbody tr:last-child { border-bottom: 0; }
    .table-stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
    .table-stack td::before { content: attr(data-label); color: var(--text-subtle); font-size: 12.5px; text-align: left; }
    .table-stack td.cell-lead { display: block; text-align: left; padding-bottom: 8px; }
    .table-stack td.cell-lead::before { content: none; }
    .table-stack td.cell-actions { width: 100%; justify-content: flex-end; padding-top: 8px; }
    .table-stack td.cell-actions::before { content: none; }
    .table-stack tbody tr:hover td { background: transparent; }
    .auth-panel { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
.callout .validation-summary-errors ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.auth-brand .brand-product { color: var(--text-muted); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; }
.field-help .icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

/* Website access: one visible row per POS, grouped by location. */
.website-overview-summary { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--text-muted); }
.website-overview-summary strong { color: var(--text); font-variant-numeric: tabular-nums; }
.website-location { overflow: hidden; }
.website-location .card-header { background: var(--surface-sunken); }
.website-location .card-header h2 { font-size: 16px; }
.website-table { table-layout: fixed; }
.website-table thead th:first-child { width: 18%; }
.website-table thead th:nth-child(2) { width: 46%; }
.website-table thead th:nth-child(3) { width: 11%; }
.website-table thead th:last-child { width: 25%; }
.website-table tbody th { text-transform: none; letter-spacing: normal; font-weight: 600; font-size: 14px; color: var(--text); background: transparent; border-bottom: 1px solid var(--border); }
.website-table tbody tr:last-child > th { border-bottom: 0; }
.website-table tr.is-highlighted > th, .website-table tr.is-highlighted > td { background: var(--brand-soft); }
.website-table .cell-actions { white-space: normal; }
.website-table .website-actions { justify-content: flex-end; gap: 8px; }
.website-table tr[id] { scroll-margin-top: 84px; }
.website-access-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.website-access-controls .website-key-form { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.website-key-control { display: flex; align-items: center; gap: 12px; min-width: 0; }
.website-key-control code { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; white-space: normal; user-select: all; font-size: 14px; line-height: 1.5; }
.website-key-control .btn { flex: 0 0 auto; min-width: 76px; }
.website-key-form [hidden] { display: none; }
.website-key-error { margin-top: 8px; color: var(--danger); white-space: normal; }
.website-confirmation {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(440px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    padding: 24px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}
.website-confirmation::backdrop { background: rgb(6 13 23 / 0.4); }
.website-confirmation h2 { font-size: 18px; }
.website-confirmation .website-actions { display: grid; gap: 16px; }
.website-confirm-prompt { margin: 0; color: var(--text-muted); text-align: left; line-height: 1.5; }
.website-confirm-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.website-action-error { margin-top: 8px; color: var(--danger); white-space: normal; }
.website-table [aria-busy="true"] .btn { cursor: progress; }
@media (max-width: 760px) {
    .website-table tbody th { display: block; width: 100%; border: 0; padding: 4px 0 8px; }
    .website-table .website-key-cell.has-key { display: block; text-align: left; }
    .website-table .cell-actions { justify-content: flex-start; }
    .website-table .website-actions { justify-content: flex-start; }
    .website-table tr[id] { scroll-margin-top: 16px; }
}
.website-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn-danger { color: var(--danger); border-color: var(--danger-border); background: var(--surface); }
.btn-danger:hover { background: var(--danger-bg); }
.field-hint { color: var(--text-muted); font-size: .875rem; margin: .25rem 0 0; }
