:root {
  color-scheme: light;
  --navy-950: #071527;
  --navy-900: #0b2038;
  --navy-800: #12304f;
  --blue-700: #075fcb;
  --blue-600: #0875e1;
  --blue-100: #dceeff;
  --cyan-400: #29d3dc;
  --green-700: #047a56;
  --green-100: #d8f7e9;
  --amber-700: #a55608;
  --amber-100: #fff0ce;
  --violet-700: #6740c5;
  --violet-100: #eee7ff;
  --red-700: #b42332;
  --red-100: #fde7e9;
  --ink: #15283d;
  --muted: #67798c;
  --line: #dfe7ee;
  --line-soft: #eaf0f4;
  --surface: #ffffff;
  --surface-soft: #f5f8fb;
  --canvas: #edf3f7;
  --shadow: 0 12px 32px rgba(19, 42, 67, 0.08);
  font-family: "Aptos", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { max-width: 100%; overflow-x: clip; }
body { width: 100%; max-width: 100%; margin: 0; overflow-x: clip; background: var(--canvas); color: var(--ink); font-size: 16px; }
button, input, select { font: inherit; }
button { color: inherit; }
input, select { min-width: 0; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell { width: 100%; max-width: 100%; min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 18px 22px; background: linear-gradient(160deg, var(--navy-950), var(--navy-900) 62%, #0c2d45); color: #dce9f5; display: flex; flex-direction: column; }
.brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 12px; padding: 0 10px 30px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg, var(--cyan-400), var(--blue-600)); box-shadow: 0 8px 24px rgba(41, 211, 220, .18); }
.brand-mark svg { width: 24px; stroke-width: 2.5; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font-size: 1.14rem; letter-spacing: .01em; }
.brand small { margin-top: 5px; color: #8fa8bd; font-size: .7rem; letter-spacing: .18em; }
.nav-list { display: grid; gap: 7px; }
.nav-item { appearance: none; border: 0; background: transparent; color: #90a8bc; min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: .9rem; text-align: left; cursor: pointer; }
.nav-item svg { width: 20px; }
.nav-item.active { color: white; background: rgba(255,255,255,.09); box-shadow: inset 3px 0 0 var(--cyan-400); }
.nav-item:disabled { opacity: .48; cursor: default; }
.sidebar-foot { margin-top: auto; }
.environment-card { border: 1px solid rgba(255,255,255,.11); border-radius: 12px; padding: 13px; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.04); }
.environment-card div { display: flex; flex-direction: column; gap: 3px; }
.environment-card strong { font-size: .82rem; }
.environment-card small, .sidebar-foot p { color: #8fa8bd; font-size: .72rem; }
.sidebar-foot p { margin: 13px 4px 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #39d497; box-shadow: 0 0 0 4px rgba(57,212,151,.13); flex: 0 0 auto; }

.main-content { width: 100%; max-width: 100%; min-width: 0; padding: 0 30px 36px; }
.topbar { min-height: 102px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 4px; color: var(--blue-700); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.8rem; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.status-pill, .safe-mode { background: var(--amber-100); color: var(--amber-700); border: 1px solid #f5d999; border-radius: 999px; padding: 7px 11px; font-size: .76rem; font-weight: 700; }
.safe-mode.edit-enabled { color: #08734f; background: var(--green-100); border-color: #b8e8d2; }
.status-pill.live { background: var(--green-100); color: var(--green-700); border-color: #b8e8d2; }
.icon-button { width: 40px; height: 40px; border: 0; border-radius: 11px; background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.icon-button svg { width: 19px; }
.icon-button.bordered { border: 1px solid var(--line); width: 36px; height: 36px; }
.user-button { border: 0; background: transparent; display: flex; gap: 9px; align-items: center; padding: 2px; text-align: left; }
.user-button > span:first-child { width: 40px; height: 40px; border-radius: 12px; background: var(--navy-800); color: white; display: grid; place-items: center; font-size: .78rem; font-weight: 700; }
.user-copy { display: flex; flex-direction: column; gap: 2px; }
.user-copy strong { font-size: .82rem; }
.user-copy small { color: var(--muted); font-size: .72rem; }
.logout-button { min-height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: .76rem; font-weight: 700; }
.logout-button:hover { border-color: #efb9bf; background: var(--red-100); color: var(--red-700); }
.logout-button svg { width: 17px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-height: 92px; padding: 18px; border: 1px solid var(--line-soft); background: var(--surface); border-radius: 14px; display: grid; grid-template-columns: auto auto 1fr; gap: 13px; align-items: center; box-shadow: 0 2px 10px rgba(19,42,67,.025); }
.metric-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; }
.metric-icon svg { width: 20px; }
.metric-icon.blue { color: var(--blue-700); background: var(--blue-100); }
.metric-icon.green { color: var(--green-700); background: var(--green-100); }
.metric-icon.amber { color: var(--amber-700); background: var(--amber-100); }
.metric-icon.violet { color: var(--violet-700); background: var(--violet-100); }
.metric-card div { display: flex; flex-direction: column; }
.metric-card small { color: var(--muted); font-size: .76rem; }
.metric-card strong { font-size: 1.45rem; line-height: 1.2; }
.metric-note { justify-self: end; color: var(--muted); font-size: .7rem; }
.metric-note.positive { color: var(--green-700); }

.workspace { width: 100%; max-width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); gap: 18px; align-items: start; }
.workspace[hidden], .metrics[hidden] { display: none; }
.device-list-panel, .device-detail { min-width: 0; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.device-list-panel { overflow: hidden; }
.panel-heading { padding: 20px 20px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin-bottom: 3px; font-size: 1rem; }
.panel-heading p { margin: 0; color: var(--muted); font-size: .77rem; }
.search-box { height: 42px; margin: 0 16px 12px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; gap: 8px; transition: border-color .15s, box-shadow .15s; }
.search-box:focus-within { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(8,117,225,.1); }
.search-box svg { width: 18px; color: var(--muted); }
.search-box input { border: 0; outline: 0; min-width: 0; flex: 1; color: var(--ink); background: transparent; font-size: .82rem; }
.search-box kbd { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; color: var(--muted); padding: 1px 6px; font-size: .68rem; }
.filter-row { display: flex; gap: 7px; padding: 0 16px 14px; border-bottom: 1px solid var(--line-soft); }
.filter-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 9px; color: var(--muted); font-size: .72rem; font-weight: 600; cursor: pointer; }
.filter-chip span { margin-left: 4px; opacity: .75; }
.filter-chip.active { background: var(--navy-800); border-color: var(--navy-800); color: white; }
.device-list { max-width: 100%; max-height: 654px; overflow-x: hidden; overflow-y: auto; }
.device-row { width: 100%; min-width: 0; border: 0; border-bottom: 1px solid var(--line-soft); background: white; padding: 15px 16px; text-align: left; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, auto); gap: 11px; align-items: center; cursor: pointer; transition: background .15s, box-shadow .15s; }
.device-row:last-child { border-bottom: 0; }
.device-row:hover { background: #f7fbfe; }
.device-row.active { background: #edf7ff; box-shadow: inset 3px 0 0 var(--blue-600); }
.row-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--blue-700); background: var(--blue-100); }
.row-icon svg { width: 20px; }
.row-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-copy strong { font-size: .82rem; overflow-wrap: anywhere; }
.row-copy small { color: var(--muted); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-status { min-width: 0; max-width: 112px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; color: var(--muted); font-size: .66rem; text-align: right; overflow-wrap: anywhere; }
.row-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #c2ccd5; }
.row-status .dot.online { background: #24b980; box-shadow: 0 0 0 3px rgba(36,185,128,.13); }
.empty-result { padding: 36px 20px; text-align: center; color: var(--muted); font-size: .82rem; }

.device-detail { min-width: 0; overflow: hidden; }
.device-header { min-height: 92px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line-soft); }
.device-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.device-glyph { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; color: var(--blue-700); background: linear-gradient(145deg, #e9f6ff, #d7ebff); }
.device-glyph svg { width: 28px; }
.title-line { display: flex; align-items: center; gap: 9px; }
.title-line h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.015em; }
.device-identity p { margin: 5px 0 0; color: var(--muted); font-size: .76rem; }
.online-badge, .enabled-label, .firmware-pill { border-radius: 999px; padding: 4px 8px; font-size: .68rem; font-weight: 700; }
.online-badge, .enabled-label { color: var(--green-700); background: var(--green-100); }
.online-badge.offline { color: var(--amber-700); background: var(--amber-100); }
.firmware-pill { color: var(--violet-700); background: var(--violet-100); }
.device-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.button { min-height: 38px; border: 1px solid transparent; border-radius: 9px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: .76rem; font-weight: 700; cursor: pointer; }
.button svg { width: 17px; }
.button.secondary { background: white; border-color: var(--line); }
.button.secondary:hover { background: var(--surface-soft); }
.button:disabled { cursor: wait; opacity: .72; }
.button.is-loading svg { animation: button-spin .8s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.button.danger-ghost { background: white; border-color: #f2c8cc; color: var(--red-700); }
.button.danger { background: var(--red-700); color: white; }
.button.primary { background: var(--blue-700); color: white; }
.access-web-button { width: 100%; margin-top: 14px; text-decoration: none; }
.settings-page { max-width: 860px; margin: 0 auto; display: grid; gap: 18px; }
.settings-page[hidden] { display: none; }
.settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.settings-heading { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.settings-heading h2 { margin: 1px 0 5px; font-size: 1.05rem; }
.settings-heading p { margin: 0; color: var(--muted); font-size: .77rem; line-height: 1.5; }
.settings-form { display: grid; gap: 16px; padding-top: 20px; }
.settings-form > label { display: grid; gap: 7px; color: var(--muted); font-size: .75rem; font-weight: 700; }
.settings-form input { width: 100%; height: 43px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; color: var(--ink); background: white; outline: 0; }
.settings-form input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(8,117,225,.1); }
.settings-security-note { display: flex; flex-direction: column; gap: 3px; border: 1px solid #ccebdc; border-radius: 10px; padding: 12px 14px; color: var(--green-700); background: #f3fbf7; font-size: .72rem; line-height: 1.45; }
.settings-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.settings-state { color: var(--muted); font-size: .72rem; }
.settings-state.configured { color: var(--green-700); font-weight: 700; }
.backup-reader-card { min-width: 0; }
.backup-reader-card code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }
.backup-summary { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.backup-summary-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.backup-summary-heading h3 { margin: 0 0 4px; font-size: .9rem; }
.backup-summary-heading p { margin: 0; color: var(--muted); font-size: .7rem; overflow-wrap: anywhere; }
.backup-steering { border: 1px solid #ccebdc; border-radius: 10px; padding: 11px 13px; background: #f3fbf7; color: var(--green-700); display: flex; justify-content: space-between; gap: 12px; font-size: .73rem; }
.backup-steering span { color: var(--muted); }
.backup-feature-panel { display: grid; gap: 12px; margin-top: 12px; padding: 14px 16px; border: 1px solid #ccebdc; border-radius: 12px; background: #f3fbf7; }
.backup-feature-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--green-700); font-size: .76rem; }
.backup-feature-heading span, .backup-feature-limits { color: var(--muted); font-size: .68rem; }
.backup-feature-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.backup-feature-toggle { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border: 1px solid #d9e7e1; border-radius: 10px; color: #40566c; background: #fff; cursor: pointer; }
.backup-feature-toggle:has(input:checked) { border-color: #78cfab; box-shadow: 0 0 0 2px rgba(36,185,128,.08); }
.backup-feature-toggle input { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; accent-color: var(--green-700); }
.backup-feature-toggle span { display: grid; gap: 2px; }
.backup-feature-toggle strong { color: var(--ink); font-size: .76rem; }
.backup-feature-toggle small { color: var(--muted); font-size: .66rem; line-height: 1.35; }
.backup-network-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.backup-network { min-width: 0; border: 1px solid #dbe6f1; border-radius: 14px; padding: 18px; background: linear-gradient(145deg, #fff, #fbfdff); box-shadow: 0 8px 24px rgba(16,35,63,.045); }
.backup-network h3 { margin: 0 0 14px; font-size: .86rem; color: var(--ink); }
.backup-network p { margin: 0; color: var(--muted); font-size: .72rem; }
.tabs { height: 52px; padding: 0 22px; border-bottom: 1px solid var(--line); display: flex; gap: 24px; }
.tab { position: relative; border: 0; background: transparent; color: var(--muted); padding: 0 2px; font-size: .79rem; font-weight: 700; cursor: pointer; }
.tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; }
.tab.active { color: var(--blue-700); }
.tab.active::after { background: var(--blue-600); }
.tab-panel { min-width: 0; max-width: 100%; padding: 20px 22px 24px; overflow-x: hidden; }
.tab-panel[hidden] { display: none; }
.health-banner { min-height: 78px; border: 1px solid #ccebdc; background: linear-gradient(90deg, #eefbf5, #f7fcfa); border-radius: 13px; padding: 13px 16px; display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.health-score { position: relative; width: 48px; height: 48px; display: grid; place-items: center; }
.health-score svg { position: absolute; width: 48px; height: 48px; transform: rotate(-90deg); }
.health-score circle { fill: none; stroke: #ccebdc; stroke-width: 4; }
.health-score circle.progress { stroke: #24b980; stroke-dasharray: 106.8; stroke-dashoffset: 8.5; }
.health-score strong { font-size: .8rem; }
.health-banner h3 { margin-bottom: 3px; font-size: .9rem; }
.health-banner p { margin: 0; color: var(--muted); font-size: .73rem; }
.quality-chip { margin-left: auto; color: var(--green-700); font-size: .7rem; font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.info-card { border: 1px solid var(--line); border-radius: 13px; padding: 17px; min-width: 0; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
.card-title h3 { margin: 0; font-size: .86rem; }
.card-title .status-dot { width: 7px; height: 7px; }
.text-button { border: 0; background: transparent; color: var(--blue-700); font-size: .7rem; font-weight: 700; cursor: pointer; padding: 2px; }
dl { margin: 0; }
dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
dt { color: var(--muted); font-size: .72rem; }
dd { margin: 0; text-align: right; font-size: .74rem; font-weight: 600; overflow-wrap: anywhere; }
.text-success { color: var(--green-700); }
.wifi-summary { display: grid; gap: 11px; }
.wifi-summary > div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.wifi-summary > div + div { padding-top: 11px; border-top: 1px solid var(--line-soft); }
.wifi-summary div div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wifi-summary strong { font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wifi-summary small { color: var(--muted); font-size: .68rem; }
.band { width: 32px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-100); color: var(--blue-700); font-size: .65rem; font-weight: 800; }
.band.accent { background: var(--violet-100); color: var(--violet-700); }
.band.combined { width: 46px; background: linear-gradient(135deg, var(--blue-100) 0 49%, var(--violet-100) 51% 100%); color: var(--navy-800); font-size: .6rem; line-height: .8rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { display: flex; gap: 10px; align-items: flex-start; }
.timeline-icon { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: #b9c5cf; box-shadow: 0 0 0 4px #edf1f4; }
.timeline-icon.success { background: #24b980; box-shadow: 0 0 0 4px var(--green-100); }
.timeline-icon.blue { background: var(--blue-600); box-shadow: 0 0 0 4px var(--blue-100); }
.timeline li div { display: flex; flex-direction: column; gap: 2px; }
.timeline strong { font-size: .72rem; }
.timeline small { color: var(--muted); font-size: .67rem; }
.ixc-card { grid-column: 1 / -1; }
.ixc-card .card-title > div { min-width: 0; }
.ixc-card .card-title small { display: block; margin-top: 3px; color: var(--muted); font-size: .67rem; font-weight: 400; }
.ixc-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.ixc-status { flex: 0 0 auto; border-radius: 999px; padding: 6px 10px; background: var(--green-100); color: var(--green-700); font-size: .66rem; font-weight: 800; }
.ixc-status.loading { background: var(--blue-100); color: var(--blue-700); }
.ixc-status.offline, .ixc-status.error { background: var(--amber-100); color: var(--amber-700); }
.ixc-message { margin: 0; border-radius: 9px; padding: 10px 12px; background: var(--amber-100); color: var(--amber-700); font-size: .72rem; }
.ixc-message:not([hidden]) + .ixc-details { display: none; }

.section-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-intro h3 { margin-bottom: 3px; font-size: 1rem; }
.section-intro p { margin: 0; color: var(--muted); font-size: .78rem; }
.wifi-mode-note { margin: -4px 0 16px; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; color: var(--muted); background: var(--surface-soft); font-size: .73rem; line-height: 1.5; }
.wifi-mode-note strong { color: var(--ink); }
.wifi-mode-note.active { border-color: #b8e8d2; background: #f0fbf6; }
.wifi-mode-note.separate { border-color: #d8e5ef; background: #f7fafc; }
.config-grid { width: 100%; max-width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.config-grid.unified { grid-template-columns: minmax(0, 1fr); }
.config-card { min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 18px; }
.unified-wifi-card { max-width: 760px; }
.config-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.config-head > div { display: flex; align-items: center; gap: 9px; }
.config-head h3 { margin: 0; font-size: .88rem; }
.config-head .switch { display: block; margin: 0; }
.config-card label { color: var(--muted); font-size: .72rem; font-weight: 600; display: grid; gap: 6px; margin-bottom: 13px; }
.config-card input, .config-card select { width: 100%; height: 39px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface-soft); color: var(--ink); font-size: .77rem; opacity: 1; }
.field-row { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.switch input { position: absolute; opacity: 0; }
.switch span { display: block; width: 38px; height: 22px; padding: 3px; border-radius: 999px; background: #c9d3dc; }
.switch span::after { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: white; transform: translateX(0); box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .15s ease; }
.switch input:checked + span { background: #24b980; }
.switch input:checked + span::after { transform: translateX(16px); }
.password-field { position: relative; }
.password-field input { padding-right: 40px; }
.reveal-password { position: absolute; right: 4px; top: 4px; width: 31px; height: 31px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; transition: color .15s ease, background .15s ease; }
.reveal-password:hover, .reveal-password[aria-pressed="true"] { color: var(--blue-600); background: rgba(8,117,225,.09); }
.reveal-password:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 1px; }
.reveal-password:disabled { cursor: wait; opacity: .65; }
.reveal-password.loading svg { animation: password-pulse .8s ease-in-out infinite alternate; }
.reveal-password svg { width: 18px; }
@keyframes password-pulse { to { opacity: .25; transform: scale(.88); } }
.password-action-row { display: flex; justify-content: flex-end; margin-top: -2px; }
.password-action-row .edit-wifi-password { min-height: 36px; padding: 0 12px; font-size: .72rem; }
.password-action-row .edit-wifi-password svg { width: 16px; }
.file-only-password-notice { margin-top: 14px; border: 1px solid #ead9a4; border-radius: 10px; padding: 11px 12px; background: #fffaf0; color: #765b13; display: grid; gap: 4px; font-size: .72rem; line-height: 1.45; }
.file-only-password-notice strong { color: #59420b; font-size: .75rem; }
.hg-feature-controls { margin-top: 11px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.feature-control { border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.feature-control > span { display: grid; gap: 1px; }
.feature-control small { color: var(--muted); font-size: .65rem; }
.feature-control input { width: 18px; height: 18px; accent-color: var(--blue-600); }
.feature-control:has(input:disabled) { cursor: not-allowed; opacity: .66; }
.white-hg-editor { width: 100%; min-width: 0; }
.white-hg-editor .backup-summary-heading { border: 1px solid #cfe0ef; border-radius: 12px; padding: 13px 15px; background: #f6faff; }
.white-config-state { margin: 12px 0 0; border-radius: 10px; padding: 10px 12px; background: #edf8f2; color: #176747; font-size: .72rem; line-height: 1.45; }
.white-config-state.cached { background: #fff8e8; color: #7a5812; }
.white-config-loading { border: 1px solid var(--line); border-radius: 13px; padding: 22px; color: var(--muted); background: var(--surface-soft); font-size: .78rem; }
.white-hg-editor .backup-editor-actions { justify-content: flex-end; }
.white-hg-editor .backup-network-grid.unified { grid-template-columns: minmax(0, 1fr); }
.white-hg-editor .backup-network-grid.unified .backup-network { max-width: 760px; }
.voip-form { border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: #fff; }
.voip-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; border-radius: 10px; padding: 11px 13px; background: #f0f8f4; color: var(--muted); font-size: .74rem; }
.voip-status strong { color: var(--ink); }
.voip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.voip-form h4 { margin: 22px 0 10px; font-size: .82rem; }
.voip-server-grid { display: grid; gap: 10px; }
.voip-server-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px; }
.voip-field { display: grid; gap: 6px; color: var(--muted); font-size: .7rem; font-weight: 700; }
.voip-field input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: var(--surface-soft); color: var(--ink); }
.voip-field input:focus { outline: 2px solid rgba(8,117,225,.18); border-color: var(--blue-600); }
.voip-form-footer { display: grid; grid-template-columns: minmax(280px,1fr) auto; align-items: center; gap: 22px; margin: 24px -20px -20px; padding: 18px 20px; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; background: linear-gradient(135deg,#f8fbfd 0%,#f2f7fb 100%); }
.voip-security-note { flex-direction: row; align-items: center; gap: 12px; min-width: 0; margin: 0; border: 0; padding: 0; background: transparent; }
.voip-security-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border: 1px solid #bde5d3; border-radius: 11px; color: var(--green-700); background: #e8f8f0; box-shadow: 0 3px 10px rgba(14,118,80,.08); }
.voip-security-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.voip-security-copy { display: grid; gap: 2px; min-width: 0; }
.voip-security-copy strong { color: var(--ink); font-size: .75rem; }
.voip-security-copy span { color: var(--muted); font-size: .69rem; line-height: 1.45; }
.voip-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 0; }
.voip-actions .button { min-height: 42px; padding-inline: 17px; white-space: nowrap; }
.voip-actions .primary { box-shadow: 0 7px 16px rgba(8,117,225,.18); }
.lan-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.lan-table { width: 100%; border-collapse: collapse; font-size: .73rem; }
.lan-table th, .lan-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
.lan-table th { background: var(--surface-soft); color: var(--muted); font-size: .67rem; text-transform: uppercase; letter-spacing: .03em; }
.lan-table tr:last-child td { border-bottom: 0; }
.lan-table td .dot { display: inline-block; margin-right: 6px; }
.lan-table .button { min-height: 32px; padding: 0 10px; font-size: .67rem; }
.connection-kind { display: inline-flex; border-radius: 999px; padding: 4px 8px; background: #eef4fa; color: #3c5b76; font-weight: 800; }
.connection-kind.wifi { background: #e9f7f1; color: #087e57; }
.lan-client-dialog { width: min(760px, calc(100vw - 28px)); overflow: hidden; border: 1px solid rgba(255,255,255,.72); background: #fff; }
.lan-client-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(135deg,#fff 0%,#f6f9fc 100%); }
.lan-client-modal-head > div { min-width: 0; }
.lan-client-modal-kicker { display: block; margin-bottom: 5px; color: var(--blue-600); font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.lan-client-modal-head h2 { margin: 0 0 5px; color: var(--ink); font-size: 1.05rem; line-height: 1.25; }
.lan-client-modal-head p { margin: 0; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
.lan-client-close { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: #60758b; background: #fff; box-shadow: 0 3px 10px rgba(16,35,63,.06); cursor: pointer; transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.lan-client-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lan-client-close:hover { border-color: #f0b9bd; color: var(--red-700); background: var(--red-100); box-shadow: 0 5px 14px rgba(190,37,47,.12); transform: translateY(-1px); }
.lan-client-close:active { transform: translateY(0); }
.lan-client-close:focus-visible { outline: 3px solid rgba(8,117,225,.18); outline-offset: 2px; }
.lan-client-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 20px 24px 24px; }
.lan-client-details > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; border: 1px solid var(--line-soft); border-radius: 11px; padding: 10px 13px; background: var(--surface-soft); transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.lan-client-details > div:hover { border-color: #c9d9e8; background: #f8fbfd; transform: translateY(-1px); }
.lan-client-details dt { color: var(--muted); font-size: .65rem; }
.lan-client-details dd { margin: 0; color: var(--ink); font-size: .76rem; font-weight: 800; text-align: right; overflow-wrap: anywhere; }
.unified-band-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.unified-band-grid article { border: 1px solid var(--line-soft); border-radius: 11px; padding: 13px; background: var(--surface-soft); }
.unified-band-grid article > div:first-child { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.unified-band-grid article strong { font-size: .8rem; }
.diagnostic-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.diagnostic-actions button { border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface-soft); min-height: 98px; padding: 16px; display: flex; align-items: flex-start; gap: 12px; text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease; }
.diagnostic-actions button:hover { border-color: #b9d7f3; background: #f5faff; box-shadow: 0 7px 18px rgba(16,35,63,.07); transform: translateY(-2px); }
.diagnostic-actions button:focus-visible { outline: 3px solid rgba(8,117,225,.18); outline-offset: 2px; }
.diagnostic-actions button:disabled { opacity: .58; cursor: wait; transform: none; }
.diagnostic-actions svg { width: 23px; flex: 0 0 23px; fill: none; stroke: var(--blue-700); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.diagnostic-actions span { display: flex; flex-direction: column; gap: 4px; }
.diagnostic-actions strong { font-size: .82rem; }
.diagnostic-actions small { color: var(--muted); font-size: .7rem; line-height: 1.4; }
.diagnostic-result { margin-top: 16px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }
.diagnostic-empty { display: grid; gap: 4px; padding: 25px; color: var(--muted); text-align: center; }
.diagnostic-empty strong { color: var(--ink); font-size: .82rem; }
.diagnostic-empty span { font-size: .72rem; }
.diagnostic-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 19px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(135deg,#f8fbfd,#f3f8fb); }
.diagnostic-summary-copy { display: grid; gap: 3px; }
.diagnostic-summary-copy strong { color: var(--ink); font-size: .86rem; }
.diagnostic-summary-copy span { color: var(--muted); font-size: .69rem; }
.diagnostic-score { min-width: 62px; border-radius: 999px; padding: 7px 11px; color: var(--green-700); background: #e8f8f0; font-size: .72rem; font-weight: 800; text-align: center; }
.diagnostic-score.warn { color: var(--amber-700); background: var(--amber-100); }
.diagnostic-score.bad { color: var(--red-700); background: var(--red-100); }
.diagnostic-checks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; }
.diagnostic-check { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 67px; padding: 13px 17px; border-bottom: 1px solid var(--line-soft); }
.diagnostic-check:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.diagnostic-check:nth-last-child(-n+2) { border-bottom: 0; }
.diagnostic-check-dot { width: 9px; height: 9px; border-radius: 50%; background: #94a3b2; box-shadow: 0 0 0 4px rgba(148,163,178,.12); }
.diagnostic-check.good .diagnostic-check-dot { background: #18b77d; box-shadow: 0 0 0 4px rgba(24,183,125,.12); }
.diagnostic-check.warn .diagnostic-check-dot { background: #e69a20; box-shadow: 0 0 0 4px rgba(230,154,32,.13); }
.diagnostic-check.bad .diagnostic-check-dot { background: #d83b46; box-shadow: 0 0 0 4px rgba(216,59,70,.12); }
.diagnostic-check-copy { display: grid; gap: 3px; min-width: 0; }
.diagnostic-check-copy strong { color: var(--ink); font-size: .74rem; }
.diagnostic-check-copy small { color: var(--muted); font-size: .66rem; line-height: 1.35; }
.diagnostic-check-value { max-width: 150px; color: #40566c; font-size: .7rem; font-weight: 800; text-align: right; overflow-wrap: anywhere; }

dialog { width: min(430px, calc(100% - 32px)); border: 0; border-radius: 16px; padding: 0; box-shadow: 0 24px 80px rgba(7,21,39,.26); }
dialog::backdrop { background: rgba(7,21,39,.55); backdrop-filter: blur(2px); }
dialog form { padding: 26px; text-align: center; }
.dialog-icon { width: 48px; height: 48px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; color: var(--red-700); background: var(--red-100); }
.dialog-icon svg { width: 23px; }
dialog h2 { margin-bottom: 8px; font-size: 1.1rem; }
dialog p { color: var(--muted); font-size: .8rem; line-height: 1.55; }
.dialog-actions { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 340px; background: var(--navy-900); color: white; border-radius: 11px; padding: 13px 16px; font-size: .78rem; box-shadow: 0 14px 36px rgba(7,21,39,.24); transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.visible { transform: translateY(0); opacity: 1; }
.login-dialog form { text-align: left; }
.login-dialog .login-mark { margin: 0 auto 16px; color: white; }
.login-dialog h2, .login-dialog > form > p { text-align: center; }
.login-dialog label { display: grid; gap: 6px; margin: 13px 0; color: var(--muted); font-size: .76rem; font-weight: 700; }
.login-dialog input { height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; color: var(--ink); outline: 0; }
.login-dialog input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(8,117,225,.1); }
.login-dialog .button { width: 100%; margin-top: 5px; }
.login-error { min-height: 18px; margin: 4px 0; color: var(--red-700) !important; text-align: left !important; }
.wifi-password-dialog form { text-align: left; }
.wifi-password-dialog h2, .wifi-password-dialog form > p { text-align: center; }
.wifi-password-dialog .wifi-dialog-icon { color: var(--blue-700); background: var(--blue-100); }
.wifi-password-dialog label { display: grid; gap: 6px; margin: 13px 0; color: var(--muted); font-size: .76rem; font-weight: 700; }
.wifi-password-dialog input { height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; color: var(--ink); outline: 0; }
.wifi-password-dialog input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(8,117,225,.1); }
.wifi-change-warning { margin: 16px 0 10px; border: 1px solid #f5d999; border-radius: 9px; padding: 10px 11px; color: var(--amber-700); background: var(--amber-100); font-size: .72rem; line-height: 1.45; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 78px minmax(0,1fr); }
  .sidebar { padding-inline: 12px; }
  .brand { padding-inline: 8px; justify-content: center; }
  .brand > span:last-child, .nav-item:not(.active)::after, .nav-item { font-size: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item svg { width: 21px; }
  .environment-card div, .sidebar-foot p { display: none; }
  .environment-card { justify-content: center; padding: 13px 4px; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .workspace { grid-template-columns: 290px minmax(520px,1fr); }
  .metric-note { display: none; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 12px 18px; flex-direction: row; align-items: center; }
  .brand { padding: 0; }
  .brand > span:last-child { display: flex; }
  .nav-list { margin-left: auto; display: flex; }
  .nav-item { width: 42px; }
  .nav-item:not(.active) { display: none; }
  .sidebar-foot { display: none; }
  .main-content { padding-inline: 18px; }
  .workspace { grid-template-columns: 1fr; }
  .device-list { max-height: 300px; }
}

@media (max-width: 640px) {
  .main-content { padding: 0 12px 24px; }
  .topbar { min-height: 86px; }
  .topbar-actions .status-pill, .user-copy { display: none; }
  h1 { font-size: 1.5rem; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { grid-template-columns: auto 1fr; min-height: 76px; padding: 12px; }
  .metric-icon { width: 34px; height: 34px; }
  .device-header { align-items: flex-start; flex-direction: column; }
  .device-actions { width: 100%; }
  .device-actions { flex-wrap: wrap; }
  .device-actions .button { flex: 1 1 150px; }
  .tabs { overflow-x: auto; gap: 20px; padding-inline: 16px; }
  .tab { flex: 0 0 auto; }
  .tab-panel { padding: 16px; }
  .health-banner { align-items: flex-start; }
  .quality-chip { display: none; }
  .detail-grid, .config-grid, .diagnostic-actions, .unified-band-grid, .ixc-details, .backup-network-grid, .voip-grid { grid-template-columns: 1fr; }
  .voip-server-row { grid-template-columns: 1fr; }
  .diagnostic-checks { grid-template-columns: 1fr; }
  .diagnostic-check, .diagnostic-check:nth-child(odd), .diagnostic-check:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .diagnostic-check:last-child { border-bottom: 0; }
  .voip-form-footer { grid-template-columns: 1fr; align-items: stretch; gap: 15px; }
  .voip-actions { justify-content: stretch; }
  .voip-actions .button { flex: 1 1 0; }
  .lan-client-details { grid-template-columns: 1fr; }
  .lan-client-modal-head { padding: 18px 18px 15px; }
  .lan-client-details { padding: 16px 18px 20px; }
  .backup-summary-heading, .backup-steering { align-items: flex-start; flex-direction: column; }
  .safe-mode { display: none; }
  .settings-card { padding: 18px; }
  .settings-actions { align-items: stretch; flex-direction: column; }
}
.backup-edit-fields { display: grid; gap: 13px; }
.backup-field { display: grid; gap: 7px; min-width: 0; color: #52667a; font-size: .74rem; font-weight: 700; }
.backup-edit-fields input:not([type="checkbox"]), .backup-target-card select { width: 100%; min-height: 43px; border: 1px solid #d4deea; border-radius: 9px; padding: 0 12px; background: #fff; color: #10233f; font: inherit; outline: 0; transition: border-color .15s ease, box-shadow .15s ease; }
.backup-edit-fields input:not([type="checkbox"]):focus, .backup-target-card select:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(8,117,225,.1); }
.backup-edit-fields input:disabled { background: #f1f5f8; color: #8291a1; cursor: not-allowed; }
.backup-password-control { position: relative; }
.backup-password-control input { padding-right: 44px !important; }
.reveal-backup-password { position: absolute; top: 5px; right: 5px; width: 33px; height: 33px; display: grid; place-items: center; border: 0; border-radius: 7px; color: #60758b; background: transparent; cursor: pointer; }
.reveal-backup-password:hover, .reveal-backup-password[aria-pressed="true"] { color: var(--blue-600); background: rgba(8,117,225,.08); }
.reveal-backup-password:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 1px; }
.reveal-backup-password svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.backup-channel-row { display: grid; grid-template-columns: minmax(100px,.55fr) minmax(160px,1fr); gap: 10px; align-items: end; }
.backup-option-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.backup-check { display: flex; align-items: center; gap: 9px; min-height: 43px; padding: 0 11px; border: 1px solid #e0e8f0; border-radius: 9px; color: #40566c; background: #f8fbfd; font-size: .74rem; font-weight: 700; cursor: pointer; }
.backup-check:has(input:checked) { border-color: #b9ddce; color: var(--green-700); background: #f1faf6; }
.backup-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--green-700); }
.backup-network-meta { padding-top: 2px; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.backup-target-card { display: grid; grid-template-columns: minmax(250px,1fr) minmax(300px,1.15fr); gap: 10px 20px; align-items: end; margin-top: 16px; padding: 16px 18px; border: 1px solid #cfe0f0; border-radius: 13px; background: #f7fbff; }
.backup-target-copy { display: flex; align-items: center; gap: 12px; grid-row: span 2; }
.backup-target-copy div { display: grid; gap: 3px; }
.backup-target-copy strong { color: var(--ink); font-size: .8rem; }
.backup-target-copy small { color: var(--muted); font-size: .69rem; line-height: 1.45; }
.backup-target-icon { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 10px; color: var(--blue-600); background: #e5f2ff; }
.backup-target-icon svg { width: 20px; }
.backup-target-card > label { color: #52667a; font-size: .72rem; font-weight: 700; }
.backup-target-card select { min-width: 0; cursor: pointer; }
.backup-target-card option:disabled { color: #94a1ae; }
.backup-editor-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
@media (max-width: 760px) {
  .backup-channel-row, .backup-option-grid, .backup-target-card, .backup-feature-grid { grid-template-columns: 1fr; }
  .backup-feature-heading { align-items: flex-start; flex-direction: column; }
  .backup-target-copy { grid-row: auto; }
  .backup-editor-actions .button { flex: 1 1 100%; }
}
