:root {
  --bg: #ffffff;
  --text: #000000;
  --muted: #343b47;
  --line: #dce3ed;
  --soft: #f6f8fb;
  --soft2: #eef4ff;
  --blue: #006dff;
  --blue2: #0056d6;
  --green: #059a3d;
  --yellow: #d97706;
  --red: #e00000;
  --shadow: 0 28px 90px rgba(0, 0, 0, .13);
  --radius: 34px;
}

* { box-sizing: border-box; }

html, body { background: #fff; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: #000000;
  -webkit-tap-highlight-color: transparent;
}

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

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #000;
  pointer-events: none;
  animation: bootToWhite 1.18s cubic-bezier(.16, 1, .3, 1) forwards;
}

.app {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 330px 1fr;
  overflow: hidden;
}

.tree-panel {
  height: 100svh;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(18px);
  padding: 22px;
  overflow: auto;
  transition: transform .34s cubic-bezier(.16, 1, .3, 1), opacity .34s ease;
  z-index: 20;
}

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

.eyebrow {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

.tree-head h2 { margin: 4px 0 14px; font-size: 26px; }

.icon-btn {
  border: 0;
  background: var(--soft);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 28px;
  line-height: 1;
}

.progress-text { color: var(--muted); font-size: 14px; margin: 8px 0; }

.progress-line {
  height: 8px;
  background: var(--soft);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-line > div {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), #6bb6ff);
  transition: width .42s cubic-bezier(.16, 1, .3, 1);
}

.tree { display: grid; gap: 8px; }

.tree-step { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; }
.tree-step-title { padding: 12px 12px 8px; font-weight: 850; font-size: 14px; color: #000; }

.tree-item {
  width: calc(100% - 12px);
  margin: 0 6px 6px;
  border: 0;
  background: var(--soft);
  color: #000;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), background .18s ease;
}

.tree-item:active, .primary-btn:active, .secondary-btn:active, .pill-btn:active, .voice-btn:active, .choice:active { transform: scale(.955); }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.tree-item.answered .dot { background: var(--green); }
.tree-item.current .dot { background: var(--yellow); }
.tree-item.current { background: #fff7ed; }
.tree-item.answered { background: #f0fdf4; }

.main {
  height: 100svh;
  overflow: hidden;
  position: relative;
  background: #ffffff;
}

.main::before {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(0,109,255,.055), transparent 32%),
    radial-gradient(circle at 20% 100%, rgba(0,0,0,.035), transparent 34%);
  animation: slowBreath 8s ease-in-out infinite alternate;
}

.topbar {
  position: relative;
  z-index: 2;
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 22px 10px;
}

.pill-btn, .primary-btn, .secondary-btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), box-shadow .18s ease, background .18s ease;
}

.pill-btn, .secondary-btn { background: var(--soft); color: #000; }

.primary-btn {
  background: var(--blue);
  color: white;
  font-weight: 850;
  box-shadow: 0 20px 48px rgba(0,109,255,.34);
}

.primary-btn:hover { background: var(--blue2); transform: translateY(-1px); }
.big { min-height: 60px; padding-inline: 28px; font-size: 19px; }

.server-signal {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: min(58vw, 520px);
  color: var(--muted);
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signal-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  border-top-color: var(--blue);
  animation: spin .9s linear infinite;
  flex: 0 0 auto;
}

.server-signal.ok .signal-spinner { border-color: var(--green); animation: pulseDot 1.2s ease-in-out infinite; }
.server-signal.error .signal-spinner { border-color: var(--red); animation: pulseDot 1s ease-in-out infinite; }
.server-signal.recording .signal-spinner { border-color: var(--red); animation: pulseDot .7s ease-in-out infinite; }
.server-signal.idle .signal-spinner { animation: spin 1s linear infinite; }

.start-screen, .finish-screen, .question-screen {
  position: relative;
  z-index: 2;
  height: calc(100svh - 72px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.start-screen.leaving { animation: leaveUp .24s cubic-bezier(.7, 0, .84, 0) both; }

.start-card {
  width: min(640px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  padding: clamp(26px, 6vw, 56px);
  text-align: center;
  animation: cinematicQuestionIn .72s cubic-bezier(.16, 1, .3, 1) both;
}

.logo-dot {
  width: 78px;
  height: 78px;
  margin: 0 auto 22px;
  border-radius: 28px;
  background: var(--soft2);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 950;
}
.logo-dot.ok { color: var(--green); background: #f0fdf4; }

.start-card h1 {
  color: #000;
  font-size: clamp(30px, 7vw, 52px);
  line-height: 1.02;
  margin-bottom: 18px;
  letter-spacing: -.055em;
  font-weight: 950;
}

.start-card p { color: var(--muted); font-size: 18px; line-height: 1.5; margin-bottom: 28px; }
.admin-link { display: block; margin-top: 16px; color: var(--muted); }

.question-screen { place-items: stretch center; align-content: center; gap: 12px; }
.context-strip { width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; opacity: .45; }

.ghost-question {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 14px;
  color: var(--muted);
  background: rgba(255,255,255,.72);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.question-card {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 42px);
  will-change: transform, opacity, filter;
}

.question-card.switching { animation: cinematicQuestionIn .58s cubic-bezier(.16, 1, .3, 1) both; }
.question-card.leaving { animation: questionOut .2s cubic-bezier(.7, 0, .84, 0) both; }

.step-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; margin-bottom: 18px; }

#questionText {
  color: #000;
  font-size: clamp(34px, 8.6vw, 58px);
  line-height: 1.02;
  letter-spacing: -.058em;
  font-weight: 950;
  margin-bottom: 12px;
  text-wrap: balance;
}

#hintText { color: var(--muted); font-size: clamp(20px, 5.25vw, 30px); line-height: 1.42; margin-bottom: 24px; }
.answer-host { display: grid; gap: 12px; }
.answer-host > * { animation: answerPopIn .46s cubic-bezier(.16, 1, .3, 1) both; }

.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: #000;
  border-radius: 22px;
  padding: 16px 18px;
  outline: none;
  font-size: clamp(20px, 5vw, 25px);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.025), 0 12px 32px rgba(0,0,0,.055);
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 5px rgba(0,109,255,.12), 0 16px 40px rgba(0,0,0,.075);
}

.textarea { min-height: 160px; resize: vertical; }
.choice-grid { display: grid; gap: 10px; }

.choice {
  border: 1px solid var(--line);
  background: #fff;
  color: #000;
  border-radius: 18px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0,0,0,.055);
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), box-shadow .18s ease, background .18s ease, border-color .18s ease;
  animation: answerPopIn .38s cubic-bezier(.16, 1, .3, 1) both;
}
.choice:hover { transform: translateY(-1px); box-shadow: 0 18px 42px rgba(0,0,0,.085); }
.choice.selected { background: #eaf3ff; border-color: var(--blue); box-shadow: 0 16px 40px rgba(0,109,255,.20); }

.file-drop { border: 1px dashed #b8c2d2; background: #fff; color: #000; border-radius: 20px; padding: 18px; }
.file-list { display: grid; gap: 8px; margin-top: 10px; color: var(--muted); }

.card-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; flex-wrap: wrap; animation: answerPopIn .5s cubic-bezier(.16, 1, .3, 1) both; }
.hidden-action { display: none !important; }
.question-card.info-mode .answer-host { display: none; }
.question-card.info-mode .card-actions { justify-content: center; margin-top: 28px; }
.question-card.info-mode #nextBtn { flex: 0 1 360px; width: min(360px, 100%); min-height: 68px; font-size: 22px; }

.voice-box {
  width: min(760px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.90);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px;
  animation: answerPopIn .55s cubic-bezier(.16, 1, .3, 1) both;
}

.voice-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #000;
  border-radius: 999px;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.mic-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(0,109,255,.28);
}

