
  :root {
    --bg-base: #F0F4F8;

    /* Glass layers */
    --glass: rgba(255,255,255,0.52);
    --glass-border: rgba(255,255,255,0.62);
    --glass-shadow: rgba(59,130,246,0.07);
    --glass-hover: rgba(255,255,255,0.72);
    --glass-strong: rgba(240,244,248,0.88);

    /* Text */
    --text-1: #0F172A;
    --text-2: #475569;
    --text-3: #94A3B8;
    --text-on-accent: #FFFFFF;

    /* Accent */
    --accent: #3B82F6;
    --accent-hover: #2563EB;
    --accent-soft: rgba(59,130,246,0.09);
    --accent-glow: rgba(59,130,246,0.18);

    /* States */
    --ok: #10B981;
    --ok-soft: rgba(16,185,129,0.07);
    --ok-border: rgba(16,185,129,0.22);
    --err: #EF4444;
    --err-soft: rgba(239,68,68,0.07);
    --err-border: rgba(239,68,68,0.22);

    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 24px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur: 0.42s;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { height: 100%; overflow: hidden; }

  body {
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    background: var(--bg-base);
    color: var(--text-1);
    -webkit-font-smoothing: antialiased;
  }

  /* ── AMBIENT ── */
  .ambient {
    position: fixed; inset: 0; z-index: 0;
    overflow: hidden; pointer-events: none;
  }
  .orb {
    position: absolute; border-radius: 50%;
    filter: blur(90px); opacity: 0.45;
    animation: drift 22s ease-in-out infinite alternate;
  }
  .orb:nth-child(1) {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(59,130,246,0.16), transparent 70%);
    top: -12%; left: -8%;
  }
  .orb:nth-child(2) {
    width: 340px; height: 340px;
    background: radial-gradient(circle, rgba(99,102,241,0.10), transparent 70%);
    bottom: -14%; right: -8%;
    animation-delay: -8s; animation-duration: 26s;
  }
  .orb:nth-child(3) {
    width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(59,130,246,0.09), transparent 70%);
    top: 38%; right: -6%;
    animation-delay: -14s; animation-duration: 19s;
  }
  @keyframes drift {
    0%   { transform: translate(0,0) scale(1); }
    50%  { transform: translate(25px,-18px) scale(1.04); }
    100% { transform: translate(-12px,20px) scale(0.98); }
  }

  /* ── PROGRESS ── */
  .prog-wrap {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: var(--glass-strong);
    backdrop-filter: blur(28px) saturate(1.5);
    -webkit-backdrop-filter: blur(28px) saturate(1.5);
    border-bottom: 1px solid var(--glass-border);
  }
  .prog-track { height: 3px; background: rgba(59,130,246,0.08); }
  .prog-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--accent), #818CF8);
    border-radius: 0 3px 3px 0;
    transition: width 0.6s var(--ease-out);
    position: relative;
  }
  .prog-fill::after {
    content: ''; position: absolute; right: -3px; top: -3px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 14px var(--accent-glow);
    opacity: 0.75;
  }
  .prog-row {
    display: flex; justify-content: space-between;
    padding: 10px 24px 10px;
  }
  .prog-label {
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--text-2);
  }
  .prog-pct {
    font-size: 10.5px; font-weight: 700; color: var(--accent);
    font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  }

  /* ── VIEWPORT ── */
  .viewport {
    position: fixed; top: 54px; left: 0; right: 0; bottom: 0;
    overflow: hidden; z-index: 1;
  }

  /* ── SLIDE ── */
  .slide {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 20px 20px 108px;
    opacity: 0; transform: translateY(5px);
    pointer-events: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out);
  }
  .slide.active  { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .slide.exit-up { opacity: 0; transform: translateY(-5px); pointer-events: none; }

  /* ── GLASS CARD ── */
  .card {
    width: 100%; max-width: 400px;
    background: var(--glass);
    backdrop-filter: blur(44px) saturate(1.6);
    -webkit-backdrop-filter: blur(44px) saturate(1.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    padding: 36px 28px;
    box-shadow:
      0 4px 28px var(--glass-shadow),
      0 1px 2px rgba(0,0,0,0.03),
      inset 0 1px 0 rgba(255,255,255,0.55);
    position: relative;
  }
  .card::before {
    content: ''; position: absolute;
    top: 0; left: 20px; right: 20px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.85), transparent);
  }

  /* ── QUESTION ── */
  .q-step {
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.15em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 18px;
  }
  .q-title {
    font-size: 20px; font-weight: 700; line-height: 1.35;
    color: var(--text-1); margin-bottom: 6px;
  }
  .q-desc {
    font-size: 13px; font-weight: 400; color: var(--text-2);
    line-height: 1.65; margin-bottom: 26px;
  }

  /* ── ANSWER BUTTONS ── */
  .answers { display: flex; flex-direction: column; gap: 10px; width: 100%; }

  .ans-btn {
    width: 100%; padding: 15px 20px;
    border-radius: var(--r-sm);
    border: 1.5px solid rgba(15,23,42,0.06);
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-1);
    font-family: "Montserrat", sans-serif;
    font-size: 14px; font-weight: 500;
    text-align: left; cursor: pointer;
    transition: all 0.22s var(--ease);
    -webkit-tap-highlight-color: transparent;
  }
  .ans-btn:active { transform: scale(0.98); }
  .ans-btn:hover {
    border-color: rgba(59,130,246,0.22);
    background: rgba(255,255,255,0.78);
    box-shadow: 0 2px 10px rgba(59,130,246,0.06);
  }
  .ans-btn.sel-yes {
    border-color: var(--ok-border);
    background: var(--ok-soft);
    color: #065F46; font-weight: 600;
  }
  .ans-btn.sel-no {
    border-color: var(--err-border);
    background: var(--err-soft);
    color: #991B1B; font-weight: 600;
  }

  /* ── PHOTO ── */
  .photo-zone {
    width: 100%; aspect-ratio: 4/3;
    border-radius: var(--r-md);
    border: 2px dashed rgba(59,130,246,0.18);
    background: rgba(255,255,255,0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 10px;
    cursor: pointer; overflow: hidden; position: relative;
    transition: all 0.28s var(--ease);
    -webkit-tap-highlight-color: transparent;
  }
  .photo-zone:hover { border-color: rgba(59,130,246,0.35); background: rgba(59,130,246,0.03); }
  .photo-zone:active { transform: scale(0.99); }
  .photo-zone.has-photo { border-style: solid; border-color: var(--ok-border); }
  .photo-zone img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; border-radius: calc(var(--r-md) - 2px);
  }
  .pz-icon {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--accent-soft);
    display: flex; align-items: center; justify-content: center;
  }
  .pz-icon svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .pz-text { font-size: 13px; font-weight: 500; color: var(--text-2); }
  .pz-hint { font-size: 11px; color: var(--text-3); }
  .pz-retake {
    position: absolute; inset: 0;
    background: rgba(15,23,42,0.40);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    border-radius: calc(var(--r-md) - 2px);
    opacity: 0; transition: opacity 0.22s;
  }
  .photo-zone.has-photo:hover .pz-retake,
  .photo-zone.has-photo:active .pz-retake { opacity: 1; }
  .pz-retake span {
    background: rgba(255,255,255,0.16); backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 9px 20px; border-radius: var(--r-sm);
    font-size: 13px; font-weight: 600; color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
  }
  input[type="file"] { display: none; }

  /* ── TEXT ── */
  .txt-field {
    width: 100%; padding: 15px 18px;
    background: rgba(255,255,255,0.50);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(15,23,42,0.06);
    border-radius: var(--r-sm);
    color: var(--text-1); font-family: "Montserrat", sans-serif;
    font-size: 14px; outline: none; resize: none;
    transition: all 0.22s var(--ease);
  }
  .txt-field:focus {
    border-color: rgba(59,130,246,0.38);
    background: rgba(255,255,255,0.72);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.07);
  }
  .txt-field::placeholder { color: var(--text-3); }

  /* ── BOTTOM BAR ── */
  .bottom {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    padding: 12px 24px calc(14px + env(safe-area-inset-bottom, 0px));
    background: var(--glass-strong);
    backdrop-filter: blur(28px) saturate(1.5);
    -webkit-backdrop-filter: blur(28px) saturate(1.5);
    border-top: 1px solid var(--glass-border);
    display: flex; justify-content: center;
  }
  .cta {
    width: 100%; max-width: 400px; padding: 16px 32px;
    border-radius: var(--r-sm); border: none;
    background: var(--accent); color: var(--text-on-accent);
    font-family: "Montserrat", sans-serif;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.28s var(--ease);
    -webkit-tap-highlight-color: transparent;
    position: relative; overflow: hidden;
  }
  .cta::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, transparent 55%);
    pointer-events: none;
  }
  .cta:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 6px 24px rgba(59,130,246,0.22);
    transform: translateY(-1px);
  }
  .cta:active:not(:disabled) { transform: scale(0.98); }
  .cta:disabled { opacity: 0.32; cursor: not-allowed; }
  .cta.is-done { background: var(--ok); }

  /* ── WELCOME ── */
  .w-icon {
    width: 68px; height: 68px; border-radius: 18px;
    background: var(--accent-soft);
    border: 1.5px solid rgba(59,130,246,0.12);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 22px;
  }
  .w-icon svg { width: 30px; height: 30px; stroke: var(--accent); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .w-title { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 8px; line-height: 1.3; }
  .w-desc { font-size: 14px; color: var(--text-2); text-align: center; line-height: 1.65; max-width: 300px; }

  /* ── DONE ── */
  .d-circle {
    width: 76px; height: 76px; border-radius: 50%;
    background: var(--ok-soft); border: 2px solid var(--ok-border);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 22px;
    animation: pop 0.45s var(--ease-out);
  }
  @keyframes pop { 0%{transform:scale(0);opacity:0} 60%{transform:scale(1.06)} 100%{transform:scale(1);opacity:1} }
  .d-circle svg { width: 34px; height: 34px; stroke: var(--ok); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
  .d-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
  .d-desc { font-size: 14px; color: var(--text-2); text-align: center; line-height: 1.65; max-width: 280px; margin-bottom: 18px; }
  .d-meta {
    display: flex; align-items: center; gap: 6px;
    padding: 9px 18px;
    background: rgba(255,255,255,0.50);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-sm);
    font-size: 13px; color: var(--text-2); font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  .d-meta strong { color: var(--text-1); font-weight: 700; }

  /* ── CHOICE ── */
  .choices { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .chc-btn {
    flex: 1 1 calc(50% - 4px); min-width: 120px;
    padding: 13px 16px;
    border-radius: var(--r-sm);
    border: 1.5px solid rgba(15,23,42,0.07);
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: var(--text-1);
    font-family: "Montserrat", sans-serif;
    font-size: 13.5px; font-weight: 500;
    text-align: center; cursor: pointer;
    transition: all 0.22s var(--ease);
    -webkit-tap-highlight-color: transparent;
    line-height: 1.3;
  }
  .chc-btn:active { transform: scale(0.97); }
  .chc-btn:hover {
    border-color: rgba(59,130,246,0.25);
    background: rgba(255,255,255,0.80);
  }
  .chc-btn.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent); font-weight: 700;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
  }

  /* ── TG NATIVE MODE — MainButton приховує нижній бар ── */
  body.use-tg .bottom { display: none !important; }
  body.use-tg .slide { padding-bottom: 20px !important; }
  body.use-tg .viewport { bottom: 0 !important; }

  @media (max-width: 390px) {
    .card { padding: 28px 22px; }
    .q-title { font-size: 18px; }
  }
  @media (prefers-reduced-motion: reduce) {
    *,*::before,*::after { animation-duration: .01ms!important; transition-duration: .01ms!important; }
  }
