/* ── TangleClaw v3 — Landing Page Styles ── */
/* Mobile-first. Preserves v2 color palette and visual identity. */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── CSS Variables (v2 palette — do not change) ── */
:root {
  --primary: #8BC34A;
  --primary-bright: #9CCC65;
  --primary-dark: #558B2F;
  --chrome: #C0C0C0;
  --bg: #000000;
  --card-bg: #0D0D0D;
  --elevated-bg: #1A1A1A;
  --danger: #EF5350;
  --danger-dark: #C62828;
  --text: #E8E8E8;
  --text-muted: #777;
  --root-accent: #4a9eff;
  --amber: #FFA726;
  /* Semantic aliases */
  --engine-claude: #8BC34A;
  --engine-codex: #42A5F5;
  --engine-aider: #AB47BC;
  --engine-genesis: #FF7043;
  --radius-btn: 6px;
  --radius-card: 10px;
  --radius-modal: 12px;
  --radius-pill: 14px;
}

/* ── Light Theme ── */
[data-theme="light"] {
  --bg: #F5F5F5;
  --card-bg: #FFFFFF;
  --elevated-bg: #E0E0E0;
  --text: #1A1A1A;
  --text-muted: #666;
}

/* ── High Contrast Theme ── */
[data-theme="high-contrast"] {
  --bg: #000000;
  --card-bg: #000000;
  --elevated-bg: #333333;
  --text: #FFFFFF;
  --text-muted: #BBBBBB;
  --primary: #A4D65E;
  --primary-bright: #B8E070;
  --danger: #FF6B6B;
}

/* ── Base ── */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Dashboard Bar ── */
.main-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.dash-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 5px) 16px 5px;
  flex-shrink: 0;
}
.dash-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.dash-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.dash-wordmark {
  height: 16px;
  object-fit: contain;
}
.dash-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
}
.dash-version {
  font-size: 10px;
  color: var(--text-muted);
  font-family: monospace;
}
.update-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-family: monospace;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-dark);
  color: #fff;
  white-space: nowrap;
}
.update-pill.hidden { display: none; }
.update-pill-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.update-pill-link:hover { text-decoration: none; }

/* Orphan hooks repair banner (#145, chunk 2) */
.orphan-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--amber);
  color: #1a1a1a;
  padding: 10px 16px;
  margin: 0 0 12px 0;
  border-radius: var(--radius-card);
  font-size: 13px;
  font-weight: 500;
}
.orphan-banner.hidden { display: none; }
/* Stale-server variant (#199). Same shape as orphan-banner; different colour
   so the two banners read distinctly when both surface together. */
