/* Generated by npm run build:frontend. Edit frontend/ sources; see frontend/README.md. */
.brand-toolbar { justify-content: flex-start; flex-wrap: wrap; gap: 10px; }
.brand-toolbar select { width: min(240px, 100%); }
.brand-tag { width: fit-content; max-width: 100%; padding: 2px 7px; border: 1px solid var(--border); border-radius: 4px; color: var(--primary-dark); background: var(--surface-soft); overflow-wrap: anywhere; font-size: 12px; }
.brand-site-options { display: grid; }
.brand-site-option { display: flex !important; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.brand-site-option[hidden] { display: none !important; }
.brand-site-option input { flex: 0 0 18px; width: 18px; height: 18px; min-height: 18px; }
.brand-site-option > span { min-width: 0; }
.brand-site-option strong, .brand-site-option small { display: block; overflow-wrap: anywhere; }
.brand-site-option small { margin-top: 3px; color: var(--muted); font-weight: 400; }
#brandForm .dialog-body { display: grid; grid-template-columns: minmax(0, 1fr); }
#brandSelectionCount { color: var(--muted); font-size: 13px; }

*,
*::before,
*::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
}

body,
button,
input,
select,
textarea {
  color: var(--text);
  font-family: "Segoe UI Variable", "Microsoft YaHei UI", sans-serif;
  font-size: var(--font-body);
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
}

button,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--purple-border);
  outline-offset: 2px;
}

small,
.eyebrow,
.module-context,
.module-result-meta,
.detail-meta,
.field-status,
.bar-caption,
.chart-axis,
.chart-label,
.list-pagination-summary,
.backup-selection-meta small,
.site-title span,
.platform-metric small,
.dashboard-kpi small,
.dashboard-health-copy small,
.incident-row small,
.incident-row time,
.event-log-list time {
  font-size: var(--font-meta);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 12;
  top: 0;
  display: flex;
  width: auto;
  height: 100vh;
  padding: 0;
  overflow: hidden;
  flex-direction: column;
  border: 0;
  background: var(--sidebar);
  color: #dce4f5;
}

.sidebar::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: var(--accent-gradient);
  opacity: 0.7;
  content: "";
}

.brand-block {
  display: flex;
  min-height: 72px;
  padding: 0 20px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid rgba(150, 165, 203, 0.16);
  background: transparent;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}

.brand-block strong {
  color: #ffffff;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 700;
}

.brand-block span {
  margin-top: 2px;
  color: #99a8c8;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
}

.main-nav {
  display: block;
  min-height: 0;
  margin: 0;
  padding: 16px 12px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  background: transparent;
}

.nav-section-label {
  display: block;
  margin: 10px 8px 5px;
  padding: 0;
  color: #ad9fbd;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-primary,
.nav-item {
  position: relative;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #b8c3db;
  font-size: 16px;
  text-align: left;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-primary {
  display: grid;
  padding: 0 10px;
  align-items: center;
  grid-template-columns: 20px minmax(0, 1fr) 16px;
  gap: 10px;
}

.nav-item {
  display: grid;
  padding: 0 10px 0 30px;
  align-items: center;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
}

.nav-item--root {
  padding-left: 10px;
  font-weight: 650;
}

.nav-primary:hover,
.nav-item:hover,
.nav-cluster:has(.nav-item.active) > .nav-primary {
  background: rgba(255, 255, 255, 0.045);
  color: #ffffff;
}

.nav-item.active {
  background: #3c2456;
  box-shadow: inset 3px 0 0 #a87ce5;
  color: #ffffff;
  font-weight: 700;
}

.main-nav > .nav-item--root.active:hover {
  background: #482c65;
  box-shadow: inset 3px 0 0 #a87ce5;
}

.nav-item::before,
.nav-item::after,
.nav-item.active::before,
.nav-item.active::after {
  display: none;
  content: none;
}

.nav-children .nav-item.active::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 10px;
  display: block;
  width: 2px;
  border: 0;
  border-radius: 2px;
  background: var(--accent-gradient);
  box-shadow: none;
  content: "";
}

.nav-primary > svg:first-child,
.nav-item > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #8495bd;
  stroke-width: 1.8;
  transition: color 160ms ease, filter 160ms ease;
}

.nav-item.active > svg,
.nav-cluster:has(.nav-item.active) > .nav-primary > svg:first-child {
  color: var(--star-blue);
  filter: none;
  transform: none;
}

.nav-chevron {
  width: 15px;
  height: 15px;
  color: #7686aa;
}

.nav-children {
  display: grid;
  max-height: 0;
  gap: 2px;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 220ms ease, opacity 160ms ease, padding 180ms ease;
}

.nav-cluster.is-open .nav-children {
  max-height: 380px;
  padding: 3px 0 7px;
  opacity: 1;
}

.sidebar-runtime {
  display: grid;
  margin: auto 14px 14px;
  padding: 13px;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(170, 187, 220, 0.28);
  border-radius: 7px;
  background: #2d1c40;
  box-shadow: none;
  color: #9cabc7;
}

.sidebar-runtime strong {
  color: #ffffff;
  font-size: 16px;
}

.sidebar-runtime span {
  color: #9cabc7;
  font-size: 13px;
}

.sidebar-runtime-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--star-blue);
  box-shadow: 0 0 0 4px rgba(65, 156, 242, 0.12);
}

