:root {
  color-scheme: dark;
  --bg: #071017;
  --panel: rgba(10, 17, 25, 0.90);
  --panel-2: rgba(13, 21, 30, 0.96);
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.22);
  --text: #edf4fb;
  --muted: #a0b2c0;
  --muted-2: #7f90a0;
  --accent: #78d6ff;
  --accent-2: #7fe0bf;
  --danger: #ff8594;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 16%, rgba(120, 214, 255, 0.10), transparent 22%),
    radial-gradient(circle at 88% 10%, rgba(127, 224, 191, 0.06), transparent 18%),
    linear-gradient(180deg, #040a10 0%, var(--bg) 44%, #09131b 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 100% 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 80%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-thumb {
  background: rgba(159, 180, 198, 0.24);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.app-shell {
  width: min(1520px, calc(100vw - 28px));
  margin: 14px auto 24px;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 16px;
}

.sidebar,
.card,
.hero,
.status-card,
.mini-card,
.branch-card,
.provider-card,
.form-panel,
.result-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent), var(--panel);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  padding: 16px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.012));
}

.brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(120, 214, 255, 0.96), rgba(127, 224, 191, 0.84));
  color: #041018;
  font-weight: 900;
  font-size: 1.4rem;
  box-shadow: 0 10px 22px rgba(120, 214, 255, 0.16);
}

.brand-kicker,
.eyebrow,
.metric-label,
.status-label,
.mini-label,
.sidebar-note-label,
.result-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent);
}

.brand-card h1 {
  margin: 6px 0 0;
  font-size: 1.18rem;
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  position: relative;
  padding: 11px 12px;
  border-radius: 14px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line);
  transform: translateX(1px);
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(8, 15, 23, 0.7);
}

.sidebar-note p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.main {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(9, 17, 26, 0.88);
  box-shadow: var(--shadow);
}

.topbar h2,
.section h3,
.hero h3,
.result-topline h4 {
  margin: 0;
  letter-spacing: -0.03em;
}

.topbar h2 {
  font-size: clamp(1.3rem, 2vw, 2rem);
}

.topbar-actions,
.button-row,
.copy-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border: 1px solid transparent;
  padding: 11px 14px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
  box-shadow: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #041018;
  background: linear-gradient(135deg, var(--accent), #9ae4ff 55%, #c2f2ff);
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.hero,
.card {
  border-radius: var(--radius-xl);
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
  padding: 22px;
  border-color: rgba(120, 214, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)), rgba(8, 17, 25, 0.94);
}

.hero h3 {
  font-size: clamp(1.65rem, 3vw, 2.8rem);
  line-height: 1.02;
  margin-bottom: 10px;
}

.lead,
.helper,
.status-card p,
.mini-card p,
.branch-card p,
.provider-card p,
.metric p,
.sidebar-note p,
.alert p {
  color: var(--muted);
  line-height: 1.5;
}

.lead {
  margin: 0 0 16px;
  max-width: 70ch;
  font-size: 1.02rem;
}

.status-stack,
.metrics-grid,
.branch-grid,
.provider-grid,
.result-grid,
.input-grid {
  display: grid;
  gap: 14px;
}

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

.status-card,
.mini-card,
.provider-card {
  border-radius: 16px;
  padding: 16px;
  background: rgba(8, 15, 23, 0.74);
}

.status-card strong,
.metric strong,
.mini-card strong,
.provider-card strong,
.branch-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.metric {
  border-radius: 18px;
  padding: 18px;
}

.metric strong {
  font-size: 1.42rem;
}

.section,
.card {
  padding: 20px;
}

.section-head,
.result-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-head h3 {
  margin-top: 4px;
  font-size: 1.24rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill-emerald {
  color: #97efc4;
  border-color: rgba(127, 224, 191, 0.22);
}

.branch-grid,
.provider-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.branch-card {
  border-radius: 16px;
  padding: 16px;
  background: rgba(8, 15, 23, 0.72);
}

.branch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.branch-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}

.branch-meta dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-2);
}

.branch-meta dd {
  margin: 6px 0 0;
  word-break: break-word;
  color: var(--text);
}

.split-layout,
.grid-two {
  display: grid;
  gap: 16px;
}

.split-layout {
  grid-template-columns: 0.92fr 1.08fr;
  margin-top: 16px;
}

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

.form-panel,
.result-panel {
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.form-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-panel input,
.form-panel select,
.form-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(7, 13, 21, 0.92);
  padding: 12px 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.form-panel input:focus,
.form-panel select:focus,
.form-panel textarea:focus {
  border-color: rgba(120, 214, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(120, 214, 255, 0.08);
}

.form-panel textarea {
  min-height: 170px;
  resize: vertical;
}

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

.helper {
  margin: -2px 0 0;
  font-size: 0.9rem;
}

.result-topline h4 {
  margin-top: 5px;
  font-size: 1.16rem;
}

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

.alert {
  border-radius: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 133, 148, 0.28);
  background: rgba(39, 9, 14, 0.84);
}

.alert strong {
  display: block;
  color: #ffd1d8;
  margin-bottom: 4px;
}

.alert-hidden {
  display: none;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.tab.active,
.tab:hover {
  color: var(--text);
  background: rgba(120, 214, 255, 0.11);
  border-color: rgba(120, 214, 255, 0.2);
  transform: translateY(-1px);
}

.code-view {
  margin: 0;
  min-height: 280px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(3, 8, 13, 0.72), rgba(5, 10, 16, 0.86));
  color: #d9e7f2;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

.code-view.compact {
  min-height: 220px;
}

.code-view.tall {
  min-height: 340px;
}

.reference-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.reference-meta {
  display: grid;
  gap: 14px;
}

.mini-card {
  border-radius: 16px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1260px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
  }

  .hero,
  .split-layout,
  .grid-two,
  .reference-layout,
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100vw - 16px, 1520px);
    margin: 8px auto 14px;
  }

  .topbar,
  .section,
  .card,
  .hero,
  .sidebar {
    border-radius: 18px;
  }

  .section-head,
  .result-topline,
  .branch-head,
  .topbar {
    flex-direction: column;
  }

  .branch-meta,
  .input-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .button-row,
  .hero-actions {
    width: 100%;
  }

  .btn,
  .tab {
    width: 100%;
    justify-content: center;
  }
}

