:root {
  color-scheme: dark;
  --bg: #0b1420;
  --surface: #111e2d;
  --card: #152232;
  --border: #243549;
  --edge: #31485e;
  --surface-glint: rgb(225 245 255 / 6%);
  --surface-depth: rgb(1 8 17 / 26%);
  --text: #f2f7fc;
  --muted: #94a8be;
  --mint: #65e2c0;
  --mint-bright: #87f0d2;
  --mint-dark: #1b3c38;
  --blue: #8cafff;
  --amber: #ffc878;
  --red: #ffaaa4;
  --gutter: 16px;
  --radius: 22px;
  --nav-height: 64px;
  --app-width: 1440px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  accent-color: var(--mint);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; min-height: 100vh; min-height: 100dvh; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: var(--mint); }
svg, img { display: block; max-width: 100%; }
svg { flex: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.45rem, 4.8vw, 1.9rem); line-height: 1.23; letter-spacing: -.035em; }
h2 { font-size: 1.2rem; line-height: 1.35; letter-spacing: -.02em; }
h3 { font-size: 1rem; line-height: 1.4; }
p { line-height: 1.52; }
:where(a, button, input, textarea, select, [tabindex]):focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
::selection { color: var(--bg); background: var(--mint); }
[dir="rtl"] :is(h1, h2, h3, .eyebrow, .brand-text) { letter-spacing: normal; }

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(142deg, #101f30, var(--bg) 57%, #0a121e);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  width: min(100%, var(--app-width));
  margin-inline: auto;
  min-height: 66px;
  padding: max(8px, env(safe-area-inset-top)) var(--gutter) 8px;
}
.brand, .top-actions, .hero-top, .inline-actions { display: flex; align-items: center; }
.brand { gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--mint-dark);
  color: var(--mint);
}
.brand-mark svg { width: 27px; height: 27px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.brand-text { display: grid; min-width: 0; gap: 2px; line-height: 1.05; }
.brand-text :is(strong, b, .brand-name) { font-size: 1.37rem; font-weight: 700; letter-spacing: -.045em; }
.brand-text :is(small, span:not(.brand-name)) { color: var(--muted); font-size: .59rem; letter-spacing: .075em; }
.top-actions { justify-content: end; gap: 8px; flex: 0 0 auto; }

.workspace { display: flex; flex: 1 1 auto; width: min(100%, var(--app-width)); min-height: 0; margin-inline: auto; }
.rail { flex: 0 0 auto; display: flex; align-items: stretch; background: var(--surface); }
.rail > nav, .rail > .nav-list, .rail > .rail-nav { display: flex; align-items: stretch; flex: 1 1 auto; gap: inherit; }
.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 48px;
  padding: 7px 4px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.14;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.nav-button svg { width: 22px; height: 22px; }
.nav-button:is(.is-active, [aria-current="page"], [aria-selected="true"]) {
  background: linear-gradient(145deg, #234741, #182f34);
  color: var(--mint);
  font-weight: 670;
  box-shadow: inset 0 0 0 1px rgb(101 226 192 / 22%), inset 0 1px var(--surface-glint);
}
.rail-foot { margin-block-start: auto; color: var(--muted); font-size: .76rem; line-height: 1.5; }

.content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block-end: 64px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding: 10px var(--gutter) 8px;
  gap: 12px;
}
.content > * { flex-shrink: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.page-heading > div { min-width: 0; }
.page-heading h1 { overflow-wrap: anywhere; }
.page-heading p { margin-block-start: 3px; }
.eyebrow { color: var(--mint); font-weight: 650; font-size: .72rem; letter-spacing: .09em; line-height: 1.4; }
.subtle { color: var(--muted); font-size: .83rem; line-height: 1.5; }
.stack { display: grid; align-content: start; min-width: 0; gap: 12px; }
.split { display: grid; min-width: 0; gap: 12px; }
.split > *, .quick-grid > *, .stats > *, .meta-grid > * { min-width: 0; }
.card, .stat, .quick-card, .device-row, .option-row, .empty {
  min-width: 0;
  border: 1px solid #2b4055;
  border-radius: var(--radius);
  background: linear-gradient(148deg, #1a2b3e, #142233 62%, #121f2f);
  box-shadow: inset 0 1px var(--surface-glint), 0 3px 10px var(--surface-depth);
}
.card, .empty { padding: 14px; }
.card > :is(h2, h3) + :is(p, .subtle) { margin-block-start: 4px; }
.hero {
  position: relative;
  display: grid;
  align-content: center;
  isolation: isolate;
  overflow: hidden;
  min-height: 138px;
  padding: 17px 18px;
  gap: 8px;
  border: 1px solid rgb(125 240 216 / 24%);
  border-radius: 24px;
  background: radial-gradient(ellipse at 98% 0, rgb(97 224 190 / 15%), transparent 58%), linear-gradient(108deg, #1b3443 4%, #153d44 58%, #235d54 100%);
  box-shadow: inset 0 1px rgb(219 255 249 / 12%), 0 8px 24px rgb(2 11 20 / 34%);
}
.hero::before, .login-art::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: repeating-radial-gradient(circle at 12% 47%, transparent 0 47px, rgb(112 239 210 / 12%) 48px 49px, transparent 50px 71px);
  mask-image: linear-gradient(to right, #000 28%, transparent 86%);
  pointer-events: none;
}
.hero-top { justify-content: space-between; gap: 8px; color: #c1e1dc; font-size: .86rem; font-weight: 550; }
.hero :is(svg, .eyebrow) { color: var(--mint); }
.hero-top svg { width: 23px; height: 23px; }
.hero-value { color: var(--text); font-size: clamp(2.7rem, 10.5vw, 4rem); font-weight: 670; line-height: 1.02; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.hero-caption { color: #b4d9d3; font-size: .82rem; line-height: 1.45; }
.stats, .quick-grid, .meta-grid { display: grid; gap: 8px; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  --stat-tint: rgb(101 226 192 / 9%);
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 69px;
  padding: 10px 9px;
  background: radial-gradient(ellipse at 100% 0, var(--stat-tint), transparent 66%), linear-gradient(148deg, #1a2a3c, #142233 74%);
}
.stat:nth-child(2) { --stat-tint: rgb(140 175 255 / 13%); }
.stat:nth-child(3) { --stat-tint: rgb(238 248 255 / 7%); }
.stat :is(strong, b, .stat-value) { display: block; color: var(--mint); font-size: clamp(1.4rem, 6vw, 1.8rem); line-height: 1.06; font-weight: 670; font-variant-numeric: tabular-nums; }
.stat:nth-child(2) :is(strong, b, .stat-value) { color: var(--blue); }
.stat:nth-child(3) :is(strong, b, .stat-value) { color: var(--text); }
.stat :is(small, .subtle, .stat-label) { font-size: .72rem; color: var(--muted); line-height: 1.35; }
.quick-grid, .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 10px 12px;
  color: var(--text);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.quick-card svg { width: 23px; height: 23px; color: var(--mint); }
.quick-card > svg:first-child {
  width: 38px;
  height: 38px;
  padding: 7px;
  border: 1px solid rgb(101 226 192 / 21%);
  border-radius: 12px;
  background: linear-gradient(155deg, #25483f, #1a3536);
  box-shadow: inset 0 1px var(--surface-glint);
}
.quick-card > :is(span, div) { min-width: 0; }
.quick-card :is(strong, b) { display: block; font-size: .93rem; font-weight: 650; }
.quick-card :is(small, .subtle) { display: block; margin-block-start: 2px; font-size: .69rem; color: var(--muted); }

.btn, .icon-btn {
  --control-top: #24394e;
  --control-bottom: #192b3e;
  --control-edge: #3b536a;
  --control-hover: #506d84;
  --control-depth: rgb(1 8 17 / 27%);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  min-width: 0;
  padding: 9px 13px;
  border: 1px solid var(--control-edge);
  border-radius: 15px;
  background: linear-gradient(155deg, var(--control-top), var(--control-bottom));
  box-shadow: inset 0 1px rgb(245 255 255 / 9%), 0 2px 5px var(--control-depth);
  color: var(--text);
  font-size: .88rem;
  font-weight: 670;
  line-height: 1.26;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 120ms ease;
}
.btn svg { width: 19px; height: 19px; }
.btn > span { min-width: 0; overflow-wrap: anywhere; }
.btn.primary {
  --control-top: #8af1d4;
  --control-bottom: #55d9b4;
  --control-edge: #a0f3dc;
  --control-hover: #cbffef;
  --control-depth: rgb(52 216 168 / 16%);
  color: #0a2424;
}
.btn.secondary > svg { color: #a4dbdf; }
.btn.soft {
  --control-top: #23483f;
  --control-bottom: #183531;
  --control-edge: #38615b;
  --control-hover: #70bcaa;
  color: #9ef0d8;
}
.btn.quiet {
  --control-top: #152536;
  --control-bottom: #132131;
  --control-edge: #2c4056;
  --control-hover: #45617a;
  box-shadow: none;
  color: var(--muted);
}
.btn.danger {
  --control-top: #4b303c;
  --control-bottom: #382632;
  --control-edge: #754d58;
  --control-hover: #ac6b73;
  color: #ffd4cf;
}
.icon-btn { flex: 0 0 auto; width: 48px; padding: 0; color: #8bead0; }
.icon-btn svg { width: 21px; height: 21px; }
:is(.btn, .icon-btn):not(:disabled, [aria-disabled="true"]):active { transform: translateY(1px); box-shadow: inset 0 1px 3px rgb(1 10 18 / 30%); }
:is(button, .btn, .nav-button):is(:disabled, [aria-disabled="true"]) { opacity: .58; cursor: not-allowed; }
:is(.btn, .icon-btn):is(:disabled, [aria-disabled="true"]) { box-shadow: none; }
.btn.primary:is(:disabled, [aria-disabled="true"]) { background: #30454f; border-color: #42606a; color: #c4d8db; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--mint-dark);
  color: var(--mint);
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
}
.top-actions .badge, .badge:is(.amber, .warning, .demo) { background: #332b22; color: var(--amber); }
.badge:is(.danger, .disabled) { background: #3b2631; color: #ffd4cf; }
.field:not(input, textarea, select) { display: grid; align-content: start; min-width: 0; gap: 6px; }
.field :is(label, legend), label.field { color: var(--muted); font-size: .83rem; line-height: 1.42; }
.field-row, .input-wrap, .search { display: flex; align-items: center; min-width: 0; gap: 8px; }
.field-row > .field { flex: 1 1 0; }
.input-wrap > :is(input, select), .search > :is(input, .field) { flex: 1 1 auto; }
:where(input:not([type="checkbox"], [type="radio"]), textarea, select) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  caret-color: var(--mint);
}
:is(input, textarea)::placeholder { color: var(--muted); opacity: 1; }
:where(input, textarea, select):is(:focus, :focus-visible) { border-color: var(--mint); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
label:has(> input:is([type="checkbox"], [type="radio"])) { display: flex; align-items: center; gap: 8px; min-height: 38px; color: var(--muted); }
textarea { min-height: 82px; resize: vertical; }
:is(input[type="email"], input[type="url"], input[type="tel"], input[type="password"], .mac, .ltr) { direction: ltr; unicode-bidi: isolate; }
.mac { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; letter-spacing: .015em; }
.inline-actions { gap: 8px; min-width: 0; }
.inline-actions > .btn { flex: 1 1 0; }
.page-actions {
  position: sticky;
  z-index: 2;
  inset-block-end: -8px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-start: auto;
  padding: 10px 0 8px;
  background: linear-gradient(180deg, transparent, var(--bg) 26%);
}
.page-actions > .btn:only-child, .page-actions > .primary, .page-actions > .inline-actions { flex: 1 1 auto; }
.page-actions > .btn { min-width: min(20%, 86px); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 34px;
  padding: 6px 5px;
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  font-size: .74rem;
  text-align: center;
}
.step.current, .step[aria-current="step"] { color: var(--bg); background: var(--mint); font-weight: 670; }
.step.done { color: var(--mint); }
.device-list, .option-list { display: grid; align-content: start; gap: 8px; }
.device-results { display: flex; flex: 1 0 auto; flex-direction: column; min-width: 0; gap: inherit; }
.device-row, .option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 8px 10px;
  text-align: start;
}
.device-row :is(a, button).device-info { text-decoration: none; color: inherit; }
.device-row { border-radius: 19px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.device-row:focus-within { border-color: #557485; box-shadow: inset 0 1px var(--surface-glint), 0 0 0 2px rgb(101 226 192 / 11%); }
.device-row > .icon-btn { width: 44px; min-height: 44px; margin-inline-start: auto; border-radius: 13px; }
.device-row:is(a, button), .option-row:is(a, button), .device-row[tabindex], .device-info:is(a, button) { cursor: pointer; }
.device-info { flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: none; text-align: start; }
.device-info :is(.mac, strong, b, .subtle) { display: block; }
.device-info .mac { color: var(--text); font-size: .86rem; font-weight: 630; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[dir="rtl"] .device-info .mac { text-align: right; }
.device-info .subtle { font-size: .73rem; }
.device-icon { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border: 1px solid rgb(101 226 192 / 21%); border-radius: 12px; background: linear-gradient(155deg, #25483f, #1a3536); color: var(--mint); }
.device-icon svg { width: 21px; height: 21px; }
.device-meta { display: flex; align-items: center; gap: 4px 7px; min-width: 0; flex-wrap: wrap; }
.device-meta .subtle { min-width: 0; overflow-wrap: anywhere; }
.device-status { display: inline-flex; align-items: center; width: max-content; max-width: 100%; min-height: 19px; padding: 1px 6px; border-radius: 7px; background: #203b38; color: #a4edd8; font-size: .65rem; font-weight: 650; line-height: 1.25; }
.device-status.amber { background: #392e24; color: #ffd496; }
.device-status:is(.danger, .disabled) { background: #422d37; color: #ffd4cf; }
.search {
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--edge);
  border-radius: 17px;
  background: linear-gradient(165deg, #0d1724, #101e2e);
  box-shadow: inset 0 1px 3px rgb(1 8 17 / 38%), 0 2px 7px var(--surface-depth);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.search:focus-within { border-color: #69b4a5; box-shadow: 0 0 0 3px rgb(101 226 192 / 13%); }
.search > input { min-height: 44px; border: 0; border-radius: 13px; background: transparent; padding-inline: 12px 9px; }
.search > input::-webkit-search-cancel-button { display: none; }
[dir="rtl"] .search > input:placeholder-shown { direction: rtl; text-align: right; }
.search > input:focus-visible { outline-offset: -2px; }
.search .icon-btn { --control-top: #23473f; --control-bottom: #1b3433; --control-edge: #3a615b; --control-hover: #70bcaa; width: 44px; height: 44px; min-height: 44px; border-radius: 13px; }
.search .search-clear { --control-top: #192a3c; --control-bottom: #142232; --control-edge: #304458; --control-hover: #526d83; color: var(--muted); }
.pager { display: grid; grid-template-columns: minmax(70px, 88px) minmax(0, 1fr) minmax(70px, 88px); align-items: center; gap: 8px; text-align: center; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.pager .btn { width: 100%; gap: 5px; padding-inline: 8px; }
.pager .btn svg { width: 16px; height: 16px; }
[dir="rtl"] .pager .btn svg { transform: scaleX(-1); }
.page-actions > .pager { width: 100%; }
.empty { display: grid; justify-items: start; align-content: center; min-height: 110px; gap: 5px; }
.notice { padding: 10px 12px; border: 1px solid #315047; border-radius: 12px; background: #16312e; color: #b9ecd9; font-size: .81rem; line-height: 1.5; overflow-wrap: anywhere; }
.notice.error, .notice.warning { border-color: #634c31; background: #302719; color: var(--amber); }
.notice:empty { display: none; }

.login-layout {
  display: grid;
  width: min(100%, 500px);
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-items: start;
  min-height: 0;
  margin-inline: auto;
  padding: 10px var(--gutter) max(12px, env(safe-area-inset-bottom));
  gap: 12px;
  overflow: auto;
  overscroll-behavior: contain;
}
.login-intro { display: grid; min-width: 0; gap: 6px; }
.login-card { min-width: 0; }
.login-card:is(form, .card), .login-card > form { display: grid; align-content: start; gap: 12px; }
.login-card:not(.card):not(form) { display: grid; align-content: start; gap: 12px; }
.login-art { display: none; }
.login-layout .page-actions { inset-block-end: -12px; }

dialog.dialog:not([open]) { display: none; }
.dialog {
  display: flex;
  flex-direction: column;
  width: min(100% - 24px, 540px);
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: auto;
  overflow: hidden;
  padding: 14px;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 25px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 18px 70px rgb(0 0 0 / 38%);
}
.dialog::backdrop { background: rgb(3 8 14 / 74%); backdrop-filter: blur(3px); }
.dialog-overlay, .dialog-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; overflow: auto; background: rgb(3 8 14 / 74%); }
.dialog > form { display: flex; flex-direction: column; min-height: 0; gap: 12px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-head > :first-child { min-width: 0; }
.dialog-head h2 { font-size: 1.3rem; }
.dialog-head .subtle { margin-block-start: 2px; }
.dialog-body { display: grid; align-content: start; flex: 1 1 auto; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border) transparent; gap: 10px; }
.dialog-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
.dialog-actions > .btn { flex: 1 1 90px; }
.meta-grid .card { display: grid; min-height: 59px; align-content: center; gap: 3px; padding: 10px 12px; }
.option-row { width: 100%; min-height: 58px; padding-inline: 13px; color: var(--text); text-decoration: none; }
.option-row > svg:first-child { width: 22px; height: 22px; color: var(--mint); }
.option-row > :is(span, div) { flex: 1 1 auto; min-width: 0; }
.option-row > .badge { flex: 0 0 auto; }
.option-row :is(strong, small, .subtle) { display: block; }
.option-row small { color: var(--muted); font-size: .73rem; }
.option-row .chevron { color: var(--muted); }
[dir="rtl"] .option-row svg.chevron { transform: scaleX(-1); }

.scanner { display: grid; min-width: 0; gap: 10px; }
.scanner-frame { position: relative; isolation: isolate; overflow: hidden; min-height: 170px; aspect-ratio: 4 / 3; border: 1px solid var(--border); border-radius: 20px; background: #091019; }
.scanner-frame::after { position: absolute; z-index: 1; inset: 17% 18%; border: 2px solid var(--mint); border-radius: 17px; box-shadow: 0 0 0 200px rgb(3 8 14 / 30%); content: ""; pointer-events: none; }
.camera-video { display: block; width: 100%; max-height: 46dvh; object-fit: cover; }
.scanner-frame .camera-video { position: absolute; inset: 0; height: 100%; max-height: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); border: 0; }

@media (max-width: 799px) {
  .workspace { flex-direction: column; }
  .rail { order: 2; gap: 3px; min-height: var(--nav-height); padding: 6px 12px max(6px, env(safe-area-inset-bottom)); }
  .rail > :is(nav, .nav-list, .rail-nav) { flex-direction: row; }
  .nav-button { flex: 1 1 0; flex-direction: column; }
  .rail-foot { display: none; }
  .login-layout { display: flex; flex-direction: column; align-items: stretch; }
  .login-layout > * { flex-shrink: 0; }
}

@media (min-width: 560px) {
  :root { --gutter: 24px; }
  .content { gap: 15px; }
  .card, .empty { padding: 18px; }
  .hero { min-height: 150px; padding: 20px 24px; }
  .stat { min-height: 77px; padding: 12px 14px; }
  .quick-card { min-height: 70px; padding: 11px 15px; }
  .dialog { padding: 18px; }
}

@media (min-width: 800px) {
  :root { --gutter: 26px; }
  .app-shell { background: radial-gradient(ellipse at 94% 5%, #142736 0, transparent 40%), linear-gradient(145deg, #101f30, var(--bg) 55%, #0a121e); }
  .topbar { min-height: 78px; padding-block: 12px; }
  .topbar::after { position: absolute; inset-inline: 0; inset-block-start: 77px; height: 1px; background: rgb(148 168 190 / 14%); content: ""; pointer-events: none; }
  .brand-mark { width: 43px; height: 43px; border-radius: 13px; }
  .brand-text :is(strong, b, .brand-name) { font-size: 1.5rem; }
  .workspace { padding: 18px var(--gutter) 20px; gap: clamp(16px, 2.2vw, 32px); }
  .rail { flex-basis: clamp(165px, 19vw, 228px); flex-direction: column; gap: 5px; padding: 12px; border: 1px solid var(--border); border-radius: 22px; background: rgb(17 30 45 / 82%); }
  .rail > :is(nav, .nav-list, .rail-nav) { flex: 0 1 auto; flex-direction: column; }
  .nav-button { justify-content: flex-start; padding: 10px 12px; gap: 11px; border-radius: 13px; font-size: .88rem; text-align: start; }
  .rail-foot { padding: 10px 9px 2px; border-block-start: 1px solid var(--border); }
  .content { padding: 2px 2px 10px; gap: 16px; }
  .content > .stack { gap: 16px; }
  .page-heading { min-height: 44px; }
  .page-heading h1 { font-size: clamp(1.65rem, 2.65vw, 2.2rem); }
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .stats, .quick-grid, .meta-grid { gap: 12px; }
  .hero { min-height: 178px; padding: 23px 27px; }
  .stat { min-height: 88px; padding: 13px 17px; }
  .quick-card { min-height: 75px; padding: 12px 16px; }
  .page-actions { inset-block-end: -10px; padding-block-end: 10px; }
  .device-row { min-height: 66px; padding-inline: 13px; }
  .device-info .mac { font-size: .94rem; }
  .login-layout { width: min(100%, 1170px); grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); align-content: center; align-items: center; gap: clamp(24px, 5vw, 76px); padding: 26px var(--gutter) 36px; }
  .login-intro { gap: 9px; }
  .login-intro h1 { font-size: clamp(2.05rem, 4.2vw, 4.05rem); letter-spacing: -.055em; }
  .login-intro .subtle { font-size: .96rem; }
  .login-card.card, .login-card > .card { padding: 22px; }
  .login-art { position: relative; isolation: isolate; display: grid; place-items: center; overflow: hidden; min-height: 165px; margin-block-start: 10px; padding: 14px; border: 1px solid #2b494c; border-radius: 23px; background: linear-gradient(120deg, #19313f, #214f4c); color: var(--mint); }
  .login-art svg { width: min(42%, 112px); height: auto; }
  .login-layout > .page-actions { position: static; grid-column: 2; width: 100%; margin-block-start: -15px; background: none; }
}

@media (max-width: 374px) {
  .topbar { gap: 7px; }
  .top-actions { gap: 5px; }
  .top-actions .badge { padding-inline: 7px; }
  .quick-card { gap: 7px; padding-inline: 9px; }
  .quick-card > svg:first-child { width: 34px; height: 34px; padding: 6px; }
}

@media (max-height: 620px) and (max-width: 799px) {
  .topbar { min-height: 57px; padding-block-end: 5px; }
  .content { gap: 9px; padding-block-start: 7px; }
  .hero { min-height: 118px; gap: 4px; padding-block: 12px; }
  .stat { min-height: 63px; }
  .quick-card { min-height: 55px; }
  .rail { min-height: 58px; padding-block-start: 4px; }
}

@media (hover: hover) and (pointer: fine) {
  :is(.btn, .icon-btn):not(:disabled, [aria-disabled="true"]):hover { border-color: var(--control-hover); box-shadow: inset 0 1px rgb(245 255 255 / 13%), 0 3px 9px var(--control-depth); }
  .btn.primary:not(:disabled, [aria-disabled="true"]):hover { --control-top: #a4f6dd; --control-bottom: #68e4c1; }
  :is(button.quick-card, a.quick-card, button.option-row, a.option-row):not(:disabled, [aria-disabled="true"]):hover { border-color: #4a7082; background: linear-gradient(148deg, #21374b, #17293a 70%); }
  .device-row:has(.device-info:not(:disabled):hover) { border-color: #4a7082; }
  .nav-button:not(.is-active):not([aria-current="page"]):hover { background-color: var(--card); color: var(--text); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  :is(.btn, .icon-btn):active { transform: none !important; }
}

.hero-number, .account-profile { display:flex; align-items:center; gap:12px; }
.hero-number { justify-content:space-between; }
.account-profile-text { min-width:0; overflow-wrap:anywhere; }
.device-note { overflow-wrap:anywhere; white-space:pre-wrap; }
.playlist-name { overflow-wrap:anywhere; }
.playlist-protection:not(:has([name="protect"]:checked)) .playlist-pin-fields { display:none; }
.scanner-placeholder { display:grid; justify-items:center; align-content:center; gap:12px; padding:24px; min-height:185px; text-align:center; color:var(--muted); }
.scanner-placeholder svg { width:48px; height:48px; color:var(--mint); }
.qr-key-field .subtle { margin-block-start:2px; }
.login-quick-playlist { width:100%; text-align:start; }
.login-quick-playlist > span { flex:1; }
[dir="rtl"] .login-quick-playlist > svg:last-child { transform:scaleX(-1); }
.dialog[data-type="quick-playlist"] .page-heading { min-height:0; }
.dialog[data-type="quick-playlist"] .dialog-body { padding-inline-end:2px; }
.login-presentation { display:grid; gap:14px; }
@media (min-width:800px) {
  .login-layout { row-gap:12px; }
  .login-presentation { grid-column:1; grid-row:1 / span 2; gap:20px; }
  .login-card { grid-column:2; grid-row:1; }
  .login-layout > .page-actions { grid-row:2; margin-block-start:0; padding-block-end:0; }
  .login-art { min-height:212px; padding:24px; justify-items:start; text-align:start; gap:16px; }
  .login-art .login-illustration { display:grid; place-items:center; width:65px; height:65px; border:1px solid rgb(101 226 192 / 35%); border-radius:18px; background:#1b3c38; }
  .login-art .login-illustration svg { width:39px; height:39px; }
  .login-art h2 { color:var(--text); font-size:1.45rem; }
  .content > .page-actions, .device-results > .page-actions { position:static; margin-block-start:4px; padding:0; background:none; }
  .content[data-page="home"] > .page-actions > .btn,
  .content[data-page="account"] > .page-actions > .btn { flex:0 1 330px; }
}