.stale-server-banner {
  background: var(--danger, #c53030);
  color: #fff;
}
.stale-server-banner .orphan-banner-text { color: inherit; }
.stale-server-banner code {
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 12px;
}
.orphan-banner-text { flex: 1; }
.orphan-banner-btn {
  background: #1a1a1a;
  color: var(--amber);
  border: none;
  font-weight: 600;
  white-space: nowrap;
}
.orphan-banner-btn:hover { background: #333; }
.orphan-banner-details {
  background: transparent;
  border: 1px solid #1a1a1a;
  color: #1a1a1a;
  padding: 4px 10px;
  border-radius: var(--radius-btn);
  font-size: 12px;
  cursor: pointer;
}
.orphan-banner-details:hover { background: rgba(0,0,0,0.08); }
.update-pill-dismiss {
  background: none;
  border: none;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 2px;
  opacity: 0.7;
}
.update-pill-dismiss:hover { opacity: 1; }
.dash-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.dash-stat {
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.dash-stat-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dash-stat .stat-value {
  font-size: 12px;
  font-weight: 700;
  margin: 0;
}
.dash-stat-up {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.dash-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.dash-action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-btn);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  min-height: 24px;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 0.15s, color 0.15s;
}
.dash-action:active, .dash-action.active {
  border-color: var(--primary);
  color: var(--primary);
}
.dash-gear {
  font-size: 14px;
  border: none;
  background: none;
  padding: 2px 4px;
  color: var(--text-muted);
}
.dash-gear:active { color: var(--primary); }
.dash-badge {
  background: rgba(139, 195, 74, 0.15);
  color: var(--primary);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
}
@media (max-width: 600px) {
  .dash-stats { display: none; }
}

/* ── Stat value colors (used by dashboard bar) ── */
.stat-value {
  font-size: 13px;
  font-weight: 700;
}
.stat-green { color: var(--primary); }
.stat-amber { color: var(--amber); }
.stat-red { color: var(--danger); }

/* ── Ports Panel ── */
.ports-grid {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 16px;
}
.ports-grid.open {
  max-height: 400px;
  padding-top: 4px;
  padding-bottom: 12px;
  overflow-y: auto;
}
.ports-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px;
}
.port-group {
  margin-bottom: 8px;
}
.port-group-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text);
  margin-bottom: 0;
}
.port-group-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  min-height: 44px;
}
.port-group-toggle:active .port-group-name { color: var(--primary); }
.port-group-toggle .arrow {
  display: inline-block;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.15s;
}
.port-group-toggle .arrow.open { transform: rotate(180deg); }
.port-group-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.port-group-content.open {
  max-height: 500px;
}
.port-lease {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: var(--card-bg);
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-btn);
  margin-bottom: 2px;
  font-size: 13px;
}
.port-number {
  font-weight: 700;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--primary);
  min-width: 48px;
}
.port-project {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.port-service {
  flex: 1;
  color: var(--text-muted);
}
.port-type {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-transform: uppercase;
}
.port-type-permanent {
  background: rgba(139, 195, 74, 0.15);
  color: var(--primary);
}
.port-type-ttl {
  background: rgba(255, 167, 38, 0.15);
  color: var(--amber);
}

/* ── Groups Panel ── */
.groups-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 16px;
}
.groups-panel.open {
  max-height: 600px;
  padding-top: 4px;
  padding-bottom: 12px;
  overflow-y: auto;
}
.groups-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px;
}
.groups-header-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}
.group-item {
  margin-bottom: 4px;
}
.group-item-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  min-height: 44px;
}
.group-item-toggle:active .group-item-name { color: var(--primary); }
.group-item-toggle .arrow {
  display: inline-block;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.15s;
}
.group-item-toggle .arrow.open { transform: rotate(180deg); }
.group-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.group-item-meta {
  font-size: 10px;
  color: var(--text-muted);
  flex: 1;
}
.group-item-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.group-item-content.open {
  max-height: 500px;
  overflow-y: auto;
}
.group-item-desc {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 8px;
  margin-bottom: 6px;
}
.group-detail-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 2px 8px;
}
.group-empty-hint {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 8px;
  font-style: italic;
}
.group-members-inline,
.group-docs-inline {
  padding: 2px 8px;
}
.group-member-row,
.group-doc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 12px;
}
.group-member-name,
.group-doc-name {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-doc-mode {
  font-size: 9px;
  background: var(--elevated-bg);
  color: var(--text-muted);
}
.group-doc-inject {
  font-size: 9px;
}
.doc-lock-indicator {
  font-size: 12px;
  flex-shrink: 0;
}
.doc-lock-indicator.locked {
  color: var(--amber);
}

/* ── Group Members List (modal) ── */
.group-members-list {
  max-height: 200px;
  overflow-y: auto;
}
.group-member-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
  -webkit-user-select: none;
  user-select: none;
}
.group-member-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* ── Group Docs List (modal) ── */
.group-docs-list {
  max-height: 200px;
  overflow-y: auto;
}
.group-doc-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  font-size: 12px;
  border-bottom: 1px solid var(--elevated-bg);
}
.group-doc-edit-row:last-child { border-bottom: none; }

/* ── Group Badge on Project Cards ── */
.badge-group {
  background: rgba(100, 181, 246, 0.15);
  color: #64B5F6;
  font-size: 9px;
}

