:root {
  color-scheme: dark;
  --bg: #071017;
  --bg-soft: #0d1b24;
  --panel: #11232e;
  --panel-2: #162b37;
  --line: #284756;
  --text: #f3fbff;
  --muted: #a8bdc8;
  --accent: #63d29a;
  --accent-2: #5db7f2;
  --warning: #f2c766;
  --danger: #ff7f7f;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(93, 183, 242, 0.16), transparent 28rem),
    radial-gradient(circle at 90% 18%, rgba(99, 210, 154, 0.12), transparent 26rem),
    linear-gradient(180deg, #08131b 0%, #071017 44%, #050a0f 100%);
  color: var(--text);
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(7, 16, 23, 0.88);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 800;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(32, 36, 43, 0.12);
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061016;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.nav a,
button,
.text-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.62rem 0.85rem;
  background: #10202a;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.nav a[aria-current="page"],
.nav a:hover,
button:hover,
.text-link:hover {
  border-color: var(--accent);
}

.page {
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  padding: clamp(1.2rem, 3vw, 2.2rem) 0;
}

.hero.compact {
  grid-template-columns: 1fr;
  max-width: 920px;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 0.75rem;
  max-width: 860px;
  font-size: clamp(2rem, 4.5vw, 4.8rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0.85rem;
  font-size: 1.05rem;
}

.hero p,
.lede,
.muted-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.55;
}

.muted-copy {
  font-size: 0.95rem;
}

.hero-status {
  display: grid;
  gap: 0.2rem;
  min-width: 260px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 35, 46, 0.86);
}

.hero-status span,
label span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 800;
}

.stats,
.section-grid {
  display: grid;
  gap: 1rem;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.stats div,
.panel,
.device-card,
.warning-band,
.toolbar,
.login-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 35, 46, 0.9);
  box-shadow: 0 18px 44px rgba(0,0,0,0.2);
}

.stats div {
  display: grid;
  gap: 0.3rem;
  padding: 1rem;
}

.stats span {
  color: var(--accent);
  font-size: 1.55rem;
  font-weight: 900;
}

.stats strong {
  color: var(--muted);
  font-size: 0.82rem;
}

.warning-band {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-color: rgba(242, 199, 102, 0.42);
}

.warning-band strong { color: var(--warning); white-space: nowrap; }
.warning-band span { color: var(--muted); }

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 180px 180px auto;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  margin-bottom: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.72rem 0.8rem;
  background: #07131a;
  color: var(--text);
  font: inherit;
}

.primary-btn {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061016;
  font-weight: 850;
}

.danger-btn {
  border-color: rgba(255, 127, 127, 0.45);
  color: #ffd7d7;
}

.inventory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  align-items: start;
}

.device-list,
.side-stack,
.tech-list {
  display: grid;
  gap: 1rem;
}

.device-card,
.panel {
  padding: 1rem;
}

.device-main {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
}

.device-card h2 {
  margin: 0;
  font-size: 1.45rem;
}

.device-site {
  margin-bottom: 0.25rem;
  color: var(--accent-2);
  font-weight: 750;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  background: rgba(99, 210, 154, 0.13);
  color: #bdf5d4;
  border: 1px solid rgba(99, 210, 154, 0.32);
  white-space: nowrap;
}

.device-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.85rem 0;
}

.device-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.connect-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.connect-grid button {
  display: grid;
  gap: 0.2rem;
  text-align: left;
  min-height: 70px;
}

.connect-grid span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.connect-grid strong {
  overflow-wrap: anywhere;
}

.notes {
  margin: 0.85rem 0;
  color: var(--muted);
  line-height: 1.5;
}

.device-card footer {
  display: flex;
  justify-content: flex-end;
}

.tech-row {
  display: grid;
  gap: 0.22rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 0.75rem;
}

.tech-section {
  display: grid;
  gap: 0.75rem;
}

.tech-section h3 {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.security-stack,
.security-list {
  display: grid;
  gap: 0.65rem;
}

.security-stack {
  margin-top: 0.35rem;
}

.security-row {
  display: grid;
  gap: 0.18rem;
}

.security-row span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.security-row strong {
  font-size: 0.96rem;
  line-height: 1.35;
}

.security-row small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.security-list {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 0.8rem;
}

.security-list span {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: rgba(5, 11, 16, 0.32);
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(168, 189, 200, 0.28);
  border-radius: 999px;
  padding: 0.14rem 0.56rem;
  background: rgba(168, 189, 200, 0.12);
  color: #d7e5ec;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.security-badge.ready {
  border-color: rgba(99, 210, 154, 0.32);
  background: rgba(99, 210, 154, 0.13);
  color: #bdf5d4;
}

.security-badge.needs {
  border-color: rgba(242, 199, 102, 0.34);
  background: rgba(242, 199, 102, 0.12);
  color: #ffe4a3;
}

.tech-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tech-row span,
.tech-row em,
.mini-list,
.check-list {
  color: var(--muted);
}

.tech-row em {
  font-style: normal;
  font-size: 0.9rem;
}

.mini-list,
.check-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.65;
}

.section-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.code-block {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #050b10;
  color: #dff8ea;
}

.device-dialog {
  width: min(900px, calc(100% - 2rem));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
}

.device-dialog::backdrop {
  background: rgba(0,0,0,0.72);
}

.device-dialog form {
  padding: 1rem;
}

.device-dialog header,
.device-dialog footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.panel-heading,
.tech-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-heading h2 {
  margin-bottom: 0;
}

.compact-btn,
.tech-row-main button {
  min-height: 32px;
  padding: 0.32rem 0.55rem;
  font-size: 0.84rem;
}

.device-dialog footer {
  grid-template-columns: auto 1fr auto auto;
  margin-top: 1rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.wide {
  grid-column: 1 / -1;
}

.setting-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.78rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.setting-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0.12rem 0 0;
  accent-color: var(--accent);
}