.workspace {
  min-width: 0;
  padding: 0;
  background: transparent;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 72px;
  margin: 0;
  padding: 0 28px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.topbar::after {
  display: none;
}

.topbar-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.topbar .eyebrow {
  margin: 0 0 3px;
  color: #52627d;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 650;
  text-transform: none;
}

.topbar h1 {
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.text-action,
.table-action,
.backup-primary-action,
.backup-storage-open,
.backup-storage-copy,
.secret-toggle {
  border-radius: var(--radius-sm);
  font-size: 16px;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

:is(.primary-button, .ghost-button, .danger-button, .icon-button, .table-action,
  .backup-primary-action, .issue-advisor-button, .issue-diagnose-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1.4;
}
:is(.primary-button, .ghost-button, .danger-button, .icon-button, .table-action,
  .backup-primary-action, .issue-advisor-button, .issue-diagnose-button) > svg {
  display: block;
  flex-shrink: 0;
  align-self: center;
  vertical-align: middle;
}
:is(.primary-button, .ghost-button, .danger-button, .icon-button, .table-action) > span {
  margin-block: 0;
  line-height: inherit;
}

.primary-button {
  min-height: 38px;
  border: 1px solid transparent;
  background: var(--accent-gradient);
  box-shadow: none;
  color: #ffffff;
}

.primary-button:hover {
  border-color: transparent;
  background: var(--accent-gradient);
  box-shadow: none;
  filter: brightness(0.97);
}

.ghost-button,
.icon-button,
.table-action,
.backup-storage-open,
.backup-storage-copy,
.secret-toggle {
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: none;
  color: #334058;
}

.ghost-button:hover,
.icon-button:hover,
.table-action:hover,
.backup-storage-open:hover,
.backup-storage-copy:hover,
.secret-toggle:hover {
  border-color: #b9c5d8;
  background: #f6f8fb;
  color: #3529a4;
  box-shadow: none;
}

.danger-button,
.table-action.danger,
.table-action--danger {
  border: 1px solid rgba(196, 60, 85, 0.24);
  background: rgba(196, 60, 85, 0.055);
  color: #b4324b;
}

.text-action {
  border: 0;
  background: transparent;
  color: #5140cd;
  box-shadow: none;
  font-weight: 700;
}

.text-action:hover {
  color: #2f7de1;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea,
.task-search,
.backup-filter-search,
.compact-input,
.gsc-binding-select {
  min-height: 38px;
  border: 1px solid #ced6e3;
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: none;
  color: var(--text);
  font-size: 16px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus,
.task-search:focus-within,
.backup-filter-search:focus-within {
  border-color: #7567e6;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(104, 86, 232, 0.12);
}

input:disabled,
select:disabled,
textarea:disabled {
  border-color: var(--border);
  background: #eef2f6;
  color: #748195;
  -webkit-text-fill-color: #748195;
}

.tab-panel {
  min-width: 0;
  margin: 0;
  padding: 18px 28px 34px;
  background: transparent;
}

.panel,
.module-panel,
.dashboard-panel,
.task-center,
.alert-center-shell,
.gsc-api-shell,
.backup-shell {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
  color: var(--text);
}

.panel::before,
.module-panel::before,
.dashboard-panel::before {
  display: none;
}

.panel-heading,
.dashboard-panel-heading,
.module-toolbar,
.record-toolbar,
.site-control-bar,
.backup-batch-bar,
.backup-storage-bar,
.dialog-heading,
.dialog-actions {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text);
}

.panel h2,
.panel h3,
.panel h4,
.module-panel h2,
.module-panel h3,
.dashboard-panel h2,
.dashboard-panel h3 {
  color: var(--text);
}

.module-context,
.module-result-meta,
.panel-heading p,
.dashboard-panel-heading p {
  color: var(--muted);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-color: var(--border);
  background: #ffffff;
}

table {
  color: var(--text);
}

thead,
th {
  border-color: var(--border);
  background: #f6f8fb;
  color: #58667c;
}

th,
td,
.table-sort-button,
.sort-button {
  font-size: 16px;
}

th {
  font-weight: 700;
}

td,
.table-wrap td,
#domainMetricTable td,
.task-table td {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text);
}

tbody tr:hover td,
.table-wrap tbody tr:hover td,
#domainMetricTable tbody tr:hover td {
  background: #f8f9fc;
  box-shadow: none;
}

.table-sort-button,
.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0;
  line-height: 1.4;
  border: 0;
  background: transparent;
  color: inherit;
}
svg.lucide {
  vertical-align: middle;
  flex-shrink: 0;
}

.table-sort-button > svg,
.sort-button > svg {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.table-sort-button.is-active,
.sort-button.active {
  background: transparent;
  color: var(--primary);
}

/* Controls use the same purple accent as the rest of the console. Blue is
   reserved for active/cloud state, while status colors remain semantic. */
.table-sort-button > svg,
.sort-button > svg,
.table-action > svg,
.icon-button > svg,
.ghost-button > svg,
.text-action > svg {
  color: currentColor;
  stroke: currentColor;
}

.list-pagination,
.pagination-bar {
  min-height: 48px;
  border-color: var(--border);
  background: #f8f9fc;
  color: var(--muted);
  font-size: 16px;
}

.list-pagination-summary {
  font-size: 16px;
}

.list-pagination button,
.pagination-bar button,
.list-pagination select,
.pagination-bar select {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.status-pill,
.service-state,
.metric-source,
.backup-state,
.task-status-badge {
  min-height: 26px;
  border-width: 1px;
  box-shadow: none;
  font-size: 13px;
}

.metric-source {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  line-height: 1.35;
  white-space: nowrap;
}

.status-pill--ok,
.service-state--ok,
.metric-source--gsc,
.backup-state--success {
  border-color: var(--blue-border);
  background: var(--blue-soft);
  color: #155ba0;
}

.status-pill--warn,
.service-state--warn,
.backup-state--failed {
  border-color: rgba(183, 105, 11, 0.25);
  background: rgba(183, 105, 11, 0.08);
  color: #955607;
}

.status-pill--down,
.service-state--down {
  border-color: rgba(196, 60, 85, 0.25);
  background: rgba(196, 60, 85, 0.07);
  color: #b4324b;
}

.status-pill--muted,
.service-state--pending,
.metric-source--pending {
  border-color: #d4dce8;
  background: #f0f3f7;
  color: #607086;
}
/* Dashboard */
.control-dashboard {
  padding-top: 18px;
}

.dashboard-signal {
  position: relative;
  display: grid;
  min-height: 112px;
  grid-template-columns: 1.28fr repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(45, 57, 82, 0.045);
}

.dashboard-signal::before {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--accent-gradient);
  content: "";
}

.dashboard-health-lead,
.dashboard-kpi {
  min-width: 0;
  padding: 18px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-health-lead {
  border-left: 0;
}

.dashboard-kpi::before,
.dashboard-health-lead::before {
  display: none;
}

.health-ring {
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  flex: 0 0 58px;
  aspect-ratio: 1;
  border: 5px solid var(--purple-border);
  border-top-color: var(--success);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: none;
  color: var(--text);
}

.health-ring strong {
  color: var(--text);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 18px;
}

.health-ring span {
  color: var(--muted);
  font-size: 12px;
}

.health-ring--warn { border-top-color: var(--warning); border-right-color: var(--warning); }
.health-ring--down { border-top-color: var(--danger); border-right-color: var(--danger); }
.legend-cpu { background: var(--primary); }
.legend-memory { background: var(--star-blue); }
.legend-disk { background: #9682ad; }
.chart-line--cpu { stroke: var(--primary); }
.chart-line--memory { stroke: var(--star-blue); }
.chart-line--disk { stroke: #9682ad; stroke-dasharray: 5 3; }
.estate-site-dot--ok { background: var(--star-blue); }

.dashboard-health-copy > span,
.dashboard-kpi > span {
  color: var(--muted);
}

.dashboard-health-copy strong {
  color: var(--text);
  font-size: 17px;
}

.dashboard-kpi > strong {
  margin: 7px 0 5px;
  color: var(--text);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 23px;
}

.dashboard-health-copy small,
.dashboard-kpi small {
  color: #6d7a8f;
}

.dashboard-pulse {
  display: none;
}

.dashboard-grid {
  display: grid;
  margin-top: 16px;
  grid-template-columns: minmax(0, 1.75fr) minmax(340px, 0.75fr);
  gap: 16px;
}

.dashboard-main-column,
.dashboard-side-column {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 16px;
}

.dashboard-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
}

.dashboard-panel-heading {
  min-height: 62px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.dashboard-section-label {
  color: #65738a;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 650;
}

.dashboard-panel-heading h2 {
  margin-top: 2px;
  font-size: 18px;
}

.platform-identity {
  display: grid;
  padding: 15px 16px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.platform-node-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #ced8ea;
  border-radius: 7px;
  background: #f1f5fb;
  color: var(--star-blue);
}

.platform-node-mark svg {
  width: 19px;
  height: 19px;
}

.platform-identity strong {
  color: var(--text);
}

.platform-identity span,
.platform-identity time {
  color: var(--muted);
  font-size: 13px;
}

.platform-metrics {
  display: grid;
  padding: 8px 16px 12px;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.platform-metric {
  min-width: 0;
  min-height: 68px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid #edf0f5;
  background: transparent;
}

.platform-metric:last-child {
  border-bottom: 0;
}

.platform-metric > div:first-child {
  color: var(--text);
}

.platform-metric small {
  color: var(--muted);
}

.metric-track {
  height: 7px;
  overflow: hidden;
  border: 1px solid #dce2ec;
  border-radius: 999px;
  outline: 0;
  background: #eef2f6;
  box-shadow: none;
}

.metric-track > i {
  height: 100%;
  border: 0;
  background: var(--accent-gradient);
}

.platform-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 0;
  background: #ffffff;
}

.platform-facts > div {
  min-width: 0;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: transparent;
}

.platform-facts > div:nth-child(odd) {
  border-left: 0;
}

.platform-facts dt {
  color: var(--muted);
  font-size: 13px;
}

.platform-facts dd {
  color: var(--text);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 16px;
}

.trend-panel .dashboard-panel-heading {
  padding-right: 18px;
}

.trend-legend,
.chart-legend {
  color: var(--muted);
  font-size: 13px;
}

.platform-chart {
  min-height: 300px;
  padding: 16px 18px 0;
  background: #ffffff;
}

.platform-chart svg {
  overflow: visible;
}

.platform-chart line,
.chart-grid {
  stroke: #e6eaf1;
}

.platform-chart text,
.chart-axis,
.chart-label {
  fill: #8490a2;
  color: #8490a2;
}

.chart-axis {
  padding: 8px 18px 16px;
  background: #ffffff;
  color: #718097;
}

.service-chain,
.estate-list,
.incident-queue,
.dashboard-activity {
  background: #ffffff;
}

.service-row,
.estate-row,
.incident-row,
.dashboard-activity > li {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text);
}

.service-row:hover,
.estate-row:hover,
.incident-row:hover,
.dashboard-activity > li:hover {
  background: #f8f9fc;
}

.service-row span,
.estate-row span,
.incident-row span,
.dashboard-activity span,
.dashboard-activity time {
  color: var(--muted);
}
/* Continuous module surfaces */
.task-center,
.module-panel,
.alert-center-shell,
.gsc-api-shell,
.backup-shell {
  overflow: hidden;
}

.task-status-rail,
.backup-summary,
.alert-notify-summary,
.gsc-diagnostic-kpis,
.gsc-account-summary,
.server-summary-grid {
  border-color: var(--border);
  background: #ffffff;
  box-shadow: none;
}

.task-status-rail {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.task-status-cell {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 76px;
  padding: 14px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-left: 1px solid var(--border);
}

.task-status-cell:first-child {
  border-left: 0;
}

.task-status-cell span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 650;
}

.task-status-cell strong {
  color: var(--text);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 25px;
  line-height: 1;
}

.task-status-cell,
.backup-summary-item,
.alert-notify-metric,
.gsc-diagnostic-kpis > div,
.gsc-account-summary > div,
.server-summary-grid > div {
  border-color: var(--border);
  background: #ffffff;
  box-shadow: none;
  color: var(--text);
}

.task-status-cell::before,
.backup-summary-item::before,
.alert-notify-metric::before,
.gsc-diagnostic-kpis > div::before {
  width: 2px;
  border-radius: 0;
}

.record-toolbar,
.task-toolbar,
.module-toolbar,
.site-control-bar,
.backup-batch-bar {
  margin: 0;
  border-color: var(--border);
  background: #f8f9fc;
}

.record-toolbar,
.task-toolbar {
  display: flex;
  min-height: 58px;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-filters {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.task-filters {
  display: grid;
  min-width: 0;
  flex: 1;
  grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(124px, 0.65fr));
  gap: 8px;
}

.record-cleanup-button {
  flex: 0 0 auto;
}

.task-search,
.backup-filter-search {
  overflow: visible;
  border: 1px solid #ced6e3;
  background: #ffffff;
}

.task-search input,
.backup-filter-search input {
  min-height: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#task-center .task-search > input,
#backups .backup-filter-search > input {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#task-center .task-search > input:focus,
#backups .backup-filter-search > input:focus {
  border: 0;
  outline: 0;
  box-shadow: none;
}

.module-subnav,
.alert-subnav-shell,
.backup-subnav,
.site-view-switch,
.gsc-binding-view-tabs {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.module-subnav button,
.alert-subnav-shell button,
.backup-subnav button,
.site-view-switch button,
.gsc-binding-view-tabs button {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 16px;
}

.module-subnav button.active,
.alert-subnav-shell button.active,
.backup-subnav button.active,
.site-view-switch button.active,
.gsc-binding-view-tabs button.active {
  background: transparent;
  box-shadow: inset 0 -2px 0 #6856e8;
  color: #3529a4;
}

.site-status-tabs,
.event-filter-tabs,
.record-filter-tabs,
.metric-switch {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.site-status-tabs button,
.event-filter-tabs button,
.record-filter-tabs button,
.metric-chip {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
}

.site-status-tabs button.active,
.site-status-tabs button[aria-pressed="true"],
.event-filter-tabs button[aria-pressed="true"],
.record-filter-tabs button[aria-pressed="true"],
.metric-chip.active {
  background: #eef0ff;
  box-shadow: none;
  color: #4435b5;
}

.event-log-list,
.record-list,
.backup-list,
.backup-file-list,
.backup-activity-list,
.backup-schedule-list {
  background: #ffffff;
}

.event-log-list > li,
.record-list > li,
.backup-list-row,
.backup-file-row,
.backup-activity-row,
.backup-schedule-row,
.backup-server-group,
.site-group-toggle,
.backup-server-group-toggle {
  border-color: var(--border);
  background: #ffffff;
  box-shadow: none;
  color: var(--text);
}

.backup-server-group-toggle,
.site-group-toggle {
  background: #f6f8fb;
}

.backup-server-group-toggle:hover,
.site-group-toggle:hover,
.backup-list-row:hover,
.backup-file-row:hover,
.backup-activity-row:hover,
.backup-schedule-row:hover {
  background: #f8f9fc;
  box-shadow: none;
}

.backup-storage-bar {
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: none;
}

.backup-storage-path-control,
#backupStoragePath,
.backup-storage-copy,
.backup-storage-open {
  border-color: var(--border);
  background: #ffffff;
  color: #34425b;
}

.backup-storage-path-control {
  border-width: 1px;
  border-style: solid;
}

.backup-list-head {
  border-color: var(--border);
  background: #f6f8fb;
  color: #4f5d73;
}

.backup-storage-bar code,
.path-value,
code {
  color: #34425b;
}

.gsc-diagnostic-strip,
.gsc-coverage-flow,
.gsc-binding-status-strip,
.alert-notify-strip,
.task-detail-summary,
.rules-help-strip,
.rule-help-strip {
  border-color: var(--border);
  background: #f8f9fc;
  box-shadow: none;
  color: var(--text);
}

.gsc-coverage-flow::before {
  display: none;
  content: none;
}

.gsc-coverage-node,
.gsc-coverage-pending {
  border-color: var(--border);
  background: #ffffff;
  box-shadow: none;
  color: var(--text);
}

.gsc-coverage-node span,
.gsc-coverage-pending span {
  color: var(--muted);
}

.gsc-coverage-node strong,
.gsc-coverage-pending strong {
  color: var(--text);
}

.gsc-coverage-node--active {
  border-color: #acd2f7;
  background: #eef6ff;
}

.gsc-coverage-node--active strong {
  color: #2f7de1;
}

.gsc-coverage-pending {
  border-color: #edcc9c;
  background: #fff8ef;
}

.gsc-coverage-pending strong {
  color: #874604;
}

.gsc-account-card,
.gsc-diagnostic-card,
.gsc-binding-row,
.permission-option,
.scope-check-item,
.email-section,
.danger-zone,
.preflight-row,
.site-discovery-domain,
.backup-schedule-site-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: none;
  color: var(--text);
}

.empty-state,
.scope-empty,
.site-discovery-empty {
  color: var(--muted);
}
/* Dialogs */
.restore-new-site-fields {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.restore-new-site-fields[hidden] {
  display: none;
}

.restore-cloudflare-status,
.new-site-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.restore-cloudflare-status > span {
  flex: 1 1 180px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

#restoreDialog .restore-proxy-choice {
  display: flex;
  align-items: center;
  gap: 8px;
}

.restore-proxy-choice input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 16px;
}

#restoreDialog .restore-proxy-choice > span {
  margin: 0;
}

#restoreDialog .restore-proxy-choice[hidden] {
  display: none;
}

.restore-dns-summary {
  overflow-wrap: anywhere;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
}

.restore-provisioning-plan {
  display: grid;
  gap: 6px;
  padding: 12px 0 12px 14px;
  border-left: 2px solid var(--accent);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

.restore-provisioning-plan strong,
.restore-provisioning-plan p {
  margin: 0;
  overflow-wrap: anywhere;
}

.restore-provisioning-plan p {
  color: var(--muted);
}

#restoreDialog[data-mode="clone"] .danger-zone > svg {
  color: var(--accent);
}

#restoreDialog .dialog-actions button {
  white-space: nowrap;
}

@media (max-width: 480px) {
  #restoreDialog .dialog-actions button {
    padding-inline: 9px;
    font-size: 14px;
  }
}

.new-site-progress {
  min-width: 0;
  overflow-wrap: anywhere;
}

.new-site-stages {
  display: grid;
  padding: 0;
  list-style: none;
}

.new-site-stages li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.new-site-stages li strong {
  color: var(--accent);
}

.new-site-stages li details {
  grid-column: 1 / -1;
  color: var(--muted);
}

#restoreDialog .dialog-actions {
  flex-wrap: wrap;
  gap: 8px;
}

#cloudflareDialog {
  width: min(540px, calc(100vw - 24px));
}