/* ── OpenClaw Connections Panel ── */
.openclaw-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 16px;
}
.openclaw-panel.open {
  max-height: 600px;
  padding-top: 4px;
  padding-bottom: 12px;
  overflow-y: auto;
}
.audit-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 16px;
}
.audit-panel.open {
  max-height: 600px;
  padding-top: 4px;
  padding-bottom: 12px;
  overflow-y: auto;
}
.badge-audit {
  background: #1a3a2a;
  color: #8be9a0;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.audit-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4caf50;
  display: inline-block;
}
.badge-anomaly {
  background: #d32f2f;
  color: #fff;
  font-size: 9px;
  padding: 0 4px;
  border-radius: 6px;
  margin-left: 3px;
  font-weight: 600;
}
.audit-summary-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}
.audit-summary-table th {
  text-align: left;
  color: #888;
  font-weight: 500;
  padding: 3px 8px;
  border-bottom: 1px solid #333;
}
.audit-summary-table td {
  padding: 3px 8px;
}
.audit-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: #666;
  font-size: 12px;
}
.openclaw-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px;
}
.openclaw-header-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}
.oc-item {
  margin-bottom: 4px;
}
.oc-item-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  min-height: 44px;
}
.oc-item-toggle:active .oc-item-name { color: var(--primary); }
.oc-item-toggle .arrow {
  display: inline-block;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.15s;
}
.oc-item-toggle .arrow.open { transform: rotate(180deg); }
.oc-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.oc-item-meta {
  font-size: 10px;
  color: var(--text-muted);
  flex: 1;
  font-family: monospace;
}
.oc-item-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.oc-item-content.open {
  max-height: 300px;
  overflow-y: auto;
}
.oc-detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  padding: 4px 8px 8px;
  font-size: 12px;
}
.oc-detail-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.oc-detail-value {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* #306: muted hint shown in the Version row when a connection has no
   instanceDir configured, so the row is always present (discoverable)
   rather than silently omitted. */
.oc-detail-value.oc-detail-muted {
  color: var(--text-muted);
  font-style: italic;
}
/* Instance Dir input + Detect button row (#306-followup PR B) */
.oc-detect-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.oc-detect-row .form-input { flex: 1; }
.oc-detect-row #ocDetectBtn { white-space: nowrap; flex-shrink: 0; }
/* OpenClaw "Read Me" setup-guide modal (#306-followup) */
.oc-setup-content {
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
}
.oc-setup-fields {
  margin: 4px 0 12px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.oc-setup-fields li { margin-bottom: 3px; }
.oc-setup-prompt {
  background: var(--elevated-bg);
  color: var(--text);
  border-radius: var(--radius-btn);
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
  margin: 6px 0 4px;
}
.oc-tunnel-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 2px;
  font-size: 12px;
}
.badge-tunnel-active {
  background: rgba(255, 167, 38, 0.2);
  color: var(--amber);
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.oc-tunnel-detail {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 11px;
}
.oc-actions {
  display: flex;
  gap: 6px;
  padding: 6px 8px 8px;
}
.oc-test-result {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 4px;
}
.oc-test-pending {
  background: var(--elevated-bg);
  color: var(--text-muted);
}
.oc-test-ok {
  background: rgba(76, 175, 80, 0.15);
  color: #66BB6A;
}
.oc-test-fail {
  background: rgba(244, 67, 54, 0.15);
  color: #EF5350;
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-group-half {
  flex: 1;
}

/* ── Global Rules Panel ── */
.rules-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 16px;
}
.rules-panel.open {
  max-height: 500px;
  padding-top: 4px;
  padding-bottom: 12px;
}
.rules-editor {
  width: 100%;
  min-height: 150px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-btn);
  color: var(--text);
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}
.rules-editor:focus {
  outline: none;
  border-color: var(--primary);
}
.rules-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}
.rules-status {
  font-size: 12px;
  margin-top: 6px;
  text-align: right;
}
.rules-status-ok { color: var(--primary); }
.rules-status-err { color: var(--danger); }

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 16px;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.session-count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.count-num {
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
}
.toolbar-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  justify-content: center;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-btn);
  background: var(--card-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn:active { background: var(--elevated-bg); }
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.btn-primary {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-primary:active {
  background: var(--primary-dark);
  color: #fff;
}
.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:active {
  background: var(--danger-dark);
  color: #fff;
}
.btn-small {
  min-height: 28px;
  padding: 2px 10px;
  font-size: 12px;
}
.btn-icon {
  min-width: 32px;
  padding: 4px;
}
/* ── Search/Filter ── */
.filter-section {
  padding: 0 16px 8px;
}
.filter-input-wrap {
  position: relative;
}
.filter-input-wrap--inline {
  width: 160px;
  flex-shrink: 0;
}
.filter-input--inline {
  min-height: 26px;
  padding: 3px 28px 3px 8px;
  font-size: 12px;
}
.filter-input {
  width: 100%;
  min-height: 34px;
  padding: 6px 40px 6px 12px;
  background: var(--card-bg);
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-btn);
  color: var(--text);
  font-family: monospace;
  font-size: 14px;
}
.filter-input::placeholder { color: var(--text-muted); }
.filter-input:focus {
  outline: none;
  border-color: var(--primary);
}
.filter-clear {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
}
.filter-clear:active { color: var(--text); }

.tag-row {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tag-row::-webkit-scrollbar { display: none; }
.tag-pill {
  flex-shrink: 0;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--elevated-bg);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.tag-pill:active, .tag-pill.active {
  background: var(--primary-dark);
  border-color: var(--primary);
  color: #fff;
}
.tag-pill-unreg.active {
  background: var(--elevated-bg);
  border-color: var(--root-accent);
  color: var(--root-accent);
}

/* ── Project Cards Grid ── */
.cards-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 16px 120px;
}

/* ── Root Panel ── */
.root-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: #060d14;
  border: 1px solid #1a3a5a;
  border-radius: var(--radius-btn);
  margin-bottom: 4px;
}
.root-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--root-accent);
  background: rgba(74, 158, 255, 0.15);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}