.setting-copy {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.setting-copy strong {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.25;
}

.setting-copy small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: #10251d;
  box-shadow: 0 18px 44px rgba(0,0,0,0.35);
}

.login-page {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.support-entry-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1rem;
  background:
    radial-gradient(circle at 18% 18%, rgba(93, 183, 242, 0.18), transparent 22rem),
    radial-gradient(circle at 82% 14%, rgba(99, 210, 154, 0.12), transparent 20rem),
    linear-gradient(180deg, #09131c 0%, #071017 50%, #04090d 100%);
}

.entry-shell {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 0;
}

.entry-panel,
.entry-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 35, 46, 0.9);
  box-shadow: 0 22px 60px rgba(0,0,0,0.28);
}

.entry-panel {
  padding: clamp(1rem, 2.4vw, 1.35rem);
}

.entry-panel .login-brand {
  margin-bottom: 0.45rem;
}

.entry-panel h1 {
  margin-bottom: 0;
  font-size: 2.25rem;
  line-height: 1;
}

.entry-intro {
  max-width: 36rem;
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0.75rem;
}

.entry-card {
  display: grid;
  gap: 0.55rem;
  min-height: 100%;
  padding: 1rem;
  background: rgba(10, 22, 31, 0.72);
}

.support-download-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.support-download-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(99, 210, 154, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(99, 210, 154, 0.24), rgba(93, 183, 242, 0.24)),
    rgba(4, 12, 18, 0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.support-download-art img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.support-download-art span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 12px;
  height: 12px;
  border-right: 2px solid #dff8ea;
  border-bottom: 2px solid #dff8ea;
  transform: rotate(45deg);
}

.entry-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.16rem;
  line-height: 1.2;
}

.entry-card .lede {
  margin-bottom: 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.38;
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.2rem;
}

.entry-actions .primary-btn,
.entry-actions .text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 0.68rem 0.9rem;
  text-decoration: none;
  font-weight: 850;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 42px;
  margin-top: 0.2rem;
  border-radius: 8px;
  padding: 0.68rem 0.9rem;
  color: #061016;
  text-decoration: none;
  font-weight: 850;
}

.signin-wrap {
  min-height: 44px;
  margin: 0.2rem 0 0;
}

.google-signin-frame {
  width: 300px;
  max-width: 100%;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: #202124;
}

.google-signin-frame iframe {
  display: block !important;
  border: 0 !important;
}

.login-status {
  min-height: 1.4rem;
  margin: 0;
  font-size: 0.88rem;
}

.login-shell {
  width: min(960px, 100%);
}

.login-panel {
  max-width: 520px;
  padding: clamp(1.3rem, 4vw, 2.2rem);
}

.login-panel .signin-wrap {
  min-height: 44px;
  margin: 1.25rem 0;
}

.login-status,
.quiet-link {
  color: var(--muted);
}

.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: #10202a;
}

.notice.danger {
  border-color: rgba(255, 127, 127, 0.45);
  color: #ffd7d7;
}

@media (max-width: 980px) {
  .hero,
  .inventory-layout,
  .toolbar,
  .stats,
  .section-grid.two,
  .entry-grid {
    grid-template-columns: 1fr;
  }

  .hero-status {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .connect-grid,
  .form-grid,
  .device-dialog footer {
    grid-template-columns: 1fr;
  }

  .warning-band,
  .device-main {
    align-items: stretch;
    flex-direction: column;
  }

  .warning-band strong {
    white-space: normal;
  }
}

.console-page {
  width: min(1680px, calc(100% - 2rem));
}

.console-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  padding: 1.35rem 0 1rem;
}

.console-hero h1 {
  font-size: clamp(2rem, 3.3vw, 3.6rem);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.summary-grid article {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: rgba(17, 35, 46, 0.9);
}

.summary-grid span {
  display: block;
  color: var(--accent);
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.45rem;
}

.summary-grid strong {
  color: var(--muted);
  font-size: 0.82rem;
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 1rem;
  align-items: start;
}

.main-console {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.table-toolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(130px, 170px) minmax(140px, 180px) minmax(130px, 170px) minmax(130px, 170px) auto;
}

.table-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 35, 46, 0.92);
  box-shadow: 0 18px 44px rgba(0,0,0,0.2);
}

.table-meta,
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
}

.table-meta {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
}

.table-meta strong {
  color: var(--text);
}

.table-wrap {
  max-height: 68vh;
  overflow: auto;
}

.device-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.device-table th,
.device-table td {
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 0.62rem 0.7rem;
  text-align: left;
  vertical-align: middle;
}

.device-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0d1b24;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.device-table th button,
.device-table td button {
  min-height: 0;
  padding: 0.32rem 0.48rem;
  font-size: 0.84rem;
}

.device-table th button {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  text-transform: uppercase;
  font-weight: 800;
}

.device-table tbody tr {
  cursor: pointer;
}

.device-table tbody tr:hover,
.device-table tbody tr.selected {
  background: rgba(93, 183, 242, 0.1);
}

.device-table td strong {
  display: block;
  margin-bottom: 0.18rem;
}

.device-table td span {
  color: var(--muted);
  font-size: 0.8rem;
}

.status-pill.ready {
  background: rgba(99, 210, 154, 0.13);
  border-color: rgba(99, 210, 154, 0.32);
  color: #bdf5d4;
}

.status-pill.pending {
  background: rgba(242, 199, 102, 0.12);
  border-color: rgba(242, 199, 102, 0.34);
  color: #ffe4a3;
}

.status-pill.needs {
  background: rgba(255, 127, 127, 0.12);
  border-color: rgba(255, 127, 127, 0.34);
  color: #ffd0d0;
}