.voice-live { display: flex; align-items: center; gap: 9px; min-width: 0; }
.voice-timer { font-variant-numeric: tabular-nums; color: #000; font-weight: 850; }
.voice-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.voice-wave { display: flex; align-items: center; gap: 3px; width: 28px; height: 22px; opacity: .45; }
.voice-wave i { display: block; width: 3px; height: 7px; border-radius: 99px; background: var(--muted); }
.voice-wave i:nth-child(2) { height: 12px; }
.voice-wave i:nth-child(3) { height: 18px; }
.voice-wave i:nth-child(4) { height: 12px; }
.voice-wave i:nth-child(5) { height: 8px; }

.voice-box.recording .mic-dot { background: var(--red); animation: recPulse .7s ease-in-out infinite; }
.voice-box.recording .voice-wave { opacity: 1; }
.voice-box.recording .voice-wave i { background: var(--red); animation: wave 650ms ease-in-out infinite; }
.voice-box.recording .voice-wave i:nth-child(2) { animation-delay: .08s; }
.voice-box.recording .voice-wave i:nth-child(3) { animation-delay: .16s; }
.voice-box.recording .voice-wave i:nth-child(4) { animation-delay: .24s; }
.voice-box.recording .voice-wave i:nth-child(5) { animation-delay: .32s; }
.voice-box.sending .mic-dot, .voice-box.processing .mic-dot { background: var(--yellow); animation: pulseDot .9s ease-in-out infinite; }
.voice-box.ok .mic-dot { background: var(--green); }
.voice-box.error .mic-dot { background: var(--red); }

.primary-btn.loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  margin-right: 8px;
  animation: spin .8s linear infinite;
}

