@import url("/brand.css");
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font: 18px/1.45 Nunito, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.has-tabs main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
main { max-width: 560px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px 48px; min-height: 100vh; }
h1 { font-size: 28px; margin: 8px 0 4px; } h2 { font-size: 21px; margin: 22px 0 10px; }
.muted { color: var(--muted); } .center { text-align: center; } .small { font-size: 14px; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 12px 0; }
button, .btn { font: inherit; font-weight: 700; min-height: 48px; border: 0; cursor: pointer; border-radius: 14px; padding: 14px 18px; background: var(--soft); color: var(--ink);
  border-bottom: 4px solid var(--line); transition: transform .06s; text-decoration: none; display: inline-block; }
button:active { transform: translateY(2px); border-bottom-width: 2px; }
button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--accent); color: #fff; border-bottom-color: #d65a3b; font-weight: 700; }
.big { width: 100%; font-size: 21px; padding: 18px; margin-top: 10px; }
input { font: inherit; width: 100%; padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); margin: 6px 0; }
input:focus { outline: 3px solid var(--accent2); }
.row { display: flex; gap: 10px; align-items: center; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pill { background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.goal { height: 14px; background: var(--line); border-radius: 99px; overflow: hidden; }
.goal > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 99px; transition: width .4s; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 6px; text-align: center; position: relative; }
.tile .ic { font-size: 34px; display: block; } .tile b { font-size: 14px; display: block; }
.tile.done { border-color: var(--ok); } .tile.next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft); }
.tile .badge { position: absolute; top: 4px; right: 8px; font-size: 13px; }
.nav { display: flex; gap: 8px; margin-top: 18px; } .nav button { flex: 1; font-size: 15px; padding: 12px 6px; }
/* Упражнение */
.bar { height: 16px; background: var(--line); border-radius: 99px; overflow: hidden; flex: 1; }
.bar > i { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.x { background: none; border: 0; font-size: 26px; padding: 4px 8px; color: var(--muted); }
.q { text-align: center; margin: 26px 0 18px; }
.q .emoji { font-size: 76px; line-height: 1.1; }
.q .word { font-size: 34px; font-weight: 800; margin-top: 6px; }
.q .sub { color: var(--muted); font-size: 20px; }
.say { font-size: 22px; padding: 10px 16px; margin-top: 10px; }
.opts { display: grid; gap: 10px; }
.opts button { text-align: left; font-size: 20px; padding: 16px 18px; background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; }
.opts button.ok, .pairs button.ok { background: #dff7e9; border-color: var(--ok); color: #135c34; }
.opts button.bad, .pairs button.bad { background: #fde3e3; border-color: var(--bad); color: #7a1f1f; animation: shake .3s; }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pairs button { background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; font-size: 18px; padding: 14px 8px; }
.pairs button.sel { border-color: var(--accent); background: var(--soft); }
.pairs button.gone { visibility: hidden; }
.feedback { position: fixed; left: 0; right: 0; bottom: 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); font-weight: 700; font-size: 20px; }
.feedback .in { max-width: 560px; margin: 0 auto; }
.feedback.ok { background: #dff7e9; color: #135c34; } .feedback.bad { background: #fde3e3; color: #7a1f1f; }
.tip { background: var(--soft); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 110px; }
.chart div { flex: 1; background: var(--accent2); border-radius: 6px 6px 0 0; min-height: 3px; position: relative; }
.chart div.today { background: var(--accent); }
.stat { text-align: center; } .stat b { font-size: 28px; display: block; }
table { width: 100%; border-collapse: collapse; font-size: 16px; } td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
#toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; opacity: 0; transition: opacity .3s; pointer-events: none; font-weight: 700; z-index: 9; }
#toast.show { opacity: 1; }
.pop { animation: pop .5s; } .confetti { font-size: 64px; animation: pop .8s; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0 } 60% { transform: scale(1.15) } 100% { transform: scale(1); opacity: 1 } }
@keyframes shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.pic { width: 100%; max-width: 220px; aspect-ratio: 1; object-fit: cover; border-radius: 22px; display: block; margin: 0 auto 6px; background: var(--soft); }
.pic.big { max-width: 260px; animation: pop .5s; }
.msg { padding: 12px 14px; border-radius: 16px; margin: 8px 0; max-width: 88%; }
.msg.assistant { background: var(--card); border: 2px solid var(--line); }
.msg.user { background: var(--accent); color: #fff; margin-left: auto; }

/* --- мобильный слой (TASK-011) --- */
h1 { font-weight: 900; letter-spacing: -.5px; } h2 { font-weight: 900; }
.card, .tile, .opts button, .pairs button { border-radius: 20px; }
.hero-card { background: linear-gradient(150deg, var(--accent), var(--pink)); color: #fff; border-radius: 26px; padding: 18px; margin: 12px 0;
  box-shadow: 0 10px 28px rgba(255, 79, 129, .25); }
.hero-card .goal { background: rgba(255,255,255,.3); } .hero-card .goal > i { background: #fff; }
.hero-card .btn.primary { background: #fff; color: var(--accent); border-bottom-color: rgba(0,0,0,.15); }
.hero-card .btn:not(.primary) { background: rgba(255,255,255,.18); color: #fff; border-bottom-color: rgba(0,0,0,.12); }
.hero-card .small, .hero-card b { color: #fff; }
.pill { font-weight: 800; }
.tile { box-shadow: 0 4px 0 var(--line); transition: transform .08s; } .tile:active { transform: translateY(3px); box-shadow: none; }
.tile.next { border-color: var(--accent); box-shadow: 0 4px 0 var(--accent); }
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
#tabs[hidden] { display: none; }
#tabs a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 800; padding: 4px 0; border-radius: 14px; min-height: 48px; }
#tabs a span { display: block; font-size: 24px; line-height: 1.2; }
#tabs a.on { color: var(--accent); background: var(--soft); }
.q .word { font-weight: 900; }
.feedback { border-radius: 24px 24px 0 0; box-shadow: 0 -8px 24px rgba(0,0,0,.08); }
@media (min-width: 700px) { #tabs { max-width: 560px; margin: 0 auto 12px; border-radius: 22px; border: 1px solid var(--line); bottom: 0; } }
.q .row .say { font-size: 16px; padding: 10px 12px; white-space: nowrap; flex: 1 1 auto; }
.q .row { flex-wrap: wrap; justify-content: center; }

/* карта курса (TASK-021) */
.path { display: flex; flex-direction: column; gap: 10px; position: relative; padding: 4px 0; }
.path .step { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; background: var(--card); border: 2px solid var(--line);
  border-radius: 22px; padding: 10px 14px; box-shadow: 0 4px 0 var(--line); margin-right: 28px; transition: transform .08s; }
.path .step.r { margin-right: 0; margin-left: 28px; }
.path .step:active { transform: translateY(3px); box-shadow: none; }
.path .dot { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: var(--soft); }
.path .lbl { display: flex; flex-direction: column; }
.path .step.done { border-color: var(--ok); } .path .step.done .dot { background: var(--ok-bg); }
.path .step.cur { border-color: var(--accent); box-shadow: 0 4px 0 var(--accent); } .path .step.cur .dot { background: var(--accent); color: #fff; }

/* кабинет: сворачиваемые разделы (TASK-022) */
details.sect { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); margin: 10px 0; padding: 0 14px; }
details.sect > summary { font-weight: 900; font-size: 19px; padding: 14px 0; cursor: pointer; list-style: none; display: flex; justify-content: space-between; min-height: 48px; }
details.sect > summary::after { content: "›"; transform: rotate(90deg); transition: transform .2s; color: var(--muted); }
details.sect[open] > summary::after { transform: rotate(-90deg); }
details.sect > .card { border: 0; padding: 0 0 14px; margin: 0; background: none; }

/* мини-диалог (TASK-003) */
.dlg { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.bub { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; cursor: pointer; animation: pop .35s; }
.bub > span:last-child { background: var(--card); border: 2px solid var(--line); border-radius: 18px 18px 18px 4px; padding: 10px 14px; font-size: 18px; }
.bub.b { align-self: flex-end; flex-direction: row-reverse; } .bub.b > span:last-child { background: var(--soft); border-radius: 18px 18px 4px 18px; }
.bub .av { font-size: 28px; }
