:root {
  --ink: #f4fbff;
  --muted: rgba(230, 247, 255, 0.68);
  --glass: rgba(5, 24, 36, 0.5);
  --glass-strong: rgba(4, 25, 38, 0.78);
  --line: rgba(83, 215, 255, 0.46);
  --hot: #66e8ff;
  --hot-2: #bff7ff;
  --warn: #ffd36a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #02080b;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

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

.stage-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #02080b;
}

.scene-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #02080b;
  filter: brightness(1.48) contrast(1.02) saturate(1.08);
  z-index: -4;
}

.freeze-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #02080b;
  filter: brightness(1.48) contrast(1.02) saturate(1.08);
  opacity: 0;
  transition: opacity 220ms ease;
  z-index: -3;
}

.freeze-frame.is-visible {
  opacity: 1;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 52% 42%, rgba(49, 191, 255, 0.08), transparent 28rem),
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.03) 45%, rgba(0, 0, 0, 0.22));
  z-index: -2;
}

.scene-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 100% 5px;
  mix-blend-mode: screen;
  z-index: -1;
}

.scene-topbar {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  right: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  grid-column: 2;
  justify-self: center;
  display: grid;
  gap: 1px;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.72);
}

.brand-mark span {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.08rem, 4.8vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 0.85;
  text-transform: uppercase;
}

.brand-mark small,
.kicker,
.step-label,
.holo-topline,
.estimate-grid dt {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.back-button,
.setup-button,
.tap-to-start,
.holo-action,
.holo-ghost,
.scene-item {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(4, 25, 38, 0.45);
  box-shadow: 0 0 20px rgba(68, 214, 255, 0.12), inset 0 0 22px rgba(98, 232, 255, 0.08);
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.back-button,
.setup-button {
  min-height: 30px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.setup-button {
  grid-column: 3;
  justify-self: end;
}

.back-button {
  grid-column: 1;
}

.tap-to-start {
  position: fixed;
  left: 50%;
  bottom: calc(44px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  border-radius: 999px;
  padding: 13px 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: block;
  animation: riseIn 420ms ease both;
  pointer-events: none;
}

.kicker,
.step-label {
  margin: 0;
}

.action-hotspot {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 1px solid rgba(168, 240, 255, 0.34);
  border-radius: 999px;
  background: rgba(3, 13, 28, 0.44);
  color: var(--ink);
  padding: 0 11px 0 7px;
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: auto;
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.24), 0 0 38px rgba(102, 232, 255, 0.12);
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, opacity 220ms ease;
}

.action-hotspot:hover,
.action-hotspot:focus-visible {
  transform: translate(-50%, -50%) scale(1.04);
  border-color: rgba(168, 240, 255, 0.84);
  outline: none;
}

.hotspot-dot {
  width: 14px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(circle, #f5feff 0 24%, #9ceaff 28% 58%, rgba(102, 232, 255, 0.14) 62%);
  box-shadow: 0 0 22px rgba(102, 232, 255, 0.84);
  animation: hotspotPulse 2.3s ease-in-out infinite;
}

.hotspot-label {
  white-space: nowrap;
}

.hotspot-diagnose {
  left: 36%;
  top: 72%;
}

.hotspot-schedule {
  left: 72%;
  top: 62%;
}

.hotspot-learn {
  left: 78%;
  top: 80%;
}

.holo-panel {
  position: fixed;
  z-index: 12;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  background:
    linear-gradient(135deg, rgba(95, 221, 255, 0.16), transparent 30%),
    rgba(4, 22, 32, 0.34);
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.28), inset 0 0 28px rgba(90, 222, 255, 0.1);
  backdrop-filter: blur(10px);
  animation: holoIn 360ms ease both;
}

.holo-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(194, 250, 255, 0.22);
}

.diagnosis-panel {
  top: 24svh;
  left: 8vw;
  width: min(56vw, 245px);
  max-height: 73svh;
  overflow: auto;
}

.schedule-panel,
.learn-panel {
  left: auto;
  right: 9vw;
  width: max-content;
  max-width: 220px;
  top: 31svh;
  bottom: auto;
  display: grid;
  gap: 8px;
}

.learn-panel {
  top: auto;
  bottom: calc(26px + env(safe-area-inset-bottom));
  left: 16px;
  right: 16px;
  width: auto;
  max-width: none;
}

.holo-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.holo-topline strong {
  color: var(--hot-2);
}

.diagnosis-flow,
.flow-step,
.question-step,
.scan-running,
.readout-panel {
  display: grid;
  gap: 7px;
}

.scan-running {
  justify-items: start;
  min-height: 132px;
  align-content: center;
}

.scan-orb {
  position: relative;
  width: 44px;
  height: 44px;
  margin-bottom: 2px;
  border: 1px solid rgba(168, 240, 255, 0.42);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(168, 240, 255, 0.42), rgba(102, 232, 255, 0.08) 58%, transparent 62%);
  box-shadow: 0 0 34px rgba(102, 232, 255, 0.3);
  animation: scanOrb 1.2s ease-in-out infinite;
}

.scan-orb span {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(168, 240, 255, 0.2);
  border-radius: 999px;
  animation: scanRing 1.6s ease-out infinite;
}

.scan-orb span:nth-child(2) {
  animation-delay: 0.28s;
}

.scan-orb span:nth-child(3) {
  animation-delay: 0.56s;
}

.scan-running h2 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  line-height: 0.9;
  text-transform: uppercase;
}

