:root {
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #17233c;
  background: #f5f7fc;
  font-synthesis: none;
  --background: #f5f7fc;
  --ink: #17233c;
  --muted: #64718a;
  --line: #e5eaf4;
  --blue: #2655e6;
  --blue-deep: #1945c4;
  --sidebar: 222px;
  --ease: cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:enabled, select { cursor: pointer; }
button:disabled { cursor: default; }
button, a, input, select { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--blue); }
button, a { touch-action: manipulation; }
svg { display: inline-block; vertical-align: middle; flex: none; }
h1, h2, p { margin: 0; }
button, input, select { min-width: 0; }

.skip-link {
  position: fixed; z-index: 20; top: 12px; left: 12px; padding: 12px;
  transform: translateY(-160%); border-radius: 8px; color: white; background: var(--blue);
}
.skip-link:focus { transform: translateY(0); }

.sidebar {
  position: fixed; z-index: 5; inset: 0 auto 0 0; width: var(--sidebar);
  display: flex; flex-direction: column;
  padding: 37px 19px 22px; background: #fff; border-right: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; width: max-content; margin-left: 12px; }
.brand img { box-shadow: 0 5px 13px #2857e733; border-radius: 12px; }
.brand span { display: grid; gap: 3px; }
.brand strong { font-size: 21px; line-height: 1.15; letter-spacing: .04em; }
.brand small { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .14em; }
#navigation { margin-top: 48px; }
.nav-set { display: grid; gap: 5px; }
.nav-set a {
  display: flex; align-items: center; gap: 12px; min-height: 47px; padding: 0 13px;
  border-radius: 11px; color: #54617b; font-weight: 620; font-size: 14px;
  transition: color .18s, background .18s, transform .18s var(--ease);
}
.nav-set a:hover { color: var(--blue-deep); background: #f2f5fd; }
.nav-set a:active { transform: scale(.985); }
.nav-set a[aria-current] { background: #eaf0ff; color: #204dcf; font-weight: 750; }
.nav-set.second-set { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 22px; }
.sidebar-note {
  display: flex; gap: 10px; align-items: center; margin: auto 0 0; padding: 12px 8px 7px;
  border-top: 1px solid var(--line);
}
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; margin-bottom: 4px; }
.sidebar-note small { font-size: 12px; color: var(--muted); white-space: nowrap; }

#screen {
  max-width: 1430px; min-height: 100svh; margin-left: var(--sidebar);
  padding: 38px clamp(26px, 3.2vw, 57px) 55px;
}
#screen:focus { outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 25px; }
.page-heading h1 { font-size: clamp(30px, 3.1vw, 43px); line-height: 1.23; letter-spacing: -.05em; font-weight: 760; }
.page-heading p { color: var(--muted); font-size: 14px; font-weight: 550; margin-bottom: 7px; line-height: 1.45; }
.page-heading .button { margin-bottom: 2px; }
.surface { background: #fff; border: 1px solid var(--line); border-radius: 18px; }

.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 43px;
  padding: 10px 16px; border: 1px solid transparent; border-radius: 10px;
  white-space: nowrap; font-size: 14px; font-weight: 690; line-height: 1.24; text-decoration: none;
  transition: color .18s, background .18s, border-color .18s, transform .18s var(--ease), box-shadow .18s;
}
.button:active { transform: scale(.975); }
.button.primary { color: white; background: var(--blue); border-color: var(--blue); }
.button.primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.button.secondary { color: #34435f; border-color: #dfe5f3; background: white; }
.button.secondary:hover, .button.preset:hover { color: var(--blue-deep); border-color: #b4c6fd; background: #f7f9ff; }
.button.white { color: #1944c3; background: #fff; box-shadow: 0 5px 15px #142d8233; }
.button.white:hover { background: #eef3ff; box-shadow: 0 6px 18px #142d8255; }
.button.white:focus-visible, .hero :focus-visible { outline-color: #fff; }
.button.back { padding: 9px 6px; color: var(--muted); background: transparent; }
.button.back:hover { color: var(--blue); }
.icon-button {
  display: inline-grid; flex: none; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 10px; color: #576783; background: #fff;
  transition: color .18s, background .18s, border-color .18s, transform .18s var(--ease);
}
.icon-button:enabled:hover, .icon-button[aria-pressed="true"] { color: #2450dc; background: #edf2ff; border-color: #d6e1ff; }
.icon-button[aria-pressed="true"] svg { fill: #aabcff; }
.icon-button:enabled:active { transform: scale(.92); }
.icon-button:disabled { opacity: .38; }
.icon-button[aria-keyshortcuts] { display: inline-flex; justify-content: center; align-items: center; gap: 6px; width: auto; min-width: 40px; padding-inline: 8px; }
.keycap {
  display: inline-grid; flex: none; place-items: center; min-width: 20px; min-height: 20px;
  padding: 1px 4px; border: 1px solid currentColor; border-radius: 5px;
  background: #ffffff38; color: inherit; font-family: inherit; font-size: 11px; font-weight: 650; line-height: 1.2;
}
.glyph { display: inline-grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 11px; }
.blue { color: #2856df; background: #eaf0ff; }
.purple { color: #6550d4; background: #f0edff; }
.green { color: #0e765f; background: #e7f6ef; }
.teal { color: #067587; background: #e6f6f9; }
.amber { color: #9b5a11; background: #fff3de; }
.red { color: #a13f46; background: #fff0f1; }
.quiet { color: #65759e; background: #f0f3fa; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 19px; }
.hero {
  position: relative; display: flex; align-items: center; isolation: isolate; overflow: hidden; min-height: 282px;
  border-radius: 19px; background: linear-gradient(117deg, #1e48d0 0%, #2858eb 62%, #5176f5 115%);
  color: #fff; box-shadow: 0 10px 23px #2c51d020;
}
.hero-content { position: relative; z-index: 1; flex: 0 0 54%; padding: 25px 0 25px 28px; }
.hero h2 { display: flex; gap: 9px; align-items: center; font-size: 15px; font-weight: 690; margin-bottom: 12px; }
.hero-glyph { width: 29px; height: 29px; border-radius: 8px; color: #fff; background: #ffffff23; }
.hero-count { display: flex; align-items: baseline; gap: 10px; margin-bottom: 11px; white-space: nowrap; }
.hero-count strong { font-size: clamp(43px, 4.9vw, 68px); font-weight: 720; letter-spacing: -.065em; line-height: .99; font-variant-numeric: tabular-nums; }
.hero-count span { color: #e1e9ff; font-size: 20px; font-weight: 600; }
.progress-track { overflow: hidden; height: 7px; border-radius: 20px; background: #e8eefb; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .32s var(--ease); }
.hero .progress-track { width: min(100%, 233px); height: 6px; background: #ffffff39; }
.hero .progress-track span { background: #fff; }
.hero-caption { font-size: 14px; color: #eff3ff; margin-top: 8px; margin-bottom: 18px; }

.hero-art { position: absolute; inset: 0 0 0 47%; pointer-events: none; }
.orbit { position: absolute; width: 245px; height: 245px; right: 2%; top: 50%; translate: 0 -50%; border: 1px solid #ffffff34; border-radius: 50%; }
.orbit-one { scale: 1.45; }
.orbit-two { scale: 1.12; border-color: #ffffff28; }
.art-card {
  position: absolute; display: grid; align-content: start; justify-items: center; width: 149px; height: 181px;
  top: 49%; left: 53%; translate: -50% -50%; border-radius: 16px;
}
.art-card-under {
  translate: -31% -44%; rotate: 18deg; border: 1px solid #bad0ff86;
  background: linear-gradient(135deg,#8aa5fc,#4974ed); box-shadow: 0 9px 16px #173a8c35; overflow: hidden;
}
.art-under-grid {
  position: absolute; inset: 0; background-image: radial-gradient(#e1ebffb3 1px, transparent 1px);
  background-size: 9px 9px; mask-image: linear-gradient(135deg,transparent,#000);
}
.art-card-front {
  rotate: -12deg; padding: 13px 12px 12px; background: linear-gradient(140deg,#fff,#eef2ff);
  color: #182f73; box-shadow: 0 12px 26px #122a7777; border: 1px solid #fff;
}
.art-card-meta { display: flex; justify-content: space-between; width: 100%; color: #5269a6; font-size: 9px; font-weight: 740; letter-spacing: .12em; }
.art-icon { display: grid; place-items: center; width: 67px; height: 67px; margin: 14px 0 7px; border: 1px solid #ccdafe; border-radius: 22px; color: #2a54de; background: #dfe9ff; }
.art-word { width: 100%; text-align: center; font-size: clamp(12px, 1.85vw, 24px); line-height: 1.12; letter-spacing: -.06em; overflow-wrap: anywhere; }
.art-rule { width: 43px; height: 3px; margin-top: 9px; border-radius: 10px; background: #b8caff; }
.art-glint { position: absolute; display: block; width: 12px; aspect-ratio: 1; background: #d7e4ff; clip-path: polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%); }
.glint-one { top: 19%; right: 12%; }
.glint-two { bottom: 21%; left: 10%; opacity: .64; scale: .65; }

.stats { min-width: 0; padding: 20px 19px 17px; }
.stats-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 1px 2px 14px; }
.stats-title h2, .section-heading h2 { font-size: 20px; font-weight: 740; letter-spacing: -.04em; }
.stats-title > span { color: var(--muted); font-size: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.stat-item { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; padding: 12px 10px 10px; min-height: 88px; border-radius: 11px; background: #f7f9fd; transition: background .18s; }
a.stat-item:hover { background: #edf2ff; }
.stat-item .glyph { width: 31px; height: 31px; border-radius: 8px; }
.stat-label { color: #576781; font-size: 13px; font-weight: 630; }
.stat-number { grid-column: 1/-1; font-size: 30px; line-height: 1; font-weight: 720; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-number small { padding-left: 6px; font-size: 12px; font-weight: 540; color: var(--muted); letter-spacing: 0; }

.dashboard-section { margin-top: 26px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.text-link { display: inline-flex; align-items: center; gap: 1px; color: #2450d0; font-size: 14px; font-weight: 650; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.mode-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.mode-tile, .group-tile {
  text-align: left; border: 1px solid var(--line); background: white;
  transition: transform .22s var(--ease), border-color .2s, box-shadow .2s;
}
.mode-tile:hover, .group-tile:hover { border-color: #b9cbfd; box-shadow: 0 6px 17px #293f8410; transform: translateY(-2px); }
.mode-tile:active, .group-tile:active { transform: translateY(0) scale(.988); }
.mode-tile { display: flex; align-items: center; gap: 11px; padding: 15px 13px; border-radius: 14px; min-height: 82px; }
.mode-tile strong, .mode-tile small { display: block; }
.mode-tile strong { font-size: 15px; margin-bottom: 4px; }
.mode-tile small { font-size: 12px; color: var(--muted); line-height: 1.42; }
.tile-next { color: #7b89a6; margin-left: auto; flex: 0 0 auto; }
.group-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 11px; }
.group-tile { display: flex; flex-direction: column; gap: 9px; min-height: 109px; padding: 12px; border-radius: 13px; }
.group-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.group-top .glyph { width: 31px; height: 31px; border-radius: 8px; }
.group-tile strong { font-size: 14px; line-height: 1.42; }
.group-range { display: flex; justify-content: space-between; gap: 4px; margin-top: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.review-layout { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); gap: 18px; }
.review-summary, .review-guide { padding: clamp(20px, 4vw, 35px); }
.review-summary > .glyph { width: 53px; height: 53px; margin-bottom: 17px; }
.review-summary h2 { font-size: 26px; }
.review-summary p, .review-guide p { color: var(--muted); line-height: 1.65; margin: 9px 0 19px; }
.review-guide h2 { font-size: 20px; margin-bottom: 10px; }
.review-guide dl { margin: 0; }
.review-guide dl div { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.review-guide dt { font-weight: 700; }
.review-guide dd { margin: 0; color: var(--muted); }
.review-guide p { font-size: 14px; margin-bottom: 0; }

.wordbook { padding: 17px 18px; scroll-margin-top: 12px; }
.wordbook-controls { display: grid; grid-template-columns: minmax(180px,1fr) minmax(150px,auto) 130px; gap: 10px; }
.search-field, .select-field { display: flex; align-items: center; gap: 8px; min-height: 46px; border: 1px solid #dfe5f0; border-radius: 10px; color: var(--muted); background: #f9faff; }
.search-field { padding: 0 12px; }
.search-field:focus-within, .select-field:focus-within { border-color: #7e9af7; box-shadow: 0 0 0 3px #e7eeff; }
.search-field input, .select-field select { width: 100%; height: 44px; background: transparent; border: 0; color: var(--ink); outline: 0; }
.search-field input::placeholder { color: #65728d; font-size: 14px; }
.select-field { position: relative; }
.select-field select { appearance: none; padding: 0 29px 0 11px; font-size: 14px; text-overflow: ellipsis; }
.select-field svg { position: absolute; right: 9px; pointer-events: none; }
.word-count { color: var(--muted); margin: 15px 0 8px; font-size: 13px; }
.word-list { list-style: none; padding: 0; margin: 0; }
.word-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid #edf0f6; }
.word-row-content {
  display: grid; align-items: center; grid-template-columns: 34px 34px minmax(100px, 1fr) minmax(105px,1.5fr) 56px;
  flex: 1; min-height: 64px; gap: 10px; padding: 8px 4px; border: 0; border-radius: 8px; background: transparent; text-align: left;
  transition: background .18s;
}
.word-row-content:hover { background: #f6f8ff; }
.word-row-content .glyph { width: 32px; height: 32px; border-radius: 8px; }
.word-id { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.word-info { min-width: 0; }
.word-info strong { display: block; overflow-wrap: anywhere; font-size: 17px; line-height: 1.3; }
.word-info > span { color: var(--muted); font-size: 12px; }
.word-meaning { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.word-frequency { color: #9a5c0f; font-size: 13px; letter-spacing: .025em; white-space: nowrap; }
.row-actions { display: flex; align-items: center; gap: 5px; }
.row-actions .icon-button { width: 35px; height: 35px; }
.mistake-count { display: block; color: var(--muted); font-size: 11px; letter-spacing: 0; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 15px; border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: 14px; }
.empty { display: grid; justify-items: center; padding: 34px 17px; text-align: center; }
.wordbook .empty { border: 0; }
.empty .glyph { width: 49px; height: 49px; margin-bottom: 14px; }
.empty h2 { font-size: 23px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 18px; line-height: 1.55; }

.session-layout { max-width: 695px; margin: 0 auto; }
.session-heading { margin-bottom: 17px; }
.session-top, .session-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.session-top { color: var(--muted); font-size: 13px; text-align: right; }
.session-title { margin: 14px 0 11px; }
.session-title h1 { font-size: clamp(26px,4.7vw,35px); letter-spacing: -.045em; }
.session-title > span { color: var(--blue-deep); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.flash-shell { padding: 15px; }
.flash-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 1px 12px; }
.flash-toolbar > div { display: flex; gap: 7px; }
.flash-meta { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 13px; padding-left: 4px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.flip-card { display: block; width: 100%; min-height: 291px; padding: 0; border: 0; background: transparent; border-radius: 13px; perspective: 1250px; }
.flip-inner { display: grid; min-height: inherit; transform-style: preserve-3d; transition: transform .46s var(--ease); }
.is-flipped .flip-inner { transform: rotateY(180deg); }
.face {
  grid-area: 1/1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-width: 0; min-height: inherit; padding: 22px 15px 16px; border: 1px solid #e4ebfe;
  border-radius: 13px; backface-visibility: hidden; background: #f5f8ff;
}
.face.reverse { transform: rotateY(180deg); background: #eef3ff; }
.memory-art {
  display: grid; place-items: center; width: 116px; height: 99px; border: 1px solid #abbff240;
  border-radius: 27px; margin-bottom: 4px; box-shadow: inset 0 0 0 6px #fff6;
}
.flash-word { color: #192f70; font-size: clamp(31px, 7vw, 57px); font-weight: 760; letter-spacing: -.06em; line-height: 1.05; overflow-wrap: anywhere; max-width: 100%; }
.part-of-speech { color: #5571a5; font-size: 15px; font-weight: 640; }
.flip-hint { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; color: #516791; font-size: 13px; }
.reverse-word { color: #3357ac; font-size: 22px; font-weight: 700; }
.flash-meaning { color: #1b3171; font-size: clamp(24px,5vw,39px); line-height: 1.42; max-width: 100%; overflow-wrap: anywhere; }
.rating-bar { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-top: 12px; }
.rating {
  display: flex; justify-content: center; align-items: center; gap: 7px;
  min-height: 47px; padding: 7px 4px; border-radius: 11px; border: 1px solid currentColor; font-size: 14px; font-weight: 700;
  transition: opacity .18s, transform .18s var(--ease), box-shadow .18s;
}
.rating:disabled { opacity: .52; }
.rating:enabled:hover { box-shadow: 0 4px 12px #283e7525; transform: translateY(-1px); }
.rating:enabled:active { transform: scale(.98); }
.session-tip { margin-top: 10px; text-align: center; color: var(--muted); font-size: 13px; }
.completion > .button { margin-bottom: 11px; }
.completion-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

.quiz-card { padding: clamp(15px, 3.9vw, 31px); }
.quiz-heading { text-align: center; margin-bottom: 19px; padding: 12px 8px 15px; background: #f5f8ff; border-radius: 13px; }
.quiz-heading h2 { color: #183575; font-size: clamp(24px,5vw,36px); letter-spacing: -.035em; overflow-wrap: anywhere; }
.quiz-heading .quiz-english { font-size: clamp(29px, 5.4vw, 48px); letter-spacing: -.055em; }
.quiz-label, .quiz-pos { font-size: 14px; color: #526789; margin: 4px 0 7px; }
.quiz-pos { margin: 5px 0 0; font-weight: 650; }
.options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.choice {
  display: flex; align-items: center; text-align: left; gap: 8px; min-height: 57px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .18s, background .18s, transform .18s var(--ease);
}
.choice:enabled:hover { background: #f3f7ff; border-color: #99b2fd; }
.choice:enabled:active { transform: scale(.981); }
.choice strong { flex: 1; min-width: 0; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.choice-index { flex: none; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; background: #edf2ff; color: #375ac7; font-size: 13px; font-weight: 750; }
.choice.right { color: #0b684f; border-color: #a9dbc9; background: #edf9f3; }
.choice.wrong { color: #9c3944; border-color: #efb6bc; background: #fff1f3; }
.spelling-form label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 7px; }
.spelling-form > div { display: flex; align-items: center; gap: 8px; }
.spelling-form input, .plan-input input { width: 100%; height: 46px; padding: 8px 11px; border: 1px solid #dfe6f6; border-radius: 9px; background: #fcfdff; color: var(--ink); }
.quiz-feedback { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; padding: 11px; border-radius: 11px; }
.quiz-feedback p { margin-top: 4px; color: var(--ink); overflow-wrap: anywhere; }
.quiz-feedback p span { font-weight: 700; }
.quiz-next { margin-top: 13px; text-align: right; }

#plan-dialog { width: min(425px, calc(100% - 27px)); padding: 20px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); box-shadow: 0 18px 65px #172c6840; }
#plan-dialog::backdrop { background: #202e5c66; }
#plan-dialog[open] { animation: enter .22s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.plan-heading { display: flex; align-items: center; justify-content: space-between; }
.plan-heading h2 { font-size: 23px; }
#plan-dialog p { color: var(--muted); margin: 9px 0 17px; font-size: 14px; line-height: 1.55; }
#plan-dialog label { display: block; font-size: 14px; font-weight: 700; }
.plan-input { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.plan-input span { white-space: nowrap; font-size: 14px; color: var(--muted); }
.presets { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-top: 9px; }
.button.preset { padding: 8px 4px; color: #3856a8; background: #f4f7ff; border: 1px solid #e3eaff; min-height: 37px; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 18px; }
.plan-transfer { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.plan-transfer h3 { margin: 0; font-size: 15px; }
#plan-dialog .plan-transfer p { margin: 5px 0 9px; }
#progress-transfer-status:empty, #progress-import-confirm:empty { display: none; }
.transfer-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.toast {
  position: fixed; z-index: 8; right: 22px; bottom: 22px; max-width: calc(100% - 32px); padding: 10px 14px;
  border-radius: 10px; color: white; background: #243560; pointer-events: none; opacity: 0; transform: translateY(9px);
  transition: opacity .2s, transform .22s var(--ease); font-size: 14px; box-shadow: 0 6px 23px #11214227;
}
.toast.visible { opacity: 1; transform: translateY(0); }

@media (min-width: 1700px) {
  #screen { margin-left: max(var(--sidebar), calc((100vw - 1430px + var(--sidebar)) / 2)); }
}
@media (max-width: 1120px) {
  :root { --sidebar: 184px; }
  .sidebar { padding-left: 13px; padding-right: 13px; }
  .group-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .art-card { scale: .87; }
  .stat-item { gap: 5px; }
  .stat-label { font-size: 12px; }
}
@media (max-width: 940px) {
  :root { --sidebar: 166px; }
  #screen { padding-inline: 21px; }
  .sidebar { padding-inline: 10px; }
  .dashboard-grid { gap: 11px; grid-template-columns: minmax(0,1.28fr) minmax(0,1fr); }
  .hero-content { padding-left: 16px; flex-basis: 59%; }
  .hero-art { left: 50%; }
  .art-card { scale: .73; }
  .mode-tile { padding: 10px; gap: 8px; }
  .mode-tile .glyph { width: 33px; height: 33px; }
  .tile-next { display: none; }
  .word-row-content { gap: 6px; }
}
@media (max-width: 730px) {
  .sidebar { position: static; width: auto; padding: 13px 17px; border: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0; gap: 8px; }
  .brand img { width: 34px; height: 34px; border-radius: 9px; }
  .brand strong { font-size: 18px; }
  .brand small { font-size: 8px; }
  .sidebar-note { display: none; }
  #navigation {
    position: fixed; z-index: 6; inset: auto 0 0; display: grid; grid-template-columns: repeat(7,minmax(0,1fr));
    padding: 5px max(6px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -5px 20px #2439750b; margin: 0;
  }
  .nav-set, .nav-set.second-set { display: contents; }
  .nav-set a { flex-direction: column; justify-content: center; gap: 4px; padding: 5px 1px; min-height: 48px; border-radius: 8px; font-size: 10px; white-space: nowrap; }
  .nav-set a svg { width: 18px; height: 18px; }
  #screen { margin: 0; padding: 19px 16px calc(79px + env(safe-area-inset-bottom)); min-height: calc(100svh - 61px); }
  .page-heading { margin-bottom: 17px; }
  .page-heading h1 { font-size: 30px; }
  .page-heading p { font-size: 13px; }
  .page-heading .button { padding-inline: 10px; font-size: 13px; }
  .toast { bottom: calc(69px + env(safe-area-inset-bottom)); right: 12px; }
  .group-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 565px) {
  .dashboard-grid, .review-layout { grid-template-columns: 1fr; }
  .hero { min-height: 224px; }
  .hero-content { padding: 17px 0 17px 16px; flex-basis: 55%; }
  .hero h2 { margin-bottom: 10px; }
  .hero-count { margin-bottom: 8px; }
  .hero-count strong { font-size: 51px; }
  .hero-count span { font-size: 17px; }
  .hero-caption { margin-bottom: 12px; font-size: 13px; }
  .hero-art { left: 45%; }
  .art-card { scale: .78; }
  .art-word { font-size: 20px; }
  .stats { padding: 13px 11px 10px; }
  .stats-title { padding: 0 2px 9px; }
  .stats-title h2, .section-heading h2 { font-size: 18px; }
  .stat-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
  .stat-item { min-height: 67px; grid-template-columns: minmax(0,1fr); padding: 7px 5px; gap: 4px; }
  .stat-item .glyph { display: none; }
  .stat-number { font-size: 25px; }
  .stat-number small { padding-left: 3px; font-size: 10px; }
  .dashboard-section { margin-top: 19px; }
  .mode-grid { grid-template-columns: 1fr; gap: 7px; }
  .mode-tile { min-height: 57px; padding: 8px 11px; }
  .mode-tile strong { margin-bottom: 2px; }
  .tile-next { display: block; }
  .group-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .group-tile { padding: 9px; min-height: 93px; }
  .group-tile strong { font-size: 13px; }
  .wordbook { padding: 11px 8px; }
  .wordbook-controls { grid-template-columns: minmax(0,1fr) minmax(0,.7fr); gap: 6px; padding-inline: 2px; }
  .search-field { grid-column: 1/-1; }
  .word-row { gap: 2px; }
  .word-row-content { grid-template-columns: 29px minmax(0,1fr) auto; gap: 3px 5px; }
  .word-row-content .glyph { display: none; }
  .word-info { grid-column: 2; }
  .word-frequency { grid-column: 3; grid-row: 1; }
  .word-meaning { grid-column: 2/4; grid-row: 2; }
  .row-actions { gap: 3px; }
  .row-actions .icon-button { width: 37px; height: 38px; }
  .flash-shell { padding: 9px; }
  .flip-card { min-height: 267px; }
  .options { grid-template-columns: 1fr; gap: 7px; }
  .choice { min-height: 49px; }
  .session-title { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media (hover: none) and (pointer: coarse) {
  .keycap { display: none; }
}