.root-path {
  font-size: 12px;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--text-muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.root-count {
  font-size: 11px;
  color: var(--root-accent);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Project Card (compact row) ── */
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.project-card.compact {
  padding: 0;
}
.project-card:active { border-color: #444; }
.project-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.project-card.has-session {
  border-left: 3px solid var(--primary);
}
.project-card.unregistered {
  opacity: 0.6;
}
.project-card.archived {
  opacity: 0.5;
}

.archived-section {
  margin-top: 12px;
}
.archived-section-header {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  user-select: none;
}
.archived-section-header:hover {
  color: var(--text);
}
.archived-section-list {
  margin-top: 4px;
}

.status-dot.archived {
  background: transparent;
  border: 1px solid var(--text-muted);
}
.badge-archived {
  background: var(--bg-dim);
  color: var(--text-muted);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  min-height: 34px;
}
.card-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.card-name-muted {
  color: var(--text-muted);
}

/* ── Status Dot ── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
  flex-shrink: 0;
}
.status-dot.active {
  background: var(--primary);
  animation: breathe-card 2s ease-in-out infinite;
}
.status-dot.unregistered {
  background: transparent;
  border: 1px solid var(--text-muted);
}
@keyframes breathe-card {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Compact Badges ── */
.badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-version {
  font-family: 'SF Mono', 'Menlo', monospace;
  background: var(--elevated-bg);
  color: var(--text-muted);
}
.badge-git {
  color: var(--text-muted);
  font-family: 'SF Mono', 'Menlo', monospace;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.badge-engine {
  background: rgba(139, 195, 74, 0.15);
  color: var(--primary);
  font-size: 9px;
}
/* ── Engine Status Dot ── */
.engine-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  background: var(--text-muted);
}
.engine-status-dot.engine-status-operational {
  background: var(--primary);
}
.engine-status-dot.engine-status-degraded {
  background: var(--amber);
}
.engine-status-dot.engine-status-partial_outage {
  background: #FF7043;
}
.engine-status-dot.engine-status-major_outage {
  background: var(--danger);
}
.engine-status-dot.engine-status-unknown {
  background: var(--text-muted);
}

/* ── Engine Status Pill States ── */
.badge-engine.engine-pill-degraded {
  background: rgba(255, 167, 38, 0.2);
  color: var(--amber);
}
.badge-engine.engine-pill-partial_outage {
  background: rgba(255, 112, 67, 0.2);
  color: #FF7043;
}
.badge-engine.engine-pill-major_outage {
  background: rgba(239, 83, 80, 0.25);
  color: var(--danger);
  animation: engine-pulse 1.5s ease-in-out infinite;
}
@keyframes engine-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(239, 83, 80, 0.3); }
  50% { box-shadow: 0 0 12px rgba(239, 83, 80, 0.8); }
}
.badge-meth {
  background: rgba(171, 71, 188, 0.15);
  color: #ce93d8;
  font-size: 9px;
}
.badge-phase {
  background: rgba(255, 152, 0, 0.15);
  color: #ffb74d;
  font-size: 9px;
}
.badge-phase-unknown {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 9px;
}
.git-dirty {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

/* ── Card Row Actions ── */
.card-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}
.btn-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-btn);
  background: var(--card-bg);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.btn-compact:active { background: var(--elevated-bg); }