.status-pill.neutral {
  background: rgba(168, 189, 200, 0.12);
  border-color: rgba(168, 189, 200, 0.28);
  color: #d7e5ec;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 2rem !important;
}

.pager {
  border-top: 1px solid rgba(255,255,255,0.08);
  justify-content: flex-end;
}

.pager label {
  grid-template-columns: auto 90px;
  align-items: center;
}

.client-detail.empty {
  color: var(--muted);
  line-height: 1.5;
}

.client-detail h3 {
  margin: 0 0 0.55rem;
  font-size: 1.35rem;
}

.client-detail h4 {
  margin: 1rem 0 0.4rem;
}

.detail-note {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.client-detail dl {
  display: grid;
  gap: 0.45rem;
  margin: 1rem 0 0;
}

.client-detail dl div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
}

.client-detail dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.client-detail dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.activity-list {
  display: grid;
  gap: 0.65rem;
}

.activity-row {
  display: grid;
  gap: 0.15rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 0.65rem;
}

.activity-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.enrollment-output {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(5, 11, 16, 0.68);
}

.enrollment-output h3 {
  margin: 0;
}

.enrollment-output .code-block {
  max-height: 320px;
  white-space: pre-wrap;
}

.client-downloads {
  margin-bottom: 1rem;
}

.client-downloads .panel-heading {
  align-items: start;
  margin-bottom: 1rem;
}

.server-config-grid,
.download-grid {
  display: grid;
  gap: 0.75rem;
}

.server-config-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.server-config-grid div,
.download-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(5, 11, 16, 0.42);
  padding: 0.85rem;
}

.server-config-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.server-config-grid button {
  width: 100%;
  min-height: 42px;
  overflow-wrap: anywhere;
}

.download-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1rem;
}

.download-card {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.download-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.download-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.button-row a,
.button-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.config-details {
  margin-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1rem;
}

.config-details summary {
  cursor: pointer;
  font-weight: 800;
}

code {
  color: #dff8ea;
}

.fleet-rollout {
  margin-bottom: 1rem;
}

.fleet-script-output {
  max-height: 420px;
  margin-top: 1rem;
  white-space: pre-wrap;
}

.simple-setup {
  width: min(1200px, calc(100% - 2rem));
}

.setup-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.setup-summary article span {
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.25;
}

.rollout-steps {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.rollout-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(17, 35, 46, 0.92);
  box-shadow: 0 18px 44px rgba(0,0,0,0.2);
}

.step-number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061016;
  font-weight: 900;
  font-size: 1.25rem;
}

.rollout-card h2 {
  margin-bottom: 0.45rem;
  font-size: 1.35rem;
}

.rollout-card p {
  color: var(--muted);
  line-height: 1.5;
}

.command-box {
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: #050b10;
  color: #dff8ea;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.row-actions button {
  min-height: 32px;
}

@media (max-width: 1260px) {
  .console-grid,
  .table-toolbar,
  .summary-grid,
  .download-grid,
  .server-config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .console-hero {
    grid-template-columns: 1fr;
  }

  .table-meta,
  .pager {
    align-items: stretch;
    flex-direction: column;
  }
}

.remote-body {
  --bg: #f3f4f6;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #d9dee7;
  --text: #20242b;
  --muted: #6d7480;
  --accent: #e03b35;
  --accent-2: #1476a8;
  --warning: #b87500;
  --danger: #c5322d;
  background:
    linear-gradient(180deg, #ffffff 0 86px, #f3f4f6 86px 100%);
  color: var(--text);
}

.remote-body .remote-topbar {
  min-height: 54px;
  border-bottom-color: #dde2ea;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 12px rgba(32, 36, 43, 0.08);
}

.remote-body .brand {
  color: #252932;
  font-weight: 760;
}

.remote-body .brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #fff;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}

.login-brand img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(32, 36, 43, 0.14);
}

.login-brand .eyebrow {
  margin-bottom: 0.25rem;
}

.login-brand h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 4vw, 2.45rem);
}

.remote-body .nav a,
.remote-body button,
.remote-body .text-link {
  border-color: transparent;
  background: transparent;
  color: #4f5764;
}

.remote-body .nav a {
  padding: 0.42rem 0.58rem;
}

.remote-body .nav a[aria-current="page"],
.remote-body .nav a:hover,
.remote-body button:hover,
.remote-body .text-link:hover {
  border-color: transparent;
  color: var(--accent);
  background: #fff1f0;
}

.remote-body .primary-btn {
  min-height: 42px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(224, 59, 53, 0.18);
}

.remote-body .primary-btn:hover {
  background: #c82f2a;
  color: #fff;
}

.remote-console {
  width: min(1500px, calc(100% - 2rem));
  padding-top: 1.1rem;
}

.address-strip {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.address-card,
.address-metrics,
.remote-body .panel,
.remote-body .toolbar,
.tile-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(32, 36, 43, 0.06);
}

.address-card {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 96px;
  padding: 0.9rem;
  text-align: center;
}

.address-card span,
.address-metrics strong,
.remote-body label span,
.sort-bar span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.address-card strong {
  max-width: 100%;
  color: var(--accent);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  overflow-wrap: anywhere;
}

.address-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
}

.address-metrics article {
  display: grid;
  align-content: center;
  gap: 0.34rem;
  min-height: 96px;
  padding: 0.8rem 1rem;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f9fafc);
}

.address-metrics article:last-child {
  border-right: 0;
}

.address-metrics span {
  color: #252932;
  font-size: 1.55rem;
  font-weight: 820;
  line-height: 1;
}

.address-strip > .primary-btn {
  align-self: stretch;
  min-width: 132px;
}

