:root {
  color-scheme: dark;
  --bg: #05090f;
  --bg-deep: #02050a;
  --panel: rgba(11, 20, 31, 0.88);
  --panel-solid: #0b141f;
  --panel-raised: #111d2a;
  --panel-soft: rgba(20, 33, 47, 0.58);
  --line: rgba(154, 187, 213, 0.14);
  --line-strong: rgba(126, 221, 255, 0.34);
  --text: #eef7fb;
  --muted: #91a5b5;
  --faint: #5d7181;
  --cyan: #66d9ff;
  --cyan-strong: #16bce9;
  --cyan-wash: rgba(55, 199, 241, 0.11);
  --amber: #ffca6b;
  --green: #64e6a4;
  --red: #ff7d88;
  --violet: #a99cff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --sidebar: 252px;
  --content-max: 1480px;
  --font-display: "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-deep);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(
      circle at 78% -12%,
      rgba(25, 125, 164, 0.2),
      transparent 32rem
    ),
    radial-gradient(
      circle at 38% 110%,
      rgba(36, 87, 124, 0.12),
      transparent 38rem
    ),
    linear-gradient(145deg, #07101a 0%, var(--bg) 42%, #04080d 100%);
  font-family: var(--font-body);
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.2;
  background-image: linear-gradient(
      rgba(106, 184, 215, 0.06) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(106, 184, 215, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

a {
  color: inherit;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

[hidden],
.hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar);
  padding: 24px 18px 18px;
  flex-direction: column;
  background: rgba(4, 10, 16, 0.93);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 10px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: var(--cyan);
  border: 1px solid var(--line-strong);
  border-radius: 12px 3px 12px 3px;
  background: linear-gradient(
    145deg,
    rgba(44, 203, 250, 0.18),
    rgba(44, 203, 250, 0.02)
  );
  box-shadow:
    inset 0 0 18px rgba(77, 207, 247, 0.08),
    0 0 24px rgba(31, 177, 221, 0.08);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -2px;
}

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.sidebar-rule {
  height: 1px;
  margin: 22px 8px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

.nav-group + .nav-group {
  margin-top: 22px;
}

.nav-label {
  display: block;
  margin: 0 12px 8px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 12px;
  padding: 0 12px;
  overflow: hidden;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.nav-link::after {
  position: absolute;
  top: 10px;
  right: -1px;
  bottom: 10px;
  width: 2px;
  content: "";
  opacity: 0;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
}

.nav-link.active {
  color: var(--text);
  border-color: rgba(87, 207, 245, 0.15);
  background: linear-gradient(
    90deg,
    rgba(50, 190, 235, 0.13),
    rgba(50, 190, 235, 0.02)
  );
}

.nav-link.active::after {
  opacity: 1;
}

.nav-index {
  width: 24px;
  color: var(--faint);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.nav-link.active .nav-index {
  color: var(--cyan);
}

.sidebar-spacer {
  flex: 1;
  min-height: 18px;
}

.pilot-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.pilot-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pilot-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: var(--cyan);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--cyan-wash);
  font-size: 11px;
  font-weight: 800;
}

.pilot-meta {
  min-width: 0;
  flex: 1;
}

.pilot-meta strong,
.pilot-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pilot-meta strong {
  font-size: 12px;
}

.pilot-meta span {
  color: var(--faint);
  font-size: 10px;
}

.main-stage {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 72px;
  padding: 0 clamp(22px, 4vw, 58px);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 10, 16, 0.72);
  backdrop-filter: blur(18px);
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--faint);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.topbar-context strong {
  color: var(--text);
  font-weight: 700;
}

.system-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(100, 230, 164, 0.8);
}

.state-dot.degraded {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(255, 202, 107, 0.7);
}

.mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.mobile-toggle span,
.mobile-toggle span::before,
.mobile-toggle span::after {
  display: block;
  width: 16px;
  height: 1px;
  content: "";
  background: currentColor;
}

.mobile-toggle span::before {
  transform: translateY(-5px);
}
.mobile-toggle span::after {
  transform: translateY(4px);
}

.page {
  width: min(100%, var(--content-max));
  min-height: calc(100vh - 128px);
  margin: 0 auto;
  padding: clamp(26px, 4.5vw, 64px) clamp(22px, 4vw, 58px) 72px;
  animation: page-in 380ms ease both;
}

.page-footer {
  display: flex;
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 0 clamp(22px, 4vw, 58px) 28px;
  justify-content: space-between;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--cyan);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 18px;
  height: 1px;
  content: "";
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.page-heading {
  display: flex;
  margin-bottom: 30px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-heading h1,
.hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(35px, 5vw, 64px);
  font-stretch: condensed;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-wrap: balance;
}

.page-heading h1 {
  font-size: clamp(32px, 4vw, 52px);
}

.page-heading p,
.hero-copy {
  max-width: 690px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.hero {
  position: relative;
  display: grid;
  min-height: 360px;
  margin-bottom: 24px;
  padding: clamp(28px, 5vw, 62px);
  overflow: hidden;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(
      100deg,
      rgba(7, 15, 24, 0.97) 15%,
      rgba(7, 15, 24, 0.65) 70%,
      rgba(16, 82, 107, 0.18)
    ),
    radial-gradient(
      circle at 90% 0,
      rgba(79, 205, 245, 0.21),
      transparent 34rem
    ),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.hero::before {
  top: 35px;
  right: clamp(20px, 6vw, 90px);
  width: clamp(160px, 28vw, 360px);
  aspect-ratio: 1;
  opacity: 0.5;
  border: 1px solid rgba(93, 217, 255, 0.24);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 25px rgba(78, 199, 237, 0.015),
    inset 0 0 0 26px rgba(93, 217, 255, 0.12),
    inset 0 0 0 74px rgba(78, 199, 237, 0.01),
    inset 0 0 0 75px rgba(93, 217, 255, 0.09);
}

.hero::after {
  top: 50%;
  right: clamp(80px, 18vw, 245px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 24px var(--cyan);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.actions {
  display: flex;
  margin-top: 26px;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  min-height: 42px;
  padding: 0 17px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.035em;
  text-decoration: none;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.btn:hover {
  border-color: rgba(130, 216, 244, 0.38);
  background: rgba(255, 255, 255, 0.065);
  transform: translateY(-1px);
}

.btn-primary {
  color: #02131b;
  border-color: var(--cyan);
  background: linear-gradient(135deg, #78e2ff, #31c4ed);
  box-shadow: 0 8px 28px rgba(41, 194, 235, 0.18);
}

.btn-primary:hover {
  border-color: #a7edff;
  background: linear-gradient(135deg, #9aeaff, #4ed5fb);
  box-shadow: 0 10px 32px rgba(41, 194, 235, 0.28);
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  color: var(--red);
  border-color: rgba(255, 125, 136, 0.3);
  background: rgba(255, 125, 136, 0.06);
}

.btn-small {
  min-height: 34px;
  padding-inline: 12px;
  font-size: 10px;
}

.btn-icon {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid-wide {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
}

.card {
  position: relative;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    145deg,
    rgba(16, 28, 40, 0.82),
    rgba(8, 15, 23, 0.9)
  );
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

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

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.015em;
}

.card-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.metric-card {
  min-height: 142px;
  padding: 21px;
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.metric-note {
  display: block;
  margin-top: 10px;
  color: var(--faint);
  font-size: 11px;
}

.metric-glyph {
  color: var(--cyan);
  font-family: ui-monospace, monospace;
}

.section {
  margin-top: 24px;
}

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

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
}

.section-head a {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

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

.field {
  grid-column: span 12;
}

.field.half {
  grid-column: span 6;
}
.field.third {
  grid-column: span 4;
}
.field.two-thirds {
  grid-column: span 8;
}
.field.quarter {
  grid-column: span 3;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(2, 7, 12, 0.55);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.input::placeholder,
.textarea::placeholder {
  color: #526575;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--line-strong);
  outline: none;
  background: rgba(4, 11, 17, 0.82);
  box-shadow: 0 0 0 3px rgba(58, 201, 243, 0.07);
}

.textarea {
  min-height: 104px;
  resize: vertical;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  font-size: 10px;
}

.switch-row {
  display: flex;
  min-height: 44px;
  padding: 0 12px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(2, 7, 12, 0.38);
}

.switch-row input {
  accent-color: var(--cyan-strong);
}

.switch-row label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.search-shell {
  position: relative;
}

.search-shell .input {
  min-height: 54px;
  padding-right: 130px;
  padding-left: 45px;
  font-size: 14px;
}

.search-shell::before {
  position: absolute;
  top: 50%;
  left: 17px;
  z-index: 2;
  content: "⌕";
  color: var(--cyan);
  font-size: 22px;
  transform: translateY(-56%);
}

.search-shell .btn {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 42px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(2, 7, 12, 0.45);
}

.segment {
  min-height: 32px;
  padding: 0 12px;
  cursor: pointer;
  color: var(--muted);
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.segment.active {
  color: var(--text);
  background: var(--panel-raised);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table th {
  color: var(--faint);
  background: rgba(255, 255, 255, 0.018);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.data-table tbody tr {
  transition: background 120ms ease;
}

.data-table tbody tr:hover {
  background: rgba(63, 192, 232, 0.035);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.num {
  font-variant-numeric: tabular-nums;
}

.text-right {
  text-align: right !important;
}
.text-cyan {
  color: var(--cyan) !important;
}
.text-green {
  color: var(--green) !important;
}
.text-amber {
  color: var(--amber) !important;
}
.text-red {
  color: var(--red) !important;
}
.text-muted {
  color: var(--muted) !important;
}

.badge {
  display: inline-flex;
  min-height: 23px;
  padding: 0 8px;
  align-items: center;
  gap: 6px;
  color: var(--cyan);
  border: 1px solid rgba(89, 210, 247, 0.2);
  border-radius: 999px;
  background: rgba(69, 200, 240, 0.07);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge::before {
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: currentColor;
}

.badge.green {
  color: var(--green);
  border-color: rgba(100, 230, 164, 0.2);
  background: rgba(100, 230, 164, 0.06);
}
.badge.amber {
  color: var(--amber);
  border-color: rgba(255, 202, 107, 0.2);
  background: rgba(255, 202, 107, 0.06);
}
.badge.red {
  color: var(--red);
  border-color: rgba(255, 125, 136, 0.2);
  background: rgba(255, 125, 136, 0.06);
}
.badge.violet {
  color: var(--violet);
  border-color: rgba(169, 156, 255, 0.2);
  background: rgba(169, 156, 255, 0.06);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.result-card {
  position: relative;
  display: flex;
  min-height: 238px;
  padding: 21px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    150deg,
    rgba(17, 31, 45, 0.84),
    rgba(7, 14, 22, 0.92)
  );
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.result-card::after {
  position: absolute;
  top: -38px;
  right: -38px;
  width: 110px;
  height: 110px;
  content: "";
  opacity: 0.45;
  border: 1px solid rgba(85, 205, 244, 0.14);
  border-radius: 50%;
}

.result-card:hover {
  border-color: rgba(102, 217, 255, 0.3);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.26);
  transform: translateY(-3px);
}

.result-card h3 {
  margin: 14px 0 7px;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.1;
}

.result-eyebrow {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.result-description {
  display: -webkit-box;
  margin: 0 0 18px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.result-meta {
  display: flex;
  margin-top: auto;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 4px 7px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 9px;
  text-transform: uppercase;
}

.stretched-link::after {
  position: absolute;
  inset: 0;
  content: "";
}

.list-stack {
  display: grid;
  gap: 9px;
}

.list-row {
  display: flex;
  min-height: 58px;
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.list-row-main {
  min-width: 0;
}

.list-row-main strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row-main span {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 10px;
}

.empty-state,
.loading-state {
  display: grid;
  min-height: 190px;
  padding: 28px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 13px;
}

.loading-bar {
  width: 110px;
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.loading-bar::after {
  display: block;
  width: 50%;
  height: 100%;
  content: "";
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: scan 900ms infinite ease-in-out;
}

@keyframes scan {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(220%);
  }
}

.auth-layout {
  display: grid;
  min-height: 620px;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.72fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-visual {
  position: relative;
  display: flex;
  padding: clamp(32px, 6vw, 74px);
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: radial-gradient(
      circle at 55% 22%,
      rgba(55, 193, 234, 0.2),
      transparent 21rem
    ),
    linear-gradient(145deg, rgba(8, 21, 32, 0.7), rgba(3, 8, 13, 0.98));
}

.auth-visual::before {
  position: absolute;
  top: 12%;
  left: 18%;
  width: 55%;
  aspect-ratio: 1;
  content: "";
  opacity: 0.64;
  border: 1px solid rgba(108, 218, 253, 0.22);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 42px rgba(87, 212, 250, 0.018),
    inset 0 0 0 43px rgba(87, 212, 250, 0.11),
    inset 0 0 0 112px rgba(87, 212, 250, 0.01),
    inset 0 0 0 113px rgba(87, 212, 250, 0.09),
    0 0 80px rgba(37, 165, 206, 0.08);
}

.auth-copy {
  position: relative;
  z-index: 2;
}

.auth-copy h1 {
  max-width: 600px;
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 62px);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.auth-copy p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.auth-panel {
  padding: clamp(30px, 5vw, 58px);
  border-left: 1px solid var(--line);
  background: rgba(5, 11, 18, 0.72);
}

.tabs {
  display: flex;
  margin-bottom: 28px;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  padding: 0 0 12px;
  cursor: pointer;
  color: var(--faint);
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tab.active {
  color: var(--text);
}

.tab.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.profile-header {
  display: flex;
  margin-bottom: 24px;
  align-items: center;
  gap: 18px;
}

.profile-avatar {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  color: var(--cyan);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--cyan-wash);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
}

.profile-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
}

.profile-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.definition-list {
  display: grid;
  margin: 0;
  grid-template-columns: 130px 1fr;
  border-top: 1px solid var(--line);
}

.definition-list dt,
.definition-list dd {
  margin: 0;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.definition-list dt {
  color: var(--faint);
}
.definition-list dd {
  color: var(--text);
}

.route-rank {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--cyan);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--cyan-wash);
  font-family: ui-monospace, monospace;
  font-size: 10px;
}

.route-path {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.route-arrow {
  color: var(--cyan);
}

.operation-card {
  cursor: pointer;
}

.operation-card:hover {
  border-color: rgba(102, 217, 255, 0.28);
}

.operation-meta {
  display: grid;
  margin: 18px 0 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.operation-meta div {
  padding: 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.operation-meta span,
.operation-meta strong {
  display: block;
}

.operation-meta span {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.operation-meta strong {
  margin-top: 3px;
  font-size: 11px;
}

.leg-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.018);
}

.leg-title {
  display: flex;
  margin-bottom: 15px;
  align-items: center;
  justify-content: space-between;
}

.leg-title h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
}

.notice {
  padding: 13px 15px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 11px;
}

.notice.error {
  color: #ffc0c6;
  border-color: rgba(255, 125, 136, 0.25);
  background: rgba(255, 125, 136, 0.06);
}

.notice.success {
  color: #a4f5cc;
  border-color: rgba(100, 230, 164, 0.25);
  background: rgba(100, 230, 164, 0.06);
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: grid;
  width: min(360px, calc(100vw - 44px));
  gap: 8px;
}

.toast {
  padding: 14px 16px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(9, 19, 28, 0.96);
  box-shadow: var(--shadow);
  font-size: 12px;
  animation: toast-in 180ms ease both;
}

.toast.error {
  border-color: rgba(255, 125, 136, 0.4);
}
.toast.success {
  border-color: rgba(100, 230, 164, 0.4);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  padding: 20px;
  overflow-y: auto;
  place-items: center;
  background: rgba(0, 4, 8, 0.74);
  backdrop-filter: blur(10px);
}

.modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  padding: 26px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  margin-bottom: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
}

.code-block {
  margin: 0;
  padding: 15px;
  overflow: auto;
  color: #bad4df;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #03080c;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 11px;
}

.overlay {
  display: none;
}

@media (max-width: 1180px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-wide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }
  .main-stage {
    grid-column: auto;
  }
  .sidebar {
    width: min(290px, 86vw);
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  .overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 4, 8, 0.62);
    backdrop-filter: blur(5px);
  }
  body.nav-open .overlay {
    display: block;
  }
  .mobile-toggle {
    display: grid;
  }
  .topbar {
    height: 64px;
  }
  .topbar-context {
    margin-right: auto;
    margin-left: 14px;
  }
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    min-height: 350px;
  }
  .auth-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .page {
    padding-top: 30px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .hero {
    min-height: 430px;
    padding: 28px;
    align-items: flex-end;
  }
  .hero::before {
    top: 25px;
    right: 25px;
    width: 220px;
  }
  .hero h1 {
    font-size: 42px;
  }
  .grid-2,
  .grid-3,
  .grid-4,
  .result-grid {
    grid-template-columns: 1fr;
  }
  .field.half,
  .field.third,
  .field.two-thirds,
  .field.quarter {
    grid-column: span 12;
  }
  .card {
    padding: 19px;
  }
  .page-footer {
    display: grid;
    gap: 5px;
  }
  .system-state span:last-child {
    display: none;
  }
  .topbar-context span {
    display: none;
  }
  .search-shell .input {
    padding-right: 16px;
  }
  .search-shell .btn {
    position: static;
    width: 100%;
    margin-top: 9px;
  }
  .definition-list {
    grid-template-columns: 110px 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