.btn-launch {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-launch:active { background: var(--primary-dark); color: #fff; }
.btn-attach {
  border-color: var(--root-accent);
  color: var(--root-accent);
}
.btn-attach:active { background: rgba(74, 158, 255, 0.2); }
.btn-icon-tiny {
  min-width: 32px;
  max-width: 32px;
  padding: 4px;
  font-size: 12px;
}
.btn-detach-subtle {
  color: var(--text-muted);
  border-color: var(--elevated-bg);
}
.btn-detach-subtle:active {
  color: var(--root-accent);
  border-color: var(--root-accent);
}
.btn-danger-subtle {
  color: var(--text-muted);
  border-color: var(--elevated-bg);
}
.btn-danger-subtle:active {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-detach {
  background: transparent;
  color: var(--root-accent);
  border: 1px solid var(--root-accent);
}
.btn-detach:active {
  background: var(--root-accent);
  color: #000;
}
.btn-kill-card {
  color: var(--danger);
  border-color: var(--danger-dark);
}
.btn-kill-card:active {
  background: var(--danger-dark);
  color: #fff;
}

/* Mobile: stack card name above badges + buttons */
@media (max-width: 480px) {
  .card-row {
    flex-wrap: wrap;
    padding: 8px 12px 6px;
    row-gap: 4px;
  }
  .card-name {
    flex: 1 1 calc(100% - 24px);
    font-size: 15px;
    order: -1;
  }
  .status-dot {
    order: -2;
  }
}

/* Touch targets: ensure 44px tap area on mobile even if visual is smaller */
@media (pointer: coarse) {
  .btn-compact { min-height: 44px; }
  .btn-icon-tiny { min-width: 44px; max-width: 44px; min-height: 44px; }
  .card-row { min-height: 48px; }
}

/* ── Card Detail Expansion ── */
.card-detail {
  padding: 12px 16px;
  background: var(--elevated-bg);
  border-top: 1px solid #222;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}
.detail-label {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}
.detail-value {
  color: var(--text);
  text-align: right;
}
.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}

/* Legacy compat — keep old classes that may be referenced */
.engine-pill, .methodology-pill, .status-pill {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.engine-pill {
  background: rgba(139, 195, 74, 0.15);
  color: var(--primary);
}
.methodology-pill {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.status-green { background: rgba(139, 195, 74, 0.15); color: var(--primary); }
.status-blue { background: rgba(74, 158, 255, 0.15); color: var(--root-accent); }
.status-yellow { background: rgba(255, 167, 38, 0.15); color: var(--amber); }
.status-red { background: rgba(239, 83, 80, 0.15); color: var(--danger); }

/* ── Card Peek Panel ── */
.card-peek {
  margin-top: 8px;
  border-top: 1px solid var(--elevated-bg);
  padding-top: 8px;
}
.card-peek-content {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
  line-height: 1.4;
  color: #ccc;
  background: #000;
  border-radius: var(--radius-btn);
  padding: 8px;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Import Banner ── */
.import-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(139, 195, 74, 0.1);
  border-bottom: 1px solid var(--primary-dark);
  font-size: 13px;
  color: var(--text);
}
.import-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.import-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.import-banner-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}
.import-banner-item strong {
  color: var(--primary);
}
.import-banner-item .btn {
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state h2 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ── Connection Toast ── */
.toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.toast.visible { transform: translateY(0); }
.toast-warn { background: var(--amber); color: #000; }
.toast-ok { background: var(--primary); color: #000; }

/* ── Modal Backdrop ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-modal);
  width: 90%;
  max-width: 380px;
  padding: 20px;
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-backdrop.open .modal-content { transform: scale(1); }
.modal-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
}
.modal-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.modal-actions .btn { min-width: 80px; }

/* ── Launch Mode Picker ── */
.launch-mode-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0;
}
.launch-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card-bg);
  border-radius: var(--radius-btn);
  cursor: pointer;
}
.launch-mode-option:hover { background: var(--card-hover); }
.launch-mode-option input[type="radio"] {
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.launch-mode-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.launch-mode-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.launch-mode-desc {
  font-size: 11px;
  color: var(--text-muted);
}
.launch-mode-warning {
  font-size: 11px;
  color: var(--danger);
  font-style: italic;
}

/* ── Bottom-Sheet Drawer ── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 290;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--card-bg);
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-modal) var(--radius-modal) 0 0;
  max-height: 70vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer.open { transform: translateY(0); }
.drawer-handle {
  width: 40px;
  height: 4px;
  background: var(--elevated-bg);
  border-radius: 2px;
  margin: 12px auto 8px;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
}
.drawer-title {
  font-size: 16px;
  font-weight: 600;
}
.drawer-body { padding: 0 16px 16px; }

/* ── Form Elements ── */
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.form-input, .form-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-btn);
  color: var(--text);
  font-size: 14px;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23777' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.form-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
}
.form-input.invalid { border-color: var(--danger); }

/* ── Methodology Picker ── */
.meth-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.meth-pill {
  padding: 8px 16px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--elevated-bg);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.meth-pill:active { background: var(--elevated-bg); }
.meth-pill.selected {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(139, 195, 74, 0.08);
}
.meth-detail {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--elevated-bg);
  border-radius: 6px;
  font-size: 13px;
}
.meth-detail-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.meth-detail-desc {
  color: var(--text-muted);
  line-height: 1.4;
}
.meth-detail-phases {
  margin-top: 6px;
  color: var(--primary);
  font-size: 12px;
}

/* ── Template/Step Cards in Drawer ── */
.template-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  min-height: 44px;
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-btn);
  margin-bottom: 8px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 0.15s;
}
.template-option:active, .template-option.selected {
  border-color: var(--primary);
  background: rgba(139, 195, 74, 0.08);
}
.template-option:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.template-icon { font-size: 24px; flex-shrink: 0; }
.template-info { flex: 1; min-width: 0; }
.template-name { font-size: 14px; font-weight: 600; }
.template-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Steps Indicator ── */
.steps-row {
  display: flex;
  gap: 4px;
  padding: 0 16px 12px;
}
.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--elevated-bg);
  transition: background 0.15s;
}
.step-dot.active { background: var(--primary); }
.step-dot.done { background: var(--primary-dark); }