.remote-body .console-grid {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.remote-body .main-console,
.remote-body .side-stack {
  gap: 0.85rem;
}

.remote-toolbar {
  grid-template-columns: minmax(280px, 1.3fr) repeat(4, minmax(130px, 180px));
  margin-bottom: 0;
  padding: 0.8rem;
}

.remote-body input,
.remote-body select,
.remote-body textarea {
  border-color: #d9dee7;
  background: #fff;
  color: #20242b;
}

.remote-body input:focus,
.remote-body select:focus,
.remote-body textarea:focus {
  outline: 2px solid rgba(224, 59, 53, 0.18);
  border-color: rgba(224, 59, 53, 0.55);
}

.remote-body .setting-check {
  border-color: #e1e6ee;
  background: #f8fafc;
}

.remote-body .setting-copy {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.remote-body .setting-copy strong {
  color: #252932;
}

.remote-body .setting-copy small {
  color: var(--muted);
}

.session-tabs {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 0.15rem;
}

.session-tabs button {
  min-height: 40px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.55rem 0.72rem;
  color: #6a717d;
  font-size: 0.92rem;
}

.session-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

.tile-panel {
  overflow: hidden;
}

.remote-body .table-meta {
  border-bottom-color: var(--line);
  color: var(--muted);
  background: #fff;
}

.remote-body .table-meta > div:first-child {
  display: grid;
  gap: 0.12rem;
}

.remote-body .table-meta strong {
  color: #252932;
}

.sort-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  justify-content: flex-end;
}

.sort-bar button {
  min-height: 32px;
  border: 1px solid #d9dee7;
  border-radius: 999px;
  padding: 0.28rem 0.56rem;
  background: #f8fafc;
  color: #4f5764;
  font-size: 0.82rem;
}

.remote-section-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  padding: 1rem 1rem 0.2rem;
}

.remote-section-title h1 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.remote-section-title span {
  color: var(--muted);
  font-size: 0.86rem;
}

.remote-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.85rem;
  padding: 0.85rem 1rem 1rem;
}

.shortcut-panel {
  overflow: hidden;
}

.shortcut-list {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.65rem;
}

.shortcut-client {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  min-width: 0;
  border: 1px solid #e1e6ee;
  border-radius: 6px;
  padding: 0.5rem;
  background: #fafbfc;
}

.shortcut-client-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.48rem;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.shortcut-client-main span:last-child {
  min-width: 0;
}

.shortcut-client-main strong,
.shortcut-client-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortcut-client-main strong {
  color: #252932;
  font-size: 0.86rem;
}

.shortcut-client-main small,
.shortcut-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.shortcut-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.shortcut-actions button {
  min-height: 30px;
  border: 1px solid #d9dee7;
  border-radius: 5px;
  padding: 0.22rem 0.42rem;
  background: #fff;
  color: #4f5764;
  font-size: 0.78rem;
}

.shortcut-empty {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 0.7rem;
  background: #fafbfc;
}

.remote-tile {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce2ea;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(32, 36, 43, 0.08);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.remote-tile:hover,
.remote-tile.selected {
  border-color: rgba(224, 59, 53, 0.6);
  box-shadow: 0 14px 26px rgba(32, 36, 43, 0.14);
  transform: translateY(-1px);
}

.tile-connect {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #d9dee7;
  text-align: left;
}

.tile-wallpaper,
.detail-preview {
  background-image: var(--tile-bg);
  background-position: center;
  background-size: cover;
}

.tile-wallpaper,
.tile-shade {
  position: absolute;
  inset: 0;
}

.tile-shade {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.45)),
    linear-gradient(90deg, rgba(0,0,0,0.35), transparent 58%);
}

.tile-status {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  max-width: calc(100% - 1.1rem);
  border-radius: 999px;
  padding: 0.24rem 0.48rem;
  background: rgba(255,255,255,0.86);
  color: #232832;
  font-size: 0.72rem;
  font-weight: 760;
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: #9aa3af;
}

