:root {
  --bg-top: #f8f1df;
  --bg-bottom: #dbeeff;
  --panel: rgba(255, 251, 244, 0.88);
  --panel-strong: rgba(255, 248, 237, 0.96);
  --line: rgba(18, 55, 82, 0.12);
  --text: #133247;
  --muted: #4d6b7d;
  --accent: #ff7a32;
  --accent-strong: #ea5e15;
  --sea: #0b7fa3;
  --danger: #c64b44;
  --safe: #2f8d53;
  --shadow: 0 24px 70px rgba(19, 50, 71, 0.18);
  --led-bg: #111317;
  --led-panel: rgba(17, 19, 23, 0.94);
  --led-line: rgba(255, 210, 140, 0.12);
  --led-text: #f4efe5;
  --led-dim: #b6ab98;
  --led-glow: rgba(255, 218, 166, 0.18);
  --led-warn: #ffc36f;
  --led-hot: #ff7f70;
  --led-cool: #8ec7d8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 122, 50, 0.24), transparent 32%),
    radial-gradient(circle at bottom right, rgba(11, 127, 163, 0.22), transparent 34%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(19, 50, 71, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 50, 71, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

.shell {
  position: relative;
  width: min(960px, calc(100vw - 32px));
  margin: 24px auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.topbar,
.footer,
.guidance-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  padding: 4px 2px 16px;
}

.mode-view,
.navigation-panel {
  display: grid;
  gap: 16px;
}

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

.brand,
.status,
.beacon-chip,
.availability-pill,
.info-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.brand {
  background: rgba(19, 50, 71, 0.08);
}

.status {
  background: rgba(47, 141, 83, 0.14);
  color: var(--safe);
}

.status[data-state="offline"] {
  background: rgba(198, 75, 68, 0.14);
  color: var(--danger);
}

.info-button {
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
}

.info-panel {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.info-panel strong {
  color: var(--text);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: 0.95;
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.navigation-kicker,
.navigation-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.navigation-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.navigation-copy,
.navigation-note,
.navigation-beacon {
  color: var(--muted);
  line-height: 1.5;
}

.search-state,
.guidance-list,
.destination-selector,
.navigation-shell {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-strong);
}

.search-state {
  display: grid;
  justify-items: center;
  gap: 20px;
  min-height: 280px;
  align-content: center;
}

.scanner {
  position: relative;
  width: 160px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.scanner__pulse,
.scanner__core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.scanner__pulse {
  border: 2px solid rgba(11, 127, 163, 0.28);
  animation: pulse 2.2s infinite ease-out;
}

.scanner__pulse::before,
.scanner__pulse::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 2px solid rgba(11, 127, 163, 0.2);
}

.scanner__pulse::after {
  inset: 35%;
}

.scanner__core {
  inset: 38%;
  background: linear-gradient(135deg, var(--accent), var(--sea));
  box-shadow: 0 0 0 16px rgba(255, 122, 50, 0.12);
}

.search-state__text {
  font-size: 1.2rem;
  font-weight: 700;
}

.guidance-list {
  display: grid;
  gap: 20px;
}

.destination-selector,
.navigation-shell {
  display: grid;
  gap: 18px;
}

.destination-selector__grid {
  display: grid;
  gap: 12px;
}

.destination-button,
.navigation-reset,
.mode-switch-button {
  border: none;
  font: inherit;
  cursor: pointer;
}

.destination-button {
  width: 100%;
  padding: 18px 20px;
  border-radius: 18px;
  text-align: left;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(19, 50, 71, 0.08);
}

.navigation-shell__head,
.navigation-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.navigation-reset {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(19, 50, 71, 0.08);
  color: var(--text);
  font-weight: 700;
}

.navigation-update-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 122, 50, 0.14);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: route-update-pill 1.4s ease-out;
}

.navigation-summary {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(19, 50, 71, 0.08);
}

.navigation-summary__side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.navigation-summary__main {
  display: grid;
  gap: 12px;
}

.navigation-current-point {
  display: grid;
  gap: 4px;
}

.navigation-point {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--muted);
}

.navigation-zone {
  font-size: 1.45rem;
  font-weight: 700;
}

.navigation-shell--rerouted .navigation-zone,
.navigation-shell--rerouted .navigation-direction,
.navigation-shell--rerouted .navigation-count {
  animation: route-reroute-flash 1.4s ease-out;
}

.navigation-shell--rerouted .navigation-direction__arrow {
  animation: route-arrow-pop 1.1s ease-out;
}

.navigation-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(47, 141, 83, 0.16);
  color: var(--safe);
  font-size: 1.2rem;
  font-weight: 700;
}