/* ── Password Input ── */
.password-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-btn);
  color: var(--text);
  font-size: 14px;
  font-family: monospace;
}
.password-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--elevated-bg);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
/* ── Global Settings Toggle ── */
.gs-toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  min-height: 44px;
  -webkit-user-select: none;
  user-select: none;
}
.gs-toggle-label input[type="checkbox"] { display: none; }
.gs-toggle-label .toggle-switch {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--elevated-bg);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.gs-toggle-label .toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s;
}
.gs-toggle-label input:checked + .toggle-switch {
  background: var(--primary);
}
.gs-toggle-label input:checked + .toggle-switch::after {
  transform: translateX(18px);
}
.gs-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 16px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--elevated-bg);
}
.gs-section-label:first-child { margin-top: 0; }

.hidden { display: none !important; }

/* ── Setup Wizard ── */
.setup-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 500;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.setup-overlay.open { display: flex; justify-content: center; align-items: flex-start; }
body.setup-active { overflow: hidden; }

.setup-container {
  width: 100%;
  max-width: 480px;
  padding: 16px;
  padding-top: env(safe-area-inset-top, 16px);
  padding-bottom: env(safe-area-inset-bottom, 16px);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.setup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.setup-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.setup-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.setup-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.setup-icon {
  text-align: center;
  padding: 24px 0 8px;
}
.setup-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.setup-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.setup-text-muted {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.setup-btn {
  width: 100%;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
}
.setup-nav {
  display: flex;
  gap: 8px;
}
.setup-nav .btn {
  flex: 1;
  min-height: 44px;
}

/* Wizard project list */
.setup-project-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 50vh;
  overflow-y: auto;
}
.setup-project-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card-bg);
  border-radius: var(--radius-btn);
  cursor: pointer;
  min-height: 44px;
  -webkit-user-select: none;
  user-select: none;
}
.setup-project-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.setup-project-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.setup-project-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.setup-project-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Wizard other-directories disclosure */
.setup-other-dirs {
  margin-top: 12px;
}
.setup-other-dirs-summary {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 0;
}
.setup-other-dirs .setup-project-list {
  max-height: 30vh;
}