.scan-running p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

label {
  display: grid;
  gap: 5px;
}

label span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(126, 230, 255, 0.34);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(0, 12, 18, 0.54);
  outline: none;
}

input {
  min-height: 31px;
  padding: 0 8px;
  font-size: 0.78rem;
}

textarea {
  resize: vertical;
  padding: 8px;
  min-height: 66px;
  font-size: 0.78rem;
}

input:focus,
textarea:focus {
  border-color: var(--hot);
  box-shadow: 0 0 0 3px rgba(102, 232, 255, 0.15);
}

.quick-tags,
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.quick-tags button,
.options-grid button {
  min-height: 31px;
  border: 1px solid rgba(102, 232, 255, 0.34);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(5, 32, 48, 0.62);
  font-size: 0.68rem;
  font-weight: 800;
}

.two-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
}

.holo-action,
.holo-ghost,
.link-action {
  min-height: 31px;
  border-radius: 16px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  text-decoration: none;
}

.holo-action {
  background: rgba(91, 226, 255, 0.24);
}

.holo-ghost {
  background: rgba(0, 9, 14, 0.36);
}

.question-step h2,
.schedule-panel h2,
.learn-panel h2 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.1rem, 5vw, 1.8rem);
  line-height: 0.88;
  text-transform: uppercase;
}

.question-step p,
.schedule-panel p,
.learn-panel p,
.readout-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.32;
}

.readout-panel {
  margin-top: 7px;
  padding-top: 9px;
  border-top: 1px solid rgba(126, 230, 255, 0.22);
}

.likelihood-list {
  display: grid;
  gap: 8px;
}

.likelihood-item {
  display: grid;
  gap: 5px;
}

.likelihood-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
}

.likelihood-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(203, 247, 255, 0.16);
}

.likelihood-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--hot), var(--warn));
}

.estimate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.estimate-grid div {
  display: grid;
  gap: 2px;
}

.estimate-grid dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.28;
}

.other-answer {
  display: grid;
  gap: 8px;
}

.settings-dialog {
  width: min(92vw, 420px);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0;
  color: var(--ink);
  background: transparent;
}

.settings-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.settings-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
}

.settings-panel h2 {
  margin: 0;
}

.settings-note {
  margin: 0;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

@media (min-width: 720px) {
  .stage-shell {
    max-width: 520px;
    min-height: min(100svh, 920px);
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 28px 90px rgba(0, 0, 0, 0.5);
  }

  .scene-topbar,
  .home-menu,
  .holo-panel,
  .tap-to-start {
    position: absolute;
  }

  .diagnosis-panel {
    top: 24%;
    left: 8%;
    right: auto;
  }
}

@keyframes hotspotPulse {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.72;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes scanOrb {
  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.74;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes scanRing {
  from {
    transform: scale(0.62);
    opacity: 0.72;
  }

  to {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes holoIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    filter: blur(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