.hidden { display: none !important; }

.admin-body { background: var(--soft); }
.admin-wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 50px; }
.admin-head, .admin-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 20px; margin: 14px 0; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--soft); padding: 14px; border-radius: 16px; }
.answer-row { border-top: 1px solid var(--line); padding: 14px 0; }
.answer-row:first-child { border-top: 0; }
.answer-q { font-weight: 800; margin-bottom: 6px; }
.answer-v { color: var(--muted); white-space: pre-wrap; }
.file-row { padding: 10px 0; border-top: 1px solid var(--line); }

@keyframes bootToWhite { 0% { opacity: 1; } 38% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes slowBreath { from { transform: translate3d(-1%, -1%, 0) scale(1); opacity: .72; } to { transform: translate3d(1%, 1%, 0) scale(1.035); opacity: 1; } }
@keyframes cinematicQuestionIn { 0% { opacity: 0; transform: translateY(38px) scale(.935); filter: blur(16px); } 62% { opacity: 1; filter: blur(0); } 100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }
@keyframes questionOut { from { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } to { opacity: 0; transform: translateY(-24px) scale(.97); filter: blur(10px); } }
@keyframes answerPopIn { 0% { opacity: 0; transform: translateY(20px) scale(.975); filter: blur(8px); } 100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }
@keyframes leaveUp { from { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } to { opacity: 0; transform: translateY(-24px) scale(.985); filter: blur(10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseDot { 0%, 100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.28); opacity: 1; } }
@keyframes recPulse { 0% { box-shadow: 0 0 0 0 rgba(224,0,0,.30); transform: scale(1); } 70% { box-shadow: 0 0 0 10px rgba(224,0,0,0); transform: scale(1.12); } 100% { box-shadow: 0 0 0 0 rgba(224,0,0,0); transform: scale(1); } }
@keyframes wave { 0%, 100% { transform: scaleY(.55); } 50% { transform: scaleY(1.35); } }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .tree-panel { position: fixed; inset: 0 auto 0 0; width: min(88vw, 360px); transform: translateX(-105%); box-shadow: var(--shadow); }
  .tree-panel.open { transform: translateX(0); }
  .main { height: 100svh; }
  .question-screen { align-content: start; padding-top: 12px; overflow-y: auto; height: calc(100svh - 72px); }
  .question-card { padding: 32px 26px; }
  .context-strip { grid-template-columns: 1fr; }
  #nextQuestion { display: none; }
  .card-actions > * { flex: 1; }
  .server-signal { font-size: 13px; padding: 8px 10px; max-width: 62vw; }
  .voice-box { align-items: stretch; flex-direction: column; border-radius: 24px; padding: 12px; }
  .voice-btn { justify-content: center; width: 100%; }
  .voice-live { width: 100%; justify-content: center; }
}

@media (min-width: 901px) { #openTree, #closeTree { display: none; } }


/* ==== v5: compact mobile + visible cinematic motion ==== */
:root {
  --shadow: 0 12px 42px rgba(0,0,0,.105);
  --radius: 24px;
}

.drill-sketch {
  position: absolute;
  z-index: 1;
  top: 58px;
  right: clamp(8px, 5vw, 52px);
  width: min(42vw, 260px);
  height: 88px;
  opacity: .16;
  pointer-events: none;
  filter: contrast(120%);
}

.drill-sketch svg { width: 100%; height: 100%; overflow: visible; }
.sketch-line {
  fill: none;
  stroke: #050505;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
}
.water-stream {
  fill: none;
  stroke: #006dff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 150;
  stroke-dashoffset: 150;
  opacity: .95;
}
.water-drop { fill: #006dff; opacity: 0; }
.drill-sketch.run .sketch-line,
.drill-sketch.start-run .sketch-line { animation: drawSketch .9s cubic-bezier(.16,1,.3,1) forwards; }
.drill-sketch.run .sketch-truck { animation: truckDrive .95s cubic-bezier(.16,1,.3,1) both; }
.drill-sketch.start-run .sketch-truck { animation: truckDrive 1.2s cubic-bezier(.16,1,.3,1) both; }
.drill-sketch.run .sketch-drill,
.drill-sketch.start-run .sketch-drill { transform-origin: 270px 64px; animation: drillBite .8s ease-in-out .35s 2; }
.drill-sketch.run .water-stream,
.drill-sketch.start-run .water-stream { animation: waterDraw .85s cubic-bezier(.16,1,.3,1) .75s forwards; }
.drill-sketch.run .water-drop,
.drill-sketch.start-run .water-drop { animation: waterDrop 1.2s ease .95s infinite; }
.drill-sketch.run .drop2,
.drill-sketch.start-run .drop2 { animation-delay: 1.12s; }

.word-pop {
  display: inline-block;
  animation: wordFly .48s cubic-bezier(.16,1,.3,1) both;
  animation-delay: calc(var(--i) * 32ms);
  transform-origin: 50% 90%;
}

.question-card.send-away {
  animation: sendEnvelope .26s cubic-bezier(.7,0,.84,0) both !important;
}

.card-actions > *,
.voice-box,
.input,
.textarea,
.choice {
  animation-duration: .32s !important;
}

@keyframes drawSketch { to { stroke-dashoffset: 0; } }
@keyframes truckDrive {
  0% { transform: translateX(-28px); opacity: 0; }
  55% { opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes drillBite {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  25% { transform: rotate(-3deg) translateX(-2px); }
  50% { transform: rotate(3deg) translateX(2px); }
  75% { transform: rotate(-2deg) translateX(-1px); }
}
@keyframes waterDraw { to { stroke-dashoffset: 0; opacity: .9; } }
@keyframes waterDrop {
  0% { opacity: 0; transform: translateY(-8px) scale(.65); }
  18% { opacity: .85; }
  100% { opacity: 0; transform: translateY(18px) scale(1); }
}
@keyframes wordFly {
  0% { opacity: 0; transform: translate3d(0, 18px, 0) rotateX(55deg) scale(.94); filter: blur(9px); }
  100% { opacity: 1; transform: translate3d(0,0,0) rotateX(0) scale(1); filter: blur(0); }
}
@keyframes sendEnvelope {
  0% { opacity: 1; transform: translateY(0) scale(1); clip-path: inset(0 0 0 0 round 24px); filter: blur(0); }
  55% { opacity: .75; transform: translateY(-8px) scale(.96); clip-path: inset(32% 0 32% 0 round 22px); filter: blur(3px); }
  100% { opacity: 0; transform: translateX(80px) translateY(-28px) scale(.72) rotate(6deg); clip-path: inset(43% 0 43% 0 round 18px); filter: blur(8px); }
}

@media (max-width: 900px) {
  .topbar {
    height: 50px !important;
    padding: max(8px, env(safe-area-inset-top)) 12px 6px !important;
    gap: 8px !important;
  }

  .pill-btn {
    min-height: 38px !important;
    padding: 8px 12px !important;
    font-size: 16px !important;
  }

  .server-signal {
    max-width: 50vw !important;
    min-height: 38px !important;
    padding: 7px 10px !important;
    font-size: 13px !important;
  }

  .signal-spinner { width: 12px !important; height: 12px !important; }

  .drill-sketch {
    top: 48px;
    right: 8px;
    width: 128px;
    height: 50px;
    opacity: .12;
  }

  .start-screen,
  .finish-screen,
  .question-screen {
    height: auto !important;
    min-height: calc(100svh - 50px) !important;
    padding: 7px 10px 10px !important;
  }

  .question-screen {
    align-content: start !important;
    gap: 7px !important;
    overflow-y: auto !important;
  }

  .context-strip { display: none !important; }

  .question-card {
    width: 100% !important;
    border-radius: 22px !important;
    padding: 18px 18px 16px !important;
    box-shadow: 0 10px 34px rgba(0,0,0,.095) !important;
  }

  .step-meta {
    font-size: 13px !important;
    margin-bottom: 9px !important;
  }

  #questionText {
    font-size: clamp(27px, 7.3vw, 34px) !important;
    line-height: 1.03 !important;
    letter-spacing: -.055em !important;
    margin-bottom: 8px !important;
  }

  #hintText {
    font-size: clamp(16px, 4.3vw, 19px) !important;
    line-height: 1.27 !important;
    margin-bottom: 12px !important;
  }

  .answer-host { gap: 8px !important; }

  .input,
  .textarea,
  .select {
    min-height: 46px !important;
    border-radius: 18px !important;
    padding: 11px 14px !important;
    font-size: clamp(17px, 4.7vw, 20px) !important;
    box-shadow: 0 6px 18px rgba(0,0,0,.045) !important;
  }

  .textarea { min-height: 88px !important; }

  .choice-grid { gap: 7px !important; }
  .choice {
    border-radius: 15px !important;
    padding: 10px 12px !important;
    font-size: 16px !important;
  }

  .file-drop { padding: 12px !important; border-radius: 16px !important; }

  .card-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 13px !important;
  }

  .card-actions .primary-btn {
    grid-column: 1 / -1 !important;
  }

  .primary-btn,
  .secondary-btn {
    min-height: 46px !important;
    padding: 10px 14px !important;
    font-size: 17px !important;
  }

  .question-card.info-mode .card-actions { display: flex !important; margin-top: 16px !important; }
  .question-card.info-mode #nextBtn { min-height: 52px !important; font-size: 18px !important; }

  .voice-box {
    width: 100% !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    border-radius: 20px !important;
    padding: 8px 10px !important;
    box-shadow: 0 8px 26px rgba(0,0,0,.07) !important;
  }

  .voice-btn {
    width: auto !important;
    flex: 0 0 auto !important;
    min-height: 42px !important;
    padding: 9px 12px !important;
    font-size: 15px !important;
  }

  #voiceBtnText { max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .voice-live {
    flex: 1 1 auto !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
    gap: 7px !important;
  }

  .voice-wave { width: 23px !important; }
  .voice-timer { font-size: 16px !important; }
  .voice-status { font-size: 13px !important; }

  .start-card {
    border-radius: 24px !important;
    padding: 24px 18px !important;
  }
  .start-card h1 { font-size: clamp(28px, 7.4vw, 38px) !important; }
  .start-card p { font-size: 16px !important; line-height: 1.35 !important; }
}

@media (max-height: 700px) and (max-width: 900px) {
  .topbar { height: 46px !important; }
  .start-screen, .finish-screen, .question-screen { min-height: calc(100svh - 46px) !important; padding-top: 5px !important; }
  .question-card { padding: 15px 15px 13px !important; }
  .step-meta { margin-bottom: 6px !important; }
  #questionText { font-size: clamp(24px, 6.8vw, 30px) !important; margin-bottom: 6px !important; }
  #hintText { font-size: clamp(15px, 4vw, 17px) !important; margin-bottom: 9px !important; }
  .input, .select { min-height: 42px !important; }
  .card-actions { margin-top: 10px !important; }
  .primary-btn, .secondary-btn { min-height: 42px !important; }
  .voice-box { padding: 6px 8px !important; }
  .voice-btn { min-height: 38px !important; }
}


/* ==== v6: ultra-compact mobile + no top status ==== */
.topbar { justify-content: flex-start !important; }
.server-signal { display: none !important; }

@media (max-width: 900px) {
  body { overflow: hidden !important; }
  .main { min-height: 100svh !important; overflow: hidden !important; }

  .topbar {
    height: 38px !important;
    padding: max(5px, env(safe-area-inset-top)) 8px 4px !important;
  }
  .pill-btn {
    min-height: 32px !important;
    padding: 5px 10px !important;
    font-size: 14px !important;
    border-radius: 18px !important;
  }

  .question-screen {
    min-height: calc(100svh - 38px) !important;
    height: calc(100svh - 38px) !important;
    padding: 5px 8px 7px !important;
    gap: 6px !important;
    display: grid !important;
    grid-template-rows: 1fr auto !important;
    overflow: hidden !important;
  }

  .question-card {
    align-self: start !important;
    max-height: calc(100svh - 128px) !important;
    overflow: hidden !important;
    border-radius: 19px !important;
    padding: 12px 13px 11px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,.085) !important;
  }

  .step-meta {
    font-size: 11px !important;
    line-height: 1.15 !important;
    margin-bottom: 5px !important;
  }

  #questionText {
    font-size: clamp(22px, 6.15vw, 28px) !important;
    line-height: 1.0 !important;
    letter-spacing: -.055em !important;
    margin: 0 0 6px !important;
  }

  #hintText {
    font-size: clamp(13.5px, 3.65vw, 16px) !important;
    line-height: 1.21 !important;
    margin: 0 0 8px !important;
    color: #2f3540 !important;
  }

  .answer-host { gap: 6px !important; }
  .input, .select {
    min-height: 38px !important;
    padding: 8px 11px !important;
    font-size: 16px !important;
    border-radius: 14px !important;
  }
  .textarea {
    min-height: 62px !important;
    padding: 8px 11px !important;
    font-size: 15px !important;
    line-height: 1.22 !important;
    border-radius: 14px !important;
  }

  .choice-grid { gap: 5px !important; }
  .choice { padding: 8px 9px !important; font-size: 14px !important; border-radius: 12px !important; }

  .card-actions {
    gap: 6px !important;
    margin-top: 8px !important;
  }
  .primary-btn, .secondary-btn {
    min-height: 38px !important;
    padding: 7px 10px !important;
    font-size: 15px !important;
    border-radius: 17px !important;
  }

  .voice-box {
    min-height: 64px !important;
    max-height: 74px !important;
    padding: 6px 8px !important;
    border-radius: 17px !important;
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    align-items: center !important;
    gap: 7px !important;
    box-shadow: 0 7px 20px rgba(0,0,0,.07) !important;
  }
  .voice-btn {
    min-height: 36px !important;
    padding: 7px 10px !important;
    border-radius: 16px !important;
    font-size: 14px !important;
  }
  #voiceBtnText { max-width: 98px !important; }
  .voice-live { gap: 5px !important; min-width: 0 !important; overflow: hidden !important; }
  .voice-wave { width: 18px !important; }
  .voice-timer { font-size: 14px !important; min-width: 42px !important; }
  .voice-status { font-size: 12px !important; line-height: 1.12 !important; white-space: normal !important; }

  .drill-sketch {
    top: 36px !important;
    right: 8px !important;
    width: 154px !important;
    height: 54px !important;
    opacity: .20 !important;
  }
  .drill-sketch.run, .drill-sketch.start-run { opacity: .38 !important; }

  .start-screen {
    min-height: calc(100svh - 38px) !important;
    padding: 8px !important;
  }
  .start-card {
    border-radius: 22px !important;
    padding: 18px 14px !important;
  }
  .start-card h1 { font-size: clamp(24px, 6.6vw, 32px) !important; line-height: 1.04 !important; }
  .start-card p { font-size: 14px !important; line-height: 1.25 !important; }
}