.status-dot.ready { background: #1fa463; }
.status-dot.pending { background: #c8841a; }
.status-dot.needs { background: #e03b35; }
.status-dot.neutral { background: #7b8490; }

.tile-initials {
  position: absolute;
  right: 0.6rem;
  bottom: 0.64rem;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 820;
  backdrop-filter: blur(8px);
}

.tile-title {
  position: absolute;
  left: 0.68rem;
  right: 3.2rem;
  bottom: 0.55rem;
  display: grid;
  gap: 0.12rem;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}

.tile-title strong,
.tile-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-title strong {
  font-size: 1rem;
}

.tile-title small {
  opacity: 0.92;
}

.tile-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.62rem 0.68rem;
}

.tile-footer strong,
.tile-footer span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-footer strong {
  color: #252932;
  font-size: 0.85rem;
}

.tile-footer span {
  color: var(--muted);
  font-size: 0.78rem;
}

.tile-actions {
  display: flex;
  gap: 0.24rem;
}

.tile-actions button {
  min-height: 30px;
  border: 1px solid #d9dee7;
  border-radius: 5px;
  padding: 0.22rem 0.42rem;
  background: #f8fafc;
  color: #4f5764;
  font-size: 0.78rem;
}

.remote-body .pager {
  border-top-color: var(--line);
  background: #fff;
}

.remote-body .pager button,
.remote-body .pager select {
  border: 1px solid #d9dee7;
  background: #fff;
}

.remote-body .panel {
  padding: 0.85rem;
}

.remote-body .panel h2 {
  color: #252932;
  font-size: 0.98rem;
}

.remote-body .security-list span {
  border-color: #e1e6ee;
  background: #f8fafc;
  color: #4f5764;
}

.remote-body .security-badge {
  border-color: #d8dee7;
  background: #f1f4f8;
  color: #596170;
}

.remote-body .security-badge.ready {
  border-color: #b9e2c8;
  background: #edf8f1;
  color: #18794e;
}

.remote-body .security-badge.needs {
  border-color: #f1d291;
  background: #fff7e6;
  color: #966100;
}

.detail-preview {
  display: grid;
  place-items: center;
  min-height: 140px;
  margin-bottom: 0.75rem;
  border-radius: 6px;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 850;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.client-detail h3 {
  color: #252932;
}

.remote-body .status-pill.ready {
  background: #edf8f1;
  border-color: #b9e2c8;
  color: #18794e;
}

.remote-body .status-pill.pending {
  background: #fff7e6;
  border-color: #f1d291;
  color: #966100;
}

.remote-body .status-pill.needs {
  background: #fff0ef;
  border-color: #f0bbb7;
  color: #b8322d;
}

.remote-body .status-pill.neutral {
  background: #f1f4f8;
  border-color: #d8dee7;
  color: #596170;
}

.remote-body .tech-row,
.remote-body .activity-row {
  border-bottom-color: #e7ebf0;
}

.remote-body .tech-section h3,
.remote-body .tech-row span,
.remote-body .tech-row em,
.remote-body .activity-row span,
.remote-body .muted-copy,
.remote-body .mini-list,
.remote-body .check-list,
.client-detail.empty,
.client-detail dt {
  color: var(--muted);
}

.remote-body .device-dialog {
  background: #fff;
  color: var(--text);
  box-shadow: 0 22px 80px rgba(32, 36, 43, 0.28);
}

.remote-body .code-block,
.remote-body .command-box {
  background: #f7f9fb;
  color: #26313d;
}

.remote-body code {
  color: #145f86;
}

.remote-body .setup-console {
  width: min(1500px, calc(100% - 2rem));
  padding-top: 0.85rem;
}

.remote-body .setup-console .console-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 0.75rem;
  padding: 0;
}

.remote-body .setup-console .console-hero > div:first-child,
.remote-body .setup-console .hero-status {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(32, 36, 43, 0.06);
}

.remote-body .setup-console .console-hero > div:first-child {
  display: grid;
  align-content: center;
  min-height: 104px;
  padding: 0.9rem 1rem;
}

.remote-body .setup-console .eyebrow {
  margin-bottom: 0.34rem;
  color: var(--accent);
}

.remote-body .setup-console h1 {
  margin-bottom: 0.3rem;
  color: #252932;
  font-size: clamp(1.3rem, 2.5vw, 1.85rem);
  line-height: 1.08;
}

.remote-body .setup-console .console-hero p {
  max-width: 860px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

.remote-body .setup-console .hero-status {
  min-width: 0;
  padding: 0.85rem;
  place-content: center;
}

.remote-body .setup-console .hero-status strong {
  color: #252932;
  overflow-wrap: anywhere;
}

.remote-body .setup-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  margin-bottom: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(32, 36, 43, 0.06);
}

.remote-body .setup-summary article {
  display: grid;
  align-content: center;
  min-height: 66px;
  padding: 0.65rem 0.8rem;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f9fafc);
}

.remote-body .setup-summary article:last-child {
  border-right: 0;
}

.remote-body .setup-summary span {
  color: #252932;
  font-size: 0.9rem;
  font-weight: 760;
}

.remote-body .setup-summary strong {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.remote-body .setup-console .warning-band {
  align-items: flex-start;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-color: #f1d291;
  background: #fff8e9;
  box-shadow: none;
}

.remote-body .setup-console .warning-band strong {
  color: #966100;
}

.remote-body .setup-console .warning-band span {
  color: #675630;
}

.remote-body .rollout-steps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.remote-body .rollout-card {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0.65rem;
  align-content: start;
  overflow: hidden;
  border-radius: 6px;
  border-color: var(--line);
  background: #fff;
  padding: 0.8rem;
  box-shadow: 0 10px 24px rgba(32, 36, 43, 0.06);
}

.remote-body .rollout-card h2 {
  margin-bottom: 0.3rem;
  color: #252932;
  font-size: 0.98rem;
}

.remote-body .rollout-card p {
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.38;
}

.remote-body .step-number {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
}

.remote-body .button-row {
  gap: 0.38rem;
  margin: 0.55rem 0;
}

.remote-body .button-row a,
.remote-body .button-row button {
  min-height: 34px;
  padding: 0.42rem 0.58rem;
  border: 1px solid #d9dee7;
  background: #fff;
  color: #4f5764;
}

.remote-body .button-row .primary-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.remote-body .setup-console .panel {
  margin-bottom: 0;
  padding: 0.85rem;
}

.remote-body .setup-console .panel h2 {
  margin-bottom: 0.3rem;
  font-size: 0.96rem;
}

.remote-body .setup-console .panel input {
  min-width: min(220px, 100%);
  min-height: 36px;
  padding: 0.5rem 0.65rem;
}

.remote-body .setup-console .command-box {
  max-height: 105px;
  min-height: 54px;
  border-color: #d9dee7;
  background: #f7f9fb;
  color: #26313d;
  font-size: 0.78rem;
  line-height: 1.38;
  padding: 0.55rem 0.65rem;
}

.remote-body .setup-secondary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.remote-body .setup-secondary-grid .muted-copy,
.remote-body .setup-secondary-grid .check-list {
  font-size: 0.84rem;
  line-height: 1.38;
}

.remote-body .setup-secondary-grid .check-list {
  margin-bottom: 0;
  padding-left: 1.1rem;
}

.remote-body .setup-secondary-grid .check-list li {
  margin-bottom: 0.38rem;
}

.remote-body .toast {
  border-color: rgba(224, 59, 53, 0.35);
  background: #fff;
  color: #252932;
}

@media (max-width: 1260px) {
  .address-strip,
  .remote-body .console-grid,
  .remote-toolbar,
  .remote-body .setup-console .console-hero,
  .remote-body .setup-summary,
  .remote-body .rollout-steps,
  .remote-body .setup-secondary-grid {
    grid-template-columns: 1fr;
  }

  .remote-body .setup-summary article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .remote-body .setup-summary article:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  .remote-console {
    width: min(100% - 1rem, 1500px);
  }

  .remote-section-title,
  .remote-body .table-meta,
  .remote-body .pager {
    align-items: stretch;
    flex-direction: column;
  }

  .session-tabs,
  .sort-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .remote-tile-grid {
    grid-template-columns: 1fr;
    padding-inline: 0.7rem;
  }

  .address-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .address-metrics article {
    min-height: 76px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .address-metrics article:nth-child(2n),
  .address-metrics article:last-child {
    border-right: 0;
  }

  .address-metrics article:nth-last-child(-n + 1) {
    border-bottom: 0;
  }

  .remote-body .setup-console {
    width: min(100% - 1rem, 1500px);
  }

  .remote-body .rollout-card {
    grid-template-columns: 1fr;
  }

  .remote-body .step-number {
    width: 32px;
    height: 32px;
  }
}

/* Stable dashboard theme layer. Keep this last so older page-specific rules cannot drift. */
.remote-body.theme-dark {
  --bg: #071017;
  --bg-soft: #0c1a22;
  --panel: #0f2029;
  --panel-2: #132934;
  --line: #284a59;
  --text: #f4fbff;
  --muted: #9db5c1;
  --accent: #62d49f;
  --accent-2: #58b7e8;
  --warning: #f1c66f;
  --danger: #ff7d7d;
  background:
    radial-gradient(circle at 12% 0%, rgba(88, 183, 232, 0.22), transparent 28rem),
    radial-gradient(circle at 86% 8%, rgba(98, 212, 159, 0.16), transparent 24rem),
    linear-gradient(180deg, #071017 0%, #08151d 42%, #050b10 100%);
  color: var(--text);
}

.remote-body.theme-light {
  --bg: #f3f6f8;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f8fbfc;
  --line: #d6e0e6;
  --text: #202832;
  --muted: #64727d;
  --accent: #0f8c65;
  --accent-2: #1476a8;
  --warning: #9a6500;
  --danger: #bf3434;
}

.remote-body.theme-dark .remote-topbar {
  border-bottom-color: rgba(255,255,255,0.08);
  background: rgba(7, 16, 23, 0.9);
  box-shadow: 0 12px 34px rgba(0,0,0,0.28);
}

.remote-body.theme-dark .brand,
.remote-body.theme-dark h1,
.remote-body.theme-dark h2,
.remote-body.theme-dark h3,
.remote-body.theme-dark .client-detail h3,
.remote-body.theme-dark .remote-body .panel h2 {
  color: var(--text);
}

.theme-toggle {
  min-height: 34px;
}

.remote-body.theme-dark .nav a,
.remote-body.theme-dark button,
.remote-body.theme-dark .text-link {
  border-color: rgba(255,255,255,0.1);
  background: rgba(12, 26, 34, 0.78);
  color: var(--text);
}

.remote-body.theme-dark .nav a[aria-current="page"],
.remote-body.theme-dark .nav a:hover,
.remote-body.theme-dark button:hover,
.remote-body.theme-dark .text-link:hover {
  border-color: rgba(98, 212, 159, 0.54);
  background: rgba(98, 212, 159, 0.12);
  color: #dff8ea;
}

.remote-body.theme-dark .primary-btn,
.remote-body.theme-dark .button-row .primary-btn {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061016;
  box-shadow: 0 12px 28px rgba(39, 150, 120, 0.22);
}

.remote-body.theme-dark .address-card,
.remote-body.theme-dark .address-metrics,
.remote-body.theme-dark .remote-body .panel,
.remote-body.theme-dark .panel,
.remote-body.theme-dark .toolbar,
.remote-body.theme-dark .tile-panel,
.remote-body.theme-dark .remote-tile,
.remote-body.theme-dark .rollout-card,
.remote-body.theme-dark .setup-summary,
.remote-body.theme-dark .setup-console .console-hero > div:first-child,
.remote-body.theme-dark .setup-console .hero-status {
  border-color: var(--line);
  background: rgba(15, 32, 41, 0.92);
  box-shadow: 0 18px 44px rgba(0,0,0,0.22);
}

.remote-body.theme-dark .address-metrics article,
.remote-body.theme-dark .setup-summary article {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(19, 41, 52, 0.92), rgba(12, 26, 34, 0.92));
}

.remote-body.theme-dark .address-metrics span,
.remote-body.theme-dark .setup-summary span,
.remote-body.theme-dark .table-meta strong,
.remote-body.theme-dark .tile-footer strong,
.remote-body.theme-dark .setup-console .hero-status strong,
.remote-body.theme-dark .setup-console h1,
.remote-body.theme-dark .rollout-card h2,
.remote-body.theme-dark .panel h2 {
  color: var(--text);
}

.remote-body.theme-dark .table-meta,
.remote-body.theme-dark .pager {
  border-color: var(--line);
  background: rgba(12, 26, 34, 0.9);
}

.remote-body.theme-dark input,
.remote-body.theme-dark select,
.remote-body.theme-dark textarea,
.remote-body.theme-dark .pager select {
  border-color: var(--line);
  background: #07131a;
  color: var(--text);
}

.remote-body.theme-dark input:focus,
.remote-body.theme-dark select:focus,
.remote-body.theme-dark textarea:focus {
  outline: 2px solid rgba(98, 212, 159, 0.22);
  border-color: rgba(98, 212, 159, 0.66);
}

.remote-body.theme-dark .sort-bar button,
.remote-body.theme-dark .tile-actions button,
.remote-body.theme-dark .button-row a,
.remote-body.theme-dark .button-row button,
.remote-body.theme-dark .pager button {
  border-color: var(--line);
  background: rgba(7, 19, 26, 0.86);
  color: var(--text);
}

.remote-body.theme-dark .session-tabs {
  border-bottom-color: var(--line);
}

.remote-body.theme-dark .session-tabs button {
  color: var(--muted);
}

.remote-body.theme-dark .session-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.remote-body.theme-dark .security-list span {
  border-color: var(--line);
  background: rgba(7, 19, 26, 0.7);
  color: var(--muted);
}

.remote-body.theme-dark .security-badge.ready,
.remote-body.theme-dark .status-pill.ready {
  border-color: rgba(98, 212, 159, 0.4);
  background: rgba(98, 212, 159, 0.13);
  color: #bdf5d4;
}

.remote-body.theme-dark .security-badge.needs,
.remote-body.theme-dark .status-pill.pending {
  border-color: rgba(241, 198, 111, 0.4);
  background: rgba(241, 198, 111, 0.13);
  color: #ffe2a1;
}

.remote-body.theme-dark .status-pill.needs {
  border-color: rgba(255, 125, 125, 0.42);
  background: rgba(255, 125, 125, 0.13);
  color: #ffd1d1;
}

.remote-body.theme-dark .code-block,
.remote-body.theme-dark .command-box {
  border-color: var(--line);
  background: #050b10;
  color: #dff8ea;
}

.remote-body.theme-dark .setup-console .warning-band {
  border-color: rgba(241, 198, 111, 0.44);
  background: rgba(241, 198, 111, 0.12);
}

.remote-body.theme-dark .setup-console .warning-band strong {
  color: #ffe2a1;
}

.remote-body.theme-dark .setup-console .warning-band span,
.remote-body.theme-dark .rollout-card p,
.remote-body.theme-dark .setup-console .console-hero p,
.remote-body.theme-dark .tile-footer span,
.remote-body.theme-dark .muted-copy,
.remote-body.theme-dark .tech-row span,
.remote-body.theme-dark .tech-row em,
.remote-body.theme-dark .activity-row span,
.remote-body.theme-dark .mini-list,
.remote-body.theme-dark .check-list,
.remote-body.theme-dark .client-detail.empty,
.remote-body.theme-dark .client-detail dt {
  color: var(--muted);
}

.remote-body.theme-dark .device-dialog {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

@media (max-width: 760px) {
  .theme-toggle {
    width: auto;
  }

  .remote-body .setup-console,
  .remote-body .rollout-card,
  .remote-body .setup-secondary-grid .panel,
  .remote-body .command-box {
    min-width: 0;
    max-width: 100%;
  }

  .remote-body .setup-console .button-row a,
  .remote-body .setup-console .button-row button {
    flex: 1 1 150px;
    min-width: 0;
    white-space: normal;
  }

  .remote-body .setup-console .command-box {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* AnyDesk-inspired palette and dashboard view fixes. Keep this after legacy layers. */
.remote-body.theme-light {
  color-scheme: light;
  --bg: #f5f6f8;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --line: #dfe3e8;
  --text: #171a21;
  --muted: #646b76;
  --accent: #e6332a;
  --accent-2: #2a3039;
  --warning: #a86b00;
  --danger: #c5322d;
  background: linear-gradient(180deg, #ffffff 0 76px, #f5f6f8 76px 100%);
}

.remote-body.theme-dark {
  color-scheme: dark;
  --bg: #101216;
  --bg-soft: #161a20;
  --panel: #1b2028;
  --panel-2: #222832;
  --line: #353c47;
  --text: #f7f8fa;
  --muted: #aeb4bd;
  --accent: #ff4438;
  --accent-2: #f4f5f7;
  --warning: #ffc456;
  --danger: #ff6b63;
  background:
    linear-gradient(180deg, #171a20 0%, #101216 46%, #0b0d10 100%);
}

.remote-body.theme-light .remote-topbar {
  border-bottom-color: #e3e6ea;
  background: rgba(255, 255, 255, 0.95);
}

.remote-body.theme-dark .remote-topbar {
  border-bottom-color: rgba(255,255,255,0.08);
  background: rgba(16, 18, 22, 0.92);
}

.remote-body.theme-light .brand,
.remote-body.theme-light h1,
.remote-body.theme-light h2,
.remote-body.theme-light h3,
.remote-body.theme-light .table-meta strong,
.remote-body.theme-light .tile-footer strong,
.remote-body.theme-light .client-detail h3,
.remote-body.theme-light .setup-console h1,
.remote-body.theme-light .setup-console .hero-status strong,
.remote-body.theme-light .rollout-card h2,
.remote-body.theme-light .panel h2 {
  color: var(--text);
}

.remote-body.theme-light .nav a,
.remote-body.theme-light button,
.remote-body.theme-light .text-link {
  color: #424954;
}

.remote-body.theme-light .nav a[aria-current="page"],
.remote-body.theme-light .nav a:hover,
.remote-body.theme-light button:hover,
.remote-body.theme-light .text-link:hover,
.remote-body.theme-light .session-tabs button.active {
  color: var(--accent);
  background: #fff0ef;
}

.remote-body.theme-dark .nav a[aria-current="page"],
.remote-body.theme-dark .nav a:hover,
.remote-body.theme-dark button:hover,
.remote-body.theme-dark .text-link:hover,
.remote-body.theme-dark .session-tabs button.active {
  border-color: rgba(255, 68, 56, 0.58);
  background: rgba(255, 68, 56, 0.13);
  color: #ffd8d5;
}

.remote-body.theme-light .primary-btn,
.remote-body.theme-light .button-row .primary-btn,
.remote-body.theme-dark .primary-btn,
.remote-body.theme-dark .button-row .primary-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(230, 51, 42, 0.2);
}

.remote-body.theme-light .primary-btn:hover,
.remote-body.theme-light .button-row .primary-btn:hover,
.remote-body.theme-dark .primary-btn:hover,
.remote-body.theme-dark .button-row .primary-btn:hover {
  border-color: #c92f28;
  background: #c92f28;
  color: #fff;
}

.remote-body.theme-dark .address-card,
.remote-body.theme-dark .address-metrics,
.remote-body.theme-dark .panel,
.remote-body.theme-dark .toolbar,
.remote-body.theme-dark .shortcut-panel,
.remote-body.theme-dark .tile-panel,
.remote-body.theme-dark .remote-tile,
.remote-body.theme-dark .rollout-card,
.remote-body.theme-dark .setup-summary,
.remote-body.theme-dark .setup-console .console-hero > div:first-child,
.remote-body.theme-dark .setup-console .hero-status {
  border-color: var(--line);
  background: rgba(27, 32, 40, 0.94);
}

.remote-body.theme-dark .address-metrics article,
.remote-body.theme-dark .setup-summary article,
.remote-body.theme-dark .table-meta,
.remote-body.theme-dark .pager {
  border-color: var(--line);
  background: rgba(34, 40, 50, 0.9);
}

.remote-body.theme-dark .shortcut-client,
.remote-body.theme-dark .shortcut-empty {
  border-color: var(--line);
  background: #151922;
}

.remote-body.theme-dark .shortcut-client-main strong {
  color: var(--text);
}

.remote-body.theme-dark .shortcut-actions button {
  border-color: var(--line);
  background: #11151b;
  color: var(--text);
}

.remote-body.theme-light .address-card strong,
.remote-body.theme-light .address-metrics span,
.remote-body.theme-light .eyebrow,
.remote-body.theme-light .setup-console .eyebrow,
.remote-body.theme-light .setup-summary span {
  color: var(--accent);
}

.remote-body.theme-dark .address-card strong,
.remote-body.theme-dark .address-metrics span,
.remote-body.theme-dark .eyebrow,
.remote-body.theme-dark .setup-console .eyebrow,
.remote-body.theme-dark .setup-summary span {
  color: #ff6b63;
}

.remote-body.theme-light .remote-tile:hover,
.remote-body.theme-light .remote-tile.selected,
.remote-body.theme-dark .remote-tile:hover,
.remote-body.theme-dark .remote-tile.selected {
  border-color: rgba(230, 51, 42, 0.62);
  box-shadow: 0 14px 28px rgba(23, 26, 33, 0.15);
}

.remote-body.theme-light input,
.remote-body.theme-light select,
.remote-body.theme-light textarea {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.remote-body.theme-dark input,
.remote-body.theme-dark select,
.remote-body.theme-dark textarea,
.remote-body.theme-dark .pager select {
  border-color: var(--line);
  background: #11151b;
  color: var(--text);
}

.remote-body.theme-light input:focus,
.remote-body.theme-light select:focus,
.remote-body.theme-light textarea:focus,
.remote-body.theme-dark input:focus,
.remote-body.theme-dark select:focus,
.remote-body.theme-dark textarea:focus {
  outline: 2px solid rgba(230, 51, 42, 0.18);
  border-color: rgba(230, 51, 42, 0.7);
}

.remote-body.theme-light .code-block,
.remote-body.theme-light .command-box {
  border-color: var(--line);
  background: #f8f9fb;
  color: #252a33;
}

.remote-body.theme-dark .code-block,
.remote-body.theme-dark .command-box {
  border-color: var(--line);
  background: #0c0f13;
  color: #f2f4f7;
}

.remote-body.theme-light .setup-console .warning-band {
  border-color: #ffd4cf;
  background: #fff3f2;
}

.remote-body.theme-light .setup-console .warning-band strong {
  color: #bb2f28;
}

.remote-body.theme-light .setup-console .warning-band span {
  color: #6c3e3b;
}

.remote-body.theme-dark .setup-console .warning-band {
  border-color: rgba(255, 68, 56, 0.34);
  background: rgba(255, 68, 56, 0.11);
}

.remote-body.theme-dark .setup-console .warning-band strong {
  color: #ffc7c3;
}

.client-rollout-only {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-view[hidden] {
  display: none !important;
}

.security-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1.1rem 0 0.5rem;
}

.security-hero h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(2rem, 3.3vw, 3.4rem);
}

.security-hero p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.48;
}

.security-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  align-items: start;
}

.security-settings-panel {
  display: grid;
  gap: 1rem;
}

.security-settings-panel .panel-heading {
  align-items: center;
}

.security-settings-panel textarea {
  resize: vertical;
}

.security-side {
  display: grid;
  gap: 1rem;
}

.security-badge.neutral {
  border-color: #d8dee7;
  background: #f1f4f8;
  color: #596170;
}

.remote-body.theme-dark .security-badge.neutral {
  border-color: var(--line);
  background: rgba(174, 180, 189, 0.12);
  color: var(--muted);
}

.remote-body.theme-light .security-badge.ready,
.remote-body.theme-light .status-pill.ready {
  border-color: #f2b7b2;
  background: #fff0ef;
  color: #b72f28;
}

.remote-body.theme-dark .security-badge.ready,
.remote-body.theme-dark .status-pill.ready {
  border-color: rgba(255, 68, 56, 0.42);
  background: rgba(255, 68, 56, 0.13);
  color: #ffc7c3;
}

.remote-body.theme-light .security-list span {
  border-color: var(--line);
  background: #fafbfc;
  color: #424954;
}

.remote-body.theme-dark .security-list span {
  border-color: var(--line);
  background: #12161c;
  color: var(--muted);
}

@media (max-width: 980px) {
  .security-hero,
  .security-control-grid {
    grid-template-columns: 1fr;
  }
}