.navigation-count[data-level="0"] {
  background: rgba(198, 75, 68, 0.14);
  color: var(--danger);
}

.navigation-direction {
  display: grid;
  justify-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(19, 50, 71, 0.08);
  text-align: center;
}

.navigation-direction__arrow {
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(255, 122, 50, 0.18), rgba(11, 127, 163, 0.18));
  font-size: 4.4rem;
  font-weight: 700;
}

.navigation-direction__arrow--problem {
  background: rgba(198, 75, 68, 0.12);
  color: var(--danger);
}

.navigation-direction__copy {
  max-width: 24ch;
  font-size: 1.18rem;
  line-height: 1.45;
}

.search-state--compact {
  min-height: 220px;
}

.mode-switch-button {
  width: 100%;
  margin-top: 18px;
  padding: 20px 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 122, 50, 0.88), rgba(11, 127, 163, 0.86));
  color: #fff7ec;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 16px 30px rgba(19, 50, 71, 0.18);
}

.beacon-chip {
  background: rgba(255, 122, 50, 0.16);
  color: var(--accent-strong);
}

.items {
  display: grid;
  gap: 14px;
}

.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(19, 50, 71, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.item__body {
  min-width: 0;
}

.item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(19, 50, 71, 0.12);
}

.item__icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 122, 50, 0.18), rgba(11, 127, 163, 0.18));
  font-size: 2rem;
  font-weight: 700;
}

.item__name {
  font-size: 1.35rem;
  font-weight: 700;
}

.item__meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.98rem;
}

.item__badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.availability-pill[data-level="0"] {
  background: rgba(198, 75, 68, 0.14);
  color: var(--danger);
}

.availability-pill[data-level="available"] {
  background: rgba(255, 122, 50, 0.16);
  color: var(--accent-strong);
}

.availability-pill[data-level="many"] {
  background: rgba(47, 141, 83, 0.16);
  color: var(--safe);
}

.footer {
  margin-top: 18px;
  padding: 4px 2px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.hidden {
  display: none;
}

@keyframes pulse {
  0% {
    transform: scale(0.74);
    opacity: 0.2;
  }

  70% {
    transform: scale(1.06);
    opacity: 1;
  }

  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

@keyframes route-reroute-flash {
  0% {
    transform: scale(0.98);
    box-shadow: 0 0 0 rgba(255, 122, 50, 0);
    opacity: 0.5;
  }

  35% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px rgba(255, 122, 50, 0.12);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 122, 50, 0);
    opacity: 1;
  }
}