@media (max-height: 680px) and (max-width: 900px) {
  .topbar { height: 34px !important; }
  .question-screen { height: calc(100svh - 34px) !important; min-height: calc(100svh - 34px) !important; padding: 4px 7px 6px !important; }
  .question-card { max-height: calc(100svh - 110px) !important; padding: 10px 11px 9px !important; }
  #questionText { font-size: clamp(20px, 5.7vw, 25px) !important; }
  #hintText { font-size: 13px !important; margin-bottom: 6px !important; }
  .input, .select { min-height: 34px !important; font-size: 14.5px !important; }
  .primary-btn, .secondary-btn { min-height: 34px !important; font-size: 14px !important; }
  .voice-box { min-height: 56px !important; max-height: 62px !important; }
  .voice-btn { min-height: 32px !important; }
}

.word-pop {
  position: relative;
  overflow: hidden;
}
.word-pop::after {
  content: "";
  position: absolute;
  left: -15%; right: -15%; bottom: 4%;
  height: .16em;
  background: linear-gradient(90deg, transparent, rgba(0,109,255,.36), transparent);
  transform: translateX(-120%);
  animation: waterTextSweep 1.25s cubic-bezier(.16,1,.3,1) calc(.38s + var(--i) * 26ms) forwards;
}
@keyframes waterTextSweep {
  0% { transform: translateX(-120%); opacity: 0; }
  25% { opacity: .85; }
  100% { transform: translateX(120%); opacity: 0; }
}


