:root {
  color-scheme: dark;
  
  /* Curated Premium Color Palette (OKLCH) */
  --bg: oklch(13% 0.015 250);
  --bg-2: oklch(16% 0.02 248);
  --surface: oklch(19% 0.025 246);
  --surface-2: oklch(22% 0.03 245);
  --surface-3: oklch(26% 0.035 244);
  
  --text: oklch(96% 0.01 250);
  --muted: oklch(76% 0.025 250);
  --soft: oklch(62% 0.03 250);
  
  /* Glowing Brand Color: Deep Indigo/Neon Cyan Blend */
  --brand: oklch(80% 0.12 210);
  --brand-strong: oklch(84% 0.13 200);
  --brand-ink: oklch(14% 0.04 240);
  
  --good: oklch(78% 0.13 145);
  --bad: oklch(74% 0.15 25);
  --warn: oklch(82% 0.12 85);
  
  --line: oklch(28% 0.03 245);
  --line-strong: oklch(36% 0.04 245);
  
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 1px rgba(255, 255, 255, 0.05) inset;
  --radius: 16px;
  --radius-sm: 12px;
  --focus: 0 0 0 3px rgba(125, 211, 252, 0.25);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: 
    radial-gradient(circle at 15% 0%, rgba(56, 189, 248, 0.12), transparent 45rem),
    radial-gradient(circle at 85% 15%, rgba(129, 140, 248, 0.08), transparent 35rem);
  z-index: -1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--line-strong);
}

/* Typography & Headings */
h1, h2, h3, h4, p {
  margin-top: 0;
}

h1, h2, h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.3rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(120deg, var(--text) 30%, var(--brand) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.35rem;
  color: var(--text);
}

h3 {
  font-size: 1.15rem;
}

p {
  color: var(--muted);
  margin-bottom: 1rem;
}

.sub {
  font-size: 16px;
  color: var(--muted);
}

.kicker-container {
  margin-bottom: 8px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
}

.kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 10px var(--brand);
}

/* Buttons styling */
button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(125, 211, 252, 0.15);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
  border-color: var(--brand);
}

button.ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

button.ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button.danger {
  color: var(--bad);
}

button.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--bad);
}

button.sm {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
}

/* Primary Accent specific button */
.primary-accent {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: var(--brand-ink);
}

/* Inputs and Selects */
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: oklch(15% 0.02 245);
  color: var(--text);
  padding: 11px 14px;
  font-size: 14px;
  transition: all 0.2s ease;
}

input::placeholder {
  color: var(--soft);
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 0;
  border-color: var(--brand);
  box-shadow: var(--focus);
  background: oklch(17% 0.025 245);
}

/* Lock screen styling */
.lock {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lock-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
}

.lock-card h1 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.lock-desc {
  font-size: 14px;
  margin-bottom: 24px;
}

.pin-form {
  display: flex;
  gap: 12px;
}

.pin-form input {
  flex: 1;
}

.error {
  margin-top: 12px;
  color: var(--bad);
  font-size: 13px;
  font-weight: 500;
}

/* App Layout & Headers */
.app {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 40px 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Tabs Navigation Styling */
.tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.tabs-nav::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.tab-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-weight: 600;
  font-size: 14.5px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: auto;
}

.tab-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 0 0 1px var(--line) inset, 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tab-icon {
  font-size: 16px;
}

/* Grid & General layouts */
.grid {
  display: grid;
  gap: 16px;
}

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

.grid-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.panel-header-row h2 {
  margin: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.panel-head-clean {
  margin-bottom: 16px;
}

.hint {
  font-size: 13px;
  color: var(--soft);
  margin: 0;
}

/* Stats section */
.stats {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 28px;
}

.stats .card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-num {
  font-family: 'Outfit', sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  color: var(--brand);
  margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(125, 211, 252, 0.1);
}

.stats .muted {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

/* Lanes List Rendering */
.lanes-list {
  display: grid;
  gap: 12px;
}

.lane-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 24px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lane-card-row:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.disabled-row {
  opacity: 0.55;
  background: rgba(18, 22, 33, 0.4);
}

.lane-meta-info {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 0;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.indicator-green {
  background: var(--good);
  box-shadow: 0 0 10px var(--good);
}

.indicator-gray {
  background: var(--muted);
  opacity: 0.5;
}

.lane-core-data {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.lane-header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lane-display-name {
  font-family: 'Outfit', sans-serif;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text);
}

.provider-type-badge {
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.lane-display-url {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.lane-meta-right {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.lane-stat-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 11px;
  color: var(--soft);
}

.lane-stat-badge .badge-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
}

.lane-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Custom switch toggle */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--surface-3);
  border: 1px solid var(--line);
  transition: .25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text);
  transition: .25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--good);
  border-color: var(--good);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
  background-color: var(--bg-2);
}

