/* Shared surfaces and quieter hierarchy; component contracts remain unchanged. */
:root {
  --canvas: #080d16;
  --canvas-raised: #0f1724;
  --surface: #101926;
  --surface-strong: #152031;
  --surface-soft: #142031;
  --surface-hover: #182639;
  --text-muted: #a0aec0;
  --text-faint: #8b9bb0;
  --chrome: rgba(8, 13, 22, .94);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, .08);
}
html[data-theme="light"] {
  color-scheme: light;
  --canvas: #f3f5f8;
  --canvas-raised: #e8eef5;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #eef3f8;
  --surface-hover: #e6eef6;
  --border: #d5dee8;
  --border-strong: #8eafc3;
  --border-violet: #b9ace4;
  --text: #182739;
  --text-soft: #344b62;
  --text-muted: #52667d;
  --text-faint: #5d7085;
  --cyan: #086d89;
  --cyan-strong: #075e79;
  --cyan-soft: #e5f2f6;
  --violet: #6550ab;
  --violet-soft: #efebf8;
  --blue: #315d9d;
  --amber: #885508;
  --red: #b82e4d;
  --green: #1e7250;
  --chrome: rgba(249, 251, 253, .95);
  --shadow-panel: 0 14px 40px rgba(37, 61, 86, .07);
  --shadow-card: 0 3px 12px rgba(37, 61, 86, .04);
}
html[data-theme="dark"] { color-scheme: dark; }
.ambient-stage { background: var(--canvas); }
.ambient-orb { opacity: .08; }
.ambient-grid, .ambient-pointer, .ambient-noise { display: none; }
.command-sidebar, .command-topbar { background: var(--chrome); }
.command-topbar { gap: 14px; }
.search-wrap { flex: 1 1 auto; min-width: 0; }
.topbar-actions { flex: 0 0 auto; }
.search-wrap input, .search-wrap input:focus { background: var(--surface); }
.appearance-control { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; }
.appearance-control svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.appearance-trigger {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.appearance-trigger:hover, .appearance-trigger[aria-expanded="true"] { background: var(--surface-hover); border-color: var(--border-strong); color: var(--cyan); }
.appearance-trigger:focus-visible, .appearance-option:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.appearance-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + 10px);
  right: 0;
  width: 224px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .2);
}
.appearance-popover[hidden] { display: none; }
.appearance-caption { display: block; margin: 0 0 12px 2px; color: var(--text-muted); font-size: 10px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.appearance-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.appearance-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 64px;
  padding: 8px 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font: 550 11px/1.2 var(--font-sans);
  cursor: pointer;
}
.appearance-option:hover { background: var(--surface-hover); color: var(--text); }
.appearance-option[aria-pressed="true"] { color: var(--cyan); background: var(--cyan-soft); border-color: var(--border-strong); }
.auth-brand { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-brand .brand-mark { width: 44px; height: 44px; }
.auth-title { margin-bottom: 22px; }
.auth-shell { align-items: center; overflow-y: auto; padding: 24px 16px; }
.auth-panel { flex-shrink: 0; margin-block: auto; }
.hero-card { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-card); border-radius: 18px; }
.hero-card::before, .hero-card::after { display: none; }
.hero-orbit { opacity: .55; }
.hero-actions .btn-primary { box-shadow: none; }
.app-sections { gap: 44px; }
.section-block, .view-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.section-head, .view-heading { margin-bottom: 20px; padding-top: 10px; }
.section-title-icon { background: transparent; border: 0; width: 24px; }
.section-kicker, .entity-kicker, .side-nav-label, .entity-meta-label, .meta-label, .entity-subpanel-head, .eyebrow {
  font-family: var(--font-sans);
  letter-spacing: .09em;
}
.entity-kicker { display: none; }
.entity-head { padding-top: 7px; }
.entity-card, .info-panel {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
  border-radius: 14px;
  padding: 22px;
}
.entity-card:hover { transform: none; background: var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow-card); }
.entity-card::after { display: none; }
.entity-title { font-size: 19px; line-height: 1.3; }
.entity-meta-grid { gap: 14px 22px; }
.entity-meta-block { padding: 0; border: 0; border-radius: 0; background: transparent; }
.entity-meta-grid-service { gap: 0; }
.entity-meta-grid-service .entity-meta-block {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.entity-meta-grid-service .entity-meta-block:last-child { border: 0; }
.entity-meta-label { margin: 5px 0 0; font-size: 10px; line-height: 1.5; }
.entity-meta-value { font-size: 14px; }
.entity-mono { font-size: 13px; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.entity-link span, .entity-chip-link span { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.entity-chip-anchor { padding: 0; border: 0; background: transparent; font-size: 14px; overflow-wrap: anywhere; }
.entity-copy-row { align-items: start; }
.entity-copy-row > .entity-link, .entity-copy-row > .entity-mono { flex: 1 1 auto; }
.entity-note, .entity-note-standalone {
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-muted);
}
.entity-note-standalone { max-height: 470px; padding-right: 12px; scrollbar-width: thin; color: var(--text-soft); }
.entity-subpanel { padding: 16px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.entity-subpanel-head { color: var(--text-muted); font-size: 11px; }
.entity-chip-row { padding-top: 8px; }
.entity-chip-name { font-size: 14px; }
.entity-chip-link { font-size: 12px; }
.entity-context-row span { border: 0; background: transparent; padding: 0; }
.entity-context-row span + span::before { content: "·"; margin-right: 8px; color: var(--text-faint); }
.entity-hardware-card, .rustdesk-card { background: transparent; box-shadow: none; }
.info-meta-list p, .panel-subsection { border-color: var(--border); }
.note-body-content, .modal-form textarea { font-family: var(--font-sans); font-size: 15px; line-height: 1.75; }
.atlas-realm, .atlas-site, .atlas-host-cluster, .atlas-host-cluster:hover, .atlas-host-cluster:focus-within {
  background: transparent;
  box-shadow: none;
}
.atlas-realm { padding: 0; border: 0; }
.atlas-realm::before { display: none; }
.atlas-site { border: 0; border-radius: 0; }
.atlas-site-head { padding-inline: 0; background: transparent; }
.atlas-host-grid { padding-inline: 0; }
.atlas-host-cluster { border: 0; border-radius: 0; padding: 12px 0; border-top: 1px solid var(--border); }
.atlas-host-card { align-self: start; }
.atlas-host-card, .atlas-realm-external .atlas-host-card, .atlas-service-row { background: var(--surface); border-color: var(--border); }
.atlas-service-row:hover, .atlas-service-row:focus-within { background: var(--surface-hover); }
.atlas-summary-grid article, .footprint-index { background: var(--surface); }
.hosting-detail-panel, .hosting-log-details, .hosting-help { background: transparent; }
.modal-panel, .auth-panel, .hosting-dialog, .hosting-dialog .modal-head, .hosting-dialog .modal-actions, .toast { background: var(--surface); }
.modal-form input, .modal-form textarea, .modal-form select, .auth-input { background: var(--canvas); }
.footprint-map { background: var(--canvas-raised); }
.footprint-map-heading, .footprint-map-note, .footprint-pin, .footprint-unlocated { background: var(--surface); }
.footprint-pin:hover, .footprint-pin.is-selected { background: var(--surface-hover); }
.map-mode-toggle, .rescue-output-wrap { background: var(--surface); }
.rescue-output { color: var(--text-soft); }
.hosting-caption, .hosting-muted, .hosting-fact dt, .hosting-help p, .hosting-form .modal-field-tip { color: var(--text-muted); }
.hosting-badge-good, .toast-success { color: var(--green); }
.hosting-badge-error, .hosting-error, .toast-error, .auth-error { color: var(--red); }
.hosting-plan-warnings { color: var(--amber); }
html[data-theme="light"] .entity-actions { opacity: 1; }
html[data-theme="light"] .btn-primary { background: var(--cyan); color: #fff; }
html[data-theme="light"] .btn-secondary, html[data-theme="light"] .icon-only-btn, html[data-theme="light"] .icon-label-btn { background: var(--surface); }
html[data-theme="light"] .side-nav-item.is-active { background: var(--cyan-soft); border-color: var(--border); }
html[data-theme="light"] .entity-link:hover, html[data-theme="light"] .entity-chip-link:hover,
html[data-theme="light"] .rustdesk-card-link:hover, html[data-theme="light"] .atlas-service-name:hover { color: var(--text); }
html[data-theme="light"] .footprint-unlocated button:hover, html[data-theme="light"] .footprint-unlocated button[aria-pressed="true"] { color: var(--violet); }
html[data-theme="light"] .service-count-badge { border-color: var(--surface); color: #fff; }
html[data-theme="light"] .modal-shell, html[data-theme="light"] .auth-shell { background: rgba(226, 233, 242, .82); }
html[data-theme="light"] .hosting-dialog::backdrop { background: rgba(51, 68, 86, .4); }
.brand-mark { border: 0; background: transparent; box-shadow: none; }
.brand-mark img { width: 42px; height: 42px; filter: none; }
html[data-theme="light"] ::selection { color: var(--text); background: #c7e8f1; }
@media (max-width: 720px) {
  .command-content { padding: 18px 16px 30px; }
  .command-topbar { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .search-wrap { flex: 1 1 0; width: 0; }
  .search-wrap input { padding-left: 36px; }
  .search-icon { left: 11px; }
  .topbar-actions { gap: 6px; }
  .icon-label-btn { min-width: 44px; min-height: 44px; padding: 10px; }
  .hero-card { padding: 22px; }
  .app-sections { gap: 34px; }
  .section-block, .view-panel { padding: 0; }
  .section-head, .view-heading { gap: 14px; }
  .entity-card, .info-panel { padding: 18px; }
  .entity-title { font-size: 19px; }
  .entity-head { padding-top: 6px; }
  .entity-actions { gap: 2px; }
  .entity-topline { gap: 10px; }
  .entity-mark { width: 36px; height: 36px; border-radius: 10px; }
  .entity-meta-grid { gap: 14px; }
  .entity-meta-grid-service { gap: 0; }
  .entity-meta-grid-server { grid-template-columns: 1fr; }
  .entity-meta-grid-service .entity-meta-block { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
  .entity-meta-value, .entity-mono { font-size: 15px; }
  .entity-meta-label { font-size: 11px; margin-top: 3px; }
  .entity-note, .entity-note-standalone { font-size: 16px; padding: 14px 0 0; }
  .entity-subpanel { padding: 16px 0 0; }
  .entity-chip-row { gap: 4px; }
  .atlas-host-cluster { padding: 10px 0; }
  .atlas-filter-row { margin-inline: 0; padding-inline: 0; }
}
@media (prefers-reduced-transparency: reduce) {
  .command-sidebar, .command-topbar { background: var(--canvas); backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .appearance-trigger { transition: none; }
}