/* Wizard engine list */
.setup-engine-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.setup-engine-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card-bg);
  border-radius: var(--radius-btn);
  min-height: 44px;
}
.setup-engine-available {
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  width: 20px;
  text-align: center;
}
.setup-engine-unavailable {
  color: var(--danger);
  font-size: 16px;
  font-weight: 700;
  width: 20px;
  text-align: center;
}
.setup-engine-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}
.setup-engine-status {
  font-size: 11px;
  color: var(--text-muted);
}

/* Wizard toggle */
.setup-toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  min-height: 44px;
  -webkit-user-select: none;
  user-select: none;
}
.setup-toggle-label input[type="checkbox"] { display: none; }
.toggle-switch {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--elevated-bg);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s;
}
.setup-toggle-label input:checked + .toggle-switch {
  background: var(--primary);
}
.setup-toggle-label input:checked + .toggle-switch::after {
  transform: translateX(18px);
}

/* Wizard summary */
.setup-summary {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 12px;
}
.setup-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--elevated-bg);
  min-height: 36px;
}
.setup-summary-row:last-child { border-bottom: none; }
.setup-summary-label {
  font-size: 13px;
  color: var(--text-muted);
}
.setup-summary-value {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── HTTPS Wizard Step ── */
.setup-https-loading {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}
.setup-https-status {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.setup-https-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.setup-https-badge-ok {
  background: rgba(139, 195, 74, 0.15);
  color: var(--primary);
}
.setup-https-badge-warn {
  background: rgba(239, 83, 80, 0.15);
  color: var(--danger);
}
.setup-https-modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.setup-https-mode {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--elevated-bg);
  border-radius: var(--radius-card);
  cursor: pointer;
}
.setup-https-mode.selected {
  border-color: var(--primary);
}
.setup-https-mode.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.setup-https-mode input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--primary);
}
.setup-https-mode-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.setup-https-mode-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.setup-https-mode-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.setup-https-panel {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-bottom: 12px;
}
.setup-https-success {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 10px;
}
.setup-https-kv {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  margin-bottom: 10px;
}
.setup-https-kv span {
  color: var(--text-muted);
  margin-right: 6px;
}
.setup-https-kv code {
  font-size: 12px;
  word-break: break-all;
}
.setup-https-subheading {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 6px;
}
.setup-https-trust-step {
  margin-bottom: 10px;
}
.setup-https-trust-label {
  font-size: 13px;
  margin-bottom: 4px;
}
.setup-https-code {
  background: var(--elevated-bg);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  overflow-x: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}
.setup-https-trust-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.setup-https-confirmed-row {
  color: var(--primary);
  font-weight: 500;
  margin-top: 10px;
}
.setup-https-warning {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--danger);
  background: rgba(239, 83, 80, 0.08);
}
.setup-https-warn-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.setup-https-warn-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.setup-https-restart-panel {
  text-align: center;
  padding: 24px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