#cloudflareZones,
#cloudflareConnectionStatus {
  overflow-wrap: anywhere;
}

dialog {
  color: var(--text);
}

dialog::backdrop {
  background: rgba(25, 33, 49, 0.34);
  backdrop-filter: blur(5px);
}

.site-dialog,
.data-dialog {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* The dialog owns the viewport bounds; its card fills that space. */
.site-dialog {
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

.data-dialog {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  overflow: visible;
}

.data-dialog[open] {
  display: grid;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  margin: 0;
  place-items: center;
  overflow: hidden;
}

.site-dialog .dialog-card,
.data-dialog-card,
.task-detail-card {
  overflow: hidden;
  border: 1px solid #d5dce8;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-modal);
  color: var(--text);
}

.site-dialog .dialog-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: calc(100dvh - 24px);
}

.site-dialog .dialog-card > :is(.dialog-heading, .dialog-actions, .dialog-footer) {
  flex: 0 0 auto;
  min-width: 0;
}

.site-dialog .dialog-card > :is(.dialog-body, .admin-dialog-body, .backup-dialog-body,
  .backup-schedule-dialog-body, .backup-storage-dialog-body, .email-dialog-body,
  .task-detail-body, .site-discovery-body) {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.site-dialog .dialog-heading > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.site-dialog .dialog-heading > button {
  flex-shrink: 0;
}

/* Keep the native upload control accessible without inheriting full form width. */
.site-dialog .dialog-body input.file-input {
  width: 1px;
  height: 1px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
}

.site-dialog .gsc-upload-head .file-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.site-dialog .gsc-upload-head .file-button > span {
  margin: 0;
  color: inherit;
}

.site-dialog .dialog-heading .eyebrow,
.data-dialog .dialog-heading .eyebrow {
  display: none;
}

.site-dialog .dialog-heading,
.data-dialog .dialog-heading,
.task-detail-heading {
  min-height: 68px;
  padding: 0 20px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.site-dialog .dialog-heading h3,
.data-dialog .dialog-heading h3,
.task-detail-heading h3 {
  color: var(--text);
  font-size: 20px;
}

.site-dialog .dialog-body,
.site-dialog .admin-dialog-body,
.site-dialog .backup-dialog-body,
.site-dialog .backup-schedule-dialog-body,
.site-dialog .email-dialog-body,
.site-dialog .gsc-account-form,
.task-detail-body {
  overflow-y: auto;
  background: #ffffff;
  color: var(--text);
}

.site-dialog .dialog-actions,
.site-dialog .dialog-footer,
.task-detail-actions,
.rules-footer {
  min-height: 62px;
  margin: 0;
  padding: 10px 20px;
  border: 0;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.site-dialog :is(.dialog-actions, .dialog-footer) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.site-dialog :is(.dialog-actions, .dialog-footer) > button {
  width: auto;
  max-width: 100%;
}

.site-dialog .dialog-footer > [role="status"] {
  margin-right: auto;
  overflow-wrap: anywhere;
}

.site-dialog label > span,
.data-dialog label > span,
.field-label,
.dialog-section-label {
  color: var(--muted);
  font-size: var(--font-meta);
  font-weight: 600;
}

.site-dialog .email-section-head span,
.site-dialog .email-dialog-note,
.site-dialog .email-dialog-note span,
.site-dialog .gsc-upload-head span,
.site-dialog .gsc-account-brief span,
.site-dialog .permission-option em,
.site-dialog .scope-check-item em,
.site-dialog .scope-empty,
.site-dialog .backup-schedule-site-copy small,
.site-dialog .preflight-row small,
.site-dialog .site-discovery-domain span,
.site-dialog .site-discovery-meta span,
.site-dialog .site-discovery-path span,
.site-dialog .danger-zone p {
  color: var(--muted);
  font-size: var(--font-meta);
  font-weight: 400;
  line-height: 1.6;
  opacity: 1;
  text-shadow: none;
}

.site-dialog .field-status,
.site-dialog .gsc-account-status,
.site-dialog .restore-preflight-target,
.site-dialog .preflight-row strong,
.site-dialog .site-discovery-status,
.site-dialog .site-discovery-select-all {
  color: var(--text);
  font-size: 16px;
  opacity: 1;
  text-shadow: none;
}

.site-dialog .field-status.is-ok,
.site-dialog .preflight-row--ok strong {
  color: var(--star-blue);
}

.site-dialog .field-status.is-error,
.site-dialog .preflight-row--failed strong {
  color: #b4324b;
}

.site-dialog .preflight-row--skipped strong {
  color: #955607;
}

.site-dialog .restore-operation {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f7f9fc;
  color: var(--text);
}

.site-dialog .restore-operation[hidden] {
  display: none;
}

.site-dialog .restore-operation-icon {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #cdd7e5;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #5140cd;
}

.site-dialog .restore-operation-icon svg {
  width: 20px;
  height: 20px;
}

.site-dialog .restore-operation > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.site-dialog .restore-operation strong,
.site-dialog .restore-operation p {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

.site-dialog .restore-operation p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.site-dialog .restore-operation--running .restore-operation-icon svg {
  animation: spin 700ms linear infinite;
}

.site-dialog .restore-operation--success {
  border-color: var(--blue-border);
  background: var(--blue-soft);
}

.site-dialog .restore-operation--success .restore-operation-icon {
  border-color: var(--blue-border);
  color: var(--star-blue);
}

.site-dialog .restore-operation--failed {
  border-color: #efc3cb;
  background: #fff5f6;
}

.site-dialog .restore-operation--failed .restore-operation-icon {
  border-color: #efc3cb;
  color: #b4324b;
}

.data-dialog-card {
  display: flex;
  width: min(1240px, calc(100vw - 72px));
  height: min(870px, calc(100vh - 72px));
  max-width: none;
  max-height: none;
  flex-direction: column;
}

.data-dialog .dialog-heading {
  flex: 0 0 76px;
}

.data-dialog .dialog-heading .eyebrow {
  margin: 0 0 4px;
  color: #66738a;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.data-dialog .dialog-heading h3 {
  font-size: 21px;
}

.data-detail-hero {
  display: grid;
  flex: 0 0 auto;
  min-height: 88px;
  padding: 10px 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #f8f9fc;
}

.detail-identity {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.detail-identity strong,
.detail-identity span {
  color: var(--text);
}

.detail-identity > div {
  min-width: 0;
}

.detail-identity > div > strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-identity > div > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.data-detail-toolbar {
  display: flex;
  align-items: end;
  gap: 8px;
}

.data-detail-toolbar label {
  display: grid;
  gap: 4px;
}

.data-detail-toolbar label > span {
  font-weight: 700;
}

.data-detail-toolbar input {
  width: 142px;
}

.data-detail-toolbar select {
  width: 118px;
}

.data-detail-toolbar .primary-button {
  min-height: 38px;
}

.data-detail-tabs {
  display: flex;
  flex: 0 0 50px;
  padding: 0 20px;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.detail-tab {
  position: relative;
  flex: 0 0 auto;
  height: 49px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #59667c;
  font-size: 16px;
  font-weight: 650;
}

.detail-tab:hover {
  background: transparent;
  color: #3529a4;
}

.detail-tab.active {
  background: transparent;
  box-shadow: none;
  color: #3529a4;
}

.detail-tab.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent-gradient);
  content: "";
}

.data-detail-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  background: #ffffff;
  color: var(--text);
}

.detail-pane {
  min-height: 100%;
  padding: 0;
  background: #ffffff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.metric-grid > .empty-state {
  display: grid;
  min-height: 112px;
  padding: 18px;
  place-items: center;
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  text-align: center;
}

.metric-tile {
  min-width: 0;
  min-height: 112px;
  padding: 16px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  color: var(--text);
}

.metric-tile:first-child {
  border-left: 0;
}

.metric-tile > span {
  color: var(--muted);
  font-size: 13px;
}

.metric-tile > strong {
  display: block;
  margin: 7px 0 5px;
  overflow: hidden;
  color: var(--text);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 21px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-tile small {
  color: var(--muted);
}

.compare-block {
  color: var(--muted);
  font-size: 12px;
}

.compare-block .compare-reference,
.compare-block .compare-reference b {
  color: var(--muted);
}

.compare-block--up .compare-change,
.compare-block--up .compare-change b,
.compare-block--up .compare-direction {
  color: #c2334d;
}

.compare-block--down .compare-change,
.compare-block--down .compare-change b,
.compare-block--down .compare-direction {
  color: var(--star-blue);
}

.compare-block--flat .compare-change,
.compare-block--flat .compare-change b,
.compare-block--flat .compare-direction {
  color: var(--muted);
}

.compare-direction {
  align-items: center;
  justify-content: flex-start !important;
  gap: 5px !important;
  font-weight: 750;
}

.compare-direction svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.overview-analytics-grid {
  display: grid;
  min-height: 400px;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.7fr);
}

.overview-chart-panel {
  min-width: 0;
  padding: 18px 20px 14px;
  border-right: 1px solid var(--border);
}

.overview-query-panel {
  min-width: 0;
  padding: 18px;
}

.detail-section-head {
  min-height: 48px;
  margin: 0;
  padding: 16px 20px 10px;
  border: 0;
  background: #ffffff;
}

.overview-chart-panel .detail-section-head,
.overview-query-panel .detail-section-head {
  padding: 0 0 12px;
}

.detail-section-head h4 {
  color: var(--text);
  font-size: 16px;
}

.detail-section-head span,
.detail-section-head p {
  color: var(--muted);
  font-size: 13px;
}

.overview-trend-chart,
.trend-chart {
  min-height: 300px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.overview-trend-chart .line-chart,
.trend-chart .line-chart {
  width: 100%;
  height: auto;
}

.chart-line {
  fill: none;
  stroke-width: 2.5;
}

.chart-line--current {
  stroke: var(--primary);
}

.chart-line--compare {
  stroke: var(--star-blue);
}

.chart-dot--current {
  fill: var(--primary);
}

.chart-dot--compare {
  fill: var(--star-blue);
}

.chart-grid {
  stroke: #e7ebf2;
  stroke-width: 1;
}

.chart-label,
.chart-axis {
  fill: #8591a4;
  font-size: 12px;
}

.chart-legend {
  color: var(--muted);
}

.legend-line--current {
  background: var(--primary);
}

.legend-line--compare {
  background: var(--star-blue);
}

.overview-query-list {
  display: grid;
  gap: 0;
}

.overview-query-row {
  display: grid;
  min-height: 56px;
  padding: 7px 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #edf0f5;
}

.overview-query-row:last-child {
  border-bottom: 0;
}

.overview-query-row strong,
.overview-query-row span {
  display: block;
}

.overview-query-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.overview-query-row > b {
  color: #38455c;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 16px;
}

.detail-pane > .table-wrap,
.detail-pane .table-wrap {
  margin: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.table-tools {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: #f8f9fc;
}

.detail-page-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-page-scope {
  grid-template-columns: repeat(2, minmax(88px, 1fr));
  flex: 0 0 auto;
}

.table-search {
  min-width: 280px;
}

.rules-workbench {
  background: #ffffff;
}
.rules-policy,
.rules-editor,
.rule-editor-block {
  border-color: var(--border);
  background: #ffffff;
  box-shadow: none;
  color: var(--text);
}

.rule-switch-row,
.rule-number-row {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text);
}

.rule-switch-row small,
.rule-number-row small,
.rules-policy-head p,
.rule-editor-head p,
.rules-footer > div:first-child > span {
  color: var(--muted);
}

.toast {
  z-index: 100;
  max-width: min(460px, calc(100vw - 28px));
  border: 1px solid #cfd7e4;
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(27, 39, 64, 0.18);
  color: var(--text);
  font-size: 16px;
  opacity: 1;
  backdrop-filter: none;
}

.toast.error,
.toast.is-error {
  border-color: rgba(196, 60, 85, 0.3);
  background: #fff7f8;
  color: #a92e46;
}
/* Login */
.login-page {
  background:
    linear-gradient(90deg, var(--sidebar) 0 50%, transparent 50%),
    var(--bg);
}

.login-brief {
  background: var(--sidebar);
  color: #dce4f5;
}

.login-brand strong {
  color: #ffffff;
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 700;
}

.login-brand span {
  color: #aebbd3;
}

.login-brief__content .eyebrow {
  color: #8fc9ff;
}

.login-brief__content h1 {
  color: #ffffff;
}

.login-brief__content p:not(.eyebrow) {
  color: #d4dced;
}

.login-panel,
.login-security-list > div {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: none;
  color: var(--text);
}

.login-signal-grid {
  border: 1px solid rgba(174, 187, 211, 0.28);
  border-radius: var(--radius);
  background: rgba(174, 187, 211, 0.2);
}

.login-signal {
  background: rgba(8, 18, 33, 0.52);
}

.login-signal span {
  color: #aebbd3;
}

.login-signal strong {
  color: #ffffff;
}

.login-panel {
  box-shadow: var(--shadow-soft);
}

.login-panel p,
.login-panel label > span,
.login-security-list span {
  color: var(--muted);
}

.login-submit span {
  color: #ffffff;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .tab-panel {
    padding-right: 20px;
    padding-left: 20px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  }

  .data-dialog-card {
    width: calc(100vw - 40px);
    height: calc(100vh - 40px);
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-tile:nth-child(4) {
    border-left: 0;
  }

  .metric-tile:nth-child(n + 4) {
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 860px) {
  .login-shell {
    display: flex;
    min-height: 100dvh;
    flex-direction: column;
  }

  .login-brief {
    min-height: auto;
    padding: 22px 18px 20px;
    align-content: start;
    gap: 22px;
  }

  .login-brief__content {
    max-width: 620px;
  }

  .login-brief__content h1 {
    margin: 6px 0 10px;
    font-size: 32px;
  }

  .login-signal-grid,
  .login-audit-strip {
    display: none;
  }

  .login-panel {
    align-self: center;
    margin: 18px auto 28px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(308px, 84vw);
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform 220ms ease;
  }

  .app-shell.is-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    z-index: 35;
    background: rgba(25, 33, 49, 0.42);
    backdrop-filter: blur(3px);
  }

  .topbar {
    min-height: 64px;
    padding: 0 14px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar-actions .export-menu,
  .topbar-actions > .ghost-button:not(#addSiteButton),
  #logoutButton {
    display: none;
  }

  .tab-panel {
    padding: 12px;
  }

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

  .dashboard-health-lead {
    grid-column: 1 / -1;
  }

  .dashboard-kpi {
    min-height: 96px;
    border-top: 1px solid var(--border);
  }

  .dashboard-kpi:nth-of-type(odd) {
    border-left: 0;
  }

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

  .trend-panel,
  .platform-panel,
  .estate-panel,
  .service-panel,
  .incident-panel,
  .activity-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .record-toolbar,
  .task-toolbar,
  .module-toolbar,
  .site-control-bar,
  .backup-batch-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .record-filters,
  .task-filters,
  .backup-filter-tools {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-status-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-status-cell:nth-child(odd) {
    border-left: 0;
  }

  .task-status-cell:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .data-dialog {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    max-width: none;
    max-height: none;
    overflow: hidden;
  }

  .data-dialog-card {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .data-dialog .dialog-heading {
    position: sticky;
    z-index: 3;
    top: 0;
    flex-basis: 64px;
    min-height: 64px;
    padding: 0 14px;
  }

  .data-dialog .dialog-heading h3 {
    max-width: 230px;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .data-detail-hero {
    display: grid;
    flex: 0 0 auto;
    padding: 10px 14px 12px;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .data-detail-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-detail-toolbar input,
  .data-detail-toolbar select,
  .data-detail-toolbar .primary-button {
    width: 100%;
  }

  .data-detail-tabs {
    padding: 0 14px;
    gap: 20px;
  }

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

  .metric-tile:nth-child(odd) {
    border-left: 0;
  }

  .metric-tile:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .overview-analytics-grid {
    display: block;
  }

  .overview-chart-panel {
    min-height: 400px;
    padding: 14px;
    border-right: 0;
  }

  .overview-query-panel {
    border-top: 1px solid var(--border);
  }

  .table-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .table-search {
    min-width: 0;
    width: 100%;
  }

  .login-page {
    background: var(--bg);
  }
}

@media (max-width: 560px) {
  .login-brief {
    padding: 18px 16px;
  }

  .login-brand span {
    font-size: 13px;
  }

  .login-brief__content h1 {
    font-size: 28px;
  }

  .login-panel {
    width: calc(100vw - 24px);
    margin-top: 12px;
    padding: 16px;
  }

  .login-security-list {
    display: none;
  }

  .topbar-actions #addSiteButton {
    display: none;
  }

  .primary-button,
  .ghost-button,
  .icon-button,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select {
    min-height: 42px;
  }

  .dashboard-signal {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-health-lead,
  .dashboard-kpi {
    grid-column: 1;
    border-left: 0;
  }

  .platform-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .platform-facts > div {
    border-left: 0;
  }

  .trend-legend {
    display: none;
  }

  .data-detail-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-tile {
    min-height: 102px;
  }

  .overview-chart-panel {
    min-height: 340px;
  }

  .overview-trend-chart {
    min-height: 260px;
  }

  .alert-block--records .table-wrap {
    overflow: visible;
  }

  .alert-history-table,
  .email-record-table {
    min-width: 0;
    width: 100%;
  }

  .alert-history-table thead,
  .email-record-table thead {
    display: none;
  }

  .alert-history-table tbody,
  .email-record-table tbody {
    display: grid;
  }

  .alert-history-table tr,
  .email-record-table tr {
    display: grid;
    min-width: 0;
    padding: 12px;
    gap: 9px;
    border-bottom: 1px solid var(--border);
  }

  .alert-history-table tr:last-child,
  .email-record-table tr:last-child {
    border-bottom: 0;
  }

  .alert-history-table td,
  .email-record-table td {
    display: grid;
    min-width: 0 !important;
    width: auto !important;
    padding: 0;
    align-items: start;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
    border: 0;
    overflow-wrap: anywhere;
  }

  .alert-history-table td::before,
  .email-record-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 13px;
    font-weight: 650;
  }

  .alert-history-table td[colspan],
  .email-record-table td[colspan] {
    grid-template-columns: minmax(0, 1fr);
  }

  .alert-history-table td[colspan]::before,
  .email-record-table td[colspan]::before {
    display: none;
  }

  .alert-history-table .status-pill,
  .email-record-table .status-pill {
    justify-self: start;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
main > .panel.tab-panel,
main > .tab-panel > .panel.module-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.table-wrap,
.task-table-wrap,
.summary-strip,
.event-log-list,
.backup-config-list,
.backup-file-list,
.backup-schedule-list,
.backup-activity-list,
.gsc-account-main,
.gsc-account-brief {
  border-color: var(--border);
  background: #ffffff;
  box-shadow: none;
}

.table-wrap,
.event-log-list,
.backup-config-list,
.backup-file-list,
.backup-schedule-list,
.backup-activity-list {
  border-width: 1px;
  border-style: solid;
}

#summaryStrip {
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: none;
}

@media (min-width: 621px) {
  #alertRulesPanel .table-wrap {
    position: relative;
    max-width: 100%;
    overflow-x: auto;
  }
}

#summaryStrip .summary-item {
  background: #ffffff;
}

#dataDetailDialog .rules-workbench,
#adminPolicyPanel .policy-layout {
  align-items: start;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#dataDetailDialog .rules-policy,
#dataDetailDialog .rules-editor,
#dataDetailDialog .rule-editor-block,
#adminPolicyPanel .policy-item,
#adminPolicyPanel .scope-policy-item {
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: none;
}

#dataDetailDialog .rule-editor-block {
  border-left-width: 1px;
}

.data-detail-toolbar label > span {
  color: #46546b;
  font-size: 16px;
}

.data-detail-toolbar .primary-button > span,
.rules-footer .primary-button > span {
  color: #ffffff;
  font-size: 16px;
}

#websiteStatusPanel .site-sort-control {
  border: 1px solid var(--border);
  background: #ffffff;
  color: #34425b;
  box-shadow: none;
}

#websiteStatusPanel .site-sort-control > svg {
  color: var(--primary-dark);
}

#websiteStatusPanel .site-sort-control select,
#websiteStatusPanel .site-sort-control select:focus {
  background: transparent;
  color: var(--text);
}

#backups .backup-primary-action {
  border: 1px solid #c9d2f6;
  background: #eef0ff;
  color: #4435b5;
  box-shadow: none;
}

#backups .backup-primary-action:hover {
  border-color: #aebaf0;
  background: #e3e7ff;
  color: #3529a4;
}

#backups .backup-restore-action {
  min-width: 112px;
  border: 1px solid #efb9c3;
  background: #fff1f3;
  color: #a92740;
}

