:root {
  --page: #f6f8fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-blue: #f0f6ff;
  --text: #162033;
  --text-secondary: #53627a;
  --text-muted: #718096;
  --line: #dce3ee;
  --line-strong: #c7d2e2;
  --primary: #1769e0;
  --primary-hover: #0f56bd;
  --primary-soft: #eaf2ff;
  --success: #16845b;
  --success-soft: #e9f8f0;
  --warning: #a96000;
  --warning-soft: #fff4dc;
  --danger: #c3374f;
  --danger-soft: #fff0f2;
  --shadow: 0 14px 34px rgba(31, 49, 82, .08);
  --shadow-float: 0 18px 48px rgba(24, 45, 79, .16);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color: var(--text);
  background: var(--page);
  font-family: system-ui, "Segoe UI", "Noto Sans", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html { min-height: 100%; background: var(--page); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--page); color: var(--text); }
body, button, input, select { font: inherit; }
button, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(23, 105, 224, .42); outline-offset: 3px; }
::selection { background: #cfe1ff; color: #0f3269; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--page); }
::-webkit-scrollbar-thumb { border: 3px solid var(--page); background: #aebbd0; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #8d9bb2; }

.skip-link { position: fixed; z-index: 20; top: -5rem; left: 1rem; padding: .72rem 1rem; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 700; text-decoration: none; box-shadow: var(--shadow-float); }
.skip-link:focus { top: 1rem; }
.shell { width: min(1280px, calc(100% - 2.5rem)); margin: 0 auto; padding: 1.5rem 0 3.5rem; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--text); font-weight: 700; letter-spacing: -.018em; text-wrap: balance; }

.loading-stage { min-height: calc(100vh - 8rem); display: grid; place-content: center; gap: 1rem; color: var(--text-secondary); text-align: center; }
.loader-course { display: flex; width: 11rem; height: .45rem; gap: .36rem; margin: 0 auto; }
.loader-course span { flex: 1; border-radius: 999px; background: #cbd8ea; animation: loader-step 1.25s var(--ease) infinite; }
.loader-course span:nth-child(2) { animation-delay: .12s; background: #8db8f5; }
.loader-course span:nth-child(3) { animation-delay: .24s; background: var(--primary); }
@keyframes loader-step { 0%, 100% { opacity: .48; transform: scaleX(.78); } 45% { opacity: 1; transform: scaleX(1); } }

.login-stage { min-height: calc(100vh - 8rem); display: grid; place-items: center; }
.login-window { width: min(620px, 100%); padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.mark { display: flex; gap: .28rem; height: 1rem; margin-bottom: 1.35rem; }
.mark span { display: block; width: .3rem; height: 100%; border-radius: 999px; background: #7eafea; }
.mark span:nth-child(2) { background: #3c84e8; }
.mark span:nth-child(3) { background: var(--primary); }
.login-copy h1 { max-width: 18ch; margin-bottom: .75rem; font-size: clamp(1.85rem, 4vw, 2.65rem); line-height: 1.15; }
.login-copy p { max-width: 62ch; margin-bottom: 1.75rem; color: var(--text-secondary); line-height: 1.65; }
.auth-form { display: grid; gap: .72rem; max-width: 34rem; }
.auth-form + .auth-form { margin-top: 1rem; }
.auth-form label { color: var(--text); font-size: .92rem; font-weight: 650; }
.auth-form input { width: 100%; min-height: 3rem; padding: .68rem .85rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); transition: border-color 160ms ease, box-shadow 160ms ease; }
.auth-form input:hover { border-color: #98a9c0; }
.auth-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 224, .12); outline: 0; }
.input-line { position: relative; }
.input-line input { padding-right: 3.25rem; }
.reveal-button { position: absolute; top: .25rem; right: .25rem; display: grid; width: 2.5rem; height: 2.5rem; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.reveal-button:hover { background: var(--surface-muted); color: var(--primary); }
.reveal-button svg, .icon-button svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.85; }
.form-message { min-height: 1.45rem; margin: .9rem 0 0; color: var(--primary); font-size: .9rem; font-weight: 600; }
.form-message[data-tone="error"] { color: var(--danger); }

.control-stage { display: grid; gap: 1.5rem; }
.control-header { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 0 0 1.2rem; border-bottom: 1px solid var(--line); }
.control-message { margin: 0; padding: .8rem 1rem; border: 1px solid #c9daf5; border-radius: 10px; background: var(--surface-blue); color: #1d4f94; font-size: .92rem; font-weight: 600; line-height: 1.5; }
.control-message[data-tone="error"] { border-color: #f2bec7; background: var(--danger-soft); color: #9a2138; }
.masthead { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.masthead .mark { flex: 0 0 auto; height: 1.55rem; margin: 0; }
.masthead h1 { margin: 0; font-size: 1.45rem; line-height: 1.18; }
.masthead-title { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.preview-badge { display: inline-flex; align-items: center; padding: .22rem .5rem; border: 1px solid #b7d2fb; border-radius: 999px; background: var(--primary-soft); color: #1459b8; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.header-actions, .tenant-actions { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; }
.tenant-actions { flex-wrap: wrap; }
.session-state { display: inline-flex; align-items: center; gap: .48rem; color: var(--text-secondary); font-size: .84rem; font-weight: 600; white-space: nowrap; }
.session-state i, .state-dot { display: inline-block; width: .55rem; height: .55rem; flex: 0 0 auto; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(22, 132, 91, .12); }

.course-button { display: inline-flex; min-height: 2.55rem; align-items: center; justify-content: center; gap: .56rem; padding: .58rem .85rem; border: 1px solid transparent; border-radius: 8px; background: var(--primary); color: #fff; cursor: pointer; font-size: .88rem; font-weight: 650; line-height: 1; transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms var(--ease); }
.course-button:hover { background: var(--primary-hover); box-shadow: 0 4px 10px rgba(23, 105, 224, .2); transform: translateY(-1px); }
.course-button:active { box-shadow: none; transform: translateY(0); }
.course-button:disabled, .icon-button:disabled { cursor: not-allowed; opacity: .52; transform: none; box-shadow: none; }
.course-button[data-busy="true"], .icon-button[data-busy="true"] { cursor: progress; opacity: .72; }
.course-button svg { width: 1.08rem; height: 1.08rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.course-button.compact { min-height: 2.4rem; border-color: var(--line-strong); background: var(--surface); color: var(--text-secondary); }
.course-button.compact:hover { border-color: #9cb7dc; background: var(--primary-soft); color: #1459b8; }
.pairing-trigger { border-color: #a8c7f4; background: var(--primary-soft); color: #1459b8; }
.pairing-trigger:hover { border-color: var(--primary); background: var(--primary); color: #fff; }
.icon-button { display: inline-grid; width: 2.4rem; height: 2.4rem; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text-secondary); cursor: pointer; transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, transform 160ms var(--ease); }
.icon-button:hover { border-color: #9cb7dc; background: var(--primary-soft); color: var(--primary); transform: translateY(-1px); }
.icon-button.is-spinning svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dispatch-window { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(18rem, .75fr); gap: 1.5rem; padding: clamp(1.35rem, 3.2vw, 2.25rem); border: 1px solid #d1def0; border-radius: 14px; background: #eff5ff; color: var(--text); box-shadow: 0 10px 28px rgba(36, 82, 145, .08); }
.window-copy h2 { max-width: 25ch; margin-bottom: .65rem; font-size: clamp(1.55rem, 3vw, 2.1rem); line-height: 1.2; }
.window-copy p { max-width: 65ch; margin: 0; color: var(--text-secondary); line-height: 1.62; }
.preview-note { margin-top: .85rem !important; padding: .75rem .85rem; border: 1px solid #bad3f8; border-radius: 8px; background: rgba(255, 255, 255, .6); color: #245696 !important; font-size: .9rem; }
.fleet-readout { display: grid; align-content: center; gap: .6rem; margin: 0; }
.fleet-readout > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem .95rem; border: 1px solid #d6e2f3; border-radius: 10px; background: rgba(255, 255, 255, .78); }
.fleet-readout dt { color: var(--text-secondary); font-size: .8rem; font-weight: 600; }
.fleet-readout dd { margin: 0; color: #173e77; font-size: 1.45rem; font-weight: 750; font-variant-numeric: tabular-nums; }

.layout-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(18rem, .65fr); gap: 1.5rem; align-items: start; }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.panel-heading h2 { margin: 0; font-size: 1.28rem; line-height: 1.25; }
.panel-heading > p { max-width: 30ch; margin: 0; color: var(--text-muted); font-size: .86rem; line-height: 1.45; text-align: right; }
.course-viewport { display: grid; gap: .7rem; min-height: 4rem; }
.tenant-course { display: grid; grid-template-columns: .5rem minmax(0, 1fr) auto auto; align-items: center; gap: clamp(.85rem, 2vw, 1.35rem); min-height: 7.4rem; padding: 1rem clamp(1rem, 2.5vw, 1.35rem); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 3px 10px rgba(23, 40, 69, .035); transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms var(--ease); }
.tenant-course:hover { border-color: #b9cbe4; box-shadow: 0 10px 24px rgba(38, 67, 111, .1); transform: translateY(-1px); }
.course-index { display: grid; gap: .25rem; align-self: stretch; align-content: center; }
.course-index span { display: block; width: .36rem; height: .36rem; border-radius: 50%; background: #b6c3d7; }
.course-index span:first-child { background: var(--primary); }
.tenant-copy { min-width: 0; }
.tenant-copy .tenant-id { margin: 0 0 .22rem; overflow: hidden; color: var(--text-muted); font-size: .72rem; font-weight: 650; letter-spacing: .035em; text-overflow: ellipsis; white-space: nowrap; }
.tenant-copy h3 { margin: 0 0 .58rem; overflow: hidden; color: var(--text); font-size: 1.08rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.tenant-copy dl { display: flex; flex-wrap: wrap; gap: .58rem 1.3rem; margin: 0; }
.tenant-copy dl > div { min-width: 0; }
.tenant-copy dt { margin-bottom: .12rem; color: var(--text-muted); font-size: .68rem; font-weight: 650; letter-spacing: .035em; text-transform: uppercase; }
.tenant-copy dd { max-width: min(32vw, 22rem); margin: 0; overflow: hidden; color: var(--text-secondary); font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.tenant-copy .tenant-fingerprint { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .73rem; }
.tenant-state { display: flex; align-items: center; justify-self: end; gap: .48rem; min-width: 7.4rem; color: var(--success); font-size: .79rem; font-weight: 650; }
.tenant-state.inactive { color: var(--danger); }
.tenant-state.inactive .state-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(195, 55, 79, .12); }
.enter-button { min-width: 9.2rem; }
.tenant-command { min-width: 7.6rem; }
.tenant-entry { min-width: 7.4rem; }
.tenant-toggle { min-width: 7.6rem; }
.tenant-toggle svg { transition: transform 160ms ease; }
.tenant-toggle[data-state="inactive"] svg { transform: translateX(1px); }

.notice-panel, .operations-panel { min-width: 0; padding: 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 3px 10px rgba(23, 40, 69, .035); }
.fleet-panel[data-stale="true"], .notice-panel[data-stale="true"], .operations-panel[data-stale="true"] { border-color: #f1bac4; }
.notice-panel .panel-heading, .operations-panel .panel-heading { align-items: flex-start; }
.notice-panel .panel-heading h2 { font-size: 1.15rem; }
.text-action { min-height: 2rem; padding: 0; border: 0; background: transparent; color: #1459b8; cursor: pointer; font-size: .82rem; font-weight: 650; text-decoration: underline; text-decoration-color: rgba(20, 89, 184, .35); text-underline-offset: .18em; }
.text-action:hover { color: var(--primary-hover); text-decoration-color: currentColor; }
.notice-list, .device-list, .audit-list { display: grid; min-width: 0; gap: .58rem; }
.notice-row { padding: .85rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted); }
.notice-row header { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .42rem; }
.notice-row h3 { margin: 0; color: #1459b8; font-size: .76rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.notice-row time { color: var(--text-muted); font-size: .72rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.notice-row p { margin: 0; color: var(--text-secondary); font-size: .89rem; line-height: 1.48; }
.notice-row[data-state="claimed"] { background: #f6f9fd; opacity: .72; }
.operations-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.operations-panel { padding: clamp(1rem, 2.5vw, 1.35rem); }
.operations-panel .panel-heading h2 { font-size: 1.2rem; }
.operations-copy { max-width: 62ch; margin: 0 0 1rem; color: var(--text-secondary); font-size: .9rem; line-height: 1.55; }
.device-row, .audit-row { border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted); }
.device-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .9rem; padding: .85rem; }
.device-copy { min-width: 0; }
.device-copy h3 { margin: 0 0 .28rem; overflow: hidden; color: var(--text); font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.device-meta { margin: 0; color: var(--text-muted); font-size: .78rem; line-height: 1.4; }
.device-state { display: inline-flex; align-items: center; gap: .42rem; color: var(--success); font-size: .76rem; font-weight: 650; white-space: nowrap; }
.device-state.inactive { color: var(--danger); }
.device-state.inactive .state-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(195, 55, 79, .12); }
.device-revoke { color: var(--danger); white-space: nowrap; }
.audit-row { display: grid; min-width: 0; grid-template-columns: minmax(5.4rem, auto) minmax(0, 1fr); gap: .85rem; padding: .8rem .85rem; }
.audit-row > div { min-width: 0; }
.audit-row time { color: var(--text-muted); font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.45; }
.audit-row h3 { margin: 0 0 .16rem; color: var(--text); font-size: .88rem; line-height: 1.3; }
.audit-row p { margin: 0; overflow: hidden; color: var(--text-secondary); font-size: .77rem; line-height: 1.38; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { display: grid; justify-items: start; gap: .65rem; min-height: 13rem; align-content: center; padding: clamp(1.1rem, 4vw, 2rem); border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-muted); color: var(--text-secondary); }
.empty-state svg { width: 2rem; height: 2rem; fill: none; stroke: var(--primary); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.empty-state h3, .empty-state p { margin: 0; }
.empty-state h3 { color: var(--text); font-size: 1rem; }
.empty-state p { max-width: 50ch; line-height: 1.55; }
.compact-empty { min-height: 9rem; justify-items: center; text-align: center; }
.safety-note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem; padding: 1.1rem 1.2rem; border: 1px solid #d7e4f6; border-radius: 12px; background: #f5f9ff; }
.safety-note > svg { width: 1.35rem; height: 1.35rem; margin-top: .08rem; fill: none; stroke: #2867bd; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.safety-note h2 { margin-bottom: .28rem; font-size: .98rem; }
.safety-note p { max-width: 90ch; margin: 0; color: var(--text-secondary); font-size: .9rem; line-height: 1.55; }

.pairing-dialog, .confirmation-dialog, .command-dialog { margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); }
.pairing-dialog { width: min(43rem, calc(100% - 1.5rem)); max-height: min(42rem, calc(100dvh - 1.5rem)); overflow: auto; }
.confirmation-dialog { width: min(34rem, calc(100% - 1.5rem)); }
.command-dialog { width: min(68rem, calc(100% - 1.5rem)); max-height: min(52rem, calc(100dvh - 1.5rem)); overflow: auto; }
.pairing-dialog::backdrop, .confirmation-dialog::backdrop, .command-dialog::backdrop { background: rgba(18, 32, 51, .42); backdrop-filter: blur(2px); }
.pairing-window, .confirmation-window, .command-window { padding: clamp(1.25rem, 4vw, 2rem); }
.confirmation-window h2, .pairing-header h2, .command-header h2 { max-width: 25ch; margin: 0 0 .55rem; font-size: 1.45rem; line-height: 1.23; }
.confirmation-window > p, .pairing-header p, .command-header p { max-width: 64ch; margin: 0; color: var(--text-secondary); line-height: 1.58; }
.confirmation-controls { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1.3rem; }
.course-button.is-danger { background: var(--danger); color: #fff; }
.course-button.is-danger:hover { background: #a9273d; }
.pairing-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }
.pairing-header .icon-button { flex: 0 0 auto; }
.pairing-steps { display: grid; gap: .7rem; margin: 0 0 1.2rem; padding: 0; list-style: none; counter-reset: pairing-step; }
.pairing-steps li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .65rem; align-items: start; color: var(--text-secondary); line-height: 1.5; }
.pairing-steps li > span { grid-column: 2; grid-row: 1; }
.pairing-steps li::before { counter-increment: pairing-step; content: counter(pairing-step); display: grid; width: 1.42rem; height: 1.42rem; place-items: center; border-radius: 50%; background: var(--primary-soft); color: #1459b8; font-size: .74rem; font-weight: 700; }
.pairing-code-wrap { min-height: 4.2rem; padding: .9rem; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-muted); }
.pairing-code-wrap code { display: block; overflow-wrap: anywhere; color: #174d99; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: clamp(.78rem, 2vw, .96rem); font-weight: 700; letter-spacing: .035em; line-height: 1.6; }
.pairing-code-wrap p { margin: 0; color: var(--text-secondary); line-height: 1.5; }
.pairing-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .9rem; }
.pairing-controls .enter-button { flex: 1 1 auto; }
.pairing-expiry { min-height: 1.4rem; margin: .85rem 0 0; color: var(--text-muted); font-size: .86rem; font-weight: 600; }
.pairing-expiry[data-tone="error"] { color: var(--danger); }
.command-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.command-header .icon-button { flex: 0 0 auto; }
.command-tenant-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: .9rem 1rem; border: 1px solid #cfe0f7; border-radius: 10px; background: var(--surface-blue); }
.command-tenant-summary div { display: grid; gap: .2rem; min-width: 0; }
.command-tenant-summary span { color: var(--text-muted); font-size: .7rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.command-tenant-summary strong { overflow: hidden; color: #174d99; font-size: .94rem; text-overflow: ellipsis; white-space: nowrap; }
.command-message { min-height: 1.35rem; margin: .8rem 0 0; color: #1d4f94; font-size: .86rem; font-weight: 650; line-height: 1.45; }
.command-message[data-tone="error"] { color: var(--danger); }
.command-message[data-tone="success"] { color: var(--success); }
.command-section { padding-top: 1.15rem; margin-top: 1.15rem; border-top: 1px solid var(--line); }
.runtime-section { padding-top: 1rem; }
.command-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.command-section-heading h3 { margin: 0 0 .25rem; font-size: 1.02rem; line-height: 1.35; }
.command-section-heading p { max-width: 65ch; margin: 0; color: var(--text-secondary); font-size: .86rem; line-height: 1.48; }
.runtime-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.runtime-summary > div { min-width: 0; padding: .78rem .85rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.runtime-summary dt { margin-bottom: .25rem; color: var(--text-muted); font-size: .69rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.runtime-summary dd { margin: 0; overflow: hidden; color: var(--text-secondary); font-size: .84rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.runtime-summary dd[data-state="ready"] { color: var(--success); }
.runtime-summary dd[data-state="warning"] { color: var(--warning); }
.payment-webhook-section { position: relative; }
.payment-webhook-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .8rem .9rem; border: 1px solid #cfe0f7; border-radius: 9px; background: linear-gradient(135deg, var(--surface-blue), var(--surface-muted)); }
.payment-webhook-copy { display: grid; gap: .34rem; min-width: 0; }
.payment-webhook-copy > span { color: var(--text-muted); font-size: .69rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.payment-webhook-copy code { overflow: hidden; color: #174d99; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: clamp(.76rem, 1.55vw, .9rem); font-weight: 700; letter-spacing: .012em; text-overflow: ellipsis; white-space: nowrap; }
.payment-webhook-card .course-button { min-width: 9.6rem; }
.payment-webhook-help { min-height: 1.35rem; margin: .72rem 0 0; color: var(--text-secondary); font-size: .82rem; font-weight: 600; line-height: 1.48; }
.payment-webhook-help[data-state="ready"] { color: var(--success); }
.payment-webhook-help[data-state="warning"] { color: var(--warning); }
.command-toggle-list { display: grid; gap: .6rem; }
.command-toggle-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted); cursor: pointer; }
.command-toggle-row > span { display: grid; gap: .18rem; min-width: 0; }
.command-toggle-row strong { color: var(--text); font-size: .91rem; }
.command-toggle-row small { color: var(--text-secondary); font-size: .8rem; line-height: 1.4; }
.command-toggle-row input[type="checkbox"] { appearance: none; position: relative; width: 2.8rem; height: 1.55rem; margin: 0; border: 1px solid #aebed5; border-radius: 999px; background: #bdc9d9; cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease; }
.command-toggle-row input[type="checkbox"]::before { content: ""; position: absolute; top: .16rem; left: .16rem; width: 1.06rem; height: 1.06rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(22, 32, 51, .24); transition: transform 160ms var(--ease); }
.command-toggle-row input[type="checkbox"]:checked { border-color: var(--primary); background: var(--primary); }
.command-toggle-row input[type="checkbox"]:checked::before { transform: translateX(1.25rem); }
.command-toggle-row input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .52; }
.command-toggle-row:has(input:disabled) { cursor: not-allowed; opacity: .78; }
.command-form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; align-items: end; }
.command-form-row label { display: grid; gap: .38rem; color: var(--text); font-size: .83rem; font-weight: 650; }
.command-form-row input, .command-form-row select { width: 100%; min-height: 2.7rem; padding: .58rem .72rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.command-form-row input:focus, .command-form-row select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 224, .12); outline: 0; }
.command-form-row input:disabled, .command-form-row select:disabled { cursor: not-allowed; background: #f2f5f9; color: var(--text-muted); }
.subadmin-picker { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-bottom: .8rem; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.permission-option { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .55rem; align-items: start; min-height: 3.55rem; padding: .65rem .72rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.permission-option input { width: 1rem; height: 1rem; margin: .16rem 0 0; accent-color: var(--primary); }
.permission-option span { display: grid; gap: .13rem; min-width: 0; }
.permission-option strong { color: var(--text); font-size: .82rem; line-height: 1.3; }
.permission-option small { color: var(--text-secondary); font-size: .72rem; line-height: 1.35; }
.permission-option.is-disabled { cursor: not-allowed; background: #f3f6fa; }
.command-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; margin-top: .9rem; }
.command-danger { border-color: #eab7c0 !important; color: var(--danger) !important; }
.command-danger:hover:not(:disabled) { border-color: var(--danger) !important; background: var(--danger-soft) !important; }
.command-boundary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .65rem; margin-top: 1.15rem; padding: .85rem .95rem; border: 1px solid #f0d39a; border-radius: 9px; background: var(--warning-soft); }
.command-boundary svg { width: 1.15rem; height: 1.15rem; margin-top: .1rem; fill: none; stroke: var(--warning); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; }
.command-boundary p { margin: 0; color: #70470c; font-size: .81rem; line-height: 1.5; }
.command-dialog[data-busy="true"] .command-window { cursor: progress; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

@media (max-width: 900px) {
  .dispatch-window, .layout-grid, .operations-grid { grid-template-columns: 1fr; }
  .fleet-readout { grid-template-columns: repeat(3, 1fr); }
  .fleet-readout > div { display: block; }
  .fleet-readout dd { margin-top: .18rem; }
  .tenant-course { grid-template-columns: .5rem minmax(0, 1fr) auto; }
  .tenant-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .tenant-state { grid-column: 3; grid-row: 1; align-self: start; min-width: auto; }
  .runtime-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .permission-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 1rem, 1280px); padding-top: .8rem; }
  .control-stage { gap: 1.2rem; }
  .control-header { display: grid; align-items: stretch; gap: .9rem; }
  .masthead { width: 100%; }
  .header-actions { display: grid; width: 100%; grid-template-columns: auto minmax(0, 1fr); justify-content: stretch; }
  .header-actions .pairing-trigger { grid-column: 1 / -1; width: 100%; }
  .header-actions #refresh-button { grid-column: 1; }
  .header-actions #logout-button { grid-column: 2; width: 100%; }
  .session-state { display: none; }
  .masthead h1 { font-size: 1.25rem; }
  .dispatch-window { gap: 1.1rem; padding: 1.2rem; border-radius: 12px; }
  .fleet-readout { grid-template-columns: 1fr; }
  .fleet-readout > div { display: flex; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .panel-heading > p { text-align: left; }
  .tenant-course { gap: .7rem; min-height: 0; padding: 1rem .85rem; }
  .tenant-copy dl { display: block; }
  .tenant-copy dl > div + div { margin-top: .42rem; }
  .tenant-copy dd { max-width: 43vw; }
  .tenant-state { font-size: .72rem; }
  .enter-button { min-width: 0; flex: 1; }
  .tenant-command, .tenant-entry, .tenant-toggle { min-width: 0; flex: 1 1 calc(50% - .35rem); }
  .command-dialog { width: min(100% - 1rem, 68rem); max-height: calc(100dvh - 1rem); }
  .command-header { gap: .7rem; }
  .command-tenant-summary, .runtime-summary, .command-form-row, .subadmin-picker { grid-template-columns: 1fr; }
  .command-section-heading { flex-direction: column; gap: .45rem; }
  .command-section-heading .text-action { align-self: flex-start; }
  .payment-webhook-card { grid-template-columns: 1fr; }
  .payment-webhook-card .course-button { width: 100%; }
  .command-form-row .course-button { width: 100%; }
  .command-actions { align-items: stretch; flex-direction: column; }
  .command-actions .course-button { width: 100%; }
  .notice-panel { padding: 1rem; }
  .device-row { grid-template-columns: minmax(0, 1fr) auto; }
  .device-state { grid-column: 1; grid-row: 2; }
  .device-revoke { grid-column: 2; grid-row: 1 / span 2; }
  .audit-row { grid-template-columns: 1fr; gap: .25rem; }
  .pairing-header { margin-bottom: 1rem; }
  .pairing-controls { align-items: stretch; flex-direction: column; }
  .pairing-controls .text-action { align-self: flex-start; }
  .confirmation-controls { align-items: stretch; flex-direction: column-reverse; }
  .confirmation-controls .course-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
