/* Discovery — стиль по референсу «Фаст-трек»: чёрный фон, цветное свечение, одна большая карточка на шаг */
:root {
  color-scheme: dark;
  --bg: #050609;
  --ink: #fff;
  --ink-2: rgba(255, 255, 255, .72);
  --ink-3: rgba(255, 255, 255, .48);
  --ink-4: rgba(255, 255, 255, .28);
  --glass: rgba(255, 255, 255, .07);
  --glass-2: rgba(255, 255, 255, .12);
  --hair: rgba(255, 255, 255, .10);
  --glow: #3D5AFE;
  --glow-2: #6A3CFF;
  --go: #8CF5A4;
  --revise: #FFC56B;
  --park: #A9B3D6;
  --kill: #FF8A7A;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* фон: свечение + зерно */
.glow {
  position: fixed; inset: -20%; z-index: 0; pointer-events: none; filter: blur(40px); transition: background .8s ease;
  background:
    radial-gradient(40% 35% at 50% 40%, color-mix(in srgb, var(--glow) 55%, transparent), transparent 70%),
    radial-gradient(30% 30% at 64% 62%, color-mix(in srgb, var(--glow-2) 38%, transparent), transparent 70%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.screen { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 14px 16px 48px; }
.bar { width: min(760px, 100%); display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; margin-bottom: 18px; }
.bar .t { text-align: center; min-width: 0; grid-column: 2; }
.bar .t b { display: block; font-size: 19px; font-weight: 500; letter-spacing: -.01em; }
.bar .t small { display: block; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .t b, .bar .t small:empty { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#backBtn { grid-column: 1; grid-row: 1; }
#newBtn { grid-column: 3; grid-row: 1; }
.circle { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--glass); display: grid; place-items: center; cursor: pointer; color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.circle:hover { background: var(--glass-2); }

.main { width: min(760px, 100%); display: flex; flex-direction: column; flex: 1; }

/* шаги */
.steps { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; flex-wrap: wrap; }
.sd { width: 26px; height: 26px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 12.5px; background: rgba(255, 255, 255, .08); color: var(--ink-3); cursor: pointer; padding: 0; }
.sd:disabled { cursor: default; }
.sd.done { background: #3D5AFE; color: #fff; }
.sd.on { background: #fff; color: #0A0A0C; }
.sd.done[data-gate="kill"] { background: var(--kill); color: #0A0A0C; }
.sd.done[data-gate="park"] { background: var(--park); color: #0A0A0C; }
.sd.done[data-gate="revise"] { background: var(--revise); color: #0A0A0C; }
.sl { font-size: 13.5px; margin: 0 4px 0 2px; }
.steps .sep { width: 12px; height: 1px; background: var(--ink-4); }

/* карточка */
.card {
  position: relative; border-radius: 46px; padding: 30px 30px 28px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--glow) 60%, transparent), transparent 72%),
    radial-gradient(70% 50% at 100% 100%, color-mix(in srgb, var(--glow-2) 32%, transparent), transparent 70%),
    #0E0F14;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 -30px 60px -30px rgba(0, 0, 0, .6), 0 40px 90px -30px color-mix(in srgb, var(--glow) 60%, transparent);
  transition: background .8s;
}
.card.enter { animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.card h1 { font-size: clamp(26px, 5vw, 32px); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 14px; }
.kicker { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; margin-bottom: 10px; }
.sub { color: var(--ink-2); font-size: 15px; margin: 0 0 20px; }
.meta { font-size: 13px; color: var(--ink-3); margin: 0; }
.center { text-align: center; }
.q { display: block; font-size: 13.5px; color: var(--ink-2); margin: 0 0 8px; }

/* ввод */
.big { width: 100%; min-height: 150px; background: transparent; border: 0; resize: none; font-size: clamp(20px, 4.4vw, 25px); line-height: 1.3; padding: 0; color: #fff; }
.big:focus { outline: none; }
.big::placeholder, .in::placeholder { color: var(--ink-4); }
.big[readonly] { min-height: 0; color: var(--ink-2); }
.in { width: 100%; background: rgba(0, 0, 0, .25); border: 1px solid var(--hair); border-radius: 20px; padding: 14px 16px; font-size: 16px; color: #fff; resize: vertical; min-height: 64px; }
.in:focus { outline: none; border-color: rgba(255, 255, 255, .5); }
.vf { position: relative; }
.vf .in, .vf .big { padding-right: 58px; }
.mic { position: absolute; right: 6px; top: 6px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.mic:hover { background: rgba(255, 255, 255, .22); }
.mic.on { background: #FF3B30; animation: rec 1.2s infinite; }
@keyframes rec { 0%, 100% { box-shadow: 0 0 0 4px rgba(255, 59, 48, .25); } 50% { box-shadow: 0 0 0 12px rgba(255, 59, 48, .08); } }
.big-vf .mic { width: 52px; height: 52px; top: auto; bottom: 4px; right: 0; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 10px 16px; background: rgba(255, 255, 255, .08); cursor: pointer; font-size: 14.5px; }
.pill:hover { background: rgba(255, 255, 255, .14); }
.refine .foot .pill { padding: 10px 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 6px 5px 12px; background: rgba(255, 255, 255, .1); font-size: 13px; max-width: 280px; }
.fchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip button { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 5px; }
.fchip.loading { opacity: .5; }
.fchip.error { background: rgba(255, 138, 122, .15); color: var(--kill); }

/* кнопки */
.actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 18px; }
.actions .go:only-child { margin-left: auto; }
.go { flex: 1; max-width: 340px; margin-left: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: 999px; padding: 7px 7px 7px 24px; background: rgba(255, 255, 255, .12); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #fff; font-size: 16px; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); text-align: left; }
.go span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.go .c { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: #0A0A0C; display: grid; place-items: center; flex: none; }
.go:hover { background: rgba(255, 255, 255, .18); }
.go:disabled { opacity: .38; cursor: not-allowed; }
.back { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px 12px 14px; background: rgba(255, 255, 255, .08); cursor: pointer; font-size: 15px; }
.back:hover { background: rgba(255, 255, 255, .14); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 20px; background: rgba(255, 255, 255, .1); cursor: pointer; font-size: 15px; }
.btn:hover { background: rgba(255, 255, 255, .18); }
.btn.white { background: #fff; color: #0A0A0C; }
.btn.white:hover { background: #E8E8EE; }
.btn.small { padding: 9px 16px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: wait; }
.link { background: none; border: 0; color: var(--ink-3); font-size: 13.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }
.link:hover { color: #fff; }

/* работа агента */
.todo { list-style: none; margin: 4px 0 6px; padding: 0; }
.todo li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hair); color: var(--ink-3); font-size: 15px; }
.todo li:last-child { border-bottom: 0; }
.todo .tb { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .3); display: grid; place-items: center; flex: none; }
.todo .tb svg { width: 13px; height: 13px; }
.todo li.ok { color: var(--ink-2); }
.todo li.ok .tb { background: #fff; border-color: #fff; color: #0A0A0C; }
.todo li.cur { color: #fff; }
.todo li.cur .tb { border-color: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .6); }
.ai-dots { display: flex; justify-content: center; gap: 10px; margin: 26px 0 12px; }
.ai-dots i { width: 10px; height: 10px; border-radius: 50%; background: #fff; opacity: .25; animation: blink 1.2s infinite ease-in-out; }
.ai-dots i:nth-child(2) { animation-delay: .15s; } .ai-dots i:nth-child(3) { animation-delay: .3s; } .ai-dots i:nth-child(4) { animation-delay: .45s; } .ai-dots i:nth-child(5) { animation-delay: .6s; }
@keyframes blink { 0%, 100% { opacity: .2; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); box-shadow: 0 0 10px #fff; } }
.live { min-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tip { font-size: 14px; color: var(--ink-2); background: rgba(0, 0, 0, .3); border-radius: 20px; padding: 12px 14px; margin-bottom: 16px; }

/* результат агента */
.md { font-size: 15.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.md h2 { font-size: 13px; font-weight: 500; color: var(--ink-3); margin: 26px 0 8px; padding-top: 18px; border-top: 1px solid var(--hair); }
.md > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.md blockquote { margin: 0 0 16px; padding: 0; border: 0; font-size: clamp(18px, 3.8vw, 21px); line-height: 1.35; color: #fff; }
.md blockquote p { margin: 0; }
.md h3 { font-size: 13.5px; font-weight: 400; color: var(--ink-3); margin: 14px 0 6px; }
.md h1 { font-size: 22px; font-weight: 500; color: #fff; margin: 0 0 12px; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 18px; }
.md li { margin-bottom: 4px; }
.md li::marker { color: var(--ink-4); }
.md strong { color: #fff; font-weight: 500; }
.md a { color: #fff; text-decoration-color: var(--ink-4); text-underline-offset: 3px; }
.md a:hover { text-decoration-color: #fff; }
.md code { background: rgba(255, 255, 255, .1); border-radius: 6px; padding: 1px 6px; font-size: .9em; }
.md hr { border: 0; border-top: 1px solid var(--hair); margin: 16px 0; }
.md .tbl { overflow-x: auto; background: rgba(0, 0, 0, .25); border-radius: 20px; margin: 0 0 12px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th { text-align: left; font-weight: 400; font-size: 12.5px; color: var(--ink-3); padding: 10px 12px; }
.md td { padding: 10px 12px; border-top: 1px solid var(--hair); vertical-align: top; }

.srcs { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-3); }
.srcs summary { cursor: pointer; }
.srcs ul { margin: 8px 0 0; padding-left: 18px; }
.srcs li { margin-bottom: 4px; }
.srcs a { color: var(--ink-2); }

.gp { display: inline-block; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: #0A0A0C; background: #fff; }
.gp.sm { padding: 3px 10px; font-size: 11.5px; }
.g-go .gp, .gp.g-go { background: var(--go); }
.g-revise .gp, .gp.g-revise { background: var(--revise); }
.g-park .gp, .gp.g-park { background: var(--park); }
.g-kill .gp, .gp.g-kill { background: var(--kill); }
.gate-box { display: flex; align-items: center; gap: 14px; background: rgba(0, 0, 0, .25); border-radius: 22px; padding: 14px 16px; margin: 18px 0 0; }
.gate-box b { display: block; font-weight: 500; font-size: 15.5px; }
.gate-box small { display: block; color: var(--ink-2); font-size: 13.5px; }

.refine { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--hair); }

/* отчёт */
.verdict { background: rgba(0, 0, 0, .25); border-radius: 26px; padding: 18px 20px; margin-bottom: 16px; }
.verdict .q { margin-bottom: 4px; }
.verdict b { display: block; font-size: clamp(28px, 6vw, 38px); font-weight: 500; letter-spacing: -.02em; text-transform: capitalize; }
.verdict p { margin: 6px 0 0; color: var(--ink-2); }
.dl { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.preview summary { cursor: pointer; color: var(--ink-3); font-size: 14px; margin-bottom: 12px; }

.drop { position: fixed; inset: 0; z-index: 50; background: rgba(5, 6, 9, .8); backdrop-filter: blur(10px); display: grid; place-items: center; border: 2px dashed rgba(255, 255, 255, .5); }
.drop p { font-size: 22px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: #fff; color: #0A0A0C; border-radius: 999px; padding: 12px 20px; font-size: 14px; max-width: 90vw; }

@media (max-width: 560px) {
  .card { border-radius: 34px; padding: 24px 20px 22px; }
  .sl { display: none; }
  .steps .sep { width: 6px; }
  .back span { display: none; }
  .back { padding: 12px 14px; }
  .go { max-width: none; }
  .foot .meta { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ===== Скин vebtech: как в презентации «От идеи к решению» — белый фон, Manrope,
   тёмно-синий текст, активная карточка с синим градиентом. Внутри карточки — белый текст. ===== */
@font-face { font-family: "Manrope"; src: url("/Manrope-Variable.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --navy: #16233E;
  --muted: #596B91;
  --soft: #F3F5F9;
  --line: #D3DBEC;
  --blue: #316EF5;
  --blue-2: #244CD8;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
body { background: var(--bg); color: var(--navy); font-weight: 500; }
:focus-visible { outline-color: var(--blue); }
.glow, body::after { display: none; }

.bar { width: min(860px, 100%); grid-template-columns: auto 1fr auto; padding: 6px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 12px; grid-column: 1; grid-row: 1; }
.brand img { height: 22px; width: auto; display: block; }
.brand span { font-size: 12px; color: var(--muted); padding: 4px 10px; border-radius: 8px; background: rgba(43, 58, 90, .08); white-space: nowrap; }
.bar .t { grid-column: 2; }
.bar .t b { color: var(--navy); font-weight: 700; font-size: 17px; }
.bar .t small { color: var(--muted); }
.bar-r { grid-column: 3; grid-row: 1; display: flex; gap: 8px; justify-content: flex-end; }
#backBtn, #newBtn { grid-column: auto; grid-row: auto; }
.circle { width: 42px; height: 42px; background: var(--soft); color: var(--navy); backdrop-filter: none; -webkit-backdrop-filter: none; }
.circle:hover { background: #E6EBF5; }
.main { width: min(860px, 100%); }

.sd { background: var(--soft); color: var(--muted); font-weight: 600; }
.sd.done { background: var(--navy); color: #fff; }
.sd.on { background: linear-gradient(134deg, var(--blue), var(--blue-2)); color: #fff; }
.sl { color: var(--navy); font-weight: 600; }
.steps .sep { background: var(--line); }

.card {
  border-radius: 24px;
  background: linear-gradient(134deg, var(--blue) 0%, var(--blue-2) 83%);
  box-shadow: 0 24px 60px -28px rgba(36, 76, 216, .55);
  color: #fff;
  --ink-2: rgba(255, 255, 255, .86);
  --ink-3: rgba(255, 255, 255, .66);
  --ink-4: rgba(255, 255, 255, .42);
  --hair: rgba(255, 255, 255, .18);
}
.card h1 { font-weight: 700; }
.card .md blockquote, .card .verdict b, .card .md h1 { font-weight: 600; }
.card .md h2 { font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: 12px; }
.card .in, .card .tip, .card .gate-box, .card .verdict, .card .md .tbl { background: rgba(10, 24, 70, .22); }
.card .btn.white, .card .go .c { color: var(--blue-2); }

/* элементы на белом фоне вне карточки */
.main > .actions .go, .main > .go { background: var(--navy); color: #fff; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.main > .actions .go:hover { background: #22345A; }
.main > .actions .go .c { background: #fff; color: var(--navy); }
.main > .actions .back, .main > .actions .btn, .main > .actions .pill { background: var(--soft); color: var(--navy); }
.main > .actions .back:hover, .main > .actions .btn:hover { background: #E6EBF5; }
.main > .center .link, .main > .link, .main > .actions .link, .main > p .link { color: var(--muted); }
.main > .link:hover { color: var(--navy); }
.main > .meta, .main > p { color: var(--muted); }
.toast { background: var(--navy); color: #fff; }
.drop { background: rgba(255, 255, 255, .85); border-color: var(--blue); color: var(--navy); }
.foot-note { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 22px; }
@media (max-width: 560px) { .brand span { display: none; } .card { border-radius: 22px; } }

/* таблицы: слова не рвутся по буквам, широкая таблица прокручивается внутри карточки */
.md .tbl { -webkit-overflow-scrolling: touch; }
.md table { width: max-content; min-width: 100%; }
.md th, .md td { overflow-wrap: normal; word-break: normal; hyphens: manual; max-width: 260px; }
.md td:first-child, .md th:first-child { min-width: 96px; }
@media (max-width: 560px) {
  .md th, .md td { max-width: 200px; padding: 9px 10px; }
  .sd { width: 32px; height: 32px; font-size: 13px; }
  .steps { gap: 8px; flex-wrap: nowrap; }
  .steps .sep { display: none; }
  .bar { gap: 8px; }
  .bar .t b { font-size: 15px; }
}

/* голос: идёт запись / распознавание */
.rec-time { position: absolute; right: 56px; top: 17px; font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(255, 59, 48, .9); border-radius: 999px; padding: 2px 9px; pointer-events: none; font-variant-numeric: tabular-nums; }
.big-vf .rec-time { top: auto; bottom: 17px; right: 62px; }
.mic.busy { background: rgba(255, 255, 255, .22); cursor: wait; }
.mic.busy + .rec-time { background: rgba(10, 24, 70, .45); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* попап подтверждения */
.dlg-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(22, 35, 62, .42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: dlgIn .16s ease both; }
.dlg { width: min(420px, 100%); background: #fff; color: #16233E; border-radius: 22px; padding: 22px 22px 18px; box-shadow: 0 30px 80px -30px rgba(22, 35, 62, .55); font-family: inherit; }
.dlg b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 8px; }
.dlg p { margin: 0 0 4px; color: #596B91; font-size: 14.5px; line-height: 1.45; }
.dlg-a { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.dlg-a button { border: 0; border-radius: 999px; padding: 11px 20px; font: inherit; font-weight: 600; cursor: pointer; }
.dlg-no { background: #F3F5F9; color: #16233E; }
.dlg-no:hover { background: #E6EBF5; }
.dlg-ok { background: linear-gradient(134deg, #316EF5, #244CD8); color: #fff; }
.dlg-ok.danger { background: #16233E; }
.dlg-a button:focus-visible { outline: 2px solid #316EF5; outline-offset: 2px; }
@keyframes dlgIn { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 420px) { .dlg-a button { flex: 1 1 auto; } }