#backups .backup-restore-action:hover {
  border-color: #df8fa0;
  background: #ffe5ea;
  color: #8e1f35;
}

#backups .backup-restore-action > span {
  position: static;
  display: inline;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
}

.dashboard-panel-heading > div > .dashboard-section-label,
.dashboard-panel-heading > div > span.dashboard-section-label,
.trend-panel .trend-legend span,
.panel-title > span {
  color: #506078;
}

.dashboard-signal small,
.dashboard-signal [id$="Meta"],
.platform-metric small,
.platform-facts dt {
  color: var(--muted);
}

.platform-chart text,
.chart-label,
.chart-axis,
.chart-axis span {
  fill: #5d6a80;
  color: #5d6a80;
}

.alert-column-label small,
.rule-value-unit,
.rule-value-na {
  color: #5d6a80;
}

.rules-footer > div:first-child > span,
.rules-policy-head p,
.rule-editor-head p,
.rule-switch-row small,
.rule-number-row small {
  color: var(--muted);
}

.list-pagination {
  border-top: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 620px) {
  #backups .backup-list-row {
    position: relative;
    min-height: 0;
    padding: 10px;
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
  }

  #backups .backup-list-primary,
  #backups .backup-list-actions {
    grid-column: 1 / -1;
  }

  #backups .backup-row-check {
    position: absolute;
    z-index: 1;
    top: 12px;
    right: 10px;
  }

  #backups .backup-config-grid > .backup-list-primary {
    padding-right: 34px;
  }

  #backups .backup-list-stack,
  #backups .backup-list-status,
  #backups .backup-schedule-state {
    min-width: 0;
  }

  #backups .backup-list-stack strong,
  #backups .backup-list-stack span,
  #backups .backup-list-status small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #backups .backup-list-actions {
    padding-top: 2px;
    justify-content: flex-end;
  }

  #backups .backup-list-actions .table-action,
  #backups .backup-primary-action {
    min-height: 34px;
  }

  #backups .backup-server-group-toggle {
    min-height: 44px;
    padding: 7px 10px;
    flex-wrap: wrap;
  }
}
/* Unified business surfaces: transparent pages, one crisp boundary per module. */
#summaryStrip {
  margin: 16px 28px 0;
}

