:root {
  --bg: #1a1f29;
  --bg-deep: #141922;
  --surface: #202734;
  --surface-strong: #273142;
  --surface-muted: #1d2430;
  --text: #edf2f7;
  --text-muted: #9aa5b5;
  --line: #334054;
  --line-strong: #4c5d74;
  --primary: #76c4a5;
  --primary-strong: #5ea389;
  --accent: #cf845b;
  --danger: #f08c74;
  --radius: 10px;
  --radius-small: 8px;
  --shadow: 0 10px 28px rgba(7, 10, 15, 0.22);
  --container: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Helvetica Neue", sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at top right, rgba(118, 196, 165, 0.12), transparent 28%),
    radial-gradient(circle at bottom left, rgba(207, 132, 91, 0.1), transparent 24%),
    linear-gradient(180deg, #1b202a 0%, #171c25 100%);
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(154, 165, 181, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 165, 181, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(255,255,255,0.3), transparent 70%);
  animation: gridDrift 18s linear infinite;
  opacity: 0.45;
}
body[data-ready="true"] .page-shell,
body[data-ready="true"] .workspace {
  animation: pageEnter 320ms ease;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.container { width: min(var(--container), calc(100% - 48px)); margin: 0 auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(76, 93, 116, 0.55);
  background: rgba(20, 25, 34, 0.86);
  backdrop-filter: blur(12px);
}
.topbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 70px;
}
.brand, .sidebar-brand {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.topnav, .sidebar-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--text-muted);
}
.topnav a, .sidebar-nav a {
  position: relative;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}
.topnav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 2px;
  background: var(--primary);
  opacity: 0;
}
.topnav a.active, .sidebar-nav a.active, .topnav a:hover, .sidebar-nav a:hover { color: var(--text); }
.topnav a.active::after { opacity: 1; }
.page-shell, .section-block { padding: 30px 0; }
.page-grid, .content-grid, .detail-grid, .quote-grid, .mode-grid, .feature-grid, .metric-row {
  display: grid;
  gap: 20px;
}
.page-grid { grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.82fr); align-items: start; }
.content-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mode-grid, .detail-grid, .quote-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.panel, .table-card, .info-card, .form-card, .metric, .status-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(39, 49, 66, 0.92), rgba(29, 36, 48, 0.96));
  border: 1px solid rgba(76, 93, 116, 0.5);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel::before, .table-card::before, .info-card::before, .form-card::before, .metric::before, .status-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(118, 196, 165, 0.06), transparent 42%, rgba(207, 132, 91, 0.05));
  pointer-events: none;
}
.panel, .table-card, .info-card, .form-card { padding: 18px; }
.metric, .status-card { padding: 14px; }
.status-card.compact { min-height: 100%; }
.panel > *, .table-card > *, .info-card > *, .form-card > *, .metric > *, .status-card > * { position: relative; z-index: 1; }
.panel-header, .toolbar, .top-row, .progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.toolbar {
  min-height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(76, 93, 116, 0.55);
  background: rgba(20, 25, 34, 0.86);
  backdrop-filter: blur(12px);
}
.toolbar p, .muted, label, th { color: var(--text-muted); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: rgba(39, 49, 66, 0.9);
  color: var(--text);
  font-weight: 600;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.button:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(118, 196, 165, 0.08);
}
.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #102019;
}
.button.primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.hero-copy { max-width: 60ch; }
.hero-copy h1 { font-size: clamp(2.2rem, 4vw, 3.5rem); margin-bottom: 12px; letter-spacing: -0.03em; }
.hero-copy p { font-size: 1.02rem; }
.kv-list { display: grid; gap: 12px; }
.kv-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(76, 93, 116, 0.4);
}
.kv-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.list { margin: 0; padding-left: 18px; }
.list li { margin-bottom: 10px; }
.table-card table, .panel table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td {
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid rgba(76, 93, 116, 0.4);
  vertical-align: top;
}
th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
tbody tr:hover { background: rgba(118, 196, 165, 0.05); }
tbody tr:last-child td { border-bottom: 0; }
.console-layout { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar {
  position: relative;
  background: linear-gradient(180deg, #171d26, #131821);
  border-right: 1px solid rgba(76, 93, 116, 0.55);
  padding: 24px 18px;
}
.sidebar::after {
  content: "";
  position: absolute;
  top: 24px;
  right: 0;
  bottom: 24px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(118, 196, 165, 0.38), transparent);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 22px;
}
.sidebar-nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.sidebar-nav a.active {
  color: var(--text);
  background: rgba(39, 49, 66, 0.82);
  border-color: rgba(118, 196, 165, 0.26);
}
.workspace { padding: 28px; }
.metric strong, .detail-grid strong, .quote-grid strong, .status-card strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(118, 196, 165, 0.32);
  background: rgba(118, 196, 165, 0.09);
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 600;
}
.bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(39, 49, 66, 0.95);
  border: 1px solid rgba(76, 93, 116, 0.55);
  overflow: hidden;
}
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #97d8bf); }
.form-grid { display: grid; gap: 14px; }
label {
  display: grid;
  gap: 6px;
  font-size: 0.94rem;
}
input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(76, 93, 116, 0.65);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(17, 22, 31, 0.75);
  color: var(--text);
  outline: none;
}
input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(118, 196, 165, 0.08);
}
.stack-field {
  display: grid;
  gap: 10px;
}
.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(76, 93, 116, 0.45);
  background: rgba(17, 22, 31, 0.45);
}
.option-row input {
  width: 18px;
  min-height: auto;
  margin: 0;
  accent-color: var(--primary);
  box-shadow: none;
}
.option-row span {
  color: var(--text-muted);
  font-size: 0.9rem;
}
@keyframes pageEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 32px, 32px 0; }
}
@media (max-width: 1100px) {
  .page-grid, .content-grid, .feature-grid, .mode-grid, .detail-grid, .metric-row, .quote-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media (max-width: 860px) {
  .console-layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid rgba(76, 93, 116, 0.55); }
  .sidebar::after { display: none; }
  .topbar-row, .toolbar, .panel-header, .progress-labels, .kv-list div, .option-row { flex-direction: column; align-items: flex-start; }
}
.install-shell {
  min-height: 100vh;
  padding: 36px 24px;
}

