/* Дизайн в стиле apple.com: шрифт SF Pro, фон #f5f5f7, белые скруглённые карточки,
   кнопки-«таблетки», синий акцент #0071e3, полупрозрачное меню с размытием.
   Красный #c8102e из британского флага — только для ★ и ошибок. */
:root {
  --bg: #f5f5f7; --surface: #ffffff; --panel: #f5f5f7; --fill: rgba(120,120,128,.12);
  --text: #1d1d1f; --muted: #6e6e73; --hair: rgba(0,0,0,.1);
  --blue: #0071e3; --blue-hover: #0077ed; --link: #0066cc; --ink: #1d1d1f;
  --red: #c8102e; --green: #248a3d;
  --tip: #f0f6ff; --warn: #fff1f3; --ok-soft: #eaf6ec; --bad-soft: #fff1f3;
  --nav-bg: rgba(250,250,252,.8);
  --shadow: 0 2px 12px rgba(0,0,0,.04);
  --hero: #000000;
  --r-card: 18px; --r-inner: 12px;
}
[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --panel: #2c2c2e; --fill: rgba(120,120,128,.24);
  --text: #f5f5f7; --muted: #a1a1a6; --hair: rgba(255,255,255,.12);
  --blue: #0a84ff; --blue-hover: #409cff; --link: #2997ff; --ink: #f5f5f7;
  --red: #ff453a; --green: #30d158;
  --tip: #0f2440; --warn: #3a1517; --ok-soft: #10301a; --bad-soft: #3a1517;
  --nav-bg: rgba(22,22,23,.8); --shadow: none; --hero: #1c1c1e;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -0.022em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, .flash .w, .stat b, .nav .brand big, .path b {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 48px; line-height: 1.08; margin: 0 0 10px; font-weight: 700; letter-spacing: -0.015em; }
@media (max-width: 600px) { h1 { font-size: 36px; } }
h2 { font-size: 28px; line-height: 1.14; font-weight: 600; letter-spacing: -0.012em; margin: 44px 0 14px; }
h3 { font-size: 19px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; letter-spacing: -0.01em; }
.en { font-weight: 600; }
.loading { padding: 80px 20px; text-align: center; color: var(--muted); }
.kicker { color: var(--red); font-weight: 600; font-size: 17px; margin: 0 0 6px; }
.note { color: var(--muted); font-size: 14px; }

/* ---------- layout & nav */
main { max-width: 980px; margin: 0 auto; padding: 40px 20px 120px; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: var(--nav-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--hair); padding: 6px 2px calc(4px + env(safe-area-inset-bottom));
}
.nav .brand, .nav .wide { display: none; }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  color: var(--muted); font-size: 11px; font-weight: 500; padding: 3px 6px; min-width: 60px; text-decoration: none;
}
.nav a i { font-style: normal; font-size: 21px; line-height: 1.2; }
.nav a b { font-weight: 500; }
.nav a.on { color: var(--blue); }
@media (min-width: 900px) {
  .nav {
    top: 0; right: auto; width: 260px; flex-direction: column; justify-content: flex-start;
    border-top: 0; border-right: 0.5px solid var(--hair); padding: 30px 14px; gap: 2px;
  }
  .nav .brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 24px; }
  .nav .brand img { width: 44px; height: 44px; border-radius: 10px; }
  .nav .brand big { display: block; font-size: 21px; line-height: 1.1; font-weight: 600; color: var(--text); }
  .nav .brand small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
  .nav .wide { display: flex; }
  .nav a[data-nav="more"] { display: none; }
  .nav a { flex-direction: row; gap: 12px; font-size: 15px; padding: 7px 12px; color: var(--text); border-radius: 8px; }
  .nav a i { width: 22px; text-align: center; font-size: 17px; color: var(--blue); }
  .nav a b { font-weight: 400; }
  .nav a:hover { background: var(--fill); text-decoration: none; }
  .nav a.on { background: var(--blue); color: #fff; }
  .nav a.on i { color: #fff; }
  main { margin-left: 260px; padding: 64px 56px 80px; max-width: 1000px; }
  body { overflow-y: scroll; }
}
@media (min-width: 1320px) { main { margin-left: calc(260px + (100vw - 260px - 1000px) / 2); } }

/* ---------- блоки */
.card {
  background: var(--surface); border-radius: var(--r-card); padding: 22px 24px; margin: 14px 0;
  box-shadow: var(--shadow);
}
.card.hero { background: var(--hero); color: #f5f5f7; padding: 30px 30px 28px; }
.card.hero h2 { margin: 12px 0 6px; font-size: 32px; color: #fff; }
.card.hero .muted { color: #a1a1a6; }
.card.hero .pill.acc { background: rgba(255,255,255,.14); color: #fff; }
.card.link { display: block; color: inherit; text-decoration: none; transition: transform .25s ease, box-shadow .25s ease; }
.card.link:hover { transform: scale(1.012); box-shadow: 0 6px 24px rgba(0,0,0,.08); text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 14px 0; }
.grid .card { margin: 0; }
.stat b { display: block; font-size: 40px; line-height: 1.1; font-weight: 600; letter-spacing: -0.01em; }
.stat span { color: var(--muted); font-size: 14px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 980px;
  background: var(--fill); color: var(--muted); white-space: nowrap; letter-spacing: 0;
}
.pill.ok { background: var(--ok-soft); color: var(--green); }
.pill.bad { background: var(--bad-soft); color: var(--red); }
.pill.acc { background: var(--tip); color: var(--blue); }
.star { color: var(--red); }
.bar { height: 6px; background: var(--fill); border-radius: 980px; overflow: hidden; }
.bar > div { height: 100%; background: var(--blue); border-radius: 980px; transition: width .4s ease; }
.bar.ok > div { background: var(--green); }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.tip { background: var(--tip); border-radius: var(--r-inner); padding: 14px 18px; margin: 12px 0; }
.warn { background: var(--warn); border-radius: var(--r-inner); padding: 14px 18px; margin: 12px 0; }
.warn::before { content: "! "; color: var(--red); font-weight: 700; }

/* ---------- кнопки и поля */
button, .btn {
  font: inherit; font-size: 17px; font-weight: 400; border: 0; border-radius: 980px;
  background: var(--fill); color: var(--blue); padding: 9px 20px; cursor: pointer; display: inline-block;
  text-decoration: none !important; transition: background .2s, transform .1s;
}
button:hover, .btn:hover { background: rgba(120,120,128,.2); }
button:active, .btn:active { transform: scale(.97); }
button.primary, .btn.primary, button.ok { background: var(--blue); color: #fff; }
button.primary:hover, .btn.primary:hover, button.ok:hover { background: var(--blue-hover); }
.card.hero .btn.primary { background: var(--blue); color: #fff; }
button.ghost { background: transparent; color: var(--link); padding-left: 6px; padding-right: 6px; }
button.ghost:hover { text-decoration: underline !important; background: transparent; }
button.bad { background: var(--bad-soft); color: var(--red); }
button:disabled { opacity: .35; cursor: default; transform: none; }
button.big, .btn.big { padding: 12px 26px; font-size: 17px; }
input[type=text], input[type=date], textarea, input[type=search] {
  font: inherit; width: 100%; color: var(--text); background: var(--surface);
  border: 1px solid #d2d2d7; border-radius: var(--r-inner); padding: 12px 14px;
}
[data-theme="dark"] input, [data-theme="dark"] textarea { border-color: #424245; background: var(--panel); }
input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,113,227,.18); }
textarea { min-height: 120px; resize: vertical; }
label.check { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; cursor: pointer; border-bottom: 0.5px solid var(--hair); }
label.check:last-child { border-bottom: 0; }
label.check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--blue); flex: none; }

/* ---------- вкладки = сегментированный переключатель iOS */
.tabs {
  display: inline-flex; gap: 2px; overflow-x: auto; margin: 18px 0 6px; padding: 3px;
  background: var(--fill); border-radius: 10px; max-width: 100%; scrollbar-width: none;
}
.tabs a {
  white-space: nowrap; padding: 6px 16px; color: var(--text); font-size: 14px; font-weight: 500;
  border-radius: 8px; text-decoration: none;
}
.tabs a.on { background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
[data-theme="dark"] .tabs a.on { background: #636366; }

/* ---------- теория */
.theory { white-space: pre-wrap; }
.examples { white-space: pre-wrap; font-weight: 600; }
pre.grammar {
  white-space: pre-wrap; font: 14.5px/1.6 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0;
  margin: 0; overflow-x: auto; color: var(--text);
}
@media (max-width: 600px) { pre.grammar { font-size: 12.5px; white-space: pre; } }
.prompt-box {
  white-space: pre-wrap; font-size: 14px; background: var(--panel); border-radius: var(--r-inner);
  padding: 14px; max-height: 260px; overflow: auto; margin: 10px 0;
}

/* ---------- упражнения */
.ex { border-bottom: 0.5px solid var(--hair); padding: 18px 0; }
.ex:first-child { padding-top: 4px; }
.ex:last-child { border-bottom: 0; padding-bottom: 4px; }
.ex .q { font-size: 19px; margin-bottom: 10px; }
.ex .q b { color: var(--blue); }
.ex .q .tag { margin-left: 6px; vertical-align: 3px; }
.ex form { display: flex; gap: 10px; }
.ex form input { flex: 1; }
.ex.correct input { border-color: var(--green); }
.ex.wrong input { border-color: var(--red); }
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
.opts button { color: var(--text); }
.opts button.chosen-ok { background: var(--green); color: #fff; }
.opts button.chosen-bad { background: var(--red); color: #fff; }
.opts button.right { box-shadow: inset 0 0 0 2px var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 50px; padding: 8px; border-radius: var(--r-inner); }
.chips.line { background: var(--panel); margin-bottom: 8px; }
.chips button { padding: 7px 14px; font-size: 17px; color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.fb { margin-top: 10px; padding: 12px 16px; font-size: 15px; border-radius: var(--r-inner); }
.fb.ok { background: var(--ok-soft); color: var(--green); font-weight: 600; }
.fb.bad { background: var(--bad-soft); }
.fb.bad b.c { color: var(--green); }
.fb .row { margin-top: 8px; }
.fb button { font-size: 14px; padding: 6px 14px; }

/* ---------- карточки слов */
.flash {
  min-height: 280px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; cursor: pointer; user-select: none;
}
.flash .w { font-size: 48px; font-weight: 700; letter-spacing: -0.015em; }
.flash .t { font-size: 24px; margin-top: 10px; }
.flash .e { color: var(--muted); margin-top: 10px; }
.boxes { display: inline-flex; gap: 3px; vertical-align: middle; }
.boxes i { width: 7px; height: 7px; border-radius: 50%; background: var(--fill); }
.boxes i.f { background: var(--green); }
.speak { background: transparent; padding: 0 4px; font-size: 16px; color: var(--muted); }
.speak:hover { background: transparent; }

/* ---------- списки как в настройках iOS */
.card.list { padding-top: 4px; padding-bottom: 4px; }
.list .item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 0.5px solid var(--hair); text-decoration: none; color: inherit; }
.list .item:last-child { border-bottom: 0; }
.list .item .grow { flex: 1; min-width: 0; }
a.item:hover { text-decoration: none; }
a.item:hover .grow { color: var(--blue); }
.num {
  width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--fill); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.num.done { background: var(--green); color: #fff; }
.num.prog { background: var(--blue); color: #fff; }

/* ---------- календарь и путь */
.cal { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 4px; overflow-x: auto; }
.cal i { width: 14px; height: 14px; border-radius: 4px; background: var(--fill); }
.cal i.l1 { background: #a8d8b4; }
.cal i.l2 { background: #5cbf74; }
.cal i.l3 { background: var(--green); }
.cal i.today { box-shadow: 0 0 0 2px var(--blue); }
.path { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.path > div { background: var(--surface); border-radius: var(--r-card); padding: 20px; box-shadow: var(--shadow); }
.path > div.now { box-shadow: inset 0 0 0 2px var(--blue); }
.path b { font-size: 34px; font-weight: 700; }
@media (max-width: 600px) { .path { grid-template-columns: 1fr; } }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(20px);
  background: rgba(29,29,31,.92); color: #fff; padding: 11px 20px; border-radius: 980px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  opacity: 0; pointer-events: none; transition: .3s ease; z-index: 20; font-size: 15px; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.err { background: var(--warn); border-radius: var(--r-inner); padding: 14px 18px; color: var(--red); }
details summary { cursor: pointer; color: var(--link); }
ol { margin: 6px 0; }

h1 .star { font-size: .6em; vertical-align: .35em; }

/* ---------- разговор с Gemini (как iMessage) */
.chat { height: min(56vh, 560px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.msg { display: flex; align-items: flex-end; gap: 4px; max-width: 86%; }
.msg.me { align-self: flex-end; }
.msg.ai { align-self: flex-start; }
.bub { padding: 10px 15px; border-radius: 20px; white-space: pre-wrap; line-height: 1.38; }
.msg.me .bub { background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.msg.ai .bub { background: var(--panel); border-bottom-left-radius: 6px; }
[data-theme="dark"] .msg.ai .bub { background: #2c2c2e; }
.msg.final { max-width: 100%; }
.msg.final .bub { background: var(--tip); }
.bub .better { color: var(--green); font-weight: 600; }
.typing span { animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.talkbar { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.mic {
  width: 64px; height: 64px; border-radius: 50%; font-size: 28px; padding: 0; flex: none;
  background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(0,113,227,.35);
}
.mic:hover { background: var(--blue-hover); }
.mic.on { background: var(--red); box-shadow: 0 0 0 0 rgba(200,16,46,.5); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(200,16,46,.45); } 70% { box-shadow: 0 0 0 16px rgba(200,16,46,0); } 100% { box-shadow: 0 0 0 0 rgba(200,16,46,0); } }
.talkbar #send { width: 44px; height: 44px; padding: 0; font-size: 20px; font-weight: 700; }

/* ---------- темы слов */
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 14px 0; }
.topics .card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.topic .ticon { font-size: 30px; line-height: 1; }
.topic h3 { margin: 4px 0 0; }
.topic p { margin: 0; }
.topic .subs { margin-top: 4px; line-height: 1.4; }

/* ---------- кино */
.mic.small-mic { width: 44px; height: 44px; font-size: 19px; box-shadow: none; }

/* ---------- единые значки (линейные, как SF Symbols) */
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
button .ic, .btn .ic { margin-right: 2px; }
.tile {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border-radius: 8px; color: #fff;
}
.tile .ic { width: 18px; height: 18px; vertical-align: 0; margin: 0; }
.tile.lg { width: 44px; height: 44px; border-radius: 11px; }
.tile.lg .ic { width: 26px; height: 26px; }
h1 .tile.lg { vertical-align: -4px; }
.qhead { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.qhead h3 { margin: 0; }
.stat b .ic.flame { width: 0.8em; height: 0.8em; vertical-align: -0.05em; color: var(--red); }
.nav a i .ic { width: 24px; height: 24px; vertical-align: 0; }
@media (min-width: 900px) { .nav a i .ic { width: 20px; height: 20px; } }
.mic .ic { width: 28px; height: 28px; vertical-align: 0; }
.mic.small-mic .ic { width: 20px; height: 20px; }
#send .ic { width: 20px; height: 20px; vertical-align: 0; margin: 0; }
.speak .ic { width: 17px; height: 17px; }
.topic .ticon { font-size: 0; line-height: 0; }

/* ---------- вход и профиль */
body.auth .nav { display: none; }
body.auth main { margin: 0 auto; max-width: 560px; padding-top: 60px; }
.login-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.login-head img { width: 56px; height: 56px; border-radius: 13px; }
.login-head h1 { margin: 0; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none; color: #fff; font-weight: 600;
  width: 36px; height: 36px; border-radius: 50%; font-size: 16px;
}
.avatar.lg { width: 48px; height: 48px; font-size: 21px; }
.avatar.xl { width: 72px; height: 72px; font-size: 32px; }
label.fl { display: block; font-size: 14px; color: var(--muted); margin: 0 0 12px; }
label.fl input, label.fl textarea, label.fl select { margin-top: 5px; color: var(--text); font-size: 17px; }
select {
  font: inherit; width: 100%; color: var(--text); background: var(--surface);
  border: 1px solid #d2d2d7; border-radius: var(--r-inner); padding: 11px 12px;
}
[data-theme="dark"] select { border-color: #424245; background: var(--panel); }
textarea[name="interests"], textarea[name="goal"] { min-height: 64px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.chip { font-size: 13px; padding: 5px 11px; color: var(--text); }
.gen .tip { margin: 10px 0 14px; }

/* ---------- аватарки */
img.avatar { object-fit: cover; padding: 0; }
.avatar.sm { width: 24px; height: 24px; font-size: 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches .sw { width: 32px; height: 32px; border-radius: 50%; padding: 0; border: 0; }
.swatches .sw.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--blue); }
.nav a i .avatar.sm { vertical-align: middle; }

/* ---------- страница профиля */
.profile-hero { text-align: center; padding: 34px 24px 26px; }
.profile-hero h1 { margin: 14px 0 2px; }
.ph-avatar { position: relative; display: inline-block; }
.avatar.xxl { width: 112px; height: 112px; font-size: 48px; }
.ph-edit {
  position: absolute; right: -2px; bottom: -2px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--surface); cursor: pointer;
}
.ph-edit .ic { width: 18px; height: 18px; vertical-align: 0; }
.levels { display: inline-flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.lvl { min-width: 40px; padding: 5px 10px; border-radius: 980px; font-size: 14px; font-weight: 600; background: var(--fill); color: var(--muted); }
.lvl.past { background: var(--ok-soft); color: var(--green); }
.lvl.now { background: var(--blue); color: #fff; }
.lvl.mid { background: var(--tip); color: var(--blue); }
.lvl.goal { box-shadow: inset 0 0 0 2px var(--green); color: var(--green); background: transparent; }
.ph-colors { margin-top: 20px; }
.ph-colors .swatches { justify-content: center; }
.ph-colors .sw { width: 26px; height: 26px; }
.ichips { display: flex; flex-wrap: wrap; gap: 8px; }
.pill.big { font-size: 14px; padding: 6px 13px; font-weight: 500; }
.settings .item { cursor: pointer; }
.settings .chev { font-size: 18px; }
.drawer { padding: 6px 0 18px 44px; border-bottom: 0.5px solid var(--hair); }
@media (max-width: 600px) { .drawer { padding-left: 0; } }
.talk-start { margin: auto; text-align: center; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.talk-start h3 { margin: 6px 0 0; }
.grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) { .grid.four { grid-template-columns: repeat(2, 1fr); } }

/* ---------- поле пароля — как все поля приложения */
input[type=password] {
  font: inherit; width: 100%; color: var(--text); background: var(--surface);
  border: 1px solid #d2d2d7; border-radius: var(--r-inner); padding: 12px 14px;
  letter-spacing: 0.08em;
}
input[type=password]::placeholder { letter-spacing: normal; }
[data-theme="dark"] input[type=password] { border-color: #424245; background: var(--panel); }
input[type=password]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,113,227,.18); }
.dc-entry { padding: 14px 0; border-top: 0.5px solid var(--hair); }
.dc-entry:first-of-type { border-top: 0; }
.habits .hrow { display: flex; align-items: center; gap: 8px; border-bottom: 0.5px solid var(--hair); }
.habits .hrow .check { flex: 1; border-bottom: 0; }
.habits .hdel { color: var(--muted); padding: 6px 8px; }
.habits .hdel:hover { color: var(--red); }

/* ---------- чек-лист: круглые галочки, как в «Напоминаниях» */
.checklist .item.ck { cursor: pointer; align-items: flex-start; gap: 14px; }
.checklist input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: none; margin: 1px 0 0;
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid #c7c7cc; background: transparent; cursor: pointer;
  transition: background .15s, border-color .15s;
}
[data-theme="dark"] .checklist input[type=checkbox] { border-color: #545458; }
.checklist input[type=checkbox]:checked {
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 15px no-repeat;
  border-color: var(--blue);
}
.checklist .ck:has(input:checked) .grow > div:first-child { color: var(--muted); }
.checklist .en-ex { font-style: italic; margin-top: 2px; }

/* ---------- единый стиль: галочки, профиль в меню, вёрстка правил */
input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: none; margin: 1px 0 0; cursor: pointer;
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c7c7cc; background: transparent; vertical-align: -5px;
  transition: background .15s, border-color .15s;
}
[data-theme="dark"] input[type=checkbox] { border-color: #545458; }
input[type=checkbox]:checked {
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
  border-color: var(--blue);
}
label.check input { width: 22px; height: 22px; }

.nav .navuser b { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) {
  .nav .navuser { margin-bottom: 10px; padding-bottom: 12px; border-bottom: 0.5px solid var(--hair); border-radius: 8px 8px 0 0; }
  .nav .navuser b { max-width: 170px; font-weight: 600; }
  .nav .navuser i .avatar.sm { width: 26px; height: 26px; }
  .only-mobile { display: none !important; }
}

.card.link.prow { display: flex; align-items: center; gap: 14px; }

.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 600px) { .grid.three { grid-template-columns: repeat(2, 1fr); } }

.grammar-body .g-h { font-size: 17px; font-weight: 600; margin: 18px 0 6px; }
.grammar-body .g-h:first-child, .grammar-body .g-p:first-child { margin-top: 0; }
.grammar-body .g-p { margin: 12px 0 6px; }
.grammar-body .g-ex { background: var(--tip); border-radius: var(--r-inner); padding: 10px 14px; margin: 6px 0 12px; }
.grammar-body .g-line { padding: 3px 0; }
.grammar-body .g-pair { display: grid; grid-template-columns: minmax(140px, 38%) 1fr; gap: 12px; padding: 4px 0; border-bottom: 0.5px solid var(--hair); }
.grammar-body .g-pair:last-child { border-bottom: 0; }
.grammar-body .g-pair span:first-child { color: var(--muted); }
.grammar-body .en { font-weight: 500; }
.g-table-wrap { overflow-x: auto; margin: 8px 0 14px; }
.g-table { border-collapse: collapse; width: 100%; font-size: 15px; }
.g-table th, .g-table td { text-align: left; padding: 7px 10px; border-bottom: 0.5px solid var(--hair); white-space: nowrap; }
.g-table th { background: var(--panel); font-weight: 600; }
.g-table tr:first-child td { font-weight: 600; background: var(--panel); }
@media (max-width: 600px) { .grammar-body .g-pair { grid-template-columns: 1fr; gap: 0; } }
.m-only { display: none; }
@media (max-width: 899px) { .d-only { display: none; } .m-only { display: inline; } }
@media (max-width: 600px) {
  .grid:not(.three):not(.four) { grid-template-columns: repeat(2, 1fr); }
  .stat b { font-size: 32px; }
}

/* ---------- ЕГЭ */
.tipsbox summary { cursor: pointer; }
.tipsbox ul { margin: 10px 0 0; padding-left: 20px; }
.eg-text { line-height: 2.1; }
.eg-gap { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--panel); border-radius: 10px; padding: 2px 8px; margin: 2px 0; line-height: 1.4; }
.eg-gap b { color: var(--blue); font-size: 14px; }
.eg-gap input { width: 150px; padding: 5px 9px; font-size: 16px; }
.eg-gap select { width: auto; padding: 5px 8px; font-size: 15px; }
.eg-word { font-weight: 700; letter-spacing: .02em; color: var(--muted); font-size: 14px; }
.eg-gap.ok { background: var(--ok-soft); } .eg-gap.bad { background: var(--bad-soft); }
.eg-right { color: var(--green); font-weight: 600; font-size: 15px; }
.eg-q { padding: 12px 0; border-bottom: 0.5px solid var(--hair); }
.eg-q:last-child { border-bottom: 0; }
.eg-q.bad > b { color: var(--red); } .eg-q.ok > b { color: var(--green); }
.eg-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.eg-opts.row { flex-direction: row; gap: 16px; flex-wrap: wrap; }
.eg-opts label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.eg-opts label.right { color: var(--green); font-weight: 600; }
input[type=radio] { width: 18px; height: 18px; accent-color: var(--blue); }
.eg-list { padding-left: 22px; margin: 6px 0 0; } .eg-list li { margin: 4px 0; }
.eg-answers { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.eg-a { display: flex; align-items: center; gap: 8px; font-weight: 600; background: var(--panel); border-radius: 12px; padding: 6px 10px; }
.eg-a input, .eg-a select { width: 92px; padding: 6px 8px; font-weight: 400; }
.eg-a.ok { background: var(--ok-soft); } .eg-a.bad { background: var(--bad-soft); }
.eg-a .small { color: var(--green); }
.eg-result { text-align: center; }
.eg-result .list, .eg-result .tip, .eg-result .fb, .eg-result details, .eg-result h3 { text-align: left; }
.eg-result .row { justify-content: center; }
.eg-score { font-size: 54px; font-weight: 700; letter-spacing: -0.02em; }
.eg-letter { background: var(--panel); border-radius: var(--r-inner); padding: 14px 16px; white-space: normal; }
.eg-ad { background: var(--tip); border-radius: var(--r-inner); padding: 14px 16px; margin: 10px 0; font-weight: 500; }
.eg-photo { background: var(--panel); border-radius: var(--r-inner); padding: 12px 14px; margin-top: 8px; }
.eg-n { width: 24px; font-weight: 700; color: var(--blue); padding-top: 12px; }
.imp-text { white-space: pre-wrap; margin-top: 8px; }
.listen .row { align-items: center; }
.track-switch { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.voices .item.ck { align-items: center; cursor: pointer; }
.voices input[type=radio] { flex: none; }
.line-exp { padding: 12px 0; border-top: 0.5px solid var(--hair); margin-top: 12px; }
.line-exp ul { margin: 6px 0 0; padding-left: 20px; }
.btn.small { font-size: 14px; padding: 6px 14px; }

/* ---------- школьные задания */
.hw-drop { border: 2px dashed var(--hair); border-radius: var(--r-card); padding: 14px; transition: background .15s, border-color .15s; }
.hw-drop.over { border-color: var(--blue); background: var(--tip); }
.hw-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 10px; cursor: pointer; text-align: center; }
.hw-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.hw-th { position: relative; width: 110px; height: 140px; border-radius: 12px; overflow: hidden; background: var(--panel); }
.hw-th img { width: 100%; height: 100%; object-fit: cover; }
.hw-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 17px; line-height: 1; }
.hw-add { width: 110px; height: 140px; border-radius: 12px; border: 2px dashed var(--hair); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--blue); cursor: pointer; font-size: 14px; }
.hw-add .ic { width: 26px; height: 26px; }
.hw-mini { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.hw-item { align-items: flex-start !important; }
.hw-mark { width: 28px; height: 28px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.hw-mark.ok { background: var(--green); } .hw-mark.bad { background: var(--red); } .hw-mark.empty { background: var(--fill); color: var(--muted); }
.yt-wrap { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--r-inner); overflow: hidden; background: #000; }
.yt-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