#railTrack {
  display: none !important;
}

#website-monitor {
  padding-top: 12px;
}

#website-monitor > .panel--site-list,
#data-monitor > .module-panel,
#server-manager > .module-view-panel,
#gsc-api-manager > .module-view-panel,
#admin-users > #adminAccountsPanel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: none;
}

#websiteStatusPanel,
#websiteEventsPanel,
#data-monitor > .module-panel > .module-view-panel,
#server-manager > .module-view-panel,
#gsc-api-manager > .module-view-panel,
#admin-users > #adminAccountsPanel {
  padding: 0;
  background: #ffffff;
}

#websiteStatusPanel > .module-toolbar,
#websiteEventsPanel > .module-toolbar,
#data-monitor .module-view-panel > .module-toolbar,
#server-manager > .module-view-panel > .module-toolbar,
#gsc-api-manager > .module-view-panel > .module-toolbar,
#bt-account-manager > .module-toolbar,
#adminAccountsPanel > .module-toolbar {
  min-height: 48px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: #ffffff;
}

#websiteStatusPanel > .site-control-bar {
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface-soft);
}

#websiteStatusPanel > .table-wrap,
#websiteEventsPanel > .event-log-list,
#data-monitor .module-view-panel > .table-wrap,
#server-manager > .module-view-panel > .table-wrap,
#gsc-api-manager > .module-view-panel > .table-wrap,
#adminAccountsPanel > .table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#websiteEventsPanel > .event-log-list {
  background: #ffffff;
}