.install-frame {
  width: min(1220px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
}

.install-sidebar,
.install-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(39, 49, 66, 0.92), rgba(29, 36, 48, 0.96));
  border: 1px solid rgba(76, 93, 116, 0.5);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.install-sidebar::before,
.install-panel::before,
.install-step::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(118, 196, 165, 0.06), transparent 42%, rgba(207, 132, 91, 0.05));
  pointer-events: none;
}

.install-sidebar,
.install-panel {
  padding: 24px;
}

.install-sidebar > *,
.install-panel > * {
  position: relative;
  z-index: 1;
}

.install-content {
  display: grid;
  gap: 20px;
}

.install-brand {
  display: inline-block;
  margin-bottom: 22px;
}

.install-sidebar-copy h1 {
  font-size: 1.9rem;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.install-step-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.install-step {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(76, 93, 116, 0.45);
  background: rgba(17, 22, 31, 0.42);
  color: var(--text-muted);
}

.install-step.active {
  color: var(--text);
  border-color: rgba(118, 196, 165, 0.3);
  background: rgba(28, 35, 46, 0.82);
}

.install-step strong,
.install-step small {
  display: block;
}

.install-step small {
  margin-top: 4px;
  color: var(--text-muted);
}

.install-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(76, 93, 116, 0.55);
  background: rgba(17, 22, 31, 0.65);
  font-weight: 700;
}

.install-panel-wide {
  padding: 24px;
}

.install-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.install-heading h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.state-chip.danger {
  border-color: rgba(240, 140, 116, 0.35);
  background: rgba(240, 140, 116, 0.08);
  color: var(--danger);
}

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

.install-status-line {
  margin: 8px 0;
  font-weight: 700;
}

.install-status-line.ok {
  color: var(--primary);
}

.install-status-line.alert {
  color: var(--danger);
}

.status-card-alert {
  border-color: rgba(240, 140, 116, 0.3);
}