/* ==== v7 mobile-first compact cinematic ==== */
:root {
  --text:#000000;
  --muted:#1f2937;
  --line:#d7dde8;
  --soft:#f8fafc;
  --blue:#006dff;
  --shadow:0 16px 48px rgba(0,0,0,.13);
}
html,body{background:#fff!important;color:#000!important;overscroll-behavior-x:none;}
body{font-weight:520;}
.boot-screen{display:grid;place-items:center;animation:bootFadeV7 2.55s cubic-bezier(.16,1,.3,1) forwards!important;}
.boot-scene{width:min(86vw,420px);text-align:center;color:#fff;filter:drop-shadow(0 24px 48px rgba(255,255,255,.12));}
.boot-drill{width:100%;height:auto;overflow:visible;}
.boot-drill path,.boot-drill circle{fill:none;stroke:#fff;stroke-width:7;stroke-linecap:round;stroke-linejoin:round;}
.boot-ground{opacity:.25;stroke-width:4!important;}
.boot-truck{animation:truckArrive 1.05s cubic-bezier(.16,1,.3,1) both;}
.boot-bore{animation:borePulse .5s ease-in-out .75s 4 alternate;}
.boot-water{stroke:#77c7ff!important;stroke-dasharray:140;stroke-dashoffset:140;animation:waterDraw .9s ease .95s forwards;}
.boot-title{font-size:clamp(28px,8vw,44px);font-weight:950;letter-spacing:-.055em;margin-top:10px;animation:bootTitle .7s ease 1.18s both;}
@keyframes bootFadeV7{0%,68%{opacity:1;background:#000}100%{opacity:0;visibility:hidden;background:#fff}}
@keyframes truckArrive{0%{transform:translateX(-120px);opacity:0}100%{transform:translateX(0);opacity:1}}
@keyframes borePulse{from{transform:translateX(0)}to{transform:translateX(4px)}}
@keyframes waterDraw{to{stroke-dashoffset:0}}
@keyframes bootTitle{from{opacity:0;transform:translateY(16px);filter:blur(8px)}to{opacity:1;transform:none;filter:blur(0)}}
.topbar{display:none!important;}
.main{height:100svh!important;overflow:hidden!important;}
.side-rail{position:fixed;left:0;top:50%;transform:translateY(-50%);z-index:15;width:36px;height:190px;border:1px solid #dbe3ef;border-left:0;border-radius:0 24px 24px 0;background:#fff;color:#000;box-shadow:0 12px 32px rgba(0,0,0,.11);display:grid;place-items:center;padding:0;transition:transform .22s ease,opacity .2s ease;}
.side-rail span{writing-mode:vertical-rl;transform:rotate(180deg);font-size:15px;font-weight:900;letter-spacing:.02em;}
.side-rail b{position:absolute;right:7px;top:50%;transform:translateY(-50%);font-size:28px;line-height:1;color:#006dff;animation:railArrow 1.2s ease-in-out infinite;}
body.menu-open .side-rail{opacity:0;pointer-events:none;}
@keyframes railArrow{50%{transform:translate(4px,-50%)}}
.tree-panel{position:fixed!important;inset:0 auto 0 0!important;width:min(86vw,360px)!important;height:100svh!important;transform:translateX(-105%)!important;box-shadow:28px 0 80px rgba(0,0,0,.24);z-index:50!important;padding:18px!important;}
.tree-panel.open{transform:translateX(0)!important;}
.start-screen,.finish-screen{height:100svh!important;min-height:100svh!important;padding:0 18px 12vh!important;place-items:end center!important;}
.start-card{width:min(100%,620px)!important;padding:34px 28px 38px!important;border-radius:32px!important;box-shadow:0 18px 54px rgba(0,0,0,.12)!important;background:#fff!important;}
.start-card h1{font-size:clamp(38px,10.2vw,60px)!important;line-height:.98!important;color:#000!important;font-weight:1000!important;letter-spacing:-.065em!important;margin-bottom:18px!important;}
.start-card p{font-size:clamp(22px,5.6vw,28px)!important;line-height:1.28!important;color:#111827!important;margin-bottom:28px!important;}
.logo-dot,.admin-link{display:none!important;}
.primary-btn.big{width:100%!important;min-height:72px!important;font-size:24px!important;font-weight:1000!important;}
.question-screen{height:100svh!important;min-height:100svh!important;padding:10px 10px 8px 44px!important;display:grid!important;grid-template-rows:auto 1fr!important;align-items:start!important;overflow-y:auto!important;gap:8px!important;}
.context-strip{display:none!important;}
.question-card{width:100%!important;max-width:720px!important;border-radius:28px!important;padding:22px 18px 16px!important;box-shadow:0 14px 46px rgba(0,0,0,.115)!important;background:#fff!important;}
.step-meta{font-size:16px!important;font-weight:720!important;color:#111827!important;margin-bottom:10px!important;}
#questionText{font-size:clamp(35px,9.7vw,56px)!important;line-height:1.0!important;color:#000!important;font-weight:1000!important;letter-spacing:-.065em!important;margin-bottom:16px!important;}
#hintText{font-size:clamp(21px,5.7vw,30px)!important;line-height:1.25!important;color:#111827!important;margin-bottom:18px!important;}
.answer-host{margin-top:0!important;}
.input,.textarea,.select{font-size:clamp(22px,5.9vw,30px)!important;min-height:62px!important;border-radius:22px!important;color:#000!important;background:#fff!important;padding:15px 18px!important;box-shadow:0 10px 30px rgba(0,0,0,.07)!important;}
.textarea{min-height:96px!important;}
.choice{font-size:clamp(20px,5.4vw,28px)!important;padding:15px 16px!important;border-radius:20px!important;color:#000!important;background:#fff!important;}
.card-actions{grid-template-columns:1fr 1fr!important;gap:10px!important;margin-top:14px!important;}
.card-actions .primary-btn{grid-column:1/3!important;min-height:64px!important;font-size:23px!important;font-weight:1000!important;}
.secondary-btn{min-height:54px!important;font-size:20px!important;padding:10px 12px!important;}
.question-card.info-mode{display:grid!important;align-content:end!important;min-height:calc(100svh - 72px)!important;margin-top:0!important;padding-bottom:42px!important;}
.question-card.info-mode #questionText{font-size:clamp(37px,10vw,58px)!important;}
.question-card.info-mode #hintText{font-size:clamp(22px,5.8vw,30px)!important;}
.question-card.info-mode .card-actions{margin-top:24px!important;}
.question-card.info-mode #nextBtn{width:100%!important;max-width:none!important;min-height:74px!important;font-size:25px!important;}
.voice-box{margin:12px 0 0!important;border-radius:22px!important;padding:9px 10px!important;display:grid!important;gap:7px!important;background:#fff!important;box-shadow:0 8px 28px rgba(0,0,0,.06)!important;}
.voice-box.hidden-action{display:none!important;}
.voice-btn{min-height:50px!important;border-radius:18px!important;font-size:20px!important;font-weight:950!important;justify-content:center!important;}
.voice-live{display:flex!important;align-items:center!important;gap:10px!important;min-height:28px!important;font-size:18px!important;overflow:hidden!important;}
.voice-timer{font-size:22px!important;font-weight:1000!important;color:#000!important;}
.voice-status{font-size:17px!important;color:#1f2937!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
.mic-dot{width:17px!important;height:17px!important;}
.voice-wave i{width:5px!important;background:#111827!important;}
.voice-box.recording .mic-dot{background:#e00000!important;box-shadow:0 0 0 8px rgba(224,0,0,.12);animation:recordPulse .72s ease-in-out infinite!important;}
.drill-sketch{position:fixed!important;left:50%!important;top:23%!important;right:auto!important;transform:translateX(-50%)!important;width:min(58vw,260px)!important;height:auto!important;opacity:.34!important;z-index:1!important;pointer-events:none!important;}
.sketch-line{stroke:#000!important;stroke-width:6!important;}
.water-stream,.water-drop{stroke:#006dff!important;fill:none!important;opacity:.9!important;}
.drill-sketch.run{animation:sketchCenterRun 1.25s cubic-bezier(.16,1,.3,1) both!important;}
@keyframes sketchCenterRun{0%{opacity:0;transform:translateX(-90%) scale(.86);filter:blur(5px)}45%{opacity:.38;filter:blur(0)}75%{transform:translateX(-50%) scale(1)}100%{opacity:.16;transform:translateX(-28%) scale(.92)}}
.question-card.switching{animation:cardComeBig .82s cubic-bezier(.16,1,.3,1) both!important;}
.word-pop{display:inline-block;opacity:0;animation:wordFly .74s cubic-bezier(.16,1,.3,1) forwards;animation-delay:calc(var(--i) * 65ms);}
@keyframes wordFly{0%{opacity:0;transform:translateY(32px) scale(.92);filter:blur(10px)}70%{opacity:1;filter:blur(0)}100%{opacity:1;transform:none;filter:blur(0)}}
@keyframes cardComeBig{0%{opacity:0;transform:translateY(38px) scale(.92);filter:blur(12px)}100%{opacity:1;transform:none;filter:blur(0)}}
.send-away{animation:sendEnvelopeV7 .43s cubic-bezier(.7,0,.84,0) both!important;}
@keyframes sendEnvelopeV7{0%{opacity:1;transform:translateY(0) scale(1);filter:blur(0)}45%{opacity:.82;transform:translateY(-8px) scale(.96);clip-path:inset(28% 0 28% 0 round 18px)}100%{opacity:0;transform:translateX(120px) translateY(-28px) rotate(5deg) scale(.68);filter:blur(8px);clip-path:inset(43% 0 43% 0 round 18px)}}
@media (max-height:700px){.start-card{padding:26px 22px 28px!important}.start-card h1{font-size:clamp(34px,9.4vw,48px)!important}.start-card p{font-size:clamp(19px,5vw,24px)!important}.question-card{padding:18px 15px 14px!important}#questionText{font-size:clamp(31px,8.7vw,45px)!important}#hintText{font-size:clamp(18px,4.9vw,24px)!important}.input,.textarea,.select{min-height:56px!important;font-size:22px!important}.voice-box{padding:7px 8px!important}.card-actions .primary-btn{min-height:58px!important}}
