:root {
  color-scheme: light;
  --ink: #18201f;
  --muted: #66716e;
  --line: #d8dfdc;
  --paper: #fbfaf5;
  --panel: #ffffff;
  --soft: #eef5f2;
  --accent: #1b7f78;
  --accent-dark: #0f5c58;
  --warm: #f2b35d;
  --danger: #be4b48;
  --blue: #1667c8;
  --red: #d22f33;
  --cyan: #00a7c7;
  --green: #168e5a;
  --shadow: 0 18px 44px rgba(43, 58, 54, 0.12);
  font-family: Verdana, Geneva, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(27, 127, 120, 0.08), transparent 38%),
    linear-gradient(315deg, rgba(242, 179, 93, 0.12), transparent 34%),
    var(--paper);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.app {
  width: min(100%, 980px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
}

.screen {
  min-height: calc(100svh - 36px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 7vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  line-height: 1.12;
}

h3 {
  font-size: 18px;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

.notice {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.panel,
.exercise-card,
.summary {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel {
  border-radius: 8px;
  padding: 18px;
}

.method-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.option-panel {
  display: grid;
  gap: 18px;
}

.option-group {
  display: grid;
  gap: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented.three {
  grid-template-columns: repeat(3, 1fr);
}

.segmented button,
.target-option {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.segmented button.selected,
.target-option.selected {
  border-color: var(--accent);
  background: #e7f4f1;
  box-shadow: inset 0 0 0 1px rgba(27, 127, 120, 0.18);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
}

.toggle-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.target-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.target-option {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  text-align: left;
}

.target-option span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.method {
  min-height: 108px;
  text-align: left;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.method strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}

.button-row button {
  flex: 1 1 140px;
}

.primary,
.secondary,
.ghost,
.danger {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 18px;
  cursor: pointer;
}

.primary {
  background: var(--accent);
  color: white;
}

.primary:active {
  background: var(--accent-dark);
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

.secondary {
  background: var(--soft);
  color: var(--ink);
  border-color: var(--line);
}

.ghost {
  background: transparent;
  color: var(--accent-dark);
  padding-inline: 6px;
}

.danger {
  background: #fff4f3;
  color: var(--danger);
  border-color: #f0c9c7;
}

.calibration-frame {
  display: grid;
  place-items: center;
  min-height: 260px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(24, 32, 31, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(24, 32, 31, 0.06) 1px, transparent 1px),
    #f8fbf9;
  background-size: 24px 24px;
  overflow: hidden;
}

.card-outline {
  width: var(--cal-width);
  height: calc(var(--cal-width) / 1.586);
  border: 3px solid var(--accent);
  border-radius: 12px;
  background: rgba(27, 127, 120, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.ruler-outline {
  width: var(--cal-width);
  height: 78px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 2px, transparent 2px 10%);
  position: relative;
}

.ruler-outline::after {
  content: "10 см";
  position: absolute;
  inset: auto 0 10px 0;
  text-align: center;
  color: var(--accent-dark);
  font-weight: 700;
}

.slider {
  width: 100%;
  accent-color: var(--accent);
}

.glasses-test {
  display: grid;
  gap: 12px;
}

.glasses-test.single {
  grid-template-columns: minmax(0, 1fr);
}

.glasses-test.two-col {
  grid-template-columns: 1fr 1fr;
}

.glasses-card {
  min-height: 190px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(24, 32, 31, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(24, 32, 31, 0.04) 1px, transparent 1px),
    #ffffff;
  background-size: 18px 18px;
  text-align: center;
}

.glasses-card .test-ring {
  width: min(34vw, 150px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 12px solid currentColor;
  background:
    radial-gradient(circle, transparent 0 30%, currentColor 31% 35%, transparent 36%),
    linear-gradient(currentColor, currentColor) center / 78% 5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 5px 78% no-repeat;
  opacity: 0.98;
}

.glasses-card strong {
  color: var(--ink);
}

.glasses-card p {
  max-width: 260px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.red-card {
  color: var(--test-red);
}

.second-card {
  color: var(--test-second);
}

.range-row {
  display: grid;
  grid-template-columns: minmax(76px, 110px) 1fr 48px;
  align-items: center;
  gap: 10px;
}

.range-row span,
.range-row b {
  color: var(--muted);
  font-size: 13px;
}

.range-row b {
  text-align: right;
}

.catalog {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.exercise-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  border-radius: 8px;
  padding: 16px;
}

.card-bottom {
  align-self: end;
  display: grid;
  gap: 10px;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.exercise-card .primary {
  width: 100%;
  height: 48px;
  min-height: 48px;
}

.session {
  height: calc(100svh - 36px);
  overflow: hidden;
}

.session-layout {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-rows: auto minmax(230px, 1fr) auto auto auto;
  gap: 12px;
}

.explain {
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.35;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfdfb;
  overflow: hidden;
}

.target {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  z-index: 3;
}

.target::before,
.target::after,
.target .mark {
  content: "";
  position: absolute;
  border-radius: inherit;
}

.target::before {
  inset: 0;
  border: 4px solid currentColor;
  background: color-mix(in srgb, currentColor 10%, white);
}

.target::after {
  width: 24%;
  height: 24%;
  background: currentColor;
}

.target .mark {
  width: 72%;
  height: 72%;
  border: 2px solid currentColor;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
  opacity: 0.82;
}

.target.rings::after,
.target.flower::after,
.target.crystal::after,
.target.orbit::after,
.target.nonius::after,
.target.tranaglyph-basic::after,
.target.tranaglyph-stereo::after,
.target.tranaglyph-central::after,
.target.tranaglyph-nonius::after,
.target.tranaglyph-basic::before,
.target.tranaglyph-stereo::before,
.target.tranaglyph-central::before,
.target.tranaglyph-nonius::before {
  display: none;
}

.target.tranaglyph-basic,
.target.tranaglyph-stereo,
.target.tranaglyph-central,
.target.tranaglyph-nonius {
  border-radius: 0;
  mix-blend-mode: multiply;
}

.tg-ring {
  position: absolute;
  border: max(2px, calc(var(--size) * .018)) solid currentColor;
  border-radius: 50%;
}

.tg-ring.outer {
  inset: 5%;
}

.tg-ring.mid {
  inset: 20%;
}

.tg-ring.inner {
  inset: 36%;
}

.tg-lock {
  position: absolute;
  width: 13%;
  height: 13%;
  border: max(2px, calc(var(--size) * .015)) solid currentColor;
  border-radius: 50%;
}

.tg-lock.top-left { left: 13%; top: 13%; }
.tg-lock.top-right { right: 13%; top: 13%; }
.tg-lock.bottom-left { left: 13%; bottom: 13%; }
.tg-lock.bottom-right { right: 13%; bottom: 13%; }

.tg-depth {
  position: absolute;
  top: 50%;
  width: 18%;
  height: 18%;
  border: max(2px, calc(var(--size) * .014)) solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.tg-depth.left {
  left: 27%;
}

.tg-depth.right {
  right: 27%;
}

.tg-cross {
  position: absolute;
  background: currentColor;
}

.tg-cross.horizontal {
  left: 35%;
  right: 35%;
  top: 50%;
  height: max(2px, calc(var(--size) * .014));
  transform: translateY(-50%);
}

.tg-cross.vertical {
  top: 35%;
  bottom: 35%;
  left: 50%;
  width: max(2px, calc(var(--size) * .014));
  transform: translateX(-50%);
}

.tg-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8%;
  height: 8%;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.tg-nonius {
  position: absolute;
  left: 50%;
  width: max(3px, calc(var(--size) * .018));
  height: 23%;
  background: currentColor;
  transform: translateX(-50%);
}

.tg-nonius.top {
  top: 2%;
}

.tg-nonius.bottom {
  bottom: 2%;
}

.ana-ring {
  position: absolute;
  border-radius: 50%;
  border: 3px solid currentColor;
}

.ana-ring.outer {
  inset: 4%;
}

.ana-ring.inner {
  inset: 28%;
  opacity: .72;
}

.petal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26%;
  height: 48%;
  border-radius: 50% 50% 42% 42%;
  border: 2px solid currentColor;
  background: color-mix(in srgb, currentColor 16%, white);
  transform-origin: 50% 86%;
}

.petal.p1 { transform: translate(-50%, -86%) rotate(0deg); }
.petal.p2 { transform: translate(-50%, -86%) rotate(60deg); }
.petal.p3 { transform: translate(-50%, -86%) rotate(120deg); }
.petal.p4 { transform: translate(-50%, -86%) rotate(180deg); }
.petal.p5 { transform: translate(-50%, -86%) rotate(240deg); }
.petal.p6 { transform: translate(-50%, -86%) rotate(300deg); }

.crystal-shape {
  position: absolute;
  inset: 10%;
  border: 3px solid currentColor;
  background: color-mix(in srgb, currentColor 12%, white);
  clip-path: polygon(50% 0, 92% 50%, 50% 100%, 8% 50%);
}

.crystal-line {
  position: absolute;
  background: currentColor;
  opacity: .75;
}

.crystal-line.vertical {
  width: 2px;
  height: 76%;
}

.crystal-line.horizontal {
  width: 76%;
  height: 2px;
}

.orbit-ring {
  position: absolute;
  inset: 13%;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.orbit-dot {
  position: absolute;
  width: 16%;
  height: 16%;
  border-radius: 50%;
  background: currentColor;
}

.orbit-dot.d1 { left: 10%; top: 42%; }
.orbit-dot.d2 { right: 14%; top: 20%; }
.orbit-dot.d3 { right: 21%; bottom: 14%; }

.nonius-ring {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 3px solid currentColor;
}

.nonius-tick {
  position: absolute;
  left: 50%;
  width: 3px;
  height: 32%;
  background: currentColor;
  transform: translateX(-50%);
}

.nonius-tick.top {
  top: 0;
}

.nonius-tick.bottom {
  bottom: 0;
}

.target.window {
  border-radius: 8px;
}

.target.window::before {
  border-radius: 8px;
}

.window-grid {
  position: absolute;
  inset: 18%;
  border: 2px solid currentColor;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
}

.center-dot {
  position: absolute;
  width: 18%;
  height: 18%;
  border-radius: 50%;
  background: currentColor;
  z-index: 2;
}

.target.bars::after,
.target.window::after,
.target.letters::after,
.target.face::after,
.target.hedgehog::after {
  display: none;
}

.target.face:not(.color-mode),
.target.hedgehog:not(.color-mode) {
  color: #20645f;
}

.target.face::before,
.target.hedgehog::before {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 18%, #f7c96f);
}

.face-eye {
  position: absolute;
  top: 34%;
  width: 12%;
  height: 12%;
  border-radius: 50%;
  background: #18201f;
  z-index: 2;
}

.left-eye {
  left: 32%;
}

.right-eye {
  right: 32%;
}

.face-smile {
  position: absolute;
  left: 50%;
  bottom: 28%;
  width: 38%;
  height: 20%;
  border-bottom: 3px solid #b55343;
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
  z-index: 2;
}

.hedgehog-spines {
  position: absolute;
  inset: 8% 18% 24% 12%;
  background: repeating-linear-gradient(135deg, #7a5a3b 0 5px, #4e3927 5px 10px);
  clip-path: polygon(0 70%, 10% 25%, 20% 65%, 32% 15%, 44% 62%, 56% 12%, 68% 64%, 80% 24%, 100% 72%, 100% 100%, 0 100%);
  z-index: 2;
}

.hedgehog-body {
  position: absolute;
  left: 22%;
  right: 12%;
  bottom: 16%;
  height: 46%;
  border-radius: 50% 45% 42% 50%;
  background: #d79a55;
  z-index: 2;
}

.hedgehog-ear {
  position: absolute;
  right: 30%;
  top: 29%;
  width: 18%;
  height: 18%;
  border-radius: 60% 60% 20% 60%;
  background: #d79a55;
  transform: rotate(22deg);
  z-index: 3;
}

.hedgehog-eye {
  position: absolute;
  right: 28%;
  top: 43%;
  width: 10%;
  height: 10%;
  border-radius: 50%;
  background: #18201f;
  z-index: 3;
}

.hedgehog-nose {
  position: absolute;
  right: 14%;
  top: 52%;
  width: 10%;
  height: 10%;
  border-radius: 50%;
  background: #18201f;
  z-index: 3;
}

.hedgehog-legs {
  position: absolute;
  left: 34%;
  right: 28%;
  bottom: 10%;
  height: 12%;
  background:
    radial-gradient(circle at 20% 50%, #7a5a3b 0 30%, transparent 32%),
    radial-gradient(circle at 80% 50%, #7a5a3b 0 30%, transparent 32%);
  z-index: 3;
}

.bar {
  position: absolute;
  width: 66%;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.bar.one {
  top: 30%;
}

.bar.two {
  top: 50%;
  transform: translateY(-50%);
}

.bar.three {
  bottom: 30%;
}

.letter {
  position: absolute;
  color: currentColor;
  font-size: calc(var(--size) * 0.2);
  font-weight: 700;
  line-height: 1;
}

.letter.top {
  top: 12%;
}

.letter.right {
  right: 12%;
}

.letter.bottom {
  bottom: 12%;
}

.letter.left {
  left: 12%;
}

.target.left {
  left: calc(50% - var(--gap));
  top: 50%;
  color: var(--left-color, var(--accent));
}

.target.right {
  left: calc(50% + var(--gap));
  top: 50%;
  color: var(--right-color, var(--accent));
}

.target.follow {
  left: 0;
  top: 0;
  color: var(--warm);
  will-change: transform;
}

.depth-scene,
.pencil-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.depth-scene {
  background:
    radial-gradient(ellipse at 50% 15%, rgba(27, 127, 120, 0.08), transparent 34%),
    linear-gradient(180deg, #fbfdfc 0 42%, #edf6f3 42% 100%);
  perspective: 720px;
}

.depth-grid {
  position: absolute;
  left: 50%;
  bottom: -22%;
  width: 120%;
  height: 74%;
  background:
    repeating-linear-gradient(90deg, rgba(27,127,120,.14) 0 1px, transparent 1px 10%),
    repeating-linear-gradient(0deg, rgba(27,127,120,.12) 0 1px, transparent 1px 16%);
  transform: translateX(-50%) rotateX(64deg);
  transform-origin: 50% 100%;
}

.depth-horizon {
  position: absolute;
  left: 16%;
  right: 16%;
  top: 42%;
  height: 1px;
  background: rgba(27,127,120,.25);
}

.depth-orb {
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, white 0 10%, transparent 11%),
    radial-gradient(circle at 42% 38%, #f7d27e 0 18%, #f2b35d 50%, #9a6b29 100%);
  box-shadow: 0 24px 28px rgba(24,32,31,.18);
  will-change: transform, filter, opacity;
}

.pencil-stage {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fcfdfb, #eef5f2);
}

.pencil-person {
  position: absolute;
  top: 18%;
  width: 130px;
  height: 78px;
  border-radius: 50% 50% 44% 44%;
  border: 2px solid rgba(24,32,31,.22);
  background: rgba(255,255,255,.72);
}

.person-eye {
  position: absolute;
  top: 34px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #18201f;
}

.person-eye.left {
  left: 36px;
}

.person-eye.right {
  right: 36px;
}

.real-pencil {
  position: absolute;
  left: 50%;
  bottom: 20%;
  width: 14px;
  height: 34%;
  border-radius: 999px 999px 4px 4px;
  background:
    linear-gradient(#2d2b28 0 10%, transparent 10%),
    linear-gradient(90deg, #d49a3d 0 35%, #f3c36b 35% 65%, #b9752f 65%);
  transform: translateX(-50%);
  animation: pencilDepthMove 3.6s ease-in-out infinite;
}

.pencil-stage p {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.target.active {
  color: var(--warm);
  filter: drop-shadow(0 0 14px rgba(242, 179, 93, 0.72));
}

.fusion-guide {
  width: calc(var(--size) * 1.18);
  height: calc(var(--size) * 1.18);
  border: 2px dashed rgba(24, 32, 31, 0.28);
  border-radius: 50%;
  z-index: 2;
}

.depth-guide {
  position: absolute;
  inset: 8% 10%;
  pointer-events: none;
  z-index: 1;
}

.depth-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44%;
  height: 1px;
  background: linear-gradient(90deg, rgba(27, 127, 120, 0.05), rgba(27, 127, 120, 0.48));
  transform-origin: 0 50%;
}

.depth-line.top-left {
  transform: rotate(212deg);
}

.depth-line.top-right {
  transform: rotate(328deg);
}

.depth-line.bottom-left {
  transform: rotate(148deg);
}

.depth-line.bottom-right {
  transform: rotate(32deg);
}

.depth-point {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 8px rgba(27, 127, 120, 0.08);
}

.depth-label {
  position: absolute;
  left: 50%;
  top: calc(50% - 34px);
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.near-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.near-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 27%;
  height: 1px;
  background: linear-gradient(90deg, rgba(242, 179, 93, 0.08), rgba(242, 179, 93, 0.7));
  transform-origin: 0 50%;
}

.near-line.left-line {
  transform: rotate(132deg);
}

.near-line.right-line {
  transform: rotate(48deg);
}

.near-point {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px dashed var(--warm);
  background: rgba(242, 179, 93, 0.08);
  transform: translateX(-50%);
  box-shadow: none;
}

.near-stick {
  position: absolute;
  left: 50%;
  bottom: calc(18% + 18px);
  width: 4px;
  height: 26%;
  border-radius: 999px;
  background: repeating-linear-gradient(
    180deg,
    rgba(242, 179, 93, 0.72) 0 10px,
    transparent 10px 17px
  );
  transform: translateX(-50%);
}

.near-label {
  position: absolute;
  left: 50%;
  bottom: calc(18% + 28px);
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  background: rgba(252, 253, 251, 0.86);
  padding: 2px 6px;
  border-radius: 999px;
}

.details {
  display: grid;
  gap: 10px;
  max-height: 24svh;
  overflow: auto;
}

.details-block {
  display: grid;
  gap: 3px;
}

.details-block strong {
  font-size: 13px;
}

.details-block p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.36;
}

.quick-hint {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(27, 127, 120, 0.22);
  background: #e7f4f1;
}

.quick-hint strong {
  color: var(--accent-dark);
  font-size: 13px;
}

.quick-hint p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.guide-toggle {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid #e0d6c5;
  background: #fff8ec;
  color: #6b4a19;
  cursor: pointer;
}

.eye-guide {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e0d6c5;
  background: #fff8ec;
}

.guide-head {
  display: grid;
  gap: 3px;
}

.guide-head strong {
  color: #6b4a19;
  font-size: 13px;
}

.guide-head span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.32;
}

.guide-demo {
  position: relative;
  height: 74px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(24, 32, 31, 0.08) 1px, transparent 1px),
    #fffdf8;
  background-size: 25% 100%;
  overflow: hidden;
}

.guide-eye {
  position: absolute;
  top: 12px;
  width: 38px;
  height: 26px;
  border: 2px solid #6b4a19;
  border-radius: 50%;
  background: white;
}

.guide-eye.left-eye-demo {
  left: calc(50% - 52px);
}

.guide-eye.right-eye-demo {
  left: calc(50% + 14px);
}

.guide-eye span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #18201f;
  transform: translate(-50%, -50%);
}

.guide-track {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  height: 20px;
  border-top: 1px dashed rgba(107, 74, 25, 0.35);
}

.guide-target {
  position: absolute;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--warm);
  transform: translateX(-50%);
  opacity: 0.45;
}

.guide-target.one {
  left: 22%;
}

.guide-target.two {
  left: 50%;
}

.guide-target.three {
  left: 78%;
}

.guide-follow .guide-target.one {
  animation: guideTargetFollow 3s linear infinite;
  opacity: 1;
}

.guide-follow .guide-target.two,
.guide-follow .guide-target.three {
  display: none;
}

.guide-follow .guide-eye span {
  animation: guidePupilFollow 3s linear infinite;
}

.guide-shifts .guide-target {
  animation: guideBlink 2.4s steps(1, end) infinite;
}

.guide-shifts .guide-target.two {
  animation-delay: .8s;
}

.guide-shifts .guide-target.three {
  animation-delay: 1.6s;
}

.guide-shifts .guide-eye span {
  animation: guidePupilShift 2.4s steps(1, end) infinite;
}

.guide-step .guide-target {
  animation: guideStepTarget 3.6s steps(1, end) infinite;
}

.guide-step .guide-target.two {
  animation-delay: 1.2s;
}

.guide-step .guide-target.three {
  animation-delay: 2.4s;
}

.guide-step .guide-eye span {
  animation: guidePupilStep 3.6s steps(1, end) infinite;
}

.guide-converge .guide-eye.left-eye-demo span {
  animation: guideLeftConverge 2.8s ease-in-out infinite;
}

.guide-converge .guide-eye.right-eye-demo span {
  animation: guideRightConverge 2.8s ease-in-out infinite;
}

.guide-converge .guide-target.two {
  opacity: 1;
  box-shadow: 0 0 0 8px rgba(242, 179, 93, 0.14);
}

.guide-diverge .guide-eye.left-eye-demo span {
  animation: guideLeftDiverge 2.8s ease-in-out infinite;
}

.guide-diverge .guide-eye.right-eye-demo span {
  animation: guideRightDiverge 2.8s ease-in-out infinite;
}

.guide-diverge .guide-target.three {
  opacity: 1;
  box-shadow: 0 0 0 8px rgba(27, 127, 120, 0.12);
}

.guide-hold .guide-eye span {
  animation: guideHold 2.4s ease-in-out infinite;
}

.guide-hold .guide-target.two {
  opacity: 1;
}

.vertical-guide-demo .guide-eye span {
  animation: guideVerticalPupil 3.6s steps(1, end) infinite;
}

.vertical-track {
  position: absolute;
  left: 50%;
  top: 18px;
  bottom: 8px;
  width: 2px;
  background: rgba(107, 74, 25, 0.22);
}

.vertical-target {
  position: absolute;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--warm);
  transform: translate(-50%, -50%);
  opacity: 0.35;
  animation: guideVerticalTarget 3.6s steps(1, end) infinite;
}

.vertical-target.bottom {
  top: 82%;
}

.vertical-target.middle {
  top: 55%;
  animation-delay: 1.2s;
}

.vertical-target.top {
  top: 28%;
  animation-delay: 2.4s;
}

.barrel-guide-demo .guide-eye span {
  animation: guideVerticalPupil 3.6s steps(1, end) infinite;
}

.mini-barrels {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 8px;
  display: grid;
  gap: 5px;
}

.mini-barrels i {
  justify-self: center;
  width: 70px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d24b4b 0 44%, transparent 44% 56%, #1b8a63 56%);
  opacity: 0.35;
  animation: guideVerticalTarget 3.6s steps(1, end) infinite;
}

.mini-barrels i:nth-child(2) {
  width: 54px;
  animation-delay: 1.2s;
}

.mini-barrels i:nth-child(3) {
  width: 38px;
  animation-delay: 2.4s;
}

.shifts-grid-demo .guide-eye span {
  animation: guideGridPupil 3.2s steps(1, end) infinite;
}

.mini-grid {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 82px;
  height: 48px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 42px;
}

.mini-grid i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--warm);
  opacity: 0.35;
  animation: guideGridTarget 3.2s steps(1, end) infinite;
}

.mini-grid i:nth-child(2) {
  animation-delay: .8s;
}

.mini-grid i:nth-child(4) {
  animation-delay: 1.6s;
}

.mini-grid i:nth-child(3) {
  animation-delay: 2.4s;
}

.pencil-demo {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 10px;
  height: 52px;
  border-radius: 999px 999px 4px 4px;
  background:
    linear-gradient(#2d2b28 0 12%, transparent 12%),
    linear-gradient(90deg, #d49a3d 0 35%, #f3c36b 35% 65%, #b9752f 65%);
  transform: translateX(-50%);
  animation: guidePencilMove 2.8s ease-in-out infinite;
}

.pencil-demo::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 34px;
  height: 14px;
  border-radius: 50%;
  background: rgba(190, 143, 92, 0.45);
  transform: translateX(-50%);
}

.pencil-demo::after {
  content: "карандаш";
  position: absolute;
  left: 50%;
  bottom: -22px;
  color: var(--muted);
  font-size: 10px;
  transform: translateX(-50%);
}

.guide-pencil .guide-eye.left-eye-demo span {
  animation: guideLeftConverge 2.8s ease-in-out infinite;
}

.guide-pencil .guide-eye.right-eye-demo span {
  animation: guideRightConverge 2.8s ease-in-out infinite;
}

.ladder {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.step {
  height: 8px;
  border-radius: 999px;
  background: #dbe5e1;
}

.step.done {
  background: var(--accent);
}

.hold-timer {
  position: absolute;
  top: 18px;
  font-size: clamp(34px, 12vw, 76px);
  font-weight: 700;
  color: rgba(24, 32, 31, 0.18);
}

.timer-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  min-width: 58px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(24, 32, 31, 0.08);
}

.session-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

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

.session-actions.one {
  grid-template-columns: 1fr;
}

.brock-scene,
.dot-card-scene,
.barrel-scene {
  position: absolute;
  inset: 0;
}

.brock-scene {
  background:
    linear-gradient(180deg, rgba(252,253,251,0) 0 35%, rgba(27,127,120,.05) 35% 100%),
    #fcfdfb;
  perspective: 700px;
  overflow: hidden;
}

.depth-floor {
  position: absolute;
  left: 50%;
  bottom: -18%;
  width: 115%;
  height: 72%;
  background:
    repeating-linear-gradient(90deg, rgba(27,127,120,.16) 0 1px, transparent 1px 12%),
    repeating-linear-gradient(0deg, rgba(27,127,120,.12) 0 1px, transparent 1px 18%);
  transform: translateX(-50%) rotateX(64deg);
  transform-origin: 50% 100%;
  z-index: 1;
}

.perspective-line {
  position: absolute;
  left: 50%;
  top: 20%;
  width: 2px;
  height: 68%;
  background: rgba(27, 127, 120, 0.48);
  transform-origin: 50% 0;
  z-index: 2;
}

.perspective-line.center {
  transform: translateX(-50%);
}

.perspective-line.left {
  transform: translateX(-50%) rotate(22deg);
  opacity: .42;
}

.perspective-line.right {
  transform: translateX(-50%) rotate(-22deg);
  opacity: .42;
}

/* legacy selector kept empty intentionally if older markup is cached */
.brock-thread {
  left: 50%;
  top: 0;
}

.bead {
  position: absolute;
  width: var(--bead-size);
  height: var(--bead-size);
  border-radius: 50%;
  background: var(--bead);
  border: 3px solid white;
  box-shadow: 0 6px 16px rgba(24, 32, 31, 0.18);
  transform: translate(-50%, -50%);
  z-index: 4;
}

.bead.depth-0 {
  filter: drop-shadow(0 18px 16px rgba(24,32,31,.18));
}

.bead.depth-1 {
  filter: drop-shadow(0 10px 10px rgba(24,32,31,.14));
}

.bead.depth-2 {
  filter: drop-shadow(0 5px 7px rgba(24,32,31,.1));
}

.bead.active {
  box-shadow: 0 0 0 8px rgba(242, 179, 93, 0.24), 0 8px 22px rgba(24, 32, 31, 0.2);
  z-index: 5;
}

.dot-guide {
  position: absolute;
  left: 50%;
  top: 12%;
  width: 2px;
  height: 78%;
  background: rgba(24, 32, 31, 0.18);
  transform-origin: 50% 100%;
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(255,255,255,.72);
}

.left-guide {
  transform: rotate(-16deg);
}

.right-guide {
  transform: rotate(16deg);
}

.dot-card-point {
  position: absolute;
  left: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dbe5e1;
  border: 2px solid #9aaba5;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.dot-card-point.active {
  width: 36px;
  height: 36px;
  background: var(--warm);
  border-color: #9a6b29;
  z-index: 4;
}

.barrel-scene {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 24px;
}

.barrel-row {
  display: flex;
  justify-content: center;
  gap: clamp(28px, 14vw, 140px);
  opacity: 0.45;
}

.barrel-row.active {
  opacity: 1;
}

.barrel {
  width: var(--barrel-size);
  height: calc(var(--barrel-size) * 0.62);
  border-radius: 50% / 42%;
  border: 3px solid currentColor;
  background:
    linear-gradient(90deg, transparent 18%, rgba(255,255,255,.62) 18% 24%, transparent 24% 76%, rgba(255,255,255,.62) 76% 82%, transparent 82%),
    color-mix(in srgb, currentColor 18%, white);
}

.barrel.red {
  color: #d24b4b;
}

.barrel.green {
  color: #1b8a63;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  background: rgba(24, 32, 31, 0.22);
}

.summary {
  width: min(100%, 460px);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

@keyframes guideTargetFollow {
  0% { left: 16%; top: -7px; }
  25% { left: 42%; top: -22px; }
  50% { left: 78%; top: -7px; }
  75% { left: 54%; top: 8px; }
  100% { left: 16%; top: -7px; }
}

@keyframes guidePupilFollow {
  0% { transform: translate(-80%, -50%); }
  25% { transform: translate(-35%, -76%); }
  50% { transform: translate(-18%, -50%); }
  75% { transform: translate(-42%, -24%); }
  100% { transform: translate(-80%, -50%); }
}

@keyframes guideBlink {
  0%, 32% { opacity: 1; box-shadow: 0 0 0 8px rgba(242, 179, 93, 0.18); }
  33%, 100% { opacity: 0.35; box-shadow: none; }
}

@keyframes guidePupilShift {
  0%, 32% { transform: translate(-78%, -50%); }
  33%, 65% { transform: translate(-50%, -50%); }
  66%, 100% { transform: translate(-22%, -50%); }
}

@keyframes guideStepTarget {
  0%, 32% { opacity: 1; transform: translateX(-50%) scale(1.3); }
  33%, 100% { opacity: 0.35; transform: translateX(-50%) scale(1); }
}

@keyframes guidePupilStep {
  0%, 32% { transform: translate(-50%, -32%); }
  33%, 65% { transform: translate(-50%, -50%); }
  66%, 100% { transform: translate(-50%, -68%); }
}

@keyframes guideLeftConverge {
  0%, 100% { transform: translate(-58%, -50%); }
  50% { transform: translate(-22%, -50%); }
}

@keyframes guideRightConverge {
  0%, 100% { transform: translate(-42%, -50%); }
  50% { transform: translate(-78%, -50%); }
}

@keyframes guideLeftDiverge {
  0%, 100% { transform: translate(-42%, -50%); }
  50% { transform: translate(-78%, -50%); }
}

@keyframes guideRightDiverge {
  0%, 100% { transform: translate(-58%, -50%); }
  50% { transform: translate(-22%, -50%); }
}

@keyframes guideHold {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -45%); }
}

@keyframes guideVerticalPupil {
  0%, 32% { transform: translate(-50%, 8%); }
  33%, 65% { transform: translate(-50%, -50%); }
  66%, 100% { transform: translate(-50%, -108%); }
}

@keyframes guideVerticalTarget {
  0%, 32% { opacity: 1; box-shadow: 0 0 0 7px rgba(242, 179, 93, 0.16); }
  33%, 100% { opacity: 0.35; box-shadow: none; }
}

@keyframes guideGridPupil {
  0%, 24% { transform: translate(-82%, -78%); }
  25%, 49% { transform: translate(-18%, -78%); }
  50%, 74% { transform: translate(-18%, -22%); }
  75%, 100% { transform: translate(-82%, -22%); }
}

@keyframes guideGridTarget {
  0%, 24% { opacity: 1; box-shadow: 0 0 0 7px rgba(242, 179, 93, 0.16); }
  25%, 100% { opacity: 0.35; box-shadow: none; }
}

@keyframes guidePencilMove {
  0%, 100% { bottom: 8px; opacity: 0.9; }
  50% { bottom: 24px; opacity: 1; }
}

@keyframes pencilDepthMove {
  0%, 100% {
    height: 28%;
    bottom: 18%;
    opacity: .82;
  }
  50% {
    height: 42%;
    bottom: 16%;
    opacity: 1;
  }
}

@media (min-width: 680px) {
  .app {
    padding-inline: 28px;
  }

  .method-grid,
  .catalog,
  .target-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session-actions {
    width: min(100%, 560px);
    justify-self: center;
  }
}

@media (max-width: 420px) {
  .top {
    flex-direction: column;
  }

  .glasses-test {
    grid-template-columns: 1fr;
  }

  .glasses-test.two-col,
  .segmented.three {
    grid-template-columns: 1fr;
  }

  .range-row {
    grid-template-columns: 1fr 42px;
  }

  .range-row span {
    grid-column: 1 / -1;
  }

  .session-actions {
    grid-template-columns: 1fr;
  }

  .session-actions.two {
    grid-template-columns: 1fr 1fr;
  }
}
