:root {
  --bg: #e9ecf2;
  --frame: #f4f5f8;
  --panel: #ffffff;
  --soft: #f2f4f8;
  --soft2: #eaeef5;
  --line: #e3e6ec;
  --ink: #111214;
  --ink2: #3b3e45;
  --muted: #8b9099;
  --good: #1f9d55;
  --good-bg: #e7f6ed;
  --bad: #d64545;
  --bad-bg: #fcebeb;
  --warn: #c98a12;
  --warn-bg: #fdf4e1;
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --shadow: 0 1px 2px rgba(17, 18, 20, .04), 0 8px 24px rgba(17, 18, 20, .05);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 .7em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.hidden { display: none !important; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- shell ---------- */
.shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
}
.frame {
  display: contents;
}
.side {
  background: var(--frame);
  border-radius: var(--r-xl) 0 0 var(--r-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 0;
  position: sticky;
  top: 20px;
  height: calc(100dvh - 40px);
}
.side .logo { font-weight: 800; font-size: 13px; letter-spacing: .04em; margin-bottom: 26px; color: var(--muted); }
.nav-btn {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink2);
  transition: background .15s, color .15s, transform .1s;
  position: relative;
}
.nav-btn:hover { background: var(--soft2); }
.nav-btn.on { background: var(--ink); color: #fff; }
.nav-btn:active { transform: scale(.94); }
.nav-btn .tip {
  position: absolute; left: 58px; white-space: nowrap; background: var(--ink); color: #fff;
  font-size: 12px; padding: 4px 8px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5;
}
.nav-btn:hover .tip { opacity: 1; }
.side .spacer { flex: 1; }

.main {
  background: var(--panel);
  border-radius: 0 var(--r-xl) var(--r-xl) 0;
  box-shadow: var(--shadow);
  padding: 28px 32px 40px;
  min-width: 0;
}
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.topbar h1 { flex: none; }
.search {
  flex: 1; max-width: 320px; display: flex; align-items: center; gap: 8px;
  background: var(--soft); border-radius: 999px; padding: 0 14px; height: 40px; color: var(--muted);
}
.search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 14px; color: var(--ink); }
.topbar .grow { flex: 1; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none;
}
.who { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink2); }
.icon-btn:hover { background: var(--soft); }
.icon-btn.dark { background: var(--ink); color: #fff; }

/* bottom nav (phone) */
.bnav { display: none; }

/* ---------- layout pieces ---------- */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

.panel-soft { background: var(--soft); border-radius: 24px; padding: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.card.soft { background: var(--soft); border-color: transparent; }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14px;
  transition: transform .08s, opacity .15s;
  white-space: nowrap;
}
.pill:active { transform: scale(.97); }
.pill[disabled] { opacity: .45; pointer-events: none; }
.pill.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.pill.ghost:hover { border-color: var(--ink); }
.pill.soft { background: var(--soft2); color: var(--ink); }
.pill.good { background: var(--good); }
.pill.bad { background: var(--bad); }
.pill.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.pill.block { width: 100%; }

.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.seg button.on { background: var(--ink); color: #fff; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--soft2); color: var(--ink2); }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }

/* list rows like "Find your teacher" */
.rows { display: flex; flex-direction: column; gap: 4px; }
.lrow {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 10px 14px; border-radius: 16px; text-align: left; width: 100%;
  transition: background .15s;
}
.lrow:hover, .lrow.on { background: var(--soft); }
.lrow .ic { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.lrow .ic.light { background: var(--soft2); color: var(--ink); }
.lrow .t { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.lrow .s { font-size: 12px; color: var(--muted); }
.lrow .meta { font-size: 13px; color: var(--ink2); white-space: nowrap; }

/* progress bars */
.bar { height: 6px; border-radius: 99px; background: var(--soft2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 99px; transition: width .4s; }
.bar.good > i { background: var(--good); }

/* ring */
.ring-wrap { display: grid; place-items: center; position: relative; }
.ring-wrap .val { position: absolute; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.ring-wrap .val small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; letter-spacing: 0; }

/* schedule date cards */
.dates { display: flex; flex-direction: column; gap: 12px; }
.dcard {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 16px; background: #fff;
}
.dcard .d { font-size: 24px; font-weight: 700; min-width: 34px; }
.dcard .m { font-size: 13px; line-height: 1.25; }
.dcard .m b { display: block; font-size: 14px; }
.dcard .r { font-size: 12px; color: var(--muted); text-align: right; }
.dcard.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.dcard.on .r { color: #c9ccd2; }
.dcard.done { opacity: .55; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 800; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats .card { padding: 14px 16px; }

.countdown { background: var(--ink); color: #fff; border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.countdown .big { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.countdown .muted { color: #a7abb3; }

/* ---------- learn ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs button { height: 38px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: 14px; background: var(--soft); color: var(--ink2); display: inline-flex; align-items: center; gap: 8px; }
.tabs button.on { background: var(--ink); color: #fff; }
.tabs .count { font-size: 11px; opacity: .7; }

.toc { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 20px; }
.toc button { text-align: left; padding: 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--ink2); display: flex; gap: 8px; align-items: flex-start; }
.toc button:hover { background: var(--soft); }
.toc button .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-top: 6px; flex: none; }
.toc button.read .dot { background: var(--good); }

.lesson { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; scroll-margin-top: 20px; }
.lesson + .lesson { margin-top: 16px; }
.lesson h3 { font-size: 18px; margin-bottom: 4px; }
.lesson .ru-title { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.bi { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.bi.single { grid-template-columns: 1fr; }
.txt { font-size: 15px; line-height: 1.62; }
.txt ul, .txt ol { margin: .2em 0 .8em; padding-left: 1.3em; }
.txt li { margin: .2em 0; }
.txt.ru { color: var(--ink2); border-left: 3px solid var(--soft2); padding-left: 16px; }
.lang-tag { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .06em; margin-bottom: 6px; }
.merke { margin-top: 14px; background: var(--soft); border-radius: 14px; padding: 12px 16px; font-size: 14px; }
.merke b.k { display: inline-block; background: var(--ink); color: #fff; font-size: 11px; border-radius: 6px; padding: 1px 7px; margin-right: 8px; letter-spacing: .04em; }

/* ---------- flashcards ---------- */
.fc-wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.fc {
  perspective: 1400px; min-height: 340px; cursor: pointer; user-select: none; -webkit-user-select: none;
}
.fc-inner { position: relative; width: 100%; min-height: 340px; transition: transform .45s cubic-bezier(.3, .7, .3, 1); transform-style: preserve-3d; }
.fc.flip .fc-inner { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 24px; padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 12px;
  background: var(--soft); overflow-y: auto;
}
.fc-face.back { transform: rotateY(180deg); background: #fff; border: 1.5px solid var(--line); justify-content: flex-start; }
.fc-term { font-size: 28px; font-weight: 800; text-align: center; letter-spacing: -.02em; }
.fc-sub { text-align: center; color: var(--muted); font-size: 14px; }
.fc-tap { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); }
.fc-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fc-btns .pill { height: 52px; font-size: 15px; }
.boxes { display: flex; gap: 6px; justify-content: center; }
.boxes span { width: 28px; height: 6px; border-radius: 4px; background: var(--soft2); }
.boxes span.on { background: var(--ink); }

/* ---------- quiz ---------- */
.q-card { border: 1px solid var(--line); border-radius: 24px; padding: 24px; max-width: 820px; }
.q-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.q-text { font-size: 18px; font-weight: 700; line-height: 1.4; margin-bottom: 4px; }
.q-ru { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.opt {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start;
  text-align: left; border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; width: 100%;
  transition: border-color .15s, background .15s;
}
.opt:hover { border-color: #c9cdd5; }
.opt .box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid #c9cdd5; display: grid; place-items: center; margin-top: 1px; }
.opt.sel { border-color: var(--ink); background: var(--soft); }
.opt.sel .box { background: var(--ink); border-color: var(--ink); color: #fff; }
.opt .ot { font-size: 15px; font-weight: 500; }
.opt .or { font-size: 13px; color: var(--muted); margin-top: 2px; }
.opt.right { border-color: var(--good); background: var(--good-bg); }
.opt.right .box { background: var(--good); border-color: var(--good); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.wrong .box { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt.missed { border-color: var(--good); border-style: dashed; }
.opt[disabled] { cursor: default; }
.explain { background: var(--soft); border-radius: 16px; padding: 16px 18px; margin-bottom: 16px; font-size: 14px; }
.verdict { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }

/* ---------- write ---------- */
textarea.answer {
  width: 100%; min-height: 200px; resize: vertical; border: 1.5px solid var(--line); border-radius: 18px;
  padding: 16px 18px; font-size: 16px; line-height: 1.55; outline: none; background: #fff;
}
textarea.answer:focus { border-color: var(--ink); }
.feedback { border-radius: 20px; padding: 20px; border: 1.5px solid var(--line); margin-top: 16px; }
.score-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.score-big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.fb-list { margin: 6px 0 12px; padding-left: 1.2em; font-size: 14px; }
.fb-list li { margin: 4px 0; }
.fb-h { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--muted); margin-top: 12px; text-transform: uppercase; }
.lang-fix { font-size: 14px; margin: 4px 0; }
.lang-fix s { color: var(--bad); }
.lang-fix ins { color: var(--good); text-decoration: none; font-weight: 600; }
.model-ans { background: var(--soft); border-radius: 16px; padding: 16px 18px; margin-top: 12px; font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.dark { border-color: rgba(0, 0, 0, .12); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- glossary ---------- */
.gl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.gl-item { border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.gl-item .t { font-weight: 700; }
.gl-item .r { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.gl-item .d { font-size: 14px; }
.gl-item .dr { font-size: 13px; color: var(--ink2); margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; }

/* ---------- tutor ---------- */
.chat { display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.msg { padding: 14px 18px; border-radius: 20px; font-size: 15px; max-width: 92%; }
.msg.user { background: var(--ink); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.msg.ai { background: var(--soft); align-self: flex-start; border-bottom-left-radius: 6px; }
.chat-input { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; max-width: 820px; }
.chat-input textarea { flex: 1; min-height: 52px; max-height: 200px; border: 1.5px solid var(--line); border-radius: 18px; padding: 13px 16px; font-size: 16px; resize: none; outline: none; }
.chat-input textarea:focus { border-color: var(--ink); }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; }
.suggest button:hover { border-color: var(--ink); }

/* ---------- exam ---------- */
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px; display: inline-flex; align-items: center; gap: 8px; }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; }
.qnav button { width: 34px; height: 34px; border-radius: 10px; background: var(--soft); font-size: 13px; font-weight: 700; }
.qnav button.ans { background: var(--soft2); outline: 2px solid var(--ink); outline-offset: -2px; }
.qnav button.cur { background: var(--ink); color: #fff; }
.qnav button.good { background: var(--good-bg); color: var(--good); }
.qnav button.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- login ---------- */
.login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px;
}
.login-card { background: #fff; border-radius: 32px; padding: 40px 36px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink2); }
.field input { height: 50px; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 16px; font-size: 16px; outline: none; background: #fff; }
.field input:focus { border-color: var(--ink); }
.err { color: var(--bad); font-size: 14px; margin-top: 12px; min-height: 20px; }
.login-mark { width: 52px; height: 52px; border-radius: 16px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; margin-bottom: 22px; font-size: 18px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  z-index: 50; box-shadow: var(--shadow); animation: up .2s ease-out;
}
@keyframes up { from { opacity: 0; transform: translate(-50%, 8px); } }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.kbd { font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .learn-layout .toc-col { display: none; }
}
@media (max-width: 900px) {
  .bi { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 767px) {
  body { background: var(--panel); font-size: 15px; }
  .shell { display: block; padding: 0; }
  .side { display: none; }
  .main { border-radius: 0; box-shadow: none; padding: 16px 16px calc(96px + var(--safe-b)); padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .topbar { margin-bottom: 18px; gap: 10px; }
  .topbar h1 { font-size: 22px; }
  .topbar .search { display: none; }
  .bnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px;
    bottom: calc(10px + var(--safe-b)); background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-radius: 24px; box-shadow: 0 8px 30px rgba(0, 0, 0, .12); padding: 8px; z-index: 30; border: 1px solid var(--line);
  }
  .bnav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 600; color: var(--muted); padding: 6px 0; border-radius: 16px; }
  .bnav button.on { color: var(--ink); background: var(--soft); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lesson { padding: 18px 16px; }
  .q-card { padding: 18px 16px; border-radius: 20px; }
  .q-text { font-size: 17px; }
  .fc, .fc-inner { min-height: 380px; }
  .fc-term { font-size: 24px; }
  .countdown .big { font-size: 34px; }
  .lrow { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 10px; }
  .lrow .meta.opt-hide { display: none; }
  .lrow .ic { width: 40px; height: 40px; }
  .panel-soft { padding: 18px; border-radius: 20px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; }
  .login-card { padding: 32px 22px; border-radius: 26px; }
  .msg { max-width: 100%; }
}
@media (hover: none) { .nav-btn .tip { display: none; } }

/* translations */
.ru-inline { color: var(--ink2); font-size: 14px; margin-top: 6px; }
.ru-det { margin-top: 6px; }
.ru-det summary { cursor: pointer; list-style: none; display: inline-block; }
.ru-det summary::-webkit-details-marker { display: none; }
.ru-det[open] summary { margin-bottom: 6px; }
details > summary { cursor: pointer; }
code { background: var(--soft2); border-radius: 6px; padding: 0 5px; font-size: .92em; }

/* visuals */
.illu { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 18px; margin: 4px 0 18px; background: var(--soft); cursor: zoom-in; display: block; }
.scheme { margin: 18px 0 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; }
.scheme img { width: 100%; display: block; cursor: zoom-in; }
.scheme figcaption { font-size: 13px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--soft); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.scheme figcaption svg.i { width: 16px; height: 16px; }
.scheme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; margin-bottom: 28px; }
.scheme-grid .scheme { margin: 0; }
.modal { position: fixed; inset: 0; background: rgba(17, 18, 20, .55); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal-box { background: #fff; border-radius: 24px; padding: 24px; width: 100%; max-width: 760px; max-height: calc(100dvh - 32px); overflow: auto; position: relative; -webkit-overflow-scrolling: touch; }
.modal.wide .modal-box { max-width: 1100px; padding: 16px; }
.modal-x { position: absolute; top: 10px; right: 10px; background: var(--soft); z-index: 2; }

/* today */
.task .lrow { border: 1px solid var(--line); }
.task + .task { margin-top: 8px; }
.task.done .lrow { opacity: .6; }
.lrow .ic.ok { background: var(--good); }
.chip.method { background: #eef3ff; color: #3b5bdb; font-size: 11px; margin-left: 6px; vertical-align: 2px; }
.sublist { display: flex; flex-direction: column; padding: 4px 14px 8px 72px; }
.sublist button { text-align: left; font-size: 13px; padding: 4px 0; color: var(--ink2); }
.plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pday { border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 10px; display: flex; flex-direction: column; font-size: 12px; }
.pday b { font-size: 15px; }
.pday span { color: var(--muted); }
.pday i { font-style: normal; font-weight: 600; margin-top: 2px; }
.pday.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pday.on span { color: #b9bdc6; }
.pday.past { opacity: .5; }
.method { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.method span { color: var(--ink2); font-size: 13px; }
.phrase { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.phrase:first-of-type { border-top: 0; }
.phrase span { color: var(--muted); }
.type-row { display: flex; gap: 8px; margin-top: 10px; }
.type-in { flex: 1; height: 48px; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 14px; font-size: 17px; outline: none; background: #fff; min-width: 0; }
.type-in:focus { border-color: var(--ink); }
@media (max-width: 767px) {
  .scheme-grid { grid-template-columns: 1fr; }
  .phrase { grid-template-columns: 1fr; gap: 2px; }
  .sublist { padding-left: 14px; }
  .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: none; }
  .fc, .fc-inner { min-height: 320px; }
}
.task .lrow .t { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; white-space: normal; }
.chip.method { display: inline-block; width: auto; flex: none; padding: 1px 8px; }
.fc.typing .fc-tap { display: none; }
.md-h { font-size: 15px; margin: 10px 0 6px; }
.hist[data-go] { cursor: pointer; }
.hist { padding: 14px 16px; }
.ok-line { color: var(--good); }
.bad-line { color: var(--bad); }
.illu { max-width: 640px; }
