/* Aerial-inspired glass. Self-hosted, static, no external fonts or UI runtime. */
:root {
  color-scheme: dark;
  --ink: #f5f5f7;
  --muted: #bac5d2;
  --dim: #a1afbf;
  --blue: #c2e1ff;
  --blue-dark: #a8d3fc;
  --blue-light: #c2e1ff15;
  --green: #8bdfba;
  --border: #ffffff21;
  --bg: #101a27;
  --scene-background:
    radial-gradient(ellipse at 88% 2%, #2b685b9c 0, transparent 48%),
    radial-gradient(ellipse at 6% 60%, #253b6a94 0, transparent 48%),
    radial-gradient(ellipse at 88% 95%, #4b3e6c66 0, transparent 50%),
    linear-gradient(145deg, #1c3044, #132431 48%, #152134);
  --scene-tint: linear-gradient(110deg, #06111d15, transparent 55%, #07111e18);
  --glass: #243142c4;
  --fill: #ffffff0a;
  --selected: #f5f5f7;
  --on-selected: #1d1d1f;
  --radius: 22px;
  --control-height: 42px;
  --control-radius: 12px;
  --shadow: 0 18px 50px #02071024, inset 0 1px 0 #ffffff1c;
  --surface-border: #ffffff42 #ffffff24 #ffffff20 #ffffff34;
  --surface-sheen: linear-gradient(140deg, #ffffff0c, #ffffff00 55%);
  --surface-solid: #243244;
  --mobile-rail-bg: #202d3ce6;
  --focus-ring: #fff;
  --focus-halo: #101a2780;
  --dialog-bg: #253547f2;
  --dialog-shadow: 0 32px 100px #00000050, inset 0 1px 0 #ffffff2c;
  --theme-option-hover: #ffffff0b;
  --theme-option-selected: #c2e1ff12;
  --theme-option-border: #c2e1ff85;
  --theme-mark-ink: #1d1d1f;
  --field-bg: #06111e30;
  --field-focus: #0b162640;
  --field-border: #ffffff2e;
  --field-border-hover: #ffffff52;
  --field-border-focus: #e6edf5a1;
  --field-disabled-bg: #ffffff04;
  --field-disabled-border: #ffffff19;
  --field-disabled-ink: #a1adbd;
  --field-error: #ffc0c7;
  --field-error-border: #ef9ca9;
  --field-error-bg: #bc4f600c;
  --dropdown-bg: #243447f5;
  --dropdown-border: #ffffff54 #ffffff32 #ffffff2b #ffffff42;
  --dropdown-shadow: 0 16px 42px #02071050, inset 0 1px 0 #ffffff21;
  --dropdown-active: #c2e1ff1c;
  --dropdown-active-border: #c2e1ff52;
  --dropdown-selected: #c2e1ff0d;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
}
:root[data-theme=light] {
  color-scheme: light;
  --ink: #1c3048;
  --muted: #495c72;
  --dim: #4b5e75;
  --blue: #225493;
  --blue-dark: #173e72;
  --blue-light: #2b65a012;
  --green: #22684c;
  --border: #6c829c30;
  --bg: #edf1f7;
  --scene-background:
    radial-gradient(ellipse at 88% 2%, #c5ded5c9 0, transparent 48%),
    radial-gradient(ellipse at 6% 60%, #c2d2ebc2 0, transparent 48%),
    radial-gradient(ellipse at 88% 95%, #e0d4e9aa 0, transparent 50%),
    linear-gradient(145deg, #f2f6fb, #eaf0f6 48%, #f2f0f8);
  --scene-tint: linear-gradient(110deg, #ffffff10, transparent 55%, #e1e8f410);
  --glass: #ffffffad;
  --fill: #496d9908;
  --selected: #244f88;
  --on-selected: #fff;
  --shadow: 0 18px 50px #40577412, inset 0 1px 0 #ffffffcc;
  --surface-border: #ffffffed #ffffffaa #7c92ab42 #ffffffdf;
  --surface-sheen: linear-gradient(140deg, #ffffff9f, #ffffff00 55%);
  --surface-solid: #f7f9fc;
  --mobile-rail-bg: #f6f9fcf0;
  --focus-ring: #245993;
  --focus-halo: #edf1f7cc;
  --dialog-bg: #f9fbfff2;
  --dialog-shadow: 0 32px 100px #324e752e, inset 0 1px 0 #fff;
  --theme-option-hover: #426b990c;
  --theme-option-selected: #e7effbbd;
  --theme-option-border: #4167a599;
  --theme-mark-ink: #fff;
  --text-strong: #20364e;
  --text-body: #3f566f;
  --action-bg: #ffffff80;
  --action-hover: #ffffffd4;
  --action-border: #738aa53d;
  --action-border-hover: #607da679;
  --field-bg: #ffffff9c;
  --field-focus: #ffffffdb;
  --field-border: #7086a566;
  --field-border-hover: #7086a58a;
  --field-border-focus: #4773a7bf;
  --field-disabled-bg: #dce4ed45;
  --field-disabled-border: #7b8ba536;
  --field-disabled-ink: #65758c;
  --field-error: #a33c4e;
  --field-error-border: #b45b6fcc;
  --field-error-bg: #fdf4f6cc;
  --dropdown-bg: #f8fbfff7;
  --dropdown-border: #ffffffed #98adc36b #819bb16b #ffffffed;
  --dropdown-shadow: 0 16px 42px #354e7526, inset 0 1px 0 #fff;
  --dropdown-active: #dce9fae6;
  --dropdown-active-border: #4e79ac6b;
  --dropdown-selected: #e7effb8c;
  --inner-bg: #6c8fb009;
  --inner-border: #6c829c26;
  --blue-ink: #225493;
  --blue-fill: #dceaff9c;
  --blue-border: #5482b346;
  --green-ink: #22684c;
  --green-fill: #d7eee3b8;
  --green-border: #478b6a46;
  --amber-ink: #785214;
  --amber-fill: #f2e4c8b3;
  --amber-border: #a57f3946;
  --red-ink: #a33c4e;
  --red-fill: #f4dde2ad;
  --red-border: #b65b6d4d;
  --neutral-ink: #52647b;
  --neutral-fill: #e6ecf39c;
  --neutral-border: #75869b3d;
}
* { box-sizing: border-box; }
html, body, #app { min-width: 0; max-width: 100%; }
html { min-height: 100%; scroll-padding-top: 120px; scrollbar-gutter: stable; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; isolation: isolate; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: var(--scene-background);
}
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--scene-tint); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .45; }
button svg { pointer-events: none; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus, :focus-visible, :focus-within { outline: none; outline-offset: 0; }
::selection { background: #e4edfa; color: #162334; }
.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.25; font-weight: 650; letter-spacing: -.8px; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
h3 { font-size: 14px; font-weight: 600; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.hidden { display: none !important; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.skip-link { position: fixed; top: 8px; left: 28px; padding: 11px 18px; z-index: 200; border-radius: 12px; background: var(--selected); color: var(--on-selected); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

/* Major surfaces carry the blur; dense controls and table cells do not. */
.topbar, .rail, .workspace, .panel, .stat, .group-card, .login-card, dialog {
  border: 1px solid;
  border-color: var(--surface-border);
  background: var(--surface-sheen), var(--glass);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
  backdrop-filter: blur(22px) saturate(125%);
}
.topbar { position: fixed; top: 24px; left: 28px; right: 28px; height: 72px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 24px; border-radius: 22px; }
.topbar-start { display: flex; align-items: center; gap: 16px; min-width: 0; }
.topbar .navigation-toggle { width: 44px; height: 44px; }
.brand { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid #ffffff52; border-radius: 12px; color: #f8f9fc; background: linear-gradient(145deg, #ffffff25, #ffffff0c); box-shadow: inset 0 1px 0 #ffffff38, 0 4px 12px #08111c18; }
.brand-mark .icon { width: 24px; height: 24px; stroke-width: 1.6; }
.brand-word { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.brand-divider { width: 1px; height: 19px; background: #ffffff30; margin: 0 5px; }
.brand-title { font-size: 14px; font-weight: 500; color: #dae0e7; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.domain-chip { display: flex; align-items: center; gap: 7px; color: #c0cad6; font-size: 12px; }
.domain-chip .icon { width: 15px; height: 15px; }
.profile { display: flex; align-items: center; gap: 10px; padding-left: 20px; border-left: 1px solid var(--border); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #ffffff30; border-radius: 50%; background: #ffffff12; color: #f3f6f9; font-size: 11px; font-weight: 600; }
.profile-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: #e0e7ee; }
.icon-button { display: inline-grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; padding: 0; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted); transition: background-color 140ms, border-color 140ms, color 140ms; }
.icon-button:hover { color: #fff; background: #ffffff12; border-color: #ffffff1f; }
.layout { min-height: 100vh; min-height: 100dvh; }
/* Match the fixed page background where content passes behind the header. */
.layout::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 120px; z-index: 25; pointer-events: auto; background: var(--scene-tint), var(--scene-background); background-size: 100% 100vh; background-size: 100% 100dvh; background-position: left top; background-repeat: no-repeat; }
.rail { position: fixed; top: 120px; left: 28px; bottom: 28px; width: 208px; z-index: 20; display: flex; flex-direction: column; gap: 9px; padding: 24px 14px 18px; border-radius: 24px; }
.rail-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; margin-bottom: 12px; }
.rail-heading { padding: 0 15px; font-size: 11px; letter-spacing: 1.5px; color: var(--dim); }
.navigation-close { display: none; }
.rail-item { display: flex; align-items: center; flex-shrink: 0; gap: 12px; min-height: 50px; width: 100%; padding: 13px 15px; border: 1px solid transparent; border-radius: 14px; background: transparent; color: #c4ceda; text-align: left; font-size: 13px; font-weight: 500; transition: background 140ms, color 140ms, border-color 140ms; }
.rail-item .icon { width: 20px; height: 20px; }
.rail-item:hover { color: #fff; background: #ffffff0d; border-color: #ffffff14; }
.rail-item.active { color: var(--on-selected); background: linear-gradient(145deg, #fff, #e7ebf0); border-color: #fff; box-shadow: 0 4px 16px #02091420, inset 0 1px 0 #fff; }
.rail-bottom { display: flex; align-items: center; flex-shrink: 0; gap: 9px; margin-top: auto; padding: 22px 14px 0; font-size: 11px; color: #a4b1c0; }
.rail-bottom .icon { width: 15px; height: 15px; }
.subnav { display: none; }
.workspace { width: calc(100% - 264px); min-width: 0; margin-left: 264px; border-radius: 24px; overflow: hidden; overflow-wrap: anywhere; }
.workspace-heading { display: flex; align-items: center; gap: 28px; flex-shrink: 0; min-width: 0; padding: 24px; border-bottom: 1px solid var(--border); }
.workspace-context { flex: 1; min-width: 0; }
.workspace-tools { display: flex; flex-shrink: 0; min-width: 0; justify-content: flex-end; }
.workspace-page-tools:empty { display: none; }
.workspace-tools:has(> .heading-actions:empty):has(> .workspace-page-tools:empty) { display: none; }
.workspace-heading .breadcrumbs { margin-bottom: 14px; }
.workspace-heading .subnav-mobile { margin-bottom: 16px; }
.workspace-heading .page-heading { margin-bottom: 0; }
.workspace-condensed .workspace-heading .breadcrumbs { margin-bottom: 10px; }
.workspace-condensed .workspace-heading .subnav-mobile { margin-bottom: 0; }
.workspace-condensed .workspace-heading .breadcrumbs:only-child { margin-bottom: 0; }
.workspace-condensed .workspace-heading { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: center; gap: 14px 20px; }
.workspace-condensed .workspace-context { display: contents; }
.workspace-condensed .workspace-context > .breadcrumbs { grid-column: 1; grid-row: 1; margin-bottom: 0; }
.workspace-condensed .workspace-context > .subnav-mobile { grid-column: 1; grid-row: 2; margin-bottom: 0; }
.workspace-condensed .workspace-tools { display: contents; }
.workspace-condensed .heading-actions { grid-column: 3; grid-row: 2; align-self: center; justify-self: end; max-width: 100%; flex-wrap: nowrap; }
.workspace-condensed[data-view=settings] .heading-actions { grid-row: 1; }
.workspace-with-filters .workspace-page-tools { display: contents; }
.workspace-page-tools > .panel-heading { grid-column: 2; grid-row: 1; min-width: 0; padding: 0; }
.workspace-page-tools > .filters { grid-column: 2; grid-row: 2; align-self: center; width: 100%; max-width: 880px; min-width: 0; margin-inline: auto; padding: 0; flex-wrap: nowrap; justify-content: center; }
.workspace-page-tools .input-wrap { flex: 1 1 220px; min-width: 0; }
.workspace-page-tools > .filters > :is(select, .ui-control) { flex: 1 1 136px; min-width: 0; max-width: 260px; }
.workspace .workspace-page-tools .search { width: 100%; min-width: 0; }
.workspace-page-tools .btn { flex-shrink: 0; }
.workspace-page-tools > .filter-summary { grid-column: 2; grid-row: 3; padding: 0; }
.workspace > #page-content { min-width: 0; }
.workspace > #page-content > .panel { border: 0; border-radius: 0; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.workspace > #page-content > .stats { margin: 24px; }
.workspace > #page-content > :is(.grid-cards, .settings-grid) { margin: 24px; }
.workspace > #page-content > .rollback-panel { margin-top: 0; border-top: 1px solid var(--border); }
.workspace :is(.stat, .group-card, .settings-card) { background: var(--surface-sheen), var(--fill); box-shadow: inset 0 1px 0 #ffffff1c; -webkit-backdrop-filter: none; backdrop-filter: none; }
.workspace .group-card:hover { background-color: var(--theme-option-hover); border-color: var(--field-border-hover); }
.workspace:focus { outline: none; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; color: #9cabbc; font-size: 11px; }
.breadcrumbs .icon { width: 13px; height: 13px; }
.breadcrumbs span:last-child { color: #c9d3de; }
.subnav-mobile { display: flex; flex-wrap: wrap; gap: 5px; width: fit-content; max-width: 100%; padding: 5px; margin: 0 0 22px; border: 1px solid #ffffff1c; border-radius: 14px; background: #0e182630; }
.subnav-mobile:has(button:only-child) { display: none; }
.subnav-mobile button { border: 1px solid transparent; border-radius: 10px; padding: 8px 18px; min-height: 38px; background: transparent; color: var(--muted); font-size: 13px; transition: background 140ms, color 140ms; }
.subnav-mobile button:hover { color: #fff; background: #ffffff0a; }
.subnav-mobile button.active { background: #e9eef3; color: var(--on-selected); border-color: #fff; box-shadow: 0 2px 5px #02071018; }
.page-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; margin-bottom: 24px; }
.page-title { min-width: 0; }
.title-line { display: flex; align-items: center; gap: 9px; }
.client-state { display: flex; align-items: center; gap: 7px; width: fit-content; margin-top: 9px; color: var(--muted); font-size: 11px; }
.client-state > .dot { width: 5px; height: 5px; background: #c2d0df; }
.client-state .help-trigger { width: 23px; height: 23px; }
.client-state .help-trigger .icon { width: 13px; height: 13px; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--control-height); height: var(--control-height); max-width: 100%; padding: 0 16px; border: 1px solid #ffffff32; border-radius: var(--control-radius); background: #ffffff0c; color: #eaf0f6; font-size: 13px; font-weight: 500; white-space: nowrap; box-shadow: inset 0 1px 0 #ffffff0b; transition: background-color 140ms, border-color 140ms, color 140ms; }
.btn .icon { width: 16px; height: 16px; }
.btn:hover:not(:disabled) { background-color: #ffffff1c; border-color: #ffffff50; color: #fff; }
/* Keep the sheen over an opaque base so hover never exposes the surface beneath. */
.btn-primary { background: linear-gradient(145deg, #fff, #ffffff00) #e8edf2; color: var(--on-selected); border-color: #ffffffed; box-shadow: 0 3px 12px #050a131a, inset 0 1px 0 #fff; }
.btn-primary:hover:not(:disabled) { color: #111820; background-color: #fff; border-color: #fff; }
.btn-quiet { color: var(--muted); }
.btn-danger { color: #ffb0b0; background: #e65e6210; border-color: #ef929238; }
.btn-danger:hover:not(:disabled) { color: #ffd2d2; background: #f26c7426; border-color: #f7a4ab70; }
.btn-sm { height: 36px; min-height: 36px; padding: 0 12px; font-size: 12px; border-radius: 10px; }
.btn.is-loading, .btn[aria-busy=true] { cursor: progress; }
.btn .spinner { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary .spinner { border-color: #1d1d1f30; border-top-color: #1d1d1f; }
.text-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 6px; min-width: 64px; min-height: 36px; padding: 6px 12px; border: 1px solid #ffffff32; border-radius: 10px; background: #ffffff0c; color: #d2e8ff; font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; box-shadow: inset 0 1px 0 #ffffff0b; transition: background-color 140ms, border-color 140ms, color 140ms; }
.text-button:hover:not(:disabled) { color: #fff; background-color: #ffffff1c; border-color: #ffffff50; }
.text-danger { color: #ffb2b7; background-color: #e65e6210; border-color: #ef929238; }
.text-danger:hover:not(:disabled) { color: #ffd2d2; background-color: #f26c7426; border-color: #f7a4ab70; }
.action-pair { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.action-pair .separator { display: none; }

/* Data surfaces. */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { min-width: 0; padding: 20px 22px 21px; border-radius: var(--radius); }
.stat-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: #bec9d5; }
.stat-heading > span:first-child { display: flex; align-items: center; gap: 2px; }
.stat-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #c2e1ff24; border-radius: 11px; background: #9bc9f912; color: #c2e1ff; }
.stat-icon .icon { width: 17px; height: 17px; }
.stat.amber .stat-icon { background: #f4c58810; border-color: #f4c58826; color: #efcf9f; }
.stat.green .stat-icon { background: #8bdfba10; border-color: #8bdfba26; color: #a0e3c6; }
.stat.rose .stat-icon { background: #e7b7dd10; border-color: #e7b7dd26; color: #e7bfdc; }
.stat-value { font-size: 38px; line-height: 1.15; letter-spacing: -1.3px; font-weight: 600; margin-top: 9px; font-variant-numeric: tabular-nums; }
.stat-foot { color: var(--dim); font-size: 11px; margin-top: 8px; }
.stat-heading .help-trigger { width: 23px; height: 23px; padding: 4px; }
.stat-heading .help-trigger .icon { width: 13px; height: 13px; }
.panel { min-width: 0; border-radius: var(--radius); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 22px 24px; }
.panel-heading h2, .settings-card h2 { display: flex; align-items: center; gap: 5px; }
.panel-heading h2 { flex-wrap: wrap; font-size: 15px; }
.panel-heading p, .description { color: var(--muted); font-size: 12px; margin-top: 6px; }
.panel-body { padding: 0 24px 24px; }
.count { display: inline-flex; align-items: center; min-height: 23px; padding: 1px 8px; border: 1px solid #ffffff15; border-radius: 7px; background: #ffffff06; font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 5px; white-space: nowrap; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 0 24px 22px; }
.input-wrap { position: relative; min-width: 0; }
.input-wrap > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--dim); pointer-events: none; }
.input-wrap input { padding-left: 37px; }
.input, select, textarea, .ui-select-trigger { min-width: 0; max-width: 100%; height: var(--control-height); border: 1px solid var(--field-border); border-radius: var(--control-radius); padding: 0 13px; color: var(--ink); background: var(--field-bg); font-size: 13px; transition: background-color 140ms, border-color 140ms, color 140ms; }
select { padding-right: 30px; cursor: pointer; }
select option, datalist { background: #233042; color: #f5f5f7; }
input::placeholder, textarea::placeholder { color: #9daabc; opacity: 1; }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled), .ui-select-trigger:hover:not(:disabled) { border-color: var(--field-border-hover); }
input:focus, select:focus, textarea:focus, .ui-select-trigger:focus, .ui-select-trigger[aria-expanded=true] { background-color: var(--field-focus); border-color: var(--field-border-focus); }
.input:focus-visible, select:focus-visible, textarea:focus-visible, .ui-select-trigger:focus-visible { outline: none; box-shadow: none; }
input:disabled, select:disabled, textarea:disabled, .ui-select-trigger:disabled { color: var(--field-disabled-ink); background-color: var(--field-disabled-bg); border-color: var(--field-disabled-border); cursor: not-allowed; opacity: .75; }
.input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true], .ui-select-trigger[aria-invalid=true] { border-color: var(--field-error-border); background-color: var(--field-error-bg); }
.field-error, .ui-control-error { color: var(--field-error); font-size: 12px; line-height: 1.7; }
.filters .search { width: 300px; }
.filters select { min-width: 136px; max-width: 260px; }

/* Keep native fields as the data source while drawing their complete interface. */
.ui-control { position: relative; display: inline-flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 100%; vertical-align: middle; }
.ui-control[hidden] { display: none; }
.ui-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; min-height: var(--control-height); text-align: left; cursor: pointer; box-shadow: inset 0 1px 0 #ffffff0a; }
.ui-select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-control-chevron { display: block; flex: 0 0 8px; width: 8px; height: 8px; margin: -4px 2px 0 0; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; color: var(--muted); transform: rotate(45deg); transition: transform 140ms; pointer-events: none; }
.is-open > .ui-select-trigger .ui-control-chevron, .is-open > .ui-combobox-toggle .ui-control-chevron { margin-top: 4px; transform: rotate(225deg); }
.ui-select > :is(select,input).ui-select-source { position: absolute !important; inset: 0 auto auto 0 !important; width: 1px !important; min-width: 0 !important; max-width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; opacity: 0 !important; clip-path: inset(50%) !important; overflow: hidden !important; pointer-events: none; }
.filters > .ui-control { width: auto; min-width: 136px; max-width: 260px; }
.form-field > .ui-control { width: 100%; }
.ui-combobox > input { width: 100%; padding-right: calc(var(--control-height) + 2px); box-shadow: inset 0 1px 0 #ffffff0a; }
.ui-combobox-toggle { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: var(--control-height); height: var(--control-height); padding: 0; border: 1px solid transparent; border-radius: var(--control-radius); background: transparent; color: var(--muted); transition: background-color 140ms, color 140ms; }
.ui-combobox-toggle:hover:not(:disabled) { color: var(--ink); }
.ui-combobox-toggle:disabled { opacity: .5; }
.ui-dropdown { position: fixed; inset: auto; display: flex; flex-direction: column; z-index: 100; width: max-content; max-width: calc(100vw - 16px); margin: 0; padding: 6px; border: 1px solid; border-color: var(--dropdown-border); border-radius: 15px; color: var(--ink); background: var(--dropdown-bg); box-shadow: var(--dropdown-shadow); -webkit-backdrop-filter: blur(20px) saturate(125%); backdrop-filter: blur(20px) saturate(125%); }
.ui-dropdown::backdrop { background: transparent; pointer-events: none; }
.ui-dropdown-list { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--field-border-hover) transparent; -webkit-overflow-scrolling: touch; }
.ui-dropdown-option { display: flex; align-items: center; gap: 14px; min-height: 40px; padding: 9px 11px; border: 1px solid transparent; border-radius: 9px; color: var(--ink); font-size: 13px; line-height: 1.5; cursor: pointer; touch-action: pan-y; transition: background-color 120ms, border-color 120ms; }
.ui-dropdown-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ui-dropdown-check { flex: 0 0 18px; width: 18px; color: var(--blue); font-size: 15px; line-height: 1; text-align: center; visibility: hidden; }
.ui-dropdown-option.is-selected { background-color: var(--dropdown-selected); font-weight: 600; }
.ui-dropdown-option.is-selected .ui-dropdown-check { visibility: visible; }
.ui-dropdown-option.is-active, .ui-dropdown-option:hover:not(.is-disabled) { background-color: var(--dropdown-active); border-color: var(--dropdown-active-border); }
.ui-dropdown-option.is-disabled { color: var(--dim); opacity: .5; cursor: not-allowed; }
.ui-dropdown-empty { padding: 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.ui-group-search { flex: 0 0 auto; padding: 2px 2px 8px; }
.ui-group-query { width: 100%; }
.ui-dropdown-option.is-create { color: var(--blue); }
.ui-control .ui-control-error { margin: 0; color: var(--field-error); }
.filter-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 24px 16px; color: var(--muted); font-size: 12px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 27px; padding: 3px 9px; border: 1px solid #c2e1ff2e; border-radius: 8px; background: #c2e1ff0a; color: #d3e6fa; font-size: 11px; overflow-wrap: anywhere; }
.filter-chip .icon { width: 13px; height: 13px; }
.filter-reset { color: var(--blue); }
.filter-spacer { flex: 1; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 62px; padding: 12px 24px; background: #ffffff03; border-top: 1px solid #ffffff0d; }
.table-toolbar-left { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.selection-info { margin-right: 7px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.table-note { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim); }
.table-note .icon { width: 13px; height: 13px; }
.table-toolbar > .help-wrap { margin-left: auto; }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-color: #c9d6e15c #09142018; scrollbar-width: thin; }
.table-scroll:focus-visible { background-color: var(--theme-option-hover); }
.data-table { width: 100%; min-width: 730px; border-collapse: collapse; text-align: left; font-size: 13px; white-space: nowrap; }
.data-table:has(.checkbox-cell) { min-width: 1000px; }
.data-table th { height: 46px; padding: 0 18px; border-top: 1px solid #ffffff18; border-bottom: 1px solid #ffffff18; color: #c0ccda; background: #ffffff07; font-size: 12px; font-weight: 500; }
.data-table td { height: 80px; padding: 16px 18px; vertical-align: middle; border-bottom: 1px solid #ffffff10; }
.data-table th:first-child, .data-table td:first-child { padding-left: 24px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 24px; }
.data-table tbody tr { transition: background 140ms; }
.data-table tbody tr:hover, .data-table tbody tr:focus-within { background: #ffffff08; }
.data-table tbody tr.selected { background: #b4d1ec14; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td:has(> .action-pair) { min-width: 132px; }
.data-table td:has(> .action-pair > :where(button:nth-of-type(2))) { min-width: 180px; }
.table-caption { padding: 11px 24px; border-top: 1px solid var(--border); background: #ffffff03; color: var(--muted); font-size: 12px; }
.data-table .checkbox-cell { width: 38px; padding-right: 0; }
.checkbox { appearance: none; -webkit-appearance: none; display: inline-grid; place-content: center; width: 18px; min-width: 18px; height: 18px; margin: 0; padding: 0; flex-shrink: 0; border: 1px solid var(--field-border-hover); border-radius: 5px; background: var(--field-bg); color: var(--on-selected); vertical-align: middle; cursor: pointer; transition: background-color 140ms, border-color 140ms; }
.checkbox::before { content: ""; width: 11px; height: 9px; background: currentColor; clip-path: polygon(10% 39%, 0 55%, 37% 96%, 100% 18%, 85% 3%, 35% 66%); visibility: hidden; }
.checkbox:checked, .checkbox:indeterminate { color: var(--on-selected); background: var(--selected); border-color: var(--selected); }
.checkbox:checked::before, .checkbox:indeterminate::before { visibility: visible; }
.checkbox:indeterminate::before { height: 2px; border-radius: 1px; clip-path: none; }
.checkbox:hover:not(:disabled) { border-color: var(--field-border-focus); }
.checkbox:disabled { cursor: not-allowed; opacity: .5; }
.checkbox-target { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; min-height: 44px; margin: 0 -13px; vertical-align: middle; cursor: pointer; touch-action: manipulation; }
.checkbox-target:has(.checkbox:disabled) { cursor: not-allowed; }
.checkbox-target:focus-within .checkbox { border-color: var(--field-border-focus); }
.checkbox-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.device-name { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; color: #f1f5f9; }
.device-name > div { min-width: 0; }
.device-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #ffffff28; border-radius: 12px; background: linear-gradient(145deg, #ffffff12, #ffffff03); color: #ccdceb; }
.device-icon .icon { width: 20px; height: 20px; }
.cell-primary { color: #e6edf4; font-size: 13px; font-weight: 500; }
.cell-secondary { max-width: 245px; overflow: hidden; text-overflow: ellipsis; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 400; }
.geoip-attribution { display: block; max-width: 100%; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.geoip-attribution:is(:hover, :focus-visible) { color: var(--blue); }
.id-value { color: #bfccdb; font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid #ffffff14; border-radius: 7px; background: #ffffff07; color: #bdc9d7; font-size: 11px; font-weight: 400; line-height: 1.45; }
.tag .icon { width: 13px; height: 13px; }
.tag .dot { width: 5px; height: 5px; }
.tag-blue { color: #c6e1ff; background: #94c9ff0e; border-color: #a1d1ff26; }
.tag-green { color: #a0e6c7; background: #73d3a60d; border-color: #8de0ba26; }
.tag-amber { color: #efd2a7; background: #e7bd7f0d; border-color: #e7c18426; }
.tag-red { color: #ffb9c0; background: #ef8b970d; border-color: #f1a0a926; }
.tag-neutral { color: #c4cfdd; background: #ffffff08; border-color: #ffffff1a; }
.group-label { display: inline-flex; align-items: center; gap: 6px; color: #c8d3e0; font-size: 11px; }
.group-label .icon { width: 14px; height: 14px; color: #9badc3; }
.table-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 16px 24px; border-top: 1px solid #ffffff12; font-size: 12px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 6px; }
.pager button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid #ffffff26; border-radius: 10px; background: #ffffff06; color: #d0dae7; font-size: 12px; }
.pager button:hover:not(:disabled):not(.active) { background: #ffffff14; border-color: #ffffff45; }
.pager button.active { background: #e9eef4; color: var(--on-selected); border-color: #ffffffd9; }
.pager button .icon { width: 14px; height: 14px; }
.pager-label { margin-right: 9px; color: var(--dim); }
.workspace-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; color: var(--dim); font-size: 11px; }

/* Empty states, grouping and settings share the same component scale. */
.empty-state { padding: 56px 24px 60px; text-align: center; white-space: normal; }
.empty-illustration { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; border: 1px solid #ffffff2b; border-radius: 20px; background: linear-gradient(145deg, #ffffff13, #ffffff04); color: #c4d5e8; box-shadow: inset 0 1px 0 #ffffff14; }
.empty-illustration .icon { width: 29px; height: 29px; stroke-width: 1.4; }
.empty-state h3 { color: #edf3f8; font-size: 15px; font-weight: 500; }
.empty-state p { max-width: 400px; margin: 10px auto 20px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.search-empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.table-empty td { height: auto; padding: 0 !important; }
.table-empty:hover { background: transparent !important; }
.error-state, .form-error { padding: 14px 16px; border: 1px solid #fa9da82e; border-radius: 12px; color: #ffc0c7; background: #bc4f6014; }
.error-state { margin: 10px 0; }
.error-state h3 { margin-bottom: 6px; }
.error-state p { margin-bottom: 12px; font-size: 12px; }
.form-error { margin-bottom: 18px; font-size: 13px; line-height: 1.7; }
.loading-area { display: flex; align-items: center; justify-content: center; gap: 11px; padding: 96px 24px; color: var(--muted); font-size: 12px; }
.initial-loader { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 100vh; min-height: 100dvh; color: var(--muted); font-size: 13px; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid #ffffff24; border-top-color: #f5f5f7; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.info-banner { display: flex; align-items: flex-start; gap: 9px; padding: 13px 16px; margin-bottom: 20px; border: 1px solid #c4deff24; border-radius: 12px; background: #a2cbff0a; color: #c9dcf4; font-size: 12px; line-height: 1.8; }
.info-banner .icon { width: 16px; height: 16px; margin-top: 2px; }
.grid-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.group-card { border-radius: var(--radius); padding: 24px; text-align: left; transition: background 140ms, border-color 140ms; }
.group-card:hover { border-color: #ffffff70; background-color: #334454c9; }
.group-card-top { display: flex; justify-content: space-between; align-items: center; }
.group-card-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 1px solid #ffffff28; color: #d4e7f9; background: #c4dfff0b; }
.group-card h3 { margin-top: 26px; color: #f1f5f8; font-size: 15px; }
.group-card p { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: var(--muted); font-size: 12px; }
.group-card p .icon { width: 13px; height: 13px; }
.group-number { color: #dbe6f1; font-size: 36px; line-height: 1; letter-spacing: -1px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.settings-card { min-width: 0; padding: 20px; }
.settings-card h2 { margin-bottom: 10px; }
.settings-card .description { margin-bottom: 20px; line-height: 1.85; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 10px 0; border-top: 1px solid var(--border); }
.settings-row:last-child { padding-bottom: 0; min-height: 46px; }
.settings-row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: #e0e7ef; font-size: 13px; font-weight: 500; }
.settings-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.settings-row > div:first-child, .settings-row > .break { min-width: 0; }
.settings-row .break { text-align: right; }
.settings-value { color: #c7d4e1; font-size: 13px; overflow-wrap: anywhere; }
.settings-row > .settings-value { max-width: 60%; text-align: right; }
.key-box { margin: 12px 0 18px; padding: 15px; max-height: 170px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid #ffffff1c; border-radius: 12px; background: #08152430; color: #c6d5e3; font-size: 12px; line-height: 1.85; }
.settings-service-row > .settings-row-title { flex: 0 0 auto; }
.settings-service-address { min-width: 0; margin: 0; padding: 8px 10px; border-radius: 9px; line-height: 1.5; text-align: right; }
.toggle { display: inline-flex; align-items: center; flex-shrink: 0; width: 48px; height: 28px; padding: 3px; border: 1px solid #ffffff45; border-radius: 16px; background: #ffffff1b; transition: background 140ms, border-color 140ms; }
.toggle:hover:not(:disabled) { border-color: #ffffff85; }
.toggle span { display: block; width: 20px; height: 20px; border-radius: 50%; background: #f3f5f7; box-shadow: 0 2px 5px #07111d40; transition: transform 140ms; }
.toggle[aria-checked=true] { background: #77bc9c; border-color: #a3e0c2; }
.toggle[aria-checked=true] span { transform: translateX(18px); }
.settings-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.rule-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.rule-tags .tag { padding: 6px 10px; }
.compact-setting { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-width: 0; padding: 16px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.compact-setting > span:last-child { display: flex; align-items: center; gap: 4px; color: #e1e8f1; text-align: right; }
.subtle-list { list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 12px; line-height: 2.3; }
.subtle-list li { display: flex; align-items: baseline; gap: 8px; }
.subtle-list .dot { width: 4px; height: 4px; }

/* Dialogs retain native focus trapping and the existing business actions. */
dialog { width: min(560px, calc(100vw - 40px)); max-width: calc(100vw - 40px); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); padding: 0; border-radius: 24px; color: var(--ink); overflow: hidden; background: var(--surface-sheen), var(--dialog-bg); box-shadow: var(--dialog-shadow); }
dialog[open] { display: flex; flex-direction: column; }
dialog.wide { width: min(880px, calc(100vw - 40px)); }
dialog::backdrop { background: #040b1566; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 78px; flex-shrink: 0; padding: 18px 24px; border-bottom: 1px solid var(--border); background: #ffffff04; }
.dialog-heading h2 { font-size: 17px; }
.dialog-body { min-height: 0; padding: 24px; overflow-y: auto; overflow-wrap: anywhere; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #c9d6e15c transparent; }
.dialog-body > :last-child { margin-bottom: 0; }
.dialog-body .table-scroll { border: 1px solid var(--border); border-radius: 12px; background: #06111e15; }
.dialog-footer { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; flex-shrink: 0; padding: 17px 24px; border-top: 1px solid var(--border); background: #ffffff05; }
.dialog-toasts { position: absolute; top: 78px; left: 16px; right: 16px; z-index: 3; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.dialog-toasts:empty { display: none; }
.dialog-toasts .toast { max-width: 100%; }
/* Large details share a bounded workspace; only the two content panes scroll. */
dialog.dialog-workspace { width: min(1440px, calc(100vw - 40px)); height: min(740px, calc(100vh - 48px)); height: min(740px, calc(100dvh - 48px)); }
.dialog-workspace > .dialog-body { display: flex; flex: 1 1 0; min-width: 0; padding: 20px; overflow: hidden; scrollbar-gutter: auto; }
.dialog-layout-form, .dialog-columns { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; }
.dialog-layout-form > .form-error { flex-shrink: 0; }
.dialog-split { display: grid; grid-template-columns: minmax(0, 44fr) minmax(0, 56fr); gap: 20px; flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; }
.dialog-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--border); border-color: var(--surface-border); border-radius: 18px; background: #ffffff03; box-shadow: inset 0 1px 0 #ffffff0b; overflow: hidden; }
.dialog-pane-scroll { flex: 1 1 0; min-width: 0; min-height: 0; padding: 18px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #c9d6e15c transparent; scroll-padding: 14px; }
.dialog-pane-scroll > :last-child { margin-bottom: 0; }
.dialog-pane-scroll > h3, .dialog-tab-panel > h3 { flex-shrink: 0; margin: 0 0 14px; color: var(--ink); font-size: 13px; }
.dialog-pane-scroll:focus-visible, .dialog-tab-panel:focus-visible { background-color: var(--theme-option-hover); }
.dialog-tabs { display: flex; align-items: center; flex-shrink: 0; gap: 6px; min-width: 0; padding: 5px; border: 1px solid var(--border); border-radius: 13px; background: #07142118; }
.dialog-tabs > button { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 0; gap: 8px; min-width: 0; min-height: 40px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.4; transition: background-color 140ms, border-color 140ms, color 140ms; }
.dialog-tabs > button:hover:not(:disabled):not([aria-selected=true]) { border-color: var(--border); background-color: var(--fill); color: var(--ink); }
.dialog-tabs > button[aria-selected=true] { border-color: var(--selected); background-color: var(--selected); color: var(--on-selected); box-shadow: 0 2px 7px #0207101a, inset 0 1px 0 #ffffff14; }
.dialog-column-tabs { display: none; }
.dialog-content-tabs { display: flex; flex-direction: column; flex: 1 1 0; gap: 14px; min-width: 0; min-height: 0; overflow: hidden; }
.dialog-pane-scroll:has(> .dialog-content-tabs) { display: flex; flex-direction: column; overflow: hidden; scrollbar-gutter: auto; }
.dialog-tab-panel { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #c9d6e15c transparent; }
.dialog-tab-panel[hidden] { display: none !important; }
.dialog-tab-panel:has(.table-scroll) { overflow: hidden; scrollbar-gutter: auto; }
.dialog-tab-panel > .detail-section { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; overflow: hidden; }
.dialog-tab-panel > .detail-section > h3 { flex-shrink: 0; }
.dialog-tab-panel > .table-scroll, .dialog-tab-panel > .detail-section > .table-scroll { flex: 1 1 0; min-width: 0; min-height: 0; max-height: none; overflow: auto; scrollbar-gutter: stable; }
.dialog-tab-panel .mini-table th { position: sticky; top: 0; z-index: 1; background: #2b3d50; box-shadow: 0 1px 0 var(--border); }
.dialog-tab-panel > .empty-inline { margin: auto 0; }
.dialog-workspace .detail-identity { margin-bottom: 20px; }
.dialog-workspace .detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; margin-bottom: 20px; padding: 16px; }
.dialog-workspace .detail-section { margin-top: 20px; padding-top: 18px; }
.dialog-workspace .dialog-tab-panel > .detail-section { margin-top: 0; padding-top: 0; }
.dialog-workspace .dialog-pane-scroll > .detail-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.dialog-workspace .form-grid { column-gap: 14px; }
.dialog-workspace .key-box { max-height: none; overflow: visible; }
.working-label { display: inline-flex; align-items: center; gap: 7px; min-width: 0; margin-right: auto; color: var(--muted); font-size: 12px; }
.btn .working-label { color: inherit; margin: 0; }
.btn-primary .spinner { border-color: #17233124; border-top-color: #172331; }
.btn[aria-busy=true] { opacity: .8; }
.working-label .spinner { width: 15px; height: 15px; flex-shrink: 0; }
.form-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin-bottom: 20px; }
.form-field:last-child { margin-bottom: 0; }
.form-field label { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: #dce5ef; font-size: 13px; font-weight: 500; }
.form-field input, .form-field select { width: 100%; height: var(--control-height); }
.form-field textarea { height: 92px; padding: 11px 13px; resize: vertical; line-height: 1.75; }
.form-field small { color: var(--muted); font-size: 12px; line-height: 1.7; }
.form-field small:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.compatibility-slot { margin-bottom: 21px; }
.compatibility-result { padding: 13px 15px; margin: 10px 0; border: 1px solid var(--border); border-radius: 14px; background: #ffffff05; box-shadow: inset 0 1px 0 #ffffff16; overflow-wrap: anywhere; }
.compatibility-heading { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.compatibility-result p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.compatibility-result .tag .icon, .compatibility-warning .icon { width: 13px; height: 13px; flex-shrink: 0; vertical-align: middle; }
.compatibility-warning .icon { margin-right: 5px; }
.compatibility-result[data-state=incompatible] { border-color: #fa9da84a; }
.compatibility-result[data-state=unverified] { border-color: #e6bf7952; }
.rollback-panel { margin-top: 24px; }
.rollback-table { max-height: 520px; }
.rollback-table .action-pair { flex-wrap: wrap; row-gap: 7px; }
.rollback-versions { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.rollback-versions > span:nth-child(2) { color: var(--muted); }
.rollback-comparison { display: flex; align-items: center; gap: 18px; padding: 16px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 14px; background: #ffffff05; box-shadow: inset 0 1px 0 #ffffff16; }
.rollback-comparison:empty { display: none; }
.rollback-comparison > span { flex: 1; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.rollback-comparison strong { font-size: 14px; }
.rollback-comparison small { display: block; color: var(--muted); margin-top: 5px; }
.rollback-comparison > .icon { flex-shrink: 0; color: var(--muted); }
.rollback-confirm { display: flex; align-items: flex-start; gap: 11px; min-height: 52px; padding: 13px 14px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 12px; background: #ffffff04; font-size: 13px; line-height: 1.8; cursor: pointer; transition: background 140ms, border-color 140ms; }
.rollback-confirm:hover { border-color: #ffffff45; background: #ffffff08; }
.rollback-confirm:has(.checkbox:checked) { border-color: #c2e1ff70; background: #c2e1ff0b; }
.rollback-confirm:focus-within { border-color: var(--field-border-focus); background-color: var(--theme-option-selected); }
.rollback-confirm > .checkbox { flex-shrink: 0; margin-top: 3px; }
.rollback-confirm > span { min-width: 0; }
.upload-zone { position: relative; padding: 30px 20px; border: 1px dashed #ffffff54; border-radius: 16px; background: #ffffff05; text-align: center; cursor: pointer; transition: background 140ms, border-color 140ms; }
.upload-zone:hover, .upload-zone.is-dragover { background: #c2e1ff0b; border-color: #c2e1ff9c; }
.upload-zone > .icon { width: 33px; height: 33px; margin-bottom: 14px; color: #c7d9eb; }
.upload-zone strong { display: block; color: #e4edf5; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.upload-zone small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.upload-zone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-zone:focus-within { border-color: var(--field-border-focus); background-color: var(--theme-option-selected); }
.upload-progress, .progress-track { display: block; appearance: none; -webkit-appearance: none; width: 100%; height: 5px; margin: 17px 0 8px; border: 0; border-radius: 6px; overflow: hidden; background: #ffffff17; }
.upload-progress::-webkit-progress-bar { background: #ffffff17; border-radius: 6px; }
.upload-progress::-webkit-progress-value { background: #d7e6f5; border-radius: 6px; }
.upload-progress::-moz-progress-bar, .progress-bar { background: #d7e6f5; border-radius: 6px; }
.progress-bar { height: 100%; width: 0; transition: width 140ms; }
.progress-label, .inline-note { color: var(--muted); font-size: 12px; }
.upload-status { margin-top: 18px; padding: 14px; border: 1px solid var(--field-border); border-radius: 14px; background: var(--fill); }
.dialog-layout-form > .upload-status { flex-shrink: 0; }
.upload-status-heading { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.upload-status-heading > strong { margin-right: auto; font-weight: 500; }
.upload-status-heading > [data-upload-percent] { font-variant-numeric: tabular-nums; }
.upload-status .upload-progress { margin-top: 12px; }
.upload-status .progress-label { margin: 0; font-variant-numeric: tabular-nums; }
.upload-status-message { min-height: 1.5em; margin: 8px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.upload-status-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.upload-status-actions .btn { min-height: 34px; padding: 7px 12px; font-size: 12px; }
.upload-status-actions [hidden] { display: none; }
.upload-status[data-phase=failed] .upload-status-message { color: var(--field-error); }
.inline-note { margin: 3px 0; }
.confirm-copy { color: #c7d2df; font-size: 13px; line-height: 1.95; }
.confirm-copy strong { color: #f5f5f7; font-weight: 600; }
.confirm-warning { margin-top: 16px; padding: 13px 15px; border: 1px solid #f2c58c26; border-radius: 11px; background: #d2a5600e; color: #e7cda6; font-size: 12px; line-height: 1.85; }
.device-delete-targets { display: grid; gap: 10px; max-height: 240px; overflow-y: auto; margin: 14px 0 0; padding: 0; list-style: none; }
.device-delete-targets li { min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--field-bg); }
.device-delete-targets :is(strong, span) { display: block; overflow-wrap: anywhere; }
.device-delete-targets .mono { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.detail-identity { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.detail-identity .device-icon { width: 48px; height: 48px; border-radius: 15px; }
.detail-identity .device-icon .icon { width: 24px; height: 24px; }
.detail-identity > div { min-width: 0; }
.detail-identity h3 { font-size: 17px; overflow-wrap: anywhere; }
.detail-identity p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.detail-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 21px; margin: 0 0 24px; padding: 20px; border: 1px solid #ffffff17; border-radius: 15px; background: #06132026; }
.detail-facts dt { margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.detail-facts dd { margin: 0; color: #d6e1ed; font-size: 12px; overflow-wrap: anywhere; }
.detail-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.detail-section h3 { margin-bottom: 15px; color: #d5e1ee; font-size: 13px; }
.mini-table { width: 100%; min-width: 430px; border-collapse: collapse; font-size: 12px; }
.mini-table th { padding: 10px; background: #ffffff05; color: var(--muted); text-align: left; font-size: 11px; font-weight: 400; }
.mini-table td { padding: 12px 10px; border-bottom: 1px solid #ffffff12; color: #cedae7; overflow-wrap: anywhere; }
.mini-table:has(> thead > tr > th:nth-child(5):last-child) { min-width: 640px; }
.mini-table:has(> thead > tr > th:nth-child(5):last-child) :is(th, td):is(:nth-child(3), :nth-child(4)) { white-space: nowrap; }
.mini-table:has(> thead > tr > th:nth-child(5):last-child) :is(th, td):nth-child(5) { min-width: 200px; white-space: normal; }
.empty-inline { padding: 22px; text-align: center; color: var(--dim); font-size: 12px; }
.code-display { margin: 19px 0; padding: 20px; border: 1px solid #c3dfff35; border-radius: 14px; background: #bbd9ff0c; color: #e5f0ff; font-family: ui-monospace, Consolas, monospace; font-size: 22px; text-align: center; letter-spacing: 2px; overflow-wrap: anywhere; }

/* Small explanations are accessible to pointer, touch and keyboard. */
.help-wrap { display: inline-flex; align-items: center; vertical-align: middle; font-weight: 400; }
.help-trigger { display: inline-grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; padding: 5px; border: 0; border-radius: 50%; background: transparent; color: #a5b4c4; cursor: help; touch-action: manipulation; }
.help-trigger .icon { width: 15px; height: 15px; }
.help-trigger:hover, .help-trigger:focus-visible, .help-trigger[aria-expanded=true] { background: #ffffff14; color: #f6f8fa; }
.help-popover { display: none; position: fixed; inset: auto 24px auto auto; top: 110px; z-index: 150; width: max-content; max-width: min(310px, calc(100vw - 28px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin: 0; padding: 13px 16px; overflow: auto; overflow-wrap: anywhere; white-space: normal; border: 1px solid #ffffff4b; border-radius: 14px; background: #2c3d50fa; box-shadow: 0 12px 36px #00000030, inset 0 1px 0 #ffffff14; color: #e7eef6; font-size: 12px; font-weight: 400; line-height: 1.8; text-align: left; }
.help-popover.is-open { display: block; }
@supports (top: anchor(bottom)) {
  .help-wrap:has(.help-trigger[aria-expanded=true]) { anchor-name: --mccv-help; }
  .help-popover.is-open { position-anchor: --mccv-help; inset: auto; top: anchor(bottom); left: clamp(16px, anchor(left), calc(100vw - 326px)); width: min(310px, calc(100vw - 32px)); margin: 8px 0; position-try-fallbacks: flip-block; }
}
.toasts { position: fixed; top: 112px; right: 30px; z-index: 100; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(450px, calc(100vw - 40px)); padding: 12px 13px 12px 16px; border: 1px solid #ffffff42; border-radius: 14px; background: #29394bfa; color: #eef3f9; box-shadow: 0 10px 32px #02071030; font-size: 13px; pointer-events: auto; animation: toast-in 180ms ease; }
.toast > .icon { color: #a3e4c7; }
.toast.error { border-color: #f1a0a94a; }
.toast.error > .icon { color: #ffb7be; }
.toast > span { min-width: 0; overflow-wrap: anywhere; }
.toast-dismiss { display: inline-grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; margin-left: 3px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.toast-dismiss .icon { width: 15px; height: 15px; }
.toast-dismiss:hover { color: #fff; background: #ffffff12; }
/* Transparent hit areas retain the compact visual size of isolated controls. */
.help-trigger, .icon-button, .toggle, .toast-dismiss { position: relative; }
.help-trigger::after, .icon-button::after, .toggle::after, .toast-dismiss::after { content: ""; position: absolute; top: 50%; left: 50%; width: 100%; height: 100%; min-width: 44px; min-height: 44px; transform: translate(-50%, -50%); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.space-top { margin-top: 18px; }
.space-top-small { margin-top: 8px; }
.space-bottom { margin-bottom: 18px; }
.no-bottom { margin-bottom: 0 !important; }
.event-message { max-width: 330px; white-space: normal; }
.event-target { min-width: 130px; max-width: 230px; white-space: normal; overflow-wrap: anywhere; }
.event-table .event-message { min-width: 220px; }
.event-diagnostic { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; margin-top: 5px; overflow: hidden; color: var(--ink); font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.run-overview + .run-overview { margin-top: 20px; }
.run-overview h3, .run-receipts-title { margin: 0 0 8px; color: var(--ink); font-size: 13px; }
.run-overview h3 { display: flex; align-items: center; gap: 4px; }
.run-message { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.run-message + .run-message { margin-top: 8px; }
.run-tasks { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.run-task { min-width: 0; padding: 16px; border: 1px solid var(--border); border-color: var(--surface-border); border-radius: 14px; background: var(--fill); }
.run-task-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 9px; }
.run-task-heading > div { flex: 1; min-width: 0; }
.run-task-heading > .tag { flex-shrink: 0; margin-top: 2px; }
.run-task-heading h3 { margin: 3px 0 0; color: var(--ink); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.run-task-action, .run-task-meta, .run-task-package { color: var(--muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.run-task-meta, .run-task-package { margin: 3px 0; }
.run-task > .run-message { margin-top: 10px; }
.run-receipts { margin: 12px 0 0; padding: 0; list-style: none; }
.run-receipts > li { padding: 12px 0; border-top: 1px solid var(--border); }
.run-receipts > li:last-child { padding-bottom: 0; }
.run-receipt-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; color: var(--ink); font-size: 12px; }
.run-receipt-time { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.run-task-receipts > .empty-inline { margin-top: 12px; padding: 12px 0 0; border-top: 1px solid var(--border); text-align: left; }
.clipboard-fallback { position: fixed; opacity: 0; }

/* The login is the same material, not a separate marketing page. */
.login-screen { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; width: 100%; max-width: 1220px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: 64px 48px; gap: 80px; }
.login-intro { display: flex; flex-direction: column; align-self: stretch; min-width: 0; padding: 28px 0; }
.login-pitch { margin: auto 0; padding: 70px 0; }
.login-eyebrow, .eyebrow { font-size: 11px; letter-spacing: 1.7px; font-weight: 500; color: #b9ccd9; }
.login-pitch h1 { margin-top: 21px; font-size: clamp(32px, 3.5vw, 48px); line-height: 1.35; font-weight: 600; letter-spacing: -1.3px; }
.login-pitch p { max-width: 350px; margin-top: 23px; color: #bccbd9; font-size: 14px; line-height: 1.9; }
.login-feature { display: inline-flex; align-items: center; gap: 10px; margin-top: 30px; color: #ccdbe6; font-size: 11px; }
.login-feature .icon { width: 16px; height: 16px; }
.login-feature .muted { margin: 0 3px; color: #ffffff38; }
.login-copyright { font-size: 11px; color: #9eafc0; }
.login-main { display: grid; place-items: center; min-width: 0; }
.login-card { width: 100%; max-width: 425px; min-width: 0; padding: 36px; border-radius: 28px; }
.login-card h2 { margin-top: 11px; font-size: 26px; font-weight: 600; letter-spacing: -.6px; }
.login-card > p { margin: 11px 0 30px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.login-card .form-field { margin-bottom: 22px; }
.login-card input, .login-card .btn-primary { width: 100%; min-width: 0; height: 46px; }
.login-card .btn-primary { justify-content: space-between; padding: 0 17px; font-size: 13px; margin-top: 4px; }
.login-help { margin-top: 24px; color: var(--muted); font-size: 11px; line-height: 1.9; overflow-wrap: anywhere; }

/* Appearance uses the same native dialog and compact component scale. */
.topbar .icon-button[data-action=appearance] { width: 44px; height: 44px; }
.icon-button.login-theme { position: fixed; top: max(24px, env(safe-area-inset-top)); right: max(28px, env(safe-area-inset-right)); z-index: 40; width: 44px; height: 44px; border-color: var(--surface-border); border-radius: 13px; background: var(--surface-sheen), var(--glass); box-shadow: var(--shadow); }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-option { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 19px; min-width: 0; min-height: 155px; padding: 18px 15px; border: 1px solid var(--border); border-radius: 16px; background: var(--fill); color: var(--ink); text-align: left; transition: background 140ms, border-color 140ms; }
.theme-option:hover { background: var(--theme-option-hover); border-color: var(--theme-option-border); }
.theme-option[aria-pressed=true] { background: var(--theme-option-selected); border-color: var(--theme-option-border); }
.theme-option-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 11px; background: var(--fill); color: var(--muted); }
.theme-option-icon .icon { width: 21px; height: 21px; }
.theme-option[aria-pressed=true] .theme-option-icon { color: var(--blue); border-color: var(--theme-option-border); background: var(--blue-light); }
.theme-option-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.theme-option-copy strong { font-size: 14px; font-weight: 600; }
.theme-option-copy small { color: var(--muted); font-size: 12px; line-height: 1.6; }
.theme-option-mark { position: absolute; top: 12px; right: 12px; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: var(--theme-mark-ink); visibility: hidden; }
.theme-option-mark .icon { width: 13px; height: 13px; stroke-width: 2.3; }
.theme-option[aria-pressed=true] .theme-option-mark { visibility: visible; }

/* Light materials keep the same geometry, focus model and background coordinates. */
:root[data-theme=light] ::selection { background: #c8dcf5; color: #183354; }
:root[data-theme=light] .brand-mark { border-color: #ffffffed; background: linear-gradient(145deg, #ffffffed, #ffffff70); color: #31577c; box-shadow: inset 0 1px 0 #fff, 0 4px 12px #53739314; }
:root[data-theme=light] .brand-divider { background: #6c829c3d; }
:root[data-theme=light] :is(.brand-title, .domain-chip, .profile-name, .rail-bottom, .breadcrumbs, .stat-heading, .id-value, .group-label, .settings-value, .detail-facts dd, .mini-table td, .confirm-copy, .login-feature) { color: var(--text-body); }
:root[data-theme=light] .avatar { border-color: #ffffffd9; background: #ffffff9c; color: var(--text-body); }
:root[data-theme=light] :is(.breadcrumbs span:last-child, .compact-setting > span:last-child) { color: var(--text-strong); }
:root[data-theme=light] :is(.icon-button:hover, .toast-dismiss:hover) { color: var(--text-strong); border-color: var(--action-border); background: var(--theme-option-hover); }
:root[data-theme=light] .icon-button.login-theme:hover { background: var(--surface-sheen), var(--glass); }
:root[data-theme=light] .rail-item { color: var(--text-body); }
:root[data-theme=light] .rail-item:hover { color: var(--text-strong); background: var(--theme-option-hover); border-color: var(--inner-border); }
:root[data-theme=light] .rail-item.active { color: var(--on-selected); background: linear-gradient(145deg, #2b5d9b, #244b80); border-color: #244f88; box-shadow: 0 4px 16px #3f628528, inset 0 1px 0 #ffffff26; }
:root[data-theme=light] .subnav-mobile { border-color: var(--inner-border); background: #eff4f980; }
:root[data-theme=light] .subnav-mobile button:hover { color: var(--text-strong); background: var(--theme-option-hover); }
:root[data-theme=light] :is(.subnav-mobile button.active, .pager button.active) { background: var(--selected); color: var(--on-selected); border-color: var(--selected); box-shadow: 0 2px 5px #41638720; }
:root[data-theme=light] .client-state > .dot { background: #6782a2; }
:root[data-theme=light] .btn { color: var(--text-strong); background: var(--action-bg); border-color: var(--action-border); box-shadow: inset 0 1px 0 #ffffffbd; }
:root[data-theme=light] .btn:hover:not(:disabled) { color: var(--ink); background-color: var(--action-hover); border-color: var(--action-border-hover); }
:root[data-theme=light] .btn-primary { color: var(--on-selected); background: linear-gradient(145deg, #2b5d9b, #2b5d9b00) #244b80; border-color: #244f88; box-shadow: 0 3px 12px #3f628526, inset 0 1px 0 #ffffff26; }
:root[data-theme=light] .btn-primary:hover:not(:disabled) { color: #fff; background-color: #224e86; border-color: #1c4479; }
:root[data-theme=light] .btn-quiet { color: var(--muted); }
:root[data-theme=light] .btn-danger { color: var(--red-ink); background: var(--red-fill); border-color: var(--red-border); }
:root[data-theme=light] .btn-danger:hover:not(:disabled) { color: #862439; background: #f5d3dbc9; border-color: #a94e636e; }
:root[data-theme=light] .text-button { color: var(--blue); background: var(--action-bg); border-color: var(--action-border); box-shadow: inset 0 1px 0 #ffffffbd; }
:root[data-theme=light] .text-button:hover:not(:disabled) { color: var(--blue-dark); background-color: var(--action-hover); border-color: var(--action-border-hover); }
:root[data-theme=light] .text-danger { color: var(--red-ink); background-color: var(--red-fill); border-color: var(--red-border); }
:root[data-theme=light] .text-danger:hover:not(:disabled) { color: #862439; background-color: #f5d3dbc9; border-color: #a94e636e; }
:root[data-theme=light] :is(.input, select, textarea) { color: var(--ink); background: var(--field-bg); border-color: var(--field-border); }
:root[data-theme=light] :is(select option, datalist) { background: var(--surface-solid); color: var(--ink); }
:root[data-theme=light] :is(input, textarea)::placeholder { color: var(--dim); }
:root[data-theme=light] :is(input, select, textarea):hover:not(:disabled) { border-color: var(--field-border-hover); }
:root[data-theme=light] :is(input, select, textarea):focus { background: var(--field-focus); border-color: var(--field-border-focus); }
:root[data-theme=light] :is(input, select, textarea):disabled { color: #65758c; background: #dce4ed45; border-color: #7b8ba536; }
:root[data-theme=light] :is(.input, select, textarea)[aria-invalid=true] { border-color: #b45b6fcc; background: #fdf4f6cc; }
:root[data-theme=light] .field-error { color: var(--red-ink); }
:root[data-theme=light] :is(.filter-chip, .info-banner) { color: var(--blue-ink); background: var(--blue-fill); border-color: var(--blue-border); }
:root[data-theme=light] :is(.table-toolbar, .table-caption, .dialog-heading, .dialog-footer) { background: var(--inner-bg); border-color: var(--inner-border); }
:root[data-theme=light] :is(.count, .tag, .tag-neutral) { color: var(--neutral-ink); background: var(--neutral-fill); border-color: var(--neutral-border); }
:root[data-theme=light] :is(.stat-icon, .tag-blue) { color: var(--blue-ink); background: var(--blue-fill); border-color: var(--blue-border); }
:root[data-theme=light] :is(.stat.green .stat-icon, .tag-green) { color: var(--green-ink); background: var(--green-fill); border-color: var(--green-border); }
:root[data-theme=light] :is(.stat.amber .stat-icon, .tag-amber) { color: var(--amber-ink); background: var(--amber-fill); border-color: var(--amber-border); }
:root[data-theme=light] .stat.rose .stat-icon { color: #7d4b80; background: #eddef0b3; border-color: #986a9b46; }
:root[data-theme=light] .tag-red { color: var(--red-ink); background: var(--red-fill); border-color: var(--red-border); }
:root[data-theme=light] .table-scroll { scrollbar-color: #6d85a180 #6886aa0d; }
:root[data-theme=light] .data-table th { color: var(--muted); background: #7394b110; border-color: var(--inner-border); }
:root[data-theme=light] .data-table td { border-color: var(--inner-border); }
:root[data-theme=light] :is(.data-table tbody tr:hover, .data-table tbody tr:focus-within) { background: #5f86b50d; }
:root[data-theme=light] .data-table tbody tr.selected { background: #5187bd1a; }
:root[data-theme=light] .data-table tbody tr.selected:hover { background: #5187bd24; }
:root[data-theme=light] .checkbox { color: var(--on-selected); background: var(--field-bg); border-color: var(--field-border-hover); }
:root[data-theme=light] :is(.checkbox:checked, .checkbox:indeterminate) { background: var(--selected); border-color: var(--selected); }
:root[data-theme=light] .checkbox:hover:not(:disabled) { border-color: var(--field-border-focus); }
:root[data-theme=light] :is(.device-name, .cell-primary, .empty-state h3, .group-card h3, .settings-row-title, .form-field label, .upload-zone strong, .confirm-copy strong, .detail-section h3) { color: var(--text-strong); }
:root[data-theme=light] :is(.device-icon, .group-card-icon, .empty-illustration) { color: var(--blue); border-color: #ffffffd9; background: linear-gradient(145deg, #ffffffd4, #e8f0f79c); box-shadow: inset 0 1px 0 #fff; }
:root[data-theme=light] .group-label .icon { color: var(--dim); }
:root[data-theme=light] .table-footer { border-color: var(--inner-border); }
:root[data-theme=light] .pager button { color: var(--text-body); background: var(--action-bg); border-color: var(--action-border); }
:root[data-theme=light] .pager button:hover:not(:disabled):not(.active) { background: var(--action-hover); border-color: var(--action-border-hover); }
:root[data-theme=light] :is(.error-state, .form-error) { color: var(--red-ink); background: var(--red-fill); border-color: var(--red-border); }
:root[data-theme=light] .spinner { border-color: #315f9b33; border-top-color: var(--blue); }
:root[data-theme=light] .btn-primary .spinner { border-color: #ffffff40; border-top-color: #fff; }
:root[data-theme=light] .group-card:hover { border-color: #8ca3c180; background-color: #ffffffd4; }
:root[data-theme=light] .group-number { color: var(--text-strong); }
:root[data-theme=light] .key-box { color: var(--text-body); background: var(--field-bg); border-color: var(--inner-border); }
:root[data-theme=light] .toggle { border-color: #7188a86e; background: #9babc24a; }
:root[data-theme=light] .toggle:hover:not(:disabled) { border-color: #47769b; }
:root[data-theme=light] .toggle span { background: #fff; box-shadow: 0 2px 5px #3b527526; }
:root[data-theme=light] .toggle[aria-checked=true] { background: #367f60; border-color: #22684c; }
:root[data-theme=light] dialog::backdrop { background: #52678040; }
:root[data-theme=light] .dialog-body { scrollbar-color: #6d85a180 transparent; }
:root[data-theme=light] .dialog-body .table-scroll { background: var(--inner-bg); }
:root[data-theme=light] .dialog-pane { background: #ffffff45; box-shadow: inset 0 1px 0 #ffffffb3; }
:root[data-theme=light] :is(.dialog-pane-scroll, .dialog-tab-panel) { scrollbar-color: #6d85a180 transparent; }
:root[data-theme=light] .dialog-tabs { border-color: var(--inner-border); background: var(--inner-bg); }
:root[data-theme=light] .dialog-tab-panel .mini-table th { background: #eef3f9; }
:root[data-theme=light] :is(.compatibility-result, .rollback-comparison) { background: var(--inner-bg); box-shadow: inset 0 1px 0 #ffffffd9; }
:root[data-theme=light] .compatibility-result[data-state=incompatible] { border-color: var(--red-border); }
:root[data-theme=light] .compatibility-result[data-state=unverified] { border-color: var(--amber-border); }
:root[data-theme=light] .rollback-confirm { background: var(--inner-bg); }
:root[data-theme=light] .rollback-confirm:hover { border-color: var(--action-border-hover); background: var(--theme-option-hover); }
:root[data-theme=light] .rollback-confirm:has(.checkbox:checked) { border-color: var(--blue-border); background: var(--blue-fill); }
:root[data-theme=light] .rollback-confirm:focus-within { border-color: var(--field-border-focus); background-color: var(--theme-option-selected); }
:root[data-theme=light] .upload-zone { border-color: var(--field-border-hover); background: var(--inner-bg); }
:root[data-theme=light] :is(.upload-zone:hover, .upload-zone.is-dragover) { background: var(--blue-fill); border-color: #547db0aa; }
:root[data-theme=light] .upload-zone > .icon { color: var(--blue); }
:root[data-theme=light] .upload-zone:focus-within { border-color: var(--field-border-focus); background-color: var(--theme-option-selected); }
:root[data-theme=light] :is(.upload-progress, .progress-track) { background: #476d9e24; }
:root[data-theme=light] .upload-progress::-webkit-progress-bar { background: #476d9e24; }
:root[data-theme=light] .upload-progress::-webkit-progress-value { background: #315f9b; }
:root[data-theme=light] .upload-progress::-moz-progress-bar { background: #315f9b; }
:root[data-theme=light] .progress-bar { background: #315f9b; }
:root[data-theme=light] .confirm-warning { color: var(--amber-ink); border-color: var(--amber-border); background: var(--amber-fill); }
:root[data-theme=light] .detail-facts { background: var(--inner-bg); border-color: var(--inner-border); }
:root[data-theme=light] .mini-table th { background: #7394b10d; }
:root[data-theme=light] .mini-table td { border-color: var(--inner-border); }
:root[data-theme=light] .code-display { color: var(--blue-ink); background: var(--blue-fill); border-color: var(--blue-border); }
:root[data-theme=light] .help-trigger { color: var(--dim); }
:root[data-theme=light] :is(.help-trigger:hover, .help-trigger:focus-visible, .help-trigger[aria-expanded=true]) { background: var(--theme-option-hover); color: var(--text-strong); }
:root[data-theme=light] .help-popover { color: var(--text-body); border-color: #8ca0bc66; background: #f8fbfffa; box-shadow: 0 12px 36px #35516f26, inset 0 1px 0 #fff; }
:root[data-theme=light] .toast { color: var(--text-strong); border-color: #c1ccdc; background: #f8fbfffa; box-shadow: 0 10px 32px #35516f24; }
:root[data-theme=light] .toast > .icon { color: var(--green-ink); }
:root[data-theme=light] .toast.error { border-color: var(--red-border); }
:root[data-theme=light] .toast.error > .icon { color: var(--red-ink); }
:root[data-theme=light] :is(.login-eyebrow, .eyebrow, .login-pitch p, .login-copyright, .login-feature .muted) { color: var(--muted); }
/* Keyboard focus uses each control's own border or fill, with no added frame. */
:root :is(button, a, [role=button], [role=option]):focus-visible { border-color: var(--field-border-focus); }
:root :is(.icon-button, .toast-dismiss, .ui-combobox-toggle):focus-visible { background-color: var(--theme-option-selected); color: var(--ink); }
:root :is(.btn:not(.btn-primary):not(.btn-danger), .text-button:not(.text-danger), .rail-item:not(.active), .subnav-mobile button:not(.active), .pager button:not(.active), .dialog-tabs > button:not([aria-selected=true]), .theme-option:not([aria-pressed=true])):focus-visible { background-color: var(--theme-option-selected); }
:root :is(.toggle[aria-checked], .rail-item.active, .subnav-mobile button.active, .pager button.active, .dialog-tabs > button[aria-selected=true], .checkbox:checked, .checkbox:indeterminate):focus-visible { border-color: var(--field-border-focus); }
.ui-dropdown-option:focus-visible { background-color: var(--dropdown-active); border-color: var(--dropdown-active-border); }
.ui-dropdown-list:focus-visible { background-color: var(--theme-option-hover); }
a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 1700px) {
  .stats { gap: 20px; }
  .stat { padding: 23px 26px; }
  .stat-value { font-size: 42px; }
  .data-table td { height: 85px; }
}
@media (max-width: 1280px) {
  .workspace-condensed .workspace-heading { grid-template-columns: minmax(0, 1fr) auto; gap: 18px 22px; }
  .workspace-condensed .workspace-context { display: block; grid-column: 1; grid-row: 1; }
  .workspace-with-filters .workspace-page-tools { display: flex; flex-direction: column; gap: 18px; grid-column: 1 / -1; grid-row: 2; min-width: 0; width: 100%; max-width: 880px; margin-inline: auto; }
  .workspace-condensed .heading-actions { grid-column: 2; grid-row: 1; }
}
@media (max-width: 1280px) {
  .stats { gap: 12px; }
  .stat { padding: 18px; }
  .stat-value { font-size: 34px; }
  .filters .search { width: 240px; }
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .login-screen { gap: 48px; }
}
@media (max-width: 1080px) {
  .brand-title { font-size: 13px; }
  .stat { padding: 16px; }
  .stat-icon { width: 28px; height: 28px; border-radius: 9px; }
  .stat-icon .icon { width: 15px; height: 15px; }
  .stat-value { font-size: 31px; }
  .domain-chip { display: none; }
  .login-screen { grid-template-columns: 1fr 1fr; gap: 30px; padding: 45px 32px; }
  .login-card { padding: 30px; }
  .login-feature { gap: 7px; }
}
@media (min-width: 761px) and (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .dialog-columns { gap: 14px; }
  .dialog-column-tabs { display: flex; }
  .dialog-split { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dialog-split > [data-column-panel]:not(.is-current) { display: none; }
  .dialog-tabs > button { min-height: 44px; }
}
@media (max-width: 760px) {
  :root { --control-height: 38px; --control-radius: 10px; }
  html { scroll-padding-top: 100px; }
  .topbar { top: 12px; left: 12px; right: 12px; height: 62px; padding: 0 12px; gap: 8px; border-radius: 18px; }
  .topbar-start { gap: 8px; }
  .brand { gap: 9px; }
  .brand-mark { width: 33px; height: 33px; border-radius: 10px; }
  .brand-mark .icon { width: 21px; height: 21px; }
  .brand-word { font-size: 17px; }
  .brand-divider { margin: 0 1px; height: 16px; }
  .brand-title { font-size: 12px; }
  .topbar-right { gap: 4px; }
  .profile { padding: 0; border: 0; gap: 6px; }
  .profile-name { display: none; }
  .avatar { width: 29px; height: 29px; font-size: 10px; }
  .icon-button { width: 32px; height: 32px; border-radius: 10px; }
  .layout { padding: 101px 16px calc(20px + env(safe-area-inset-bottom)); }
  .layout::before { height: 90px; }
  .layout > .rail { display: none; }
  .workspace { width: 100%; margin: 0; border-radius: 22px; }
  .workspace-heading { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 14px; }
  .workspace-condensed .workspace-heading { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .workspace-condensed:is([data-view=events], [data-view=settings]) .workspace-context { display: none; }
  .workspace-tools { display: flex; flex-direction: column; gap: 10px; }
  .workspace-condensed .workspace-tools { display: flex; flex-direction: column; gap: 10px; grid-column: 1; grid-row: 2; }
  .workspace-condensed[data-view=settings] .workspace-tools { grid-row: 1; }
  .workspace-with-filters .workspace-tools { display: contents; }
  .workspace-with-filters .workspace-page-tools { gap: 12px; }
  .workspace-with-filters .heading-actions { grid-column: 1; grid-row: 3; justify-self: stretch; flex-wrap: wrap; }
  .workspace-with-filters[data-view=events] .workspace-page-tools { grid-row: 1; }
  .workspace-with-filters[data-view=events] .heading-actions { grid-row: 2; }
  .workspace-page-tools > .filters { display: grid; }
  .workspace-page-tools .input-wrap { flex: initial; }
  .workspace-page-tools > .filters > :is(select, .ui-control) { width: 100%; max-width: none; }
  .workspace > #page-content > .stats { margin: 20px 17px; }
  .workspace > #page-content > :is(.grid-cards, .settings-grid) { margin: 20px 17px; }
  .breadcrumbs { display: none; }
  .subnav-mobile { margin-bottom: 21px; border-radius: 13px; }
  .subnav-mobile button { min-height: 38px; padding: 6px 14px; font-size: 12px; }
  .page-heading { gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
  h1 { font-size: 25px; }
  .title-line { gap: 6px; }
  .client-state { font-size: 11px; margin-top: 18px; }
  .heading-actions { width: 100%; justify-content: flex-start; gap: 8px; }
  .btn { gap: 6px; padding: 0 12px; font-size: 12px; }
  .btn .icon { width: 14px; height: 14px; }
  .heading-actions .btn { height: var(--control-height); min-height: var(--control-height); padding: 0 10px; font-size: 12px; }
  .heading-actions .btn-primary { margin-left: auto; }
  .heading-actions .btn .icon { width: 15px; height: 15px; }
  .btn-sm, .text-button { min-height: 36px; }
  .btn-sm { height: 36px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
  .stat { padding: 16px 17px 18px; border-radius: 19px; }
  .stat-heading { font-size: 12px; }
  .stat-value { font-size: 33px; margin-top: 9px; }
  .stat-icon { width: 30px; height: 30px; }
  .panel { border-radius: 20px; }
  .panel-heading { padding: 16px 14px; gap: 8px; }
  .panel-heading h2 { font-size: 14px; flex-wrap: wrap; }
  .panel-heading > .tag { font-size: 10px; white-space: nowrap; }
  .rollback-panel .panel-heading { align-items: flex-start; }
  .rollback-panel .panel-heading > .btn { flex-shrink: 0; }
  .rollback-comparison { gap: 10px; padding: 13px; }
  .rollback-comparison strong { font-size: 13px; }
  .panel-body { padding: 0 17px 20px; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 14px 14px; }
  .filters .input-wrap { grid-column: 1 / -1; width: 100%; }
  .filters .search { width: 100%; }
  .filters select { width: 100%; min-width: 0; max-width: none; }
  .filters > .ui-control { width: 100%; min-width: 0; max-width: none; }
  .filters > .btn { width: 100%; min-height: var(--control-height); height: var(--control-height); padding: 0 8px; }
  .filters > .btn .icon { display: none; }
  #device-filters { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #device-filters .input-wrap { grid-area: 1 / 1 / 2 / 5; }
  #device-filters > :is(.ui-control, select):nth-child(2) { grid-area: 2 / 1 / 3 / 4; }
  #device-filters > :is(.ui-control, select):nth-child(3) { grid-area: 2 / 4 / 3 / 7; }
  #device-filters > .btn[type=submit] { grid-area: 1 / 5 / 2 / 6; }
  #device-filters > [data-action=reset-device-filters] { grid-area: 1 / 6 / 2 / 7; }
  #release-filters { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #release-filters .input-wrap { grid-area: 1 / 1 / 2 / 5; }
  #release-filters > :is(.ui-control, select):nth-child(2) { grid-area: 2 / 1 / 3 / 7; }
  #release-filters > .btn[type=submit] { grid-area: 1 / 5 / 2 / 6; }
  #release-filters > [data-action=reset-release-filters] { grid-area: 1 / 6 / 2 / 7; }
  #event-filters > :first-child { grid-column: 1 / -1; }
  #apk-filters { grid-template-columns: minmax(0, 1fr) auto auto; }
  #apk-filters .input-wrap { grid-column: auto; }
  #apk-filters > .btn { min-width: 40px; }
  .filters .filter-spacer { display: none; }
  .filter-summary { gap: 7px; padding: 0 17px 17px; }
  .filter-chip { min-height: 29px; font-size: 11px; }
  .input, select, textarea, .form-field input, .form-field select, .ui-select-trigger { min-height: var(--control-height); font-size: 14px; }
  /* Editable text stays at 16px to avoid focus zoom on mobile Safari. */
  input.input, textarea, .form-field input { font-size: 16px; }
  input::placeholder, textarea::placeholder { font-size: 13px; }
  .input-wrap > .icon { left: 11px; width: 14px; height: 14px; }
  .input-wrap input { padding-left: 31px; }
  .ui-select-trigger { gap: 10px; padding: 0 11px; }
  .ui-dropdown-option { min-height: 38px; padding: 7px 10px; font-size: 14px; }
  .table-toolbar { padding: 8px 14px; min-height: 44px; gap: 5px; }
  .table-toolbar-left { flex: 1; min-width: 0; gap: 6px; }
  .table-toolbar .btn { min-height: 34px; height: 34px; padding: 0 6px; gap: 4px; font-size: 11px; }
  .workspace[data-view=devices] .table-toolbar:not(.has-selection) .btn { display: none; }
  .selection-info { font-size: 11px; margin-right: 0; }
  .table-footer { padding: 16px 17px; flex-wrap: wrap; font-size: 11px; }
  .pager button { width: 36px; height: 36px; }
  .pager-label { display: none; }
  .data-table th:first-child, .data-table td:first-child { padding-left: 17px; }
  .data-table th:last-child, .data-table td:last-child { padding-right: 17px; }
  .data-table td { height: 76px; }
  .data-table:has(.table-empty) { min-width: 0; }
  .data-table:has(.table-empty) thead { display: none; }
  .table-caption { padding: 12px 17px; font-size: 11px; }
  /* Main lists become labelled cards; the detailed mini-tables remain scrollable. */
  .table-scroll:has(> .data-table td[data-label]) { overflow: visible; }
  .data-table:has(td[data-label]), .data-table:has(td[data-label]) tbody { display: block; width: 100%; min-width: 0; white-space: normal; }
  .data-table:has(td[data-label]) thead { display: none; }
  .data-table:has(td[data-label]):has(.checkbox-cell) thead, .data-table:has(td[data-label]):has(.checkbox-cell) thead tr { display: block; }
  .data-table:has(td[data-label]) thead th { display: none; }
  .data-table:has(td[data-label]) thead th.checkbox-cell { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 2px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .data-table:has(td[data-label]) thead .checkbox-target { justify-content: flex-start; gap: 10px; width: 100%; margin: 0; padding: 0 20px; }
  .data-table:has(td[data-label]) thead .checkbox-label { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none; white-space: normal; color: var(--muted); font-size: 12px; font-weight: 400; }
  .data-table:has(td[data-label]) tbody tr:not(.table-empty) { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; padding: 20px 18px; border-top: 1px solid #ffffff16; }
  .data-table:has(td[data-label]) tbody tr:first-child { border-top: 0; }
  .data-table:has(td[data-label]) tbody td { display: block; min-width: 0; width: auto; max-width: none; height: auto; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .data-table:has(td[data-label]) tbody td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 6px; color: var(--dim); font-size: 11px; line-height: 1.45; font-weight: 400; }
  .data-table:has(td[data-label]) tbody td:first-child:not(.checkbox-cell), .data-table:has(td[data-label]) td:has(.device-name), .data-table:has(td[data-label]) td:has(.action-pair), .data-table:has(td[data-label]) td.event-message { grid-column: 1 / -1; }
  .data-table:has(td[data-label]) tbody td:has(.device-name)::before, .data-table:has(td[data-label]) tbody td:has(.action-pair)::before { display: none; }
  .data-table:has(td[data-label]) tbody td.checkbox-cell { position: absolute; top: 12px; right: 10px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; }
  .data-table:has(td[data-label]) tbody td.checkbox-cell::before { display: none; }
  .data-table:has(td[data-label]) tbody .checkbox-target { margin: 0; }
  .data-table:has(td[data-label]):has(.checkbox-cell) td:has(.device-name) { padding-right: 34px; }
  .data-table:has(td[data-label]) .device-name { align-items: flex-start; font-size: 14px; }
  .data-table:has(td[data-label]) .device-name .device-icon { width: 40px; height: 40px; }
  .data-table:has(td[data-label]) .cell-secondary { max-width: none; margin-top: 5px; overflow: visible; text-overflow: clip; white-space: normal; }
  .data-table:has(td[data-label]) td.cell-secondary { margin-top: 0; }
  .data-table:has(td[data-label]) .action-pair { padding-top: 1px; }
  .data-table:has(td[data-label]) .text-button { min-height: 36px; padding: 6px 10px; }
  .data-table:has(td[data-label]) .table-empty, .data-table:has(td[data-label]) .table-empty td { display: block; }
  .rollback-table:has(> .data-table td[data-label]) { max-height: none; }
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .group-card { padding: 19px; border-radius: 20px; }
  .group-number { font-size: 31px; }
  .group-card-icon { width: 36px; height: 36px; border-radius: 12px; }
  .group-card h3 { margin-top: 23px; font-size: 14px; }
  .settings-grid { gap: 16px; }
  .settings-card { padding: 18px; }
  .settings-card h2 { font-size: 15px; }
  .settings-row-title, .compact-setting { font-size: 13px; }
  .settings-row { gap: 12px; }
  .settings-row small { font-size: 12px; }
  .settings-row:has(.break) { flex-wrap: wrap; }
  .settings-row > .break { width: 100%; text-align: left; }
  .settings-actions .btn, .settings-row .btn-sm { min-height: var(--control-height); height: var(--control-height); font-size: 12px; }
  .key-box { font-size: 12px; }
  .rule-tags { gap: 8px; }
  .rule-tags .tag { font-size: 11px; }
  .empty-state { padding: 48px 22px; }
  .workspace-footer { font-size: 10px; }
  dialog, dialog.wide { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 22px; }
  dialog.dialog-workspace { width: calc(100vw - 24px); height: min(740px, calc(100vh - 24px)); height: min(740px, calc(100dvh - 24px)); }
  .dialog-heading { min-height: 72px; padding: 16px 18px; }
  .dialog-heading h2 { font-size: 16px; }
  .dialog-heading .icon-button { width: 36px; height: 36px; }
  .dialog-body { padding: 21px 18px; }
  .dialog-workspace > .dialog-body { padding: 14px; }
  .dialog-columns { gap: 12px; }
  .dialog-pane { border-radius: 15px; }
  .dialog-pane-scroll { padding: 14px; }
  .dialog-tabs { gap: 4px; }
  .dialog-tabs > button { padding: 8px 10px; }
  .dialog-footer { padding: 15px 18px max(15px, env(safe-area-inset-bottom)); gap: 9px; }
  .dialog-footer .btn { flex: 1 1 auto; min-width: 88px; min-height: var(--control-height); height: var(--control-height); font-size: 12px; }
  .dialog-toasts { top: 72px; left: 12px; right: 12px; }
  .dialog-footer .btn .working-label { flex-basis: auto; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-field { margin-bottom: 20px; }
  .form-field label { font-size: 13px; }
  .form-field small, .upload-zone small { font-size: 12px; }
  .detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 13px; padding: 16px; }
  .detail-facts dt { font-size: 11px; }
  .detail-facts dd { font-size: 12px; }
  .confirm-copy { font-size: 13px; }
  .confirm-warning { font-size: 12px; }
  .code-display { font-size: 17px; letter-spacing: .8px; padding: 17px 12px; }
  .help-popover, .help-popover.is-open { font-size: 13px; padding: 14px 17px; }
  @supports not (top: anchor(bottom)) {
    .help-popover, .help-popover.is-open { inset: auto 16px calc(20px + env(safe-area-inset-bottom)) 16px; width: auto; max-width: calc(100vw - 32px); margin: 0; }
  }
  .toasts { top: 87px; left: 14px; right: 14px; align-items: stretch; }
  .toast { max-width: 100%; font-size: 12px; }
  .login-screen { grid-template-columns: minmax(0, 1fr); gap: 0; min-height: 100vh; min-height: 100dvh; padding: 28px 22px max(38px, env(safe-area-inset-bottom)); align-content: start; }
  .login-intro { padding: 0; }
  .login-pitch { margin: 0; padding: 37px 5px 27px; }
  .login-pitch h1 { margin-top: 11px; font-size: 30px; line-height: 1.4; letter-spacing: -.8px; }
  .login-eyebrow, .login-pitch p, .login-feature, .login-copyright { display: none; }
  .login-main { width: 100%; }
  .login-card { max-width: 440px; padding: 28px; border-radius: 24px; }
  .login-card .eyebrow { font-size: 10px; }
  .login-card h2 { font-size: 24px; }
  .login-card > p { font-size: 12px; margin-bottom: 25px; }
  .login-card input { font-size: 16px; height: 46px; }
  .login-card .btn-primary { height: 46px; }
  .topbar .avatar { display: none; }
  .topbar .icon-button { width: 44px; height: 44px; }
  .icon-button.login-theme { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
  :root[data-theme=light] .data-table:has(td[data-label]) tbody tr:not(.table-empty) { border-top-color: var(--inner-border); }
}
@media (max-width: 560px) {
  .theme-options { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .theme-option { display: grid; grid-template-columns: 36px minmax(0, 1fr) 22px; align-items: center; gap: 13px; min-height: 82px; padding: 15px; }
  .theme-option-copy { gap: 3px; }
  .theme-option-mark { position: static; }
}
@media (max-width: 420px) {
  .brand-divider, .topbar .brand-title { display: none; }
  .topbar .brand-mark { display: none; }
  .layout { padding-left: 12px; padding-right: 12px; }
  .page-heading { column-gap: 8px; }
  .heading-actions { gap: 6px; }
  .heading-actions .btn { padding: 0 10px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat-heading { font-size: 11px; gap: 4px; }
  .stat-icon { width: 26px; height: 26px; }
  .stat-heading .help-trigger { width: 20px; height: 22px; padding: 3px; }
  .stat-value { font-size: 31px; }
  .table-toolbar-left { column-gap: 6px; }
  .selection-info { width: auto; margin-bottom: 0; }
  .table-footer { gap: 10px; }
  .group-card { padding: 17px; }
  .group-card-icon { width: 32px; height: 32px; }
  .group-card-icon .icon { width: 18px; height: 18px; }
  .settings-card { padding: 18px; }
  .login-screen { padding-left: 16px; padding-right: 16px; }
  .login-card { padding: 24px; }
}
/* The right glass frame contains its heading and shares the navigation bounds. */
@media (min-width: 761px) {
  html:has(.layout) { scrollbar-gutter: auto; }
  .layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); column-gap: 28px; height: 100vh; height: 100dvh; min-height: 0; padding: 120px 28px 28px; overflow: hidden; }
  .rail { grid-column: 1; grid-row: 1; position: relative; inset: auto; width: auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--field-border-hover) transparent; }
  .rail-item { flex-shrink: 0; }
  .workspace { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; width: auto; min-height: 0; margin: 0; }
  #page-content { flex: 1 1 0; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--field-border-hover) transparent; scroll-padding: 12px; }
  .workspace:is([data-view=devices], [data-view=apks], [data-view=events]) > #page-content { display: flex; flex-direction: column; }
  #page-content > .stats { flex-shrink: 0; }
  .workspace:is([data-view=devices], [data-view=apks], [data-view=events]) > #page-content > .panel { display: flex; flex: 1 0 auto; flex-direction: column; min-height: 0; }
  .workspace:is([data-view=devices], [data-view=apks], [data-view=events]) > #page-content > .panel > :not(.table-scroll) { flex-shrink: 0; }
  .workspace:is([data-view=devices], [data-view=apks], [data-view=events]) > #page-content > .panel > .table-scroll { flex: 1 1 auto; height: 0; min-height: 146px; overflow: auto; overscroll-behavior: contain auto; scroll-padding: 48px 0 8px; }
  .workspace:is([data-view=devices], [data-view=apks], [data-view=events]) .data-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-solid); }
  .settings-grid { align-items: stretch; }
  .layout.is-compact { grid-template-columns: 84px minmax(0, 1fr); }
  .layout.is-compact .rail { padding: 16px 10px; gap: 12px; }
  .layout.is-compact .rail-header, .layout.is-compact .rail-bottom { display: none; }
  .layout.is-compact .rail-item { justify-content: center; padding: 13px 0; }
  .layout.is-compact .rail-item > span { display: none; }
  .layout.is-compact .rail-item .icon { width: 22px; height: 22px; }
}
/* Short windows retain one content scroller rather than squeezing controls. */
@media (min-width: 761px) and (max-height: 600px) {
  .workspace-heading { padding-top: 16px; padding-bottom: 16px; }
  .workspace-heading .breadcrumbs { display: none; }
  .workspace-heading .subnav-mobile { margin-bottom: 10px; }
  .workspace-heading .page-heading { gap: 12px; }
  .workspace-heading .client-state { display: none; }
  .workspace { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--field-border-hover) transparent; }
  .workspace > #page-content, .workspace:is([data-view=devices], [data-view=apks], [data-view=events]) > #page-content { display: block; flex: 0 0 auto; overflow: visible; }
  .workspace:is([data-view=devices], [data-view=apks], [data-view=events]) > #page-content > .panel { display: block; }
  .workspace:is([data-view=devices], [data-view=apks], [data-view=events]) > #page-content > .panel > .table-scroll { height: auto; min-height: 0; }
}
@media (min-width: 761px) and (max-height: 600px) {
  .rail { overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #c9d6e15c transparent; }
  :root[data-theme=light] .rail { scrollbar-color: #6d85a180 transparent; }
  .rail-item { flex-shrink: 0; }
  .rail-bottom { display: none; }
}
@media (max-height: 480px) {
  dialog, dialog.wide { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  dialog.dialog-workspace { height: calc(100vh - 16px); height: calc(100dvh - 16px); }
  .dialog-heading { min-height: 60px; padding: 10px 18px; }
  .dialog-body { padding: 16px 18px; }
  .dialog-workspace > .dialog-body { padding: 10px 14px; }
  .dialog-columns { gap: 10px; }
  .dialog-pane-scroll { padding: 12px; }
  .dialog-footer { padding: 10px 18px max(10px, env(safe-area-inset-bottom)); }
  .dialog-footer .btn { min-height: 44px; height: 44px; }
  .dialog-toasts { top: 60px; }
}
/* The native drawer owns the glass; its moved navigation stays a single surface. */
dialog.navigation-drawer { position: fixed; inset: 12px auto 12px 12px; width: min(288px, calc(100vw - 40px)); max-width: calc(100vw - 40px); height: calc(100vh - 24px); height: calc(100dvh - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); min-width: 0; margin: 0; padding: 0; border-radius: 24px; background: var(--surface-sheen), var(--glass); }
dialog.navigation-drawer:not([open]) { display: none; }
.navigation-drawer .rail { position: static; inset: auto; display: flex; flex: 1 1 0; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 9px; width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; padding: 18px 14px; z-index: auto; border: 0; border-radius: inherit; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--field-border-hover) transparent; scroll-padding: 12px; }
.navigation-drawer .rail-header { display: flex; min-height: 44px; margin-bottom: 14px; }
.navigation-drawer .rail-heading { display: block; padding-left: 12px; }
.navigation-drawer .navigation-close { display: inline-grid; width: 44px; height: 44px; }
.navigation-drawer .rail-item { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; width: 100%; max-width: none; min-height: 52px; padding: 14px 15px; font-size: 14px; }
.navigation-drawer .rail-item > span { display: inline; }
.navigation-drawer .rail-bottom { display: flex; margin-top: auto; padding: 22px 12px 0; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar, .rail, .workspace, .panel, .stat, .group-card, .login-card, dialog, dialog.navigation-drawer, .ui-dropdown { background: var(--surface-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .rail, .workspace, .panel, .stat, .group-card, .login-card, dialog, dialog.navigation-drawer, .ui-dropdown { background: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.wallpaper-gallery { display: grid; gap: 18px; min-width: 0; }
.wallpaper-upload-zone { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; }
.wallpaper-upload-zone canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; background: #12161d; }
.wallpaper-upload-zone [hidden] { display: none; }
.wallpaper-upload-prompt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 100%; padding: 12px; }
.wallpaper-upload-prompt > .icon { width: 30px; height: 30px; margin-bottom: 10px; color: var(--muted); }
.wallpaper-upload-zone.has-preview { border-style: solid; background: #12161d; }
.wallpaper-reselect { position: absolute; right: 10px; bottom: 10px; padding: 5px 10px; border-radius: 8px; background: #12161dcc; color: #fff; font-size: 12px; pointer-events: none; }
.wallpaper-file-caption { display: grid; gap: 4px; min-width: 0; margin-top: 8px; color: var(--muted); font-size: 12px; }
.wallpaper-file-caption > span { overflow-wrap: anywhere; }
.wallpaper-file-caption > small { margin: 0; }
.wallpaper-file-caption > small:empty { display: none; }
.wallpaper-card { border: 1px solid var(--border); border-radius: 16px; padding: 12px; min-width: 0; }
.wallpaper-preview { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; border-radius: 10px; background: #12161d; }
.wallpaper-card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 13px; }
.wallpaper-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.wallpaper-expiry { display: flex; align-items: center; gap: 6px; margin: 9px 0 0; font-size: 12px; line-height: 1.6; }
.wallpaper-expiry > .icon { flex: 0 0 15px; width: 15px; height: 15px; }
#wallpaper-expiry-custom[hidden] { display: none; }
#wallpaper-expiry-at { min-width: 0; max-width: 100%; color-scheme: dark; }
:root[data-theme=light] #wallpaper-expiry-at { color-scheme: light; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.data-table.removal-preview-table{min-width:0;table-layout:fixed;margin-top:12px}
.data-table.removal-preview-table th,.data-table.removal-preview-table td{white-space:normal;overflow-wrap:anywhere}