#gscDiagnosticsPanel > .gsc-diagnostic-strip,
#gscBindingsPanel > .gsc-coverage-flow {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

#websiteEventsPanel > .list-pagination,
#data-monitor .module-view-panel > .list-pagination,
#gsc-api-manager > .module-view-panel > .list-pagination {
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

#websiteEventsPanel > .module-toolbar {
  border-bottom: 1px solid var(--border);
}

#task-center > .task-status-rail {
  overflow: hidden;
  background: #ffffff;
  box-shadow: none;
}

#task-center > .task-toolbar {
  background: var(--surface-soft);
}

#task-center > .task-table-wrap {
  margin: 0;
}

#task-center > .list-pagination {
  background: var(--surface-soft);
}

#alerts > .alert-export-toolbar {
  min-height: 38px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#alerts > .alert-view-panel {
  padding: 0;
  background: transparent;
}

#alerts .alert-block {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: none;
}

#alerts .alert-block > .record-toolbar,
#alerts .alert-block > .panel-heading {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface-soft);
}

#alerts .alert-block > .table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#alertTopSiteRows {
  margin: 0;
  padding: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

#alertTopSiteRows > .alert-site-chip--empty {
  min-height: 42px;
  padding: 0;
  align-content: center;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.record-toolbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

#alerts .alert-block > .list-pagination {
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

