/* Original UPAM components, with accessible Seiche colours and consistent type.
   Only presentation changes: retain all form, device and playback hooks. */
:root { --navy: var(--heading); --navy-dark: var(--brand-navy-dark); --blue: var(--steel-600); --blue-light: var(--brand-blue-light); --page-bg: var(--paper); --border: var(--line); --text: var(--ink); --muted: var(--ink-2); --green: var(--live); }
.unified-portal { background: var(--paper); color: var(--ink); font: 400 1rem/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
.unified-portal a { color: var(--steel-600); text-underline-offset: 3px; }
.unified-portal :focus-visible { outline: 3px solid var(--steel-500); outline-offset: 3px; }
.sc-skip { position: fixed; left: 1rem; top: -100px; padding: .75rem; z-index: 2000; background: var(--surface); }
.sc-skip:focus { top: .75rem; }
.unified-portal h1, .unified-portal h2, .unified-portal h3 { color: var(--heading); font-family: var(--ui); font-weight: 600; line-height: 1.3; letter-spacing: normal; }
.unified-portal h1 { font-size: 1.875rem; }
.unified-portal h2 { font-size: 1.25rem; }
.unified-portal .page-header, .unified-portal .pam-product-header { gap: 1rem; flex-wrap: wrap; }
.unified-portal :is(.eyebrow, .pam-product-header p) { color: var(--ink-2); font: 500 .875rem/1.5 var(--ui); text-transform: none; letter-spacing: normal; }
.unified-portal :is(.card, .panel, .pam-card, .pam-stat-tile, .admin-stat) { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.unified-portal :is(.pam-stat-tile, .admin-stat) { border-top: 3px solid var(--brand-blue); }
.unified-portal .panel { padding: 1.5rem; }
.unified-portal :is(.pam-card-header, .panel-heading, .fleet-admin-heading, .bridge-card-heading, .organisation-admin-heading) { background: var(--sunken); color: var(--heading); border-bottom: 1px solid var(--line); font-size: 1rem; text-transform: none; letter-spacing: normal; }
.unified-portal :is(input, select, textarea) { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: .375rem; font: inherit; max-width: 100%; }
.unified-portal input:is([type="checkbox"], [type="radio"]) { accent-color: var(--action); }
.unified-portal :is(.primary, .pam-primary-button) { background: var(--action); color: var(--action-ink); border-radius: .375rem; font: 600 .875rem/1.5 var(--ui); }
.unified-portal .primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.5rem; padding: .6rem 1rem; border: 0; border-radius: .375rem; background: var(--action); color: var(--action-ink); font: 600 .875rem/1.5 var(--ui); text-decoration: none; }
.unified-portal :is(.secondary, .management-links a, .pam-table-actions a, .pam-view-button) { background: var(--surface); border: 1px solid var(--line-strong); color: var(--steel-600); border-radius: .375rem; font: 600 .875rem/1.5 var(--ui); }
.unified-portal :is(.primary, .secondary, .pam-primary-button, .pam-view-button, .pam-stream-button) { min-height: 2.5rem; }
.unified-portal :is(.fleet-card, .monitor-device-card):hover { border-color: var(--brand-blue); background: var(--surface); transform: none; }
.unified-portal :is(.node-table, .pam-data-table) th { padding: .85rem 1rem; background: var(--sunken); color: var(--ink-2); font: 600 .875rem/1.4 var(--ui); text-transform: none; letter-spacing: normal; border-bottom-width: 1px; position: sticky; top: 0; z-index: 1; }
.unified-portal :is(.node-table, .pam-data-table) td { padding: 1rem; color: var(--ink); font-size: .9375rem; }
.unified-portal :is(.node-table, .pam-data-table) tbody tr:hover { background: var(--steel-100); }
.unified-portal :is(.node-table-wrap, .pam-table-scroll) { max-height: 65vh; overflow: auto; scrollbar-color: var(--line-strong) var(--sunken); }
.unified-portal :is(.pam-mono, .mono-lite, code, .recovery-codes) { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .875rem; }
.unified-portal :is(.pam-stat-tile, .admin-stat) strong { font: 600 2rem/1.3 var(--ui); font-variant-numeric: tabular-nums; }
.unified-portal :is(.pam-stat-tile strong.pam-stat-date, .admin-stat .stat-date) { font: 600 1rem/1.5 var(--ui); white-space: normal; }
.unified-portal :is(.device-stats dt, .pam-device-stats dt, .admin-stat span, .pam-stat-tile span) { font-size: .875rem; font-weight: 500; text-transform: none; letter-spacing: normal; }
.unified-portal :is(.admin-stat small, .pam-stat-tile small, .pam-device-action small, .gateway-bar small, .pending-list small, .bridge-card-heading small, .node-table td small) { font: .8125rem/1.5 var(--ui); color: var(--ink-2); text-transform: none; letter-spacing: normal; }
.unified-portal :is(.device-stats dd, .pam-device-stats dd) { font-size: 1rem; }
.unified-portal :is(.badge, .pam-badge, .status) { border-radius: .3rem; font: 600 .875rem/1.5 var(--ui); text-transform: none; letter-spacing: normal; background: var(--sunken); color: var(--ink-2); border-color: var(--line-strong); }
.unified-portal :is(.badge-active, .badge-on, .pam-badge-ok, .pam-status-online, .success-message, .portal-message-success) { background: var(--live-bg); color: var(--live); border-color: var(--live); }
.unified-portal :is(.badge-pending, .badge-maintenance, .pam-status-stale, .pairing-warning) { background: var(--attention-bg); color: var(--attention); border-color: var(--attention); }
.unified-portal :is(.pam-status-silent, .form-error, .portal-message-error, .danger-link) { background: var(--fault-bg); color: var(--fault); border-color: var(--fault); }
.unified-portal :is(.text-button, .bridge-pairing-form label em) { color: var(--fault); }
.unified-portal :is(.pam-map-caption, .spectrogram-settings, .bridge-readiness, .pairing-review-grid div, .pam-share-options label, .recovery-codes li, .pairing-flow, .pairing-review, .bridge-pairing-form) { background: var(--sunken); }
.unified-portal .command-status-list { background: var(--surface); }
.unified-portal :is(.inline-editor[open] > form, dialog) { color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 12px 36px #15284726; }
.unified-portal dialog::backdrop { background: #15284799; }
.unified-portal .dialog-heading { background: var(--sunken); }
.unified-portal .pam-product-header nav a { font-size: .875rem; }
.unified-portal .pam-product-header nav a:is(.active, :hover) { background: var(--steel-100); color: var(--steel-600); }
.unified-portal :is(.pam-device-type, .pam-type-badge) { color: var(--steel-600); font-size: .875rem; text-transform: none; letter-spacing: normal; }
.unified-portal .pam-type-badge { background: var(--steel-100); border-color: var(--steel-300); }
.unified-portal :is(.pam-device-flags i, .pam-position-dot, .pam-stream-status i.live) { background: var(--live); box-shadow: none; }
.unified-portal .pam-spectrogram { background: var(--surface); border-color: var(--line); border-radius: var(--radius); }
.unified-portal .pam-spectrogram > header { background: var(--sunken); border-color: var(--line); color: var(--heading); font-size: .875rem; text-transform: none; letter-spacing: normal; flex-wrap: wrap; gap: .75rem; }
.unified-portal .pam-stream-status { border-radius: .375rem; color: var(--ink-2); border-color: var(--line); background: var(--surface); }
.unified-portal .pam-stream-controls { border-color: var(--line); }
.unified-portal :is(.pam-stream-control, .pam-stream-control output, .pam-local-note, .pam-time-axis) { color: var(--ink-2); font: .875rem/1.5 var(--ui); }
.unified-portal .pam-stream-button { background: var(--steel-100); color: var(--steel-600); border-color: var(--line-strong); border-radius: .375rem; font-size: .875rem; }
.unified-portal .pam-stream-button.pam-connect { background: var(--live-bg); color: var(--live); border-color: var(--live); }
.unified-portal .pam-stream-button:is(.pam-disconnect, .pam-record) { background: var(--fault-bg); color: var(--fault); border-color: var(--fault); }
.unified-portal .pam-stream-control :is(input, select) { background: var(--surface); color: var(--ink); border-color: var(--line-strong); font-size: .875rem; padding: .4rem; }
.unified-portal :is(.pam-payload, .payload-detail) { background: var(--sunken); color: var(--ink-2); border-color: var(--line); border-radius: .375rem; }
.unified-portal .login-wrap { margin: clamp(1.5rem, 6vh, 5rem) auto 0; max-width: 440px; }
.unified-portal .login-wrap header h1 { font: 600 2rem/1.3 var(--ui); }
.unified-portal .login-card h2 { background: var(--brand-navy); color: #fff; font: 600 1rem/1.5 var(--ui); text-transform: none; letter-spacing: normal; }
.unified-portal .qr-code { background: white; padding: .75rem; width: fit-content; }
.unified-portal :is(.management-links, .admin-actions) { flex-wrap: wrap; }
.unified-portal :is(.form-help, .safety-note, .map-note, .admin-dialog label small, .pam-share-fieldset > p, .config-note) { font: .875rem/1.5 var(--ui); }
.unified-portal :is(.pam-detail-table th, .pam-detail-table td) { padding: .875rem; font-size: .9375rem; color: var(--ink); }
.unified-portal :is(.pam-detail-table th, .pam-detail-table td:first-child) { color: var(--ink-2); }
.unified-portal :is(.pam-page-heading a, .pam-table-actions a, .text-button, .inline-editor > summary, .inline-editor label, .pam-edit-button, .pam-clear-sharing, .pam-share-options label, .bridge-setup-links a, .pam-share-fieldset legend, .pam-customer-name, .bridge-setup-step, .bridge-readiness-item > span, .bridge-pairing-form label, .pairing-review-grid dt, .command-status-list, .fleet-admin-meta, .pam-transmitted, .compact-button, .breadcrumbs) { font-size: .875rem; line-height: 1.5; text-transform: none; letter-spacing: normal; }
.unified-portal .pam-summary { font-size: 1rem; }
.unified-portal .admin-dialog label em { color: var(--fault); font-size: .875rem; }
.unified-portal .bridge-readiness-item small { font: .8125rem/1.5 var(--ui); color: var(--ink-2); white-space: normal; overflow-wrap: anywhere; }
.unified-portal :is(h1, h2, h3) { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .unified-portal :is(.fleet-grid, .pam-device-grid, .monitor-device-grid) { grid-template-columns: minmax(0, 1fr); }
  .unified-portal .inline-editor[open] > form { position: fixed; inset: auto 1rem 1rem; width: auto; max-height: 80vh; overflow: auto; }
  .unified-portal .inline-member-form { grid-template-columns: 1fr; }
}