.install-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.install-meta-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 980px) {
  .install-frame {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .install-heading,
  .install-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

.project-shell {
  display: grid;
  gap: 20px;
}

.project-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(76, 93, 116, 0.45);
}

.project-header-bar h2 {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.project-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-subnav {
  display: flex;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(76, 93, 116, 0.35);
}

.project-subnav a {
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
}

.project-subnav a:hover {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.project-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.summary-tile {
  padding: 16px;
  border: 1px solid rgba(76, 93, 116, 0.45);
  border-radius: 8px;
  background: rgba(18, 22, 30, 0.68);
}

.summary-tile span {
  display: block;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.summary-tile strong {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.project-progress-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 20px;
}

.project-progress-panel,
.project-errors-panel {
  min-height: 100%;
}

.project-progress-meta {
  text-align: right;
}

.project-progress-meta strong {
  font-size: 1.5rem;
}

.transfer-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12px, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.transfer-cell {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 3px;
  background: rgba(76, 93, 116, 0.28);
}

.transfer-cell.complete { background: #5ea389; }
.transfer-cell.active { background: #cf845b; }
.transfer-cell.failed { background: #f08c74; }
.transfer-cell.pending { background: rgba(118, 196, 165, 0.2); }

.project-kv-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.project-kv-row div {
  padding-top: 12px;
  border-top: 1px solid rgba(76, 93, 116, 0.35);
}

.project-kv-row span {
  display: block;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.project-kv-row strong {
  font-size: 1.15rem;
}

.project-error-list,
.connection-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.project-error-item,
.connection-card {
  padding: 14px;
  border: 1px solid rgba(76, 93, 116, 0.4);
  border-radius: 8px;
  background: rgba(17, 22, 31, 0.55);
}

.project-error-item.error {
  border-color: rgba(240, 140, 116, 0.4);
}

.project-error-item.warning {
  border-color: rgba(207, 132, 91, 0.45);
}

.project-error-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.project-error-head span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.transfer-table {
  width: 100%;
}

.mailbox-route {
  display: grid;
  gap: 4px;
}

.transfer-stage,
.transfer-health {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  border: 1px solid rgba(76, 93, 116, 0.4);
}

.transfer-stage.complete,
.transfer-health.healthy {
  color: #89d1af;
  border-color: rgba(94, 163, 137, 0.45);
  background: rgba(94, 163, 137, 0.12);
}

.transfer-stage.scanning,
.transfer-stage.syncing,
.transfer-stage.delta,
.transfer-health.warning {
  color: #e3a07c;
  border-color: rgba(207, 132, 91, 0.45);
  background: rgba(207, 132, 91, 0.12);
}

.transfer-stage.failed,
.transfer-stage.needs-attention,
.transfer-health.blocked {
  color: #f0a18f;
  border-color: rgba(240, 140, 116, 0.45);
  background: rgba(240, 140, 116, 0.12);
}

.transfer-stage.queued,
.transfer-stage.paused {
  color: var(--text-muted);
  background: rgba(76, 93, 116, 0.12);
}

.transfer-progress {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(18, 22, 30, 0.9);
  border: 1px solid rgba(76, 93, 116, 0.4);
}

.transfer-progress-bar {
  height: 100%;
  min-width: 0;
  transition: width 240ms ease;
  background: #5ea389;
}

.transfer-progress-bar.scanning,
.transfer-progress-bar.syncing,
.transfer-progress-bar.delta {
  background: repeating-linear-gradient(
    135deg,
    rgba(207, 132, 91, 0.95),
    rgba(207, 132, 91, 0.95) 10px,
    rgba(186, 112, 72, 0.95) 10px,
    rgba(186, 112, 72, 0.95) 20px
  );
}

.transfer-progress-bar.failed,
.transfer-progress-bar.needs-attention {
  background: #f08c74;
}

.transfer-progress-bar.queued,
.transfer-progress-bar.paused {
  background: rgba(118, 196, 165, 0.28);
}

.transfer-progress-label {
  display: inline-block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .project-summary-grid,
  .project-progress-grid,
  .project-kv-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .project-header-bar,
  .project-header-meta,
  .project-subnav,
  .project-error-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
