:root {
  --bg: #050711;
  --bg-soft: #101426;
  --line: #28314f;
  --text: #eef2ff;
  --muted: #a8b0cc;
  --brand: #5c7cfa;
  --brand-soft: #7f9bff;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #0f1a3f 0%, var(--bg) 45%, #04050a 100%);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.ambient-1 {
  background: #4c6ef5;
  top: -180px;
  inset-inline-start: -180px;
}

.ambient-2 {
  background: #14b8a6;
  bottom: -220px;
  inset-inline-end: -150px;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #3b5bdb);
  font-weight: 700;
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.4px;
}

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

button,
.primary-btn,
.ghost-btn,
.open-btn,
.copy-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.92rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand), #3857d9);
  color: white;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 600;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(92, 124, 250, 0.35);
}

.ghost-btn,
.copy-btn {
  background: rgba(22, 27, 48, 0.65);
  color: var(--text);
  border-color: var(--line);
  padding: 9px 13px;
}

.ghost-btn:hover,
.copy-btn:hover {
  border-color: var(--brand-soft);
}

.hero {
  background: linear-gradient(145deg, rgba(14, 19, 38, 0.92), rgba(12, 18, 36, 0.72));
  border: 1px solid rgba(82, 103, 180, 0.35);
  border-radius: 24px;
  padding: 28px;
  margin-bottom: 18px;
}

.hero-kicker {
  margin: 0 0 10px;
  color: #b6c3ff;
  font-size: 0.9rem;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.7;
}

.hero-meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-chip {
  border: 1px solid rgba(122, 142, 220, 0.45);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(56, 75, 138, 0.25);
  font-size: 0.82rem;
  color: #d6dfff;
}

.routes-panel,
.options-panel {
  background: rgba(10, 14, 30, 0.78);
  border: 1px solid rgba(76, 90, 142, 0.42);
  border-radius: 22px;
  padding: 18px;
}

.routes-panel {
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2,
.options-panel h2 {
  margin: 0;
  font-size: 1.2rem;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.summary-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: #c8d2ff;
  background: rgba(12, 18, 40, 0.7);
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: 10px;
}

.route-card {
  background: linear-gradient(160deg, rgba(17, 24, 47, 0.92), rgba(13, 19, 40, 0.8));
  border: 1px solid rgba(67, 82, 130, 0.5);
  border-radius: 16px;
  padding: 14px;
}

.route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.route-icon {
  font-size: 1.2rem;
}

.status-badge {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.72rem;
  border: 1px solid transparent;
}

.status-ok {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #8ff0b1;
}

.status-warn {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #ffd69b;
}

.status-err {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ffabab;
}

.status-checking {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(129, 140, 248, 0.35);
  color: #c9d0ff;
}

.route-card h3 {
  margin: 11px 0 7px;
  font-size: 1rem;
}

.route-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.route-path {
  font-family: "Courier New", monospace;
  font-size: 0.76rem;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(66, 82, 136, 0.5);
  background: rgba(5, 10, 25, 0.7);
  margin-bottom: 10px;
  overflow-x: auto;
  white-space: nowrap;
}

.card-actions {
  display: flex;
  gap: 7px;
}

.open-btn {
  flex: 1;
  text-decoration: none;
  text-align: center;
  background: rgba(92, 124, 250, 0.15);
  border: 1px solid rgba(92, 124, 250, 0.5);
  color: #d7e0ff;
  padding: 9px 12px;
}

.open-btn:hover {
  background: rgba(92, 124, 250, 0.27);
}

.options-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.option-card {
  border: 1px solid rgba(60, 79, 141, 0.45);
  border-radius: 14px;
  padding: 14px;
  background: rgba(12, 18, 38, 0.62);
}

.option-card h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.option-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.85rem;
}

.footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #9ea8c9;
  font-size: 0.85rem;
}

.saffio-panel {
  background: linear-gradient(145deg, rgba(14, 22, 45, 0.92), rgba(10, 16, 35, 0.82));
  border: 1px solid rgba(92, 124, 250, 0.3);
  border-radius: 22px;
  padding: 18px;
  margin-top: 16px;
}

.saffio-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.saffio-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.4rem;
  background: linear-gradient(135deg, rgba(92, 124, 250, 0.2), rgba(20, 184, 166, 0.15));
  border: 1px solid rgba(92, 124, 250, 0.25);
  flex-shrink: 0;
}

.saffio-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.saffio-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.saffio-role {
  margin-bottom: 14px;
}

.saffio-role p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.88rem;
}

.saffio-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.saffio-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(60, 79, 141, 0.35);
  background: rgba(12, 18, 38, 0.55);
  font-size: 0.84rem;
  color: #d6dfff;
}

.saffio-feature-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.footer a {
  color: #bccaff;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .shell {
    padding-inline: 12px;
  }

  .topbar,
  .panel-head,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  [dir="rtl"] .topbar,
  [dir="rtl"] .panel-head,
  [dir="rtl"] .footer {
    align-items: flex-end;
  }
}
