/* Мини-приложение «Разбирай»: бело-синее оформление (23.10.2026).
   Ориентиры: Telegram Wallet, TGUI. Светлая тема своя, тёмная берёт фон и текст из themeParams Telegram, акцент всегда наш синий.
   Цвета только через переменные ниже; JS меняет их при смене темы. */
:root {
  --bg: #F3F6FB; --card: #FFFFFF; --card2: #F1F5FB; --line: #E4EAF3; --line2: #D3DDEB;
  --text: #0F1B2D; --soft: #33445E; --muted: #6B7A90; --faint: #A3AFC0;
  --accent: #2F7CF6; --accent-press: #1F66D9; --accent-ink: #1F66D9; --accent-soft: #E8F1FF; --accent-soft2: #D5E5FF;
  --ok: #16A34A; --ok-soft: #E5F6EB; --warn: #B86E00; --warn-soft: #FFF4DE; --bad: #E5484D; --bad-soft: #FDECEC;
  --grad: linear-gradient(135deg, #5AA2FF 0%, #2F7CF6 45%, #1D4ED8 100%);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
  --shadow-acc: 0 8px 22px rgba(47, 124, 246, .32);
  --r-xl: 24px; --r-lg: 18px; --r-md: 14px; --r-sm: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-top: 0px; --safe-bottom: 0px;
  color-scheme: light;
}
:root[data-theme=dark] {
  --bg: #0A1120; --card: #121B2D; --card2: #19243A; --line: #1F2B43; --line2: #2A3854;
  --text: #E9EEF7; --soft: #C3CDDD; --muted: #8B98B0; --faint: #56647D;
  --accent: #4C8DFF; --accent-press: #3B7BEE; --accent-ink: #8DB8FF; --accent-soft: rgba(76, 141, 255, .14); --accent-soft2: rgba(76, 141, 255, .26);
  --ok: #3DD68C; --ok-soft: rgba(61, 214, 140, .13); --warn: #F5B94A; --warn-soft: rgba(245, 185, 74, .13); --bad: #FF6B72; --bad-soft: rgba(255, 107, 114, .13);
  --grad: linear-gradient(135deg, #3D8BFF 0%, #2563EB 50%, #1E3A8A 100%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .22);
  --shadow-acc: 0 8px 24px rgba(37, 99, 235, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
html, body { margin: 0; color: var(--text); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { background: var(--bg); min-height: 100vh; padding-top: var(--safe-top); padding-bottom: calc(96px + max(env(safe-area-inset-bottom), var(--safe-bottom))); overscroll-behavior-y: contain; transition: background .3s ease; }
body.nonav { padding-bottom: calc(24px + max(env(safe-area-inset-bottom), var(--safe-bottom))); }
#app { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.num { font-variant-numeric: tabular-nums; }
svg { flex-shrink: 0; }

/* ---------- шапка ---------- */
header.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; margin: 0 -16px; padding: 10px 16px;
  background: var(--bg); background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%); }
header.top .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
header.top img { width: 32px; height: 32px; border-radius: 10px; }
header.top .name { font-weight: 700; font-size: 17px; line-height: 1.15; letter-spacing: -.01em; }
header.top .sub { color: var(--muted); font-size: 12px; line-height: 1.2; }
header.top .hi { margin-left: auto; display: flex; align-items: center; }
.ava { display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; letter-spacing: .02em; flex-shrink: 0; }
.ava.sm { width: 34px; height: 34px; font-size: 13px; }
.ava.lg { width: 64px; height: 64px; font-size: 22px; box-shadow: var(--shadow-acc); }
.hi .ava { cursor: pointer; }

/* ---------- типографика ---------- */
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
.page-head { margin: 10px 2px 16px; }
.page-head h1 { font-size: 26px; line-height: 1.15; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 24px 4px 10px; }
.sec h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sec .cnt { font-size: 13px; color: var(--faint); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
p { margin: 0 0 8px; }
b, strong { font-weight: 600; }
.muted, .small, .card, b { overflow-wrap: anywhere; }

/* ---------- карточки и ячейки (как Section/Cell в TGUI) ---------- */
.card { background: var(--card); border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card h3 { font-size: 17px; margin-bottom: 4px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row > * { min-width: 0; }
.list { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.cell { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; cursor: pointer; background: var(--card); transition: background .15s ease; }
.cell + .cell::before { content: ""; position: absolute; top: 0; left: 66px; right: 0; border-top: 1px solid var(--line); }
.cell:active { background: var(--card2); }
.cell.static { cursor: default; } .cell.static:active { background: var(--card); }
.cell .main { flex: 1; min-width: 0; }
.cell .t { font-weight: 600; font-size: 15px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .s { color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 1px; }
.cell .chev { color: var(--faint); }
.cell.danger .t { color: var(--bad); }
.tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent-ink); }
.tile.ok { background: var(--ok-soft); color: var(--ok); }
.tile.bad { background: var(--bad-soft); color: var(--bad); }
.tile.warn { background: var(--warn-soft); color: var(--warn); }
.tile.grad { background: var(--grad); color: #fff; box-shadow: var(--shadow-acc); }
.tile.dark { background: linear-gradient(135deg, #1E293B, #0F172A); color: #9CC3FF; }
.cell .minibar { height: 4px; border-radius: 2px; background: var(--accent-soft); margin-top: 7px; overflow: hidden; }
.cell .minibar i { display: block; height: 100%; border-radius: 2px; background: var(--grad); position: relative; overflow: hidden; }

/* ---------- метки статуса ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card2); color: var(--soft); white-space: nowrap; flex-shrink: 0; }
.chip.run { color: var(--accent-ink); background: var(--accent-soft); }
.chip.run::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 1.2s ease-in-out infinite; }
.chip.ok { color: var(--ok); background: var(--ok-soft); }
.chip.bad { color: var(--bad); background: var(--bad-soft); }
.chip.warn { color: var(--warn); background: var(--warn-soft); }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- главный экран: градиентная карточка как в Wallet ---------- */
.hero { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 20px 18px 18px; margin: 6px 0 12px; color: #fff; background: var(--grad); box-shadow: var(--shadow-acc); isolation: isolate; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; pointer-events: none; }
.hero::before { width: 220px; height: 220px; right: -70px; top: -90px; background: radial-gradient(circle, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 70%); }
.hero::after { width: 180px; height: 180px; left: -60px; bottom: -110px; background: radial-gradient(circle, rgba(147, 197, 253, .45), rgba(147, 197, 253, 0) 70%); }
.hero .hi { font-size: 14px; opacity: .85; font-weight: 500; }
.hero .title { font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; margin-top: 4px; max-width: 300px; }
.hero .stats { display: flex; gap: 8px; margin: 16px 0; }
.hero .st { flex: 1; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; padding: 9px 10px; }
.hero .st b { display: block; font-size: 20px; font-weight: 700; line-height: 1.1; }
.hero .st small { font-size: 12px; opacity: .85; }
.hero .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hero .acts button { background: #fff; color: #1D4ED8; border-radius: 14px; padding: 12px 10px; font-size: 14px; box-shadow: 0 4px 14px rgba(15, 23, 42, .12); }
.hero .acts button.alt { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .28); box-shadow: none; }
:root[data-theme=dark] .hero .acts button:not(.alt) { color: #1E3A8A; }

/* пустые состояния */
.empty { text-align: center; padding: 22px 16px 8px; }
.empty .ill { display: block; margin: 0 auto 8px; animation: float 4s ease-in-out infinite; }
.empty h3 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--muted); font-size: 14px; max-width: 320px; margin: 0 auto 14px; }
@keyframes float { 50% { transform: translateY(-6px); } }
.ill-bg { fill: var(--accent-soft); } .ill-card { fill: var(--card); stroke: var(--line2); } .ill-ring { fill: var(--card); }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; text-align: left; }
.steps li { counter-increment: s; position: relative; padding: 10px 0 10px 44px; font-size: 14px; color: var(--soft); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 8px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.steps li + li { border-top: 1px solid var(--line); }

/* ---------- кнопки ---------- */
button { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; font: 600 15px/1.2 var(--font); color: #fff; background: var(--accent); border: 0; border-radius: var(--r-md); padding: 14px 16px; cursor: pointer;
  transition: transform .16s var(--ease), background .15s ease, opacity .15s ease, box-shadow .2s ease; }
button:active { transform: scale(.97); }
button:disabled { opacity: .5; pointer-events: none; }
button.primary { background: var(--grad); box-shadow: var(--shadow-acc); }
button.ghost { background: var(--accent-soft); color: var(--accent-ink); }
button.soft { background: var(--card2); color: var(--text); }
button.danger { background: var(--bad-soft); color: var(--bad); }
button.ok { background: var(--ok-soft); color: var(--ok); }
button.link { background: none; color: var(--accent-ink); width: auto; padding: 8px 4px; font-weight: 600; }
button.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 10px; background: transparent; color: var(--muted); flex-shrink: 0; }
button.icon-btn:active { background: var(--card2); }
.btns { display: flex; gap: 10px; margin-top: 12px; }
.btns > * { flex: 1; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .16; transform: scale(0); animation: rip .55s ease-out forwards; pointer-events: none; }
@keyframes rip { to { transform: scale(1); opacity: 0; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chips button { width: auto; padding: 9px 14px; font-size: 14px; font-weight: 500; background: var(--card2); color: var(--soft); border: 1px solid var(--line); border-radius: 999px; }
.chips button.on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }

/* сегменты с плавающим ползунком */
.seg { position: relative; display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); padding: 4px; background: var(--card2); border-radius: 14px; margin: 0 0 14px; }
.seg::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n, 2)); border-radius: 11px; background: var(--card); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); transform: translateX(calc(100% * var(--i, 0))); transition: transform .28s var(--ease); }
:root[data-theme=dark] .seg::before { background: var(--line2); }
.seg button { background: none; color: var(--muted); padding: 10px 8px; font-size: 14px; font-weight: 600; border-radius: 11px; z-index: 1; gap: 6px; }
.seg button:active { transform: none; }
.seg button.on { color: var(--text); }

/* переключатель */
button.switch { width: 50px; height: 30px; padding: 0; border-radius: 999px; background: var(--line2); flex-shrink: 0; transition: background .25s ease; }
button.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
button.switch.on { background: var(--accent); }
button.switch.on i { transform: translateX(20px); }
button.switch:active { transform: none; }

/* ---------- поля ---------- */
textarea, input[type=text], input[type=number] { width: 100%; font: 400 16px/1.45 var(--font); color: var(--text); background: var(--card2); border: 1.5px solid transparent; border-radius: var(--r-md); padding: 12px 14px; resize: vertical; -webkit-appearance: none; appearance: none; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
textarea::placeholder, input::placeholder { color: var(--faint); }
textarea:focus, input:focus { outline: 0; border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 4px var(--accent-soft); }
.lbl { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.lbl .opt { font-weight: 500; font-size: 12px; color: var(--muted); background: var(--card2); padding: 2px 8px; border-radius: 999px; }
.hint { font-size: 13px; color: var(--muted); margin: -4px 0 10px; }
.card .lbl ~ textarea + .fzone, .card textarea + .fzone { margin-top: 12px; }
.drop { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; border: 1.5px dashed var(--line2); border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; background: transparent; transition: border-color .15s, background .15s, transform .15s var(--ease); }
.drop:active { border-color: var(--accent); background: var(--accent-soft); transform: scale(.985); }
.drop input { display: none; }
.drop .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex-shrink: 0; }
.drop b { display: block; font-size: 14px; color: var(--accent-ink); }
.drop small { display: block; font-size: 12px; color: var(--muted); }
.flist { display: grid; gap: 6px; margin-top: 8px; }
.flist:empty { display: none; }
.fitem { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 10px; background: var(--card2); border-radius: 12px; animation: pop .22s var(--ease); }
.fitem .meta { flex: 1; min-width: 0; }
.fitem .fn { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fitem .fs { font-size: 12px; color: var(--muted); }
.fb { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .02em; color: #fff; background: #64748B; flex-shrink: 0; }
.fb.doc { background: linear-gradient(135deg, #4F8DFD, #1D4ED8); }
.fb.pdf { background: linear-gradient(135deg, #FF7A7A, #E5484D); }
.fb.xls { background: linear-gradient(135deg, #34D399, #059669); }
.fb.ppt { background: linear-gradient(135deg, #FDBA74, #EA580C); }
.fb.dxf { background: linear-gradient(135deg, #A78BFA, #6D28D9); }
.fb.img { background: linear-gradient(135deg, #67E8F9, #0891B2); }
.info { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--soft); font-size: 13px; margin: 4px 0 14px; }
.info svg { color: var(--accent-ink); margin-top: 1px; }
.banner { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-soft); color: var(--warn); border-radius: var(--r-md); padding: 12px 14px; margin: 0 0 14px; font-size: 14px; font-weight: 500; }
.upload { background: var(--card); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }

/* ---------- полосы и кольцо прогресса ---------- */
.bar { height: 8px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; margin: 10px 0 4px; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--grad); transition: width .7s var(--ease); position: relative; overflow: hidden; }
.bar i::after, .cell .minibar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); transform: translateX(-100%); animation: shine 1.6s ease-in-out infinite; }
@keyframes shine { to { transform: translateX(100%); } }
.prog { text-align: center; padding: 22px 16px 16px; }
.ringwrap { position: relative; width: 168px; height: 168px; margin: 0 auto 6px; }
.ringwrap svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--accent-soft); stroke-width: 10; }
.ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring-spin { transform-origin: 60px 60px; animation: spin 2.4s linear infinite; }
.ring-spin circle { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 9; opacity: .45; }
@keyframes spin { to { transform: rotate(360deg); } }
.ringwrap .val { position: absolute; inset: 0; display: grid; place-content: center; }
.ringwrap .val b { font-size: 38px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.ringwrap .val b small { font-size: 18px; font-weight: 700; color: var(--muted); margin-left: 1px; }
.ringwrap .val .lab { font-size: 12px; color: var(--muted); margin-top: 4px; }
.prog .stage { font-size: 16px; font-weight: 600; margin-top: 4px; }
.prog .when { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 18px 0 2px; }
.tl div { text-align: center; font-size: 11px; color: var(--faint); font-weight: 600; }
.tl div i { display: block; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 6px; position: relative; overflow: hidden; }
.tl div.done { color: var(--muted); } .tl div.done i { background: var(--accent); }
.tl div.now { color: var(--accent-ink); } .tl div.now i { background: var(--accent-soft2); }
.tl div.now i::after { content: ""; position: absolute; inset: 0; width: 45%; border-radius: 2px; background: var(--accent); animation: slide 1.4s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(230%); } }

/* ---------- экран заказа ---------- */
.ohead { display: flex; align-items: center; gap: 12px; margin: 6px 2px 14px; }
.ohead .tile { width: 48px; height: 48px; border-radius: 15px; }
.ohead h1 { font-size: 22px; line-height: 1.2; }
.ohead .s { color: var(--muted); font-size: 13px; }
.ohead .chip { margin-left: auto; }
.task { color: var(--soft); font-size: 14px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.task.open { -webkit-line-clamp: unset; display: block; }
.answer { font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 60vh; overflow-y: auto; -webkit-user-select: text; user-select: text; padding: 12px; border-radius: 12px; background: var(--card2); color: var(--text); }
.cap { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.done-head { text-align: center; padding: 22px 16px 6px; }
.done-head h2 { font-size: 22px; margin-top: 10px; }
.done-head p { color: var(--muted); font-size: 14px; margin: 4px auto 0; max-width: 300px; }
.check { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #34D399, #16A34A); box-shadow: 0 10px 26px rgba(22, 163, 74, .32); animation: popin .5s var(--ease) both; }
.check path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .45s .25s ease forwards; }
@keyframes popin { from { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } to { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.files { display: grid; gap: 8px; margin: 14px 0 0; }
.files .fitem { animation: none; }
.rate { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.rate button { flex-direction: column; gap: 6px; padding: 14px 10px; }
.thanks { display: flex; align-items: center; gap: 12px; }

/* ---------- профиль ---------- */
.prof { display: flex; align-items: center; gap: 14px; margin: 8px 2px 16px; }
.prof h1 { font-size: 22px; line-height: 1.2; }
.prof .chip { margin-top: 6px; }
.wallet { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 18px; color: #fff; background: var(--grad); box-shadow: var(--shadow-acc); margin-bottom: 12px; isolation: isolate; }
.wallet::before { content: ""; position: absolute; z-index: -1; width: 240px; height: 240px; right: -80px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 70%); }
.wallet .l { font-size: 13px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.wallet .v { font-size: 36px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0 6px; }
.wallet .v small { font-size: 20px; font-weight: 700; opacity: .8; margin-left: 4px; }
.wallet p { font-size: 13px; opacity: .85; margin: 0 0 14px; }
.wallet button { background: #fff; color: #1D4ED8; border-radius: 14px; }
.pos { color: var(--ok); } .neg { color: var(--bad); }

/* ---------- помощь ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.skill { background: var(--card); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.skill .tile { margin-bottom: 6px; width: 36px; height: 36px; border-radius: 11px; }
.skill b { font-size: 14px; line-height: 1.3; }
.skill small { color: var(--muted); font-size: 12px; line-height: 1.35; }
details { background: var(--card); border-radius: var(--r-md); padding: 0 16px; margin-bottom: 8px; box-shadow: var(--shadow); }
details summary { list-style: none; cursor: pointer; font-weight: 600; font-size: 15px; padding: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details summary::-webkit-details-marker { display: none; }
details summary svg { color: var(--faint); transition: transform .25s var(--ease); }
details[open] summary svg { transform: rotate(90deg); color: var(--accent); }
details p { color: var(--soft); font-size: 14px; white-space: pre-wrap; margin: 0; padding: 0 0 14px; animation: fadein .25s ease; }

/* ---------- нижнее меню ---------- */
nav#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 6px 8px calc(6px + max(env(safe-area-inset-bottom), var(--safe-bottom)));
  background: var(--card); background: color-mix(in srgb, var(--card) 86%, transparent); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); border-top: 1px solid var(--line); transition: transform .3s var(--ease); }
body.nonav nav#nav { transform: translateY(110%); }
nav#nav .in { display: flex; max-width: 560px; margin: 0 auto; }
nav#nav button { flex: 1; flex-direction: column; gap: 3px; background: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 2px; border-radius: 14px; }
nav#nav button:active { transform: scale(.94); }
nav#nav .ic { display: grid; place-items: center; width: 54px; height: 30px; border-radius: 999px; transition: background .25s ease, color .25s ease; }
nav#nav button.on { color: var(--accent-ink); }
nav#nav button.on .ic { background: var(--accent-soft); }
/* круглая «+» приподнята, но целиком внутри панели вместе с тенью: у панели backdrop-filter, и часть WebView обрезает всё, что выходит за её край */
nav#nav { padding-top: 10px; }
nav#nav button { justify-content: flex-end; }
nav#nav button.new { overflow: visible; }
nav#nav button.new .ripple { display: none; }
nav#nav button.new .ic { width: 44px; height: 44px; border-radius: 15px; margin-top: -10px; background: var(--grad); color: #fff; box-shadow: 0 6px 14px -4px rgba(29, 78, 216, .45); }
nav#nav button.new.on .ic { box-shadow: 0 0 0 3px var(--accent-soft2), 0 6px 14px -4px rgba(29, 78, 216, .45); }
.ripple-off .ripple { display: none; }

/* ---------- всплывашки, листы ---------- */
.toast { position: fixed; left: 50%; bottom: calc(92px + max(env(safe-area-inset-bottom), var(--safe-bottom))); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: #111B2E; color: #fff; padding: 11px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; max-width: calc(100% - 32px); width: max-content; z-index: 30; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: toastin .3s var(--ease); }
body.nonav .toast { bottom: calc(24px + max(env(safe-area-inset-bottom), var(--safe-bottom))); }
.toast.ok svg { color: #4ADE80; } .toast.err svg { color: #FF8A8F; }
.toast.out { opacity: 0; transform: translate(-50%, 8px); transition: all .25s ease; }
:root[data-theme=dark] .toast { background: #E9EEF7; color: #0F1B2D; }
:root[data-theme=dark] .toast.ok svg { color: #16A34A; } :root[data-theme=dark] .toast.err svg { color: #E5484D; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
.modal { position: fixed; inset: 0; background: rgba(8, 15, 30, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 20; animation: fadein .2s ease; }
.modal .box { background: var(--card); border-radius: 24px 24px 0 0; padding: 10px 18px calc(18px + max(env(safe-area-inset-bottom), var(--safe-bottom))); max-width: 560px; width: 100%; animation: sheetin .32s var(--ease); }
.modal .handle { width: 38px; height: 5px; border-radius: 3px; background: var(--line2); margin: 0 auto 14px; }
.modal h3 { font-size: 20px; margin-bottom: 6px; }
.modal.out { opacity: 0; transition: opacity .2s ease; } .modal.out .box { transform: translateY(40px); transition: transform .2s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetin { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* ---------- заглушки загрузки (шиммер) ---------- */
.sk { position: relative; overflow: hidden; background: var(--card); border-radius: var(--r-lg); margin-bottom: 12px; box-shadow: var(--shadow); }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--card2), transparent); transform: translateX(-100%); animation: shine 1.3s ease-in-out infinite; }
.sk.hero { height: 216px; border-radius: var(--r-xl); background: var(--accent-soft); box-shadow: none; margin-top: 6px; }
.sk.hero::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); }
:root[data-theme=dark] .sk.hero::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
.sk.cell { height: 64px; border-radius: 0; margin: 0; box-shadow: none; }
.sk.big { height: 290px; }
.sk.line { height: 22px; width: 50%; border-radius: 8px; background: var(--card2); box-shadow: none; margin: 14px 2px; }
.skl { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.skl .sk.cell + .sk.cell { border-top: 1px solid var(--line); }

/* ---------- потяни, чтобы обновить ---------- */
.ptr { position: fixed; left: 50%; top: calc(var(--safe-top) + 56px); z-index: 7; width: 38px; height: 38px; margin-left: -19px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--accent); box-shadow: var(--shadow); opacity: 0; transform: translateY(-30px); pointer-events: none; }
.ptr.on { color: #fff; background: var(--accent); }

/* ---------- переходы между экранами ---------- */
#view[data-anim] > * { animation: in-fade .32s var(--ease) both; }
#view[data-anim=fwd] > * { animation-name: in-fwd; }
#view[data-anim=back] > * { animation-name: in-back; }
#view[data-anim] > :nth-child(2) { animation-delay: .03s; }
#view[data-anim] > :nth-child(3) { animation-delay: .06s; }
#view[data-anim] > :nth-child(4) { animation-delay: .09s; }
#view[data-anim] > :nth-child(n+5) { animation-delay: .12s; }
@keyframes in-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes in-fwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

@media (max-width: 370px) {
  .hero .title { font-size: 19px; } .hero .st b { font-size: 18px; }
  .page-head h1 { font-size: 24px; }
  nav#nav .ic { width: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .check path { stroke-dashoffset: 0; }
}

/* атрибут hidden сильнее display у .chips и других (выбор формата 24.10.2026) */
[hidden] { display: none !important; }