.empty-state {
  text-align: center;
  padding: 40px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
}

/* Settings Form elements */
.settings {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.settings-toggles {
  grid-column: 1 / -1;
  display: flex;
  gap: 24px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  flex-wrap: wrap;
}

.switch-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.switch-toggle-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* Generated config output (Code & Pre blocks) */
pre {
  white-space: pre-wrap;
  word-break: break-all;
  background: oklch(10% 0.015 250);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  max-height: 480px;
  overflow: auto;
  color: oklch(90% 0.02 180);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.wrap {
  flex-wrap: wrap;
}

/* Playbooks and deployment sections */
.providers {
  display: grid;
  gap: 16px;
}

.provider-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.provider-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.provider-title {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  color: var(--text);
  font-size: 16px;
}

.provider-docs {
  font-size: 12px;
  color: var(--soft);
  margin-bottom: 12px;
}

.provider-runner-action {
  margin-top: 14px;
}

.badge {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-3);
  text-transform: uppercase;
}

/* Probing results & cards */
.probe-results {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.probe-result-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.probe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.probe-header strong {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  color: var(--text);
}

.status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.badge-ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--good);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-fail {
  background: rgba(239, 68, 68, 0.15);
  color: var(--bad);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.probe-detail-text {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.error-msg {
  color: var(--bad);
}

.success-text {
  color: var(--good);
}

.success-deploy-card {
  border-color: var(--good);
  background: rgba(34, 197, 94, 0.02);
}

.error-deploy-card {
  border-color: var(--bad);
  background: rgba(239, 68, 68, 0.02);
}

/* Modal Dialog Styles (Native HTML5 <dialog>) */
.modal-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  background: transparent;
  max-width: 520px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow);
  overflow: visible;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 100;
}

.modal-dialog::backdrop {
  background: rgba(6, 8, 12, 0.85);
  backdrop-filter: blur(8px);
}

/* Native dialog entry animation */
.modal-dialog[open] {
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from {
    transform: translate(-50%, -46%) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.modal-header h3 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  color: var(--text);
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  min-height: auto;
  line-height: 1;
  font-weight: 300;
  transition: color 0.2s ease;
}

.close-modal-btn:hover {
  color: var(--text);
  background: transparent;
}

.modal-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.field-hint {
  font-size: 11px;
  color: var(--soft);
  margin-top: 2px;
}

.form-group-checkbox {
  margin-top: 8px;
}

.switch-container {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.switch-container input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.switch-label {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.modal-footer button {
  min-height: 40px;
}

.submit-modal-btn {
  background: var(--brand);
  color: var(--brand-ink);
}

/* Responsive Overrides */
@media (max-width: 980px) {
  .hero {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }
  
  .hero-actions {
    justify-content: flex-start;
  }
  
  .two, .stats, .grid-split, .settings {
    grid-template-columns: 1fr;
  }
  
  .lane-card-row {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .lane-meta-right {
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 12px;
  }
  
  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .tabs-nav {
    margin-inline: -24px;
    padding-inline: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Optimized Probes & Playbooks UX Styles */

/* Modal layout variants */
.modal-large {
  max-width: 800px;
}

/* Console/Terminal Window Styles */
.console-modal {
  background: #0f141f;
  border-color: #1e293b;
}

.console-body {
  padding: 16px;
  background: #0b0f17;
  overflow: hidden;
}

.console-terminal {
  background: #06090f;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 18px;
  min-height: 320px;
  max-height: 480px;
  overflow-y: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: #10b981; /* terminal green */
}

/* Scrollbar for terminal console */
.console-terminal::-webkit-scrollbar {
  width: 8px;
}
.console-terminal::-webkit-scrollbar-track {
  background: #06090f;
}
.console-terminal::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

.console-line {
  margin-bottom: 6px;
  white-space: pre-wrap;
  word-break: break-all;
}

.console-line.input {
  color: #38bdf8; /* light blue for command line */
}

.console-line.error {
  color: #f87171; /* red for errors */
}

.console-line.success {
  color: #34d399; /* emerald for successes */
}

.console-line.info {
  color: #fbbf24; /* yellow/amber for info */
}

.console-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #10b981;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 4px;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Accordion playbooks style */
.accordion {
  width: 100%;
}

.accordion-item {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.accordion-item:hover {
  border-color: var(--line-strong);
}

.accordion-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: var(--surface-2);
  user-select: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text);
}

.accordion-header h3 {
  margin: 0;
  font-size: 15.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-arrow {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.accordion-item.active .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding: 20px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.accordion-item.active .accordion-content {
  display: block;
}

/* Grid layout polish for probes split */
.grid-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: start;
}

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