@media (max-width: 860px) {
  .dashboard-main-column,
  .dashboard-side-column {
    display: contents;
  }

  .platform-panel {
    order: 1;
  }

  .trend-panel {
    order: 2;
  }

  .estate-panel {
    order: 3;
  }

  .service-panel {
    order: 4;
  }

  .incident-panel {
    order: 5;
  }

  .activity-panel {
    order: 6;
  }

  main > .tab-panel {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  #summaryStrip {
    width: auto;
    max-width: none;
    margin: 12px 12px 0;
  }

  #railTrack {
    width: auto;
    max-width: none;
    margin-right: 12px;
    margin-left: 12px;
  }

  #website-monitor {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-top: 10px;
  }

  .record-toolbar-actions {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }

  .record-toolbar-actions > button {
    width: 100%;
  }
}

@media (max-width: 620px) {
  #websiteStatusPanel th:nth-child(1),
  #websiteStatusPanel td:nth-child(1) {
    width: 35%;
  }

  #websiteStatusPanel th:nth-child(2),
  #websiteStatusPanel td:nth-child(2) {
    width: 22%;
  }

  #websiteStatusPanel th:nth-child(3),
  #websiteStatusPanel td:nth-child(3) {
    width: 31%;
  }

  #websiteStatusPanel th:nth-child(10),
  #websiteStatusPanel td:nth-child(10) {
    width: 12%;
  }
}
/* Baota account custody: one continuous asset table with explicit row actions. */
#bt-account-manager {
  overflow: hidden;
  width: auto;
  margin: 18px 28px 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

#bt-account-manager > .bt-account-table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#bt-account-manager > .list-pagination {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface-soft);
}

.bt-account-table {
  min-width: 980px;
  table-layout: fixed;
}

.bt-account-table th:nth-child(1) { width: 17%; }
.bt-account-table th:nth-child(2) { width: 24%; }
.bt-account-table th:nth-child(3) { width: 15%; }
.bt-account-table th:nth-child(4) { width: 15%; }
.bt-account-table th:nth-child(5) { width: 18%; }
.bt-account-table th:nth-child(6) { width: 11%; }

.bt-account-table th,
.bt-account-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.bt-account-table td {
  height: 74px;
}

.bt-account-table .site-title,
.bt-panel-address {
  min-width: 0;
}

.bt-account-table .site-title strong,
.bt-account-table .site-title span,
.bt-panel-address a {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-panel-address a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.bt-panel-address a:hover {
  color: var(--star-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bt-secret-cell {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 6px;
}

.bt-secret-cell code {
  display: block;
  min-width: 0;
  padding: 8px 9px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f7f9fc;
  color: #4c5970;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 16px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-secret-cell code.is-revealed {
  border-color: rgba(104, 86, 232, 0.34);
  background: rgba(104, 86, 232, 0.07);
  color: #382c9f;
}

.bt-secret-toggle {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #ffffff;
  color: #4d5b72;
}

.bt-secret-toggle:hover:not(:disabled) {
  border-color: #b9c5d8;
  background: #f6f8fb;
  color: var(--primary-dark);
}

.bt-secret-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.bt-secret-toggle svg {
  width: 17px;
  height: 17px;
}

.bt-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.bt-row-action {
  display: inline-flex;
  min-height: 36px;
  padding: 0 9px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #ffffff;
  color: #344057;
  font-size: 16px;
  font-weight: 650;
  white-space: nowrap;
}

.bt-row-action:hover:not(:disabled) {
  border-color: rgba(104, 86, 232, 0.34);
  background: rgba(104, 86, 232, 0.06);
  color: var(--primary-dark);
}

.bt-row-action--danger {
  border-color: rgba(196, 60, 85, 0.22);
  color: #ad3149;
}

.bt-row-action--danger:hover:not(:disabled) {
  border-color: rgba(196, 60, 85, 0.38);
  background: rgba(196, 60, 85, 0.06);
  color: #9c263e;
}

.bt-row-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.bt-row-action svg {
  width: 15px;
  height: 15px;
}

.bt-account-edit {
  padding: 18px 20px 20px;
  gap: 14px;
}

.bt-account-edit > label.bt-panel-sync-toggle {
  display: flex;
  min-height: 42px;
  padding: 0 12px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.bt-account-edit > label.bt-panel-sync-toggle input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border-radius: 3px;
}

.bt-account-edit input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}

.bt-account-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bt-account-context > div {
  display: grid;
  min-width: 0;
  padding: 12px 13px;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.bt-account-context span {
  color: var(--muted);
  font-size: var(--font-meta);
}

.bt-account-context strong {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-password-dialog .dialog-card {
  width: min(460px, calc(100vw - 48px));
}

.bt-password-dialog .dialog-body {
  padding: 18px 20px 22px;
}
/* Boundary ownership: every continuous work surface draws one outer edge. */
#task-center {
  overflow: hidden;
  width: auto;
  margin: 18px 28px 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: none;
}

#task-center > .task-status-rail {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

#task-center > .task-toolbar {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

#task-center > .task-table-wrap {
  border: 0;
  border-radius: 0;
}

#task-center > .list-pagination {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
}

#backups .backup-view-panel {
  background: transparent;
}

#backups .backup-batch-bar,
#backups .backup-schedule-toolbar,
#backups .backup-view-toolbar {
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #ffffff;
  box-shadow: none;
}

#backups .backup-view-toolbar {
  min-height: 52px;
  padding: 7px 10px;
}

.backup-history-batch-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.backup-history-batch-actions .record-cleanup-button {
  min-height: 34px;
}

.backup-activity-row:has(input[data-backup-activity-id]:checked),
.backup-list-row:has(input[data-backup-activity-id]:checked) {
  background: #f3f6ff;
}

#backups .backup-list-head {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 0;
}

#backups [data-backup-view-panel="files"] > .backup-list-head {
  border-radius: var(--radius) var(--radius) 0 0;
}

#backups .backup-config-list,
#backups .backup-file-list,
#backups .backup-schedule-list,
#backups .backup-activity-list {
  margin: 0;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0;
}

#backups .backup-view-panel > .list-pagination {
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface-soft);
}
/* Keep file validation copy inside its grid track and away from row actions. */
#backups .backup-file-grid > * {
  min-width: 0;
}