@keyframes route-arrow-pop {
  0% {
    transform: scale(0.9);
  }

  40% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes route-update-pill {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }

  30% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at top, rgba(255, 195, 111, 0.08), transparent 24%),
      radial-gradient(circle at bottom, rgba(142, 199, 216, 0.07), transparent 30%),
      linear-gradient(180deg, #171a1f, #101318 34%, #0d1014);
    color: var(--led-text);
  }

  body::before {
    background-image:
      radial-gradient(circle, rgba(255, 233, 199, 0.08) 0.6px, transparent 0.8px),
      linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 9px 9px, 100% 4px;
    opacity: 0.38;
  }

  .shell {
    width: 100%;
    min-height: 100svh;
    margin: 0;
    padding: 14px 12px calc(16px + env(safe-area-inset-bottom));
    border: none;
    border-radius: 0;
    background:
      linear-gradient(180deg, rgba(20, 23, 28, 0.98), rgba(12, 14, 18, 0.98)),
      linear-gradient(180deg, rgba(255, 195, 111, 0.03), transparent);
    box-shadow: none;
    backdrop-filter: none;
  }

  .topbar,
  .guidance-list__header,
  .footer {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .topbar,
  .guidance-list__header,
  .footer {
    display: grid;
    gap: 10px;
  }

  .topbar {
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 4px 2px 12px;
  }

  .topbar__actions {
    justify-self: end;
  }

  .brand,
  .status,
  .beacon-chip,
  .info-button {
    padding: 8px 10px;
    border: 1px solid var(--led-line);
    background: rgba(24, 27, 33, 0.88);
    color: var(--led-dim);
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.32);
  }

  .info-button {
    width: 36px;
    height: 36px;
    padding: 0;
  }

  .info-panel {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--led-line);
    background: rgba(24, 27, 33, 0.92);
    color: var(--led-dim);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.28);
  }

  .info-panel strong {
    color: var(--led-text);
  }

  .status {
    color: var(--led-cool);
  }

  .status[data-state="offline"] {
    color: var(--led-hot);
    background: rgba(45, 17, 17, 0.78);
    border-color: rgba(255, 116, 103, 0.28);
  }

  .footer {
    color: var(--led-dim);
  }

  h2 {
    color: var(--led-text);
    text-shadow: 0 0 6px rgba(255, 218, 166, 0.08);
  }

  .search-state,
  .guidance-list,
  .destination-selector,
  .navigation-shell {
    position: relative;
    padding: 16px 14px;
    border-radius: 20px;
    border: 1px solid var(--led-line);
    background:
      linear-gradient(180deg, rgba(24, 27, 33, 0.96), rgba(14, 16, 20, 0.96)),
      radial-gradient(circle at top, rgba(255, 195, 111, 0.03), transparent 45%);
    box-shadow:
      inset 0 0 22px rgba(0, 0, 0, 0.42),
      0 0 14px rgba(255, 195, 111, 0.05);
    overflow: hidden;
  }

  .search-state::before,
  .guidance-list::before,
  .destination-selector::before,
  .navigation-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle, rgba(255, 238, 213, 0.08) 0.7px, transparent 0.8px);
    background-size: 9px 9px;
    opacity: 0.18;
    pointer-events: none;
  }

  .search-state {
    min-height: 240px;
  }

  .scanner__pulse {
    border-color: rgba(255, 195, 111, 0.24);
  }

  .scanner__pulse::before,
  .scanner__pulse::after {
    border-color: rgba(255, 195, 111, 0.12);
  }

  .scanner__core {
    background: linear-gradient(135deg, var(--led-warn), #f4efe5);
    box-shadow: 0 0 0 12px rgba(255, 195, 111, 0.06);
  }

  .search-state__text {
    font-family: "Consolas", "Lucida Console", monospace;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--led-text);
    text-shadow: 0 0 6px rgba(255, 218, 166, 0.14);
  }

  .guidance-list {
    gap: 14px;
  }

  .destination-selector,
  .navigation-shell {
    gap: 14px;
  }

  .destination-button,
  .navigation-reset,
  .mode-switch-button {
    border: 1px solid var(--led-line);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.28);
  }

  .destination-button {
    padding: 18px 16px;
    border-radius: 16px;
    background: rgba(28, 31, 36, 0.94);
    color: var(--led-text);
    font-family: "Consolas", "Lucida Console", monospace;
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .navigation-title {
    font-size: clamp(1.6rem, 7vw, 2.3rem);
    color: var(--led-text);
    text-shadow: 0 0 6px rgba(255, 218, 166, 0.08);
  }

  .navigation-kicker,
  .navigation-label,
  .navigation-copy,
  .navigation-note,
  .navigation-beacon {
    color: var(--led-dim);
  }

  .navigation-shell__head,
  .navigation-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .navigation-reset {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(32, 35, 41, 0.96);
    color: var(--led-text);
  }

  .navigation-update-pill {
    background: rgba(255, 195, 111, 0.12);
    border: 1px solid rgba(255, 210, 140, 0.14);
    color: var(--led-warn);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.28);
  }

  .navigation-summary {
    padding: 14px;
    border-radius: 18px;
    background: rgba(31, 34, 40, 0.92);
    border: 1px solid rgba(255, 210, 140, 0.1);
  }

  .navigation-summary__side {
    gap: 6px;
  }

  .navigation-summary__main {
    gap: 10px;
  }

  .navigation-point {
    font-family: "Consolas", "Lucida Console", monospace;
    font-size: 1rem;
    color: var(--led-dim);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .navigation-zone {
    font-family: "Consolas", "Lucida Console", monospace;
    font-size: 1.22rem;
    color: var(--led-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .navigation-shell--rerouted .navigation-zone,
  .navigation-shell--rerouted .navigation-direction,
  .navigation-shell--rerouted .navigation-count {
    animation-name: route-reroute-led-flash;
  }

  .navigation-count {
    min-width: 82px;
    padding: 0;
    background: transparent;
    color: #9be28f;
    font-family: "Consolas", "Lucida Console", monospace;
    font-size: 1.6rem;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.06);
  }

  .navigation-count[data-level="0"] {
    background: transparent;
    color: var(--led-hot);
  }

  .navigation-direction {
    gap: 16px;
    padding: 18px 14px;
    border-radius: 18px;
    background: rgba(30, 33, 39, 0.94);
    border: 1px solid rgba(255, 210, 140, 0.1);
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.36);
  }

  .navigation-direction__arrow {
    width: 168px;
    height: 168px;
    border-radius: 32px;
    background: rgba(22, 25, 30, 0.98);
    border: 1px solid rgba(255, 210, 140, 0.1);
    color: var(--led-text);
    font-size: 5.6rem;
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.34);
  }

  .navigation-direction__arrow--problem {
    color: var(--led-hot);
  }

  .navigation-direction__copy {
    max-width: 22ch;
    font-family: "Consolas", "Lucida Console", monospace;
    font-size: 1.08rem;
    line-height: 1.5;
    color: var(--led-text);
  }

  .search-state--compact {
    min-height: 220px;
  }

  .items {
    gap: 10px;
  }

  .item {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 210, 140, 0.1);
    background:
      linear-gradient(180deg, rgba(29, 32, 38, 0.94), rgba(16, 18, 23, 0.94)),
      radial-gradient(circle at center, rgba(255, 195, 111, 0.03), transparent 55%);
    box-shadow:
      inset 0 0 14px rgba(0, 0, 0, 0.36),
      0 0 10px rgba(255, 195, 111, 0.04);
  }

  .item:hover {
    transform: none;
    box-shadow:
      inset 0 0 14px rgba(0, 0, 0, 0.36),
      0 0 10px rgba(255, 195, 111, 0.04);
  }

  .item__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(22, 25, 30, 0.96);
    border: 1px solid rgba(255, 210, 140, 0.1);
    color: var(--led-text);
    font-size: 1.9rem;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
  }

  .item__body {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  .item__name {
    font-family: "Consolas", "Lucida Console", monospace;
    font-size: 1.2rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--led-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 4px var(--led-glow);
  }

  .item__meta {
    display: none;
  }

  .item__badges {
    display: contents;
  }

  .availability-pill,
  .info-button {
    padding: 0;
  }

  .availability-pill {
    border: none;
    border-radius: 0;
    background: transparent;
    font-family: "Consolas", "Lucida Console", monospace;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.06);
  }

  .availability-pill[data-level="0"] {
    color: var(--led-hot);
    font-size: 1.65rem;
    line-height: 1;
  }

  .availability-pill[data-level="available"] {
    color: #9be28f;
  }

  .availability-pill[data-level="many"] {
    color: #9be28f;
  }

  .footer {
    margin-top: 12px;
    padding: 2px 2px 0;
    font-size: 0.82rem;
    font-family: "Consolas", "Lucida Console", monospace;
    letter-spacing: 0.04em;
  }

  .mode-switch-button {
    position: sticky;
    bottom: calc(12px + env(safe-area-inset-bottom));
    margin-top: 16px;
    padding: 18px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 195, 111, 0.92), rgba(142, 199, 216, 0.82));
    color: #171a1f;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
  }
}

@keyframes route-reroute-led-flash {
  0% {
    filter: brightness(0.84);
    text-shadow: 0 0 0 rgba(255, 195, 111, 0);
  }

  35% {
    filter: brightness(1.18);
    text-shadow: 0 0 10px rgba(255, 195, 111, 0.24);
  }

  100% {
    filter: brightness(1);
    text-shadow: 0 0 0 rgba(255, 195, 111, 0);
  }
}