#backups .backup-file-validation {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  justify-items: stretch;
}

#backups .backup-file-validation > .status-pill {
  justify-self: start;
}

#backups .backup-file-validation > small {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#backups .backup-file-actions {
  position: relative;
  z-index: 1;
  flex-wrap: nowrap;
  align-items: center;
  background: inherit;
}

@media (min-width: 1281px) {
  #backups .backup-file-grid {
    grid-template-columns: minmax(190px, 0.9fr) minmax(320px, 1.6fr) minmax(150px, 0.65fr) minmax(190px, 0.8fr) minmax(246px, auto);
  }
}

.export-menu__panel {
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(31, 42, 61, 0.14);
}

.export-menu__panel button {
  color: var(--text);
}

.export-menu__panel button:hover {
  background: var(--surface-soft);
}
html.app-booting body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #f4f7fb;
}

html.app-booting body::after {
  content: "";
  position: fixed;
  z-index: 10001;
  top: 92px;
  left: max(280px, calc((100vw - 1160px) / 2 + 220px));
  width: min(760px, calc(100vw - 320px));
  height: 260px;
  border: 1px solid #dce3ec;
  border-radius: 6px;
  background: linear-gradient(100deg, #ffffff 20%, #edf2f8 42%, #ffffff 64%);
  background-size: 220% 100%;
  animation: initial-shell-loading 1.2s ease-in-out infinite;
}

@keyframes initial-shell-loading {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.network-progress {
  position: fixed;
  z-index: 12000;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
}

.network-progress span {
  display: block;
  width: 42%;
  height: 100%;
  background: var(--accent-gradient);
  transform: translateX(-120%);
}

.network-progress.is-active {
  opacity: 1;
}

.network-progress.is-active span {
  animation: network-progress-run 1s ease-in-out infinite;
}

@keyframes network-progress-run {
  from { transform: translateX(-120%); }
  to { transform: translateX(340%); }
}

@media (max-width: 860px) {
  html.app-booting body::after {
    top: 76px;
    left: 18px;
    width: calc(100vw - 36px);
  }
}

.app-shell[aria-busy="true"] .main-nav button,
.app-shell[aria-busy="true"] .topbar-actions button {
  pointer-events: none;
}
/* External backup storage */
#backups .backup-storage-bar {
  grid-template-columns: 34px minmax(150px, auto) minmax(260px, 1fr) minmax(190px, auto) auto;
  gap: 10px;
}

.backup-storage-health {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.backup-storage-health small {
  overflow: hidden;
  color: var(--muted);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-storage-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.backup-storage-actions .backup-storage-open:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.backup-storage-actions .backup-storage-open.is-loading svg {
  animation: spin 700ms linear infinite;
}

/* Keep the whole action cluster visually related. Status pills carry the
   blue cloud meaning; the controls themselves use one purple accent. */
#backups .backup-storage-open,
#backups .backup-storage-copy,
#backups .backup-list-actions .table-action {
  color: var(--primary-dark);
}

#backups .backup-storage-open svg,
#backups .backup-storage-copy svg,
#backups .backup-list-actions .table-action svg {
  color: currentColor;
  stroke: currentColor;
}

#backups #openGoogleDriveButton {
  border-color: var(--border);
  background: var(--surface);
  color: var(--primary-dark);
}

#backups .backup-storage-open:disabled,
#backups .backup-storage-open:disabled svg {
  color: var(--muted-2);
}

.backup-storage-dialog .dialog-card {
  width: min(760px, calc(100vw - 48px));
}

#googleDriveDialog .drive-backup-actions {display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
#googleDriveDialog .dialog-body {display:flex;flex-direction:column;}
#googleDriveDialog .dialog-body > * {flex:0 0 auto;}
#googleDriveDialog #googleDriveSetup {min-width:0;}
#googleDriveDialog #googleDriveSetup > summary {cursor:pointer;color:var(--primary);}
#googleDriveDialog #googleDriveSetup .form-field {margin-top:14px;}
#googleDriveDialog .drive-backup-table {max-height:320px;overflow:auto;border:1px solid var(--border);border-radius:8px;}
#googleDriveDialog table {width:100%;min-width:0;border-collapse:collapse;table-layout:fixed;}
#googleDriveDialog th, #googleDriveDialog td {width:auto;min-width:0;padding:10px 12px;text-align:left;vertical-align:top;overflow-wrap:anywhere;white-space:normal;border-bottom:1px solid var(--border);}
#googleDriveDialog th {position:sticky;top:0;background:var(--surface,#fff);}
#googleDriveDialog p {margin:0;line-height:1.6;overflow-wrap:anywhere;}
#googleDriveDialog .switch-field {display:flex;align-items:center;gap:10px;}
#googleDriveDialog .switch-field input {width:18px;height:18px;min-height:18px;flex:0 0 18px;margin:0;padding:0;accent-color:var(--primary);}
#googleDriveDialog .switch-field span {margin:0;font-size:14px;font-weight:500;}
#googleDriveDialog .dialog-actions {flex-wrap:wrap;}

.backup-storage-dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.backup-storage-dialog-body .form-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.backup-storage-dialog-body .form-field > span {
  color: #4f5d73;
  font-size: 16px;
  font-weight: 700;
}

.backup-storage-dialog-body .form-field > small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.backup-storage-dialog-body input,
.backup-storage-dialog-body select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  font-size: 16px;
}

.backup-storage-server-context {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f7f9fc;
}

.backup-storage-server-context > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 11px 12px;
  border-right: 1px solid var(--border);
}

.backup-storage-server-context > div:last-child {
  border-right: 0;
}

.backup-storage-server-context span {
  color: var(--muted);
  font-size: 12px;
}

.backup-storage-server-context strong {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-storage-server-context strong.is-ready {
  color: var(--success);
}

.backup-storage-server-context strong.is-missing {
  color: var(--danger);
}

.backup-storage-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.backup-storage-switch-strategy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.backup-storage-switch-strategy legend {
  grid-column: 1 / -1;
  margin-bottom: 7px;
  color: #4f5d73;
  font-size: 16px;
  font-weight: 700;
}

.backup-storage-switch-strategy label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
}

.backup-storage-switch-strategy label:has(input:checked) {
  border-color: color-mix(in srgb, var(--primary) 55%, #d8deea);
  background: color-mix(in srgb, var(--primary) 6%, #ffffff);
}

.backup-storage-switch-strategy input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.backup-storage-switch-strategy label > span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.backup-storage-switch-strategy strong {
  color: var(--text);
  font-size: 16px;
}

.backup-storage-switch-strategy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.backup-storage-preflight {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid #efb7b7;
  border-radius: var(--radius-sm);
  background: #fff7f7;
}

.backup-storage-preflight[hidden] {
  display: none;
}

.backup-storage-preflight.is-success {
  border-color: #b9dfce;
  background: #f4fbf8;
}

.backup-storage-preflight > div {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
}

.backup-storage-preflight svg {
  width: 18px;
  height: 18px;
}

.backup-storage-preflight .is-ok svg {
  color: var(--success);
}

.backup-storage-preflight .is-failed svg {
  color: var(--danger);
}

.backup-storage-preflight .is-running svg {
  color: var(--primary);
  animation: spin 700ms linear infinite;
}

.backup-storage-preflight span {
  display: grid;
  gap: 2px;
}

.backup-storage-preflight strong {
  color: var(--text);
  font-size: 16px;
}

.backup-storage-preflight small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 680px) {
  .backup-storage-options-grid,
  .backup-storage-switch-strategy,
  .backup-storage-preflight,
  .backup-storage-server-context {
    grid-template-columns: 1fr;
  }

  .backup-storage-server-context > div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .backup-storage-server-context > div:last-child {
    border-bottom: 0;
  }
}

.backup-storage-enabled-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.backup-storage-enabled-field input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.backup-storage-dialog .dialog-note {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid #cad7ed;
  border-radius: var(--radius-sm);
  background: #f5f8fd;
  color: #46546b;
  font-size: 16px;
  line-height: 1.5;
}

.backup-storage-dialog .dialog-note svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: #5140cd;
}
