/* Kyrie: design system and every screen.
   Apple-style: system type, generous space, soft surfaces, pill controls, one blue. */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --surface-3: #e8e8ed;
  --border: #e5e5ea;
  --border-strong: #d2d2d7;
  --text: #1d1d1f;
  --text-2: #424245;
  --muted: #6e6e73;
  --faint: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-ink: #0066cc;
  --accent-soft: #e8f1fc;
  --accent-soft-2: #cde2fa;
  --accent-ring: rgba(0, 113, 227, 0.25);
  --green: #1a7f37;
  --green-soft: #e8f5ec;
  --red: #d70015;
  --red-soft: #fdecee;
  --orange: #b25000;
  --orange-soft: #fdf1e3;
  --mastered: #0071e3;
  --learning: #8ec5ff;
  --new: #d2d2d7;
  --nav-bg: rgba(245, 245, 247, 0.8);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
  --radius: 18px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', Inter, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Inter, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --surface-3: #3a3a3c;
    --border: #2c2c2e;
    --border-strong: #48484a;
    --text: #f5f5f7;
    --text-2: #d2d2d7;
    --muted: #a1a1a6;
    --faint: #86868b;
    --accent: #2997ff;
    --accent-hover: #47a5ff;
    --accent-ink: #2997ff;
    --accent-soft: #0b2440;
    --accent-soft-2: #123a66;
    --accent-ring: rgba(41, 151, 255, 0.35);
    --green: #30d158;
    --green-soft: #0d2e17;
    --red: #ff453a;
    --red-soft: #3a1210;
    --orange: #ff9f0a;
    --orange-soft: #33230a;
    --mastered: #2997ff;
    --learning: #1f5d9e;
    --new: #48484a;
    --nav-bg: rgba(22, 22, 23, 0.8);
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --surface-3: #3a3a3c;
  --border: #2c2c2e;
  --border-strong: #48484a;
  --text: #f5f5f7;
  --text-2: #d2d2d7;
  --muted: #a1a1a6;
  --faint: #86868b;
  --accent: #2997ff;
  --accent-hover: #47a5ff;
  --accent-ink: #2997ff;
  --accent-soft: #0b2440;
  --accent-soft-2: #123a66;
  --accent-ring: rgba(41, 151, 255, 0.35);
  --green: #30d158;
  --green-soft: #0d2e17;
  --red: #ff453a;
  --red-soft: #3a1210;
  --orange: #ff9f0a;
  --orange-soft: #33230a;
  --mastered: #2997ff;
  --learning: #1f5d9e;
  --new: #48484a;
  --nav-bg: rgba(22, 22, 23, 0.8);
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.47 var(--font);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
h1 {
  font-size: 40px;
  font-weight: 700;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 17px;
  letter-spacing: -0.02em;
}
p {
  margin: 0;
}
a {
  color: var(--accent-ink);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button {
  cursor: pointer;
}
code {
  font: 13px var(--mono);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0;
}
kbd {
  font: 500 11px/1 var(--mono);
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  display: inline-block;
  letter-spacing: 0;
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}
.ic {
  flex: none;
  display: block;
}
::selection {
  background: var(--accent-soft-2);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- helpers ---------- */
.row {
  display: flex;
  align-items: center;
}
.gap {
  gap: 10px;
}
.gap-sm {
  gap: 4px;
}
.wrap {
  flex-wrap: wrap;
}
.center {
  justify-content: center;
}
.grow {
  flex: 1;
  min-width: 0;
}
.w100 {
  width: 100%;
}
.mr-auto {
  margin-right: auto;
}
.mb {
  margin-bottom: 14px;
}
.mt {
  margin-top: 20px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 14px;
  letter-spacing: -0.016em;
}
em.muted {
  font-style: normal;
  font-weight: 400;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}

/* ---------- top navigation (frosted, like apple.com) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
body.scrolled .nav,
body.menu-open .nav {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
[data-theme='dark'] body.scrolled .nav {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.nav-in {
  max-width: 1120px;
  margin: 0 auto;
  height: 52px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand:hover {
  text-decoration: none;
}
.logo-stem {
  stroke: var(--accent);
}
.nav-links {
  display: flex;
  gap: 4px;
  margin: 0 auto;
}
.nav-links a {
  padding: 6px 13px;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--text-2);
  border-radius: 980px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}
.nav-links a.on {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}
[data-theme='dark'] .nav-links a.on {
  background: rgba(255, 255, 255, 0.1);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-2);
  background: none;
  border: 0;
}
.nav-icon:hover,
.nav-icon.on {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}
.nav-burger {
  display: none;
  position: relative;
}
.nav-burger span {
  position: absolute;
  left: 9px;
  width: 15px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.3s var(--ease);
}
.nav-burger span:first-child {
  top: 12px;
}
.nav-burger span:last-child {
  top: 18px;
}
body.menu-open .nav-burger span:first-child {
  transform: translateY(3px) rotate(45deg);
}
body.menu-open .nav-burger span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}
.nav-sheet {
  display: none;
}

/* ---------- page frame ---------- */
.view {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 22px 96px;
}
.view.enter {
  animation: enter 0.45s var(--ease) both;
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.view-intro {
  max-width: none;
  padding: 0;
}
.page-head {
  margin-bottom: 32px;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.crumbs a {
  color: var(--muted);
}
.crumbs a:hover {
  color: var(--accent-ink);
}
.crumbs span {
  color: var(--text-2);
}
.crumbs .ic {
  opacity: 0.5;
}
.page-head-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 40px;
}
.page-sub {
  color: var(--muted);
  margin-top: 8px;
  font-size: 17px;
}
.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.group-title {
  font-size: 21px;
  font-weight: 600;
  color: var(--text);
  margin: 36px 0 14px;
}

/* ---------- panels & tables ---------- */
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: hidden;
}
.panel.sticky,
.review-bar {
  overflow: visible;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 24px 6px;
}
.panel-head h2 {
  font-size: 19px;
}
.panel-head a {
  font-size: 14px;
}
.panel-body {
  padding: 18px 24px 24px;
}
.rows {
  display: flex;
  flex-direction: column;
  padding: 6px 0 10px;
}
.row-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  position: relative;
}
.row-item + .row-item::before,
.feed-item + .feed-item::before,
.best + .best::before,
.hard + .hard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  border-top: 1px solid var(--border);
}
.row-title {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.016em;
}
a.row-title:hover {
  color: var(--accent-ink);
  text-decoration: none;
}
.row-sub {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.row-num {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.row-item .bar {
  margin-top: 9px;
}
.table {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel .table {
  box-shadow: none;
  border-radius: 0;
}
.tr {
  display: grid;
  align-items: center;
  gap: 16px;
  padding: 13px 22px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.016em;
}
.th + div > .tr:first-child,
.tr:first-child {
  border-top: 0;
}
a.tr:hover,
.card-table .tr:not(.th):hover {
  background: var(--surface-2);
  text-decoration: none;
}
.th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
  padding-top: 14px;
  padding-bottom: 10px;
}
.card-table .tr {
  grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1.4fr) 84px 118px 34px;
}
.deck-table .tr {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 60px minmax(0, 1.2fr) 60px 110px;
}
.help-table .tr {
  grid-template-columns: 190px minmax(0, 1fr);
}
.help-table.keys .tr {
  grid-template-columns: 130px 190px minmax(0, 1fr);
}
.td-front {
  font-weight: 600;
}
.td-back {
  color: var(--text-2);
}
.td-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.td-bar .bar {
  flex: 1;
}
.td-bar span {
  font-size: 13px;
  color: var(--muted);
  width: 36px;
  text-align: right;
}
.status {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-2);
}

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 18px;
  border-radius: 980px;
  border: 0;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.016em;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  user-select: none;
  text-decoration: none !important;
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn-primary kbd {
  background: rgba(255, 255, 255, 0.18);
  border-color: transparent;
  color: #fff;
}
.btn-ghost {
  background: var(--surface-3);
  color: var(--text);
}
.panel .btn-ghost,
.modal .btn-ghost,
.done-card .btn-ghost,
.ov-center .btn-ghost,
.review-bar .btn-ghost,
.score-card .btn-ghost {
  background: var(--surface-2);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--border-strong);
}
.btn-text {
  background: none;
  color: var(--accent-ink);
  padding: 0 12px;
}
.btn-text:hover {
  text-decoration: underline !important;
}
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn.danger,
.menu .danger {
  color: var(--red);
}
.btn-xs {
  height: 28px;
  padding: 0 14px;
  font-size: 13px;
  letter-spacing: -0.01em;
}
.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 14px;
}
.btn-lg {
  height: 48px;
  padding: 0 26px;
  font-size: 17px;
}
.btn-pill {
  height: 50px;
  padding: 0 30px;
  font-size: 17px;
}
.btn-pill-sm {
  height: 40px;
  padding: 0 22px;
  font-size: 15px;
}
.btn-icon {
  width: 38px;
  padding: 0;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none !important;
  transition: background 0.2s, color 0.2s;
}
.icon-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}
.icon-btn.on {
  background: var(--accent-soft);
  color: var(--accent);
}
.icon-btn.sm {
  width: 28px;
  height: 28px;
}
.icon-btn.lg {
  width: 48px;
  height: 48px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.icon-btn.starred {
  color: #ff9f0a;
}
.icon-btn.starred svg {
  fill: #ff9f0a;
}
.link {
  color: var(--accent-ink);
}
.link-btn {
  background: none;
  border: 0;
  padding: 6px 0;
  font-size: 14px;
  color: var(--accent-ink);
}
.link-btn:hover {
  text-decoration: underline;
}
.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  outline: none;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.input::placeholder {
  color: var(--faint);
}
.input-lg {
  height: 54px;
  font-size: 18px;
  padding: 0 18px;
}
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.select-sm {
  width: auto;
  height: 36px;
  font-size: 14px;
  border-radius: 980px;
  padding-left: 16px;
}
.textarea {
  height: 200px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}
.textarea.sm {
  height: 90px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.field > span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.016em;
}
.input-row {
  display: flex;
  gap: 8px;
}
.seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--surface-3);
  border-radius: 10px;
}
.panel .seg {
  background: var(--surface-2);
}
.seg-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 0.2s, box-shadow 0.2s;
}
.seg-btn.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
[data-theme='dark'] .seg-btn.on {
  background: var(--border-strong);
}
.seg-sm .seg-btn {
  height: 28px;
  font-size: 13px;
  padding: 0 12px;
}
.switch {
  appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 20px;
  background: var(--surface-3);
  position: relative;
  cursor: pointer;
  transition: background 0.25s;
  flex: none;
  margin: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s var(--ease);
}
.switch:checked {
  background: #34c759;
}
.switch:checked::after {
  transform: translateX(18px);
}
.switch.sm {
  width: 36px;
  height: 22px;
}
.switch.sm::after {
  width: 18px;
  height: 18px;
}
.switch.sm:checked::after {
  transform: translateX(14px);
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.toggle-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
}
.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.chip-due {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.chip-ok {
  color: var(--green);
  background: var(--green-soft);
}
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 980px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  vertical-align: middle;
  letter-spacing: 0;
}
.pill-hot {
  background: var(--accent);
  color: #fff;
}
.note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text-2);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: -4px 0 18px;
}
.note .ic {
  margin-top: 2px;
  color: var(--accent);
}
.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex: none;
}
.spinner.sm {
  width: 11px;
  height: 11px;
  border-width: 1.6px;
  vertical-align: -1px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.blank {
  display: inline-block;
  width: 3.6em;
  height: 0.95em;
  border-bottom: 2px solid var(--accent);
  margin: 0 3px;
  vertical-align: baseline;
}
.blank.sm {
  width: 2.4em;
}
.ring-bg {
  fill: none;
  stroke: var(--surface-3);
}
.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s var(--ease);
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  flex: none;
}
.dot.m {
  background: var(--mastered);
}
.dot.l {
  background: var(--learning);
}
.dot.n {
  background: var(--new);
}
.bar,
.lp-bar {
  display: flex;
  height: 6px;
  border-radius: 6px;
  background: var(--surface-3);
  overflow: hidden;
}
.panel .bar,
.kpi .bar,
.deck-card .bar {
  background: var(--surface-2);
}
.bar.thin {
  height: 4px;
}
.bar i,
.lp-bar i {
  display: block;
  height: 100%;
  transition: width 0.6s var(--ease);
}
i.m {
  background: var(--mastered);
}
i.l {
  background: var(--learning);
}

/* ---------- KPIs: separate tiles ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi {
  padding: 20px 22px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.kpi-l {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.kpi-n {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.kpi-of {
  font-size: 17px;
  color: var(--faint);
  font-weight: 500;
}
.kpi .bar {
  margin-top: 12px;
}

/* ---------- home ---------- */
.empty-small {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 34px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.empty-small .ic {
  color: var(--green);
}
.feed {
  display: flex;
  flex-direction: column;
  padding: 6px 0 10px;
}
.feed-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  color: var(--text);
  position: relative;
}
.feed-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.feed-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.feed-title {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-sub {
  font-size: 13px;
  color: var(--muted);
}
.feed-time {
  font-size: 13px;
  color: var(--faint);
  white-space: nowrap;
}
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  height: 160px;
}
.week-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.week-n {
  font-size: 12px;
  color: var(--muted);
  height: 16px;
  font-variant-numeric: tabular-nums;
}
.week-bar {
  flex: 1;
  width: 100%;
  max-width: 30px;
  background: var(--surface-2);
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.week-bar i {
  display: block;
  width: 100%;
  background: var(--learning);
  border-radius: 8px;
}
.week-col.today .week-bar i {
  background: var(--accent);
}
.week-l {
  font-size: 12px;
  color: var(--muted);
}
.week-col.today .week-l {
  color: var(--text);
  font-weight: 600;
}

/* first run: no decks yet */
.first {
  max-width: 760px;
  margin: 24px auto 0;
  text-align: center;
}
.first-title {
  font-size: clamp(40px, 6vw, 56px);
  letter-spacing: -0.035em;
}
.first-sub {
  font-size: 21px;
  color: var(--muted);
  margin: 14px auto 36px;
  max-width: 34em;
  letter-spacing: -0.02em;
}
.first .dropzone {
  min-height: 280px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.first-alt {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  font-size: 15px;
}
.first-alt .link-btn {
  font-size: 15px;
}
.sep {
  width: 1px;
  height: 14px;
  background: var(--border-strong);
}
.first-formats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 14px;
}
.first-formats span {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ---------- dropzone ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  border: 2px dashed var(--border-strong);
  border-radius: 22px;
  background: var(--surface-2);
  padding: 36px 24px;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.dropzone:hover,
.dropzone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone.over {
  transform: scale(1.01);
}
.dz-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
}
.dz-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.dz-sub {
  color: var(--muted);
  font-size: 15px;
  margin-top: 4px;
}
.dz-compact {
  flex-direction: row;
  text-align: left;
  padding: 16px 18px;
  gap: 16px;
  border-radius: 16px;
}
.dz-compact .dz-icon {
  width: 42px;
  height: 42px;
}
.dz-compact .dz-title {
  font-size: 16px;
}
.dz-compact .dz-sub {
  font-size: 14px;
}

/* ---------- library ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.search {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 360px;
}
.search .ic {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
}
.search .input {
  padding-left: 38px;
  height: 36px;
  font-size: 14px;
  border-radius: 980px;
  border-color: transparent;
  background: var(--surface-3);
}
.panel .search .input {
  background: var(--surface-2);
}
.search .input:focus {
  background: var(--surface);
  border-color: var(--accent);
}
.view-toggle {
  margin-left: auto;
}
.view-toggle .seg-btn {
  padding: 0 10px;
}
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.deck-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  min-height: 176px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.deck-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.deck-card-top {
  display: flex;
  justify-content: space-between;
  min-height: 24px;
  margin-bottom: 8px;
}
.deck-card h3 {
  font-size: 19px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deck-meta {
  font-size: 14px;
  color: var(--muted);
}
.deck-foot {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.deck-pct {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.empty {
  text-align: center;
  padding: 64px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.empty h2 {
  font-size: 28px;
}
.empty-ic {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 6px;
}
.empty .btn {
  margin-top: 8px;
}

/* ---------- progress ---------- */
.heat-wrap {
  overflow-x: auto;
}
.heat {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 13px);
  gap: 4px;
  width: max-content;
}
.heat i,
.heat-legend i {
  display: block;
  border-radius: 4px;
  background: var(--surface-2);
}
.heat-legend i {
  width: 12px;
  height: 12px;
}
.heat .h1,
.heat-legend .h1 {
  background: #cfe3fb;
}
.heat .h2,
.heat-legend .h2 {
  background: #8ec5ff;
}
.heat .h3,
.heat-legend .h3 {
  background: #3e95f0;
}
.heat .h4,
.heat-legend .h4 {
  background: #0058b0;
}
.heat-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.heat-legend span {
  margin: 0 4px;
}
.best-list,
.hard-list {
  display: flex;
  flex-direction: column;
  padding: 6px 0 10px;
}
.best,
.hard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-size: 15px;
  position: relative;
}
.best strong {
  font-variant-numeric: tabular-nums;
}

/* ---------- settings & help ---------- */
.settings-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 720px;
}
.settings-page .field:last-child {
  margin-bottom: 0;
}
.help {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 880px;
}
.help-start {
  background: var(--accent-soft);
  box-shadow: none;
}
.help-start .panel-body {
  padding: 22px 24px;
}
.help-start h2 {
  margin-bottom: 4px;
}
.help-start .btn-ghost {
  background: var(--surface);
}
.faq {
  padding-bottom: 8px;
}
.faq details {
  margin: 0 24px;
  border-top: 1px solid var(--border);
}
.faq details:first-of-type {
  border-top: 0;
}
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary .ic {
  color: var(--faint);
  transition: transform 0.3s var(--ease);
}
.faq details[open] summary .ic {
  transform: rotate(90deg);
}
.faq details p {
  padding: 0 0 18px;
  color: var(--text-2);
  font-size: 15px;
}

/* ---------- create ---------- */
.create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}
.create-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.sticky {
  position: sticky;
  top: 72px;
}
.sources {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.sources:empty {
  display: none;
}
.source {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
}
.source-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--accent);
}
.source.error .source-ic {
  color: var(--red);
}
.source.error .source-sub {
  color: var(--red);
}
.source-ok {
  color: var(--green);
}
.source-main {
  flex: 1;
  min-width: 0;
}
.source-name {
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.source-sub {
  font-size: 13px;
  color: var(--muted);
}
.tip-list {
  margin: 0;
  padding: 14px 24px 22px 42px;
  color: var(--text-2);
  font-size: 15px;
}
.tip-list li {
  padding: 4px 0;
}
.engine {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.engine-opt {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
}
.engine-opt:hover {
  border-color: var(--border-strong);
}
.engine-opt.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  flex: none;
  margin-top: 1px;
  transition: border 0.2s;
}
.engine-opt.on .radio {
  border: 6px solid var(--accent);
}
.engine-top {
  font-weight: 600;
  font-size: 15px;
}
.engine-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
}
.progress-note {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 12px;
  min-height: 1.4em;
}
.review {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.review-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 24px;
  flex-wrap: wrap;
  position: sticky;
  top: 64px;
  z-index: 5;
  box-shadow: var(--shadow);
}
.review-bar h2 {
  margin-bottom: 4px;
}
.review-fields {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}
.review-fields .field {
  margin: 0;
}
.edit-table {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.edit-head,
.edit-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1.3fr) 84px 34px;
  gap: 12px;
  align-items: start;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}
.edit-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-top: 0;
  padding-top: 14px;
}
.edit-n {
  padding-top: 10px;
  font-size: 13px;
  color: var(--faint);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.edit-row .chip {
  margin-top: 8px;
}
.edit-row .icon-btn {
  margin-top: 3px;
}
.edit-row .input {
  height: auto;
  min-height: 40px;
  padding: 9px 12px;
  resize: none;
  overflow: hidden;
  line-height: 1.4;
  font-size: 15px;
  border-color: transparent;
  background: var(--surface-2);
}
.edit-row .input:focus {
  background: var(--surface);
  border-color: var(--accent);
}
.edit-row [data-f='front'] {
  font-weight: 500;
}

/* ---------- deck page ---------- */
.menu-wrap {
  position: relative;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 260px;
  padding: 6px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  animation: pop 0.18s var(--ease);
}
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: none;
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
}
.menu button:hover {
  background: var(--accent);
  color: #fff;
}
.menu button:hover .ic {
  color: #fff;
}
.menu button .ic {
  color: var(--muted);
}
.menu .danger .ic {
  color: var(--red);
}
.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-3);
  border-radius: 980px;
  margin: 10px 0 26px;
}
.tab {
  padding: 7px 18px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  border-radius: 980px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}
.tab:hover {
  color: var(--text);
  text-decoration: none;
}
.tab.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.tab-n {
  font-size: 12px;
  color: var(--muted);
}
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.mode-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  position: relative;
  min-height: 176px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.mode-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.mode-tile h3 {
  font-size: 19px;
}
.mode-tile p {
  font-size: 15px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}
.mode-ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--accent-soft);
  color: var(--accent);
}
.mode-ic.sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.mode-chev {
  position: absolute;
  right: 20px;
  top: 26px;
  color: var(--border-strong);
  transition: transform 0.3s var(--ease), color 0.3s;
}
.mode-tile:hover .mode-chev {
  color: var(--accent);
  transform: translateX(3px);
}

/* ---------- study modes ---------- */
.mode-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: -12px 0 26px;
}
.mode-head > a {
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
}
.mode-head > a span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.mode-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
}
.mode-title .ic {
  color: var(--accent);
}
.mode-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 4px;
}
.prog {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}
.prog-bar {
  flex: 1;
  height: 4px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}
.prog-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s var(--ease);
}
.flash-wrap,
.learn-wrap,
.blitz-wrap {
  max-width: 760px;
  margin: 0 auto;
}
.match-wrap {
  max-width: 920px;
  margin: 0 auto;
}
.flash-stage {
  perspective: 1800px;
}
.flip {
  height: clamp(320px, 48vh, 430px);
  cursor: pointer;
  outline: none;
  transition: transform 0.22s var(--ease), opacity 0.22s;
}
.flip.out-right {
  transform: translateX(40px);
  opacity: 0;
}
.flip.out-left {
  transform: translateX(-40px);
  opacity: 0;
}
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease);
}
.flip.flipped .flip-inner {
  transform: rotateY(180deg);
}
.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 22px 30px 24px;
  display: flex;
  flex-direction: column;
}
.face.back {
  transform: rotateY(180deg);
}
.flip:focus-visible .face {
  box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-lg);
}
.face-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.face-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
  overflow-y: auto;
  padding: 8px 0;
}
.face.back .face-text {
  font-weight: 500;
}
.face-text.long {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 500;
  line-height: 1.4;
}
.face-hint {
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}
.face-tap {
  text-align: center;
  font-size: 13px;
  color: var(--faint);
}
.q-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--accent-ink);
}
.flash-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  min-height: 64px;
}
.flip-btn {
  min-width: 220px;
}
.rate {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}
.rate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 6px;
  border-radius: 16px;
  border: 0;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.15s, background 0.2s;
}
.rate-btn:hover {
  transform: translateY(-1px);
}
.rate-btn:active {
  transform: scale(0.98);
}
.rate-btn kbd {
  position: absolute;
  top: 8px;
  left: 9px;
  font-size: 10px;
  padding: 2px 5px;
}
.rate-btn strong {
  font-size: 16px;
  font-weight: 600;
}
.rate-btn span {
  font-size: 12px;
  color: var(--muted);
}
.rate-btn.again strong {
  color: var(--red);
}
.rate-btn.hard strong {
  color: var(--orange);
}
.rate-btn.good strong {
  color: var(--green);
}
.rate-btn.easy strong {
  color: var(--accent);
}
.kbd-hint {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--faint);
}
.kbd-hint kbd {
  margin: 0 1px;
}
.done-card {
  max-width: 520px;
  margin: 24px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 44px 32px;
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow);
  animation: pop 0.4s var(--ease);
}
.done-card > .ic {
  color: var(--accent);
}
.done-ic {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 4px;
}
.done-card h2 {
  font-size: 28px;
  letter-spacing: -0.03em;
}
.done-card p {
  font-size: 15px;
}
.done-card .row {
  margin-top: 10px;
}
.tally {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.tally span {
  font-size: 13px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 980px;
  background: var(--surface-2);
}
.tally .again {
  color: var(--red);
}
.tally .hard {
  color: var(--orange);
}
.tally .good {
  color: var(--green);
}
.tally .easy {
  color: var(--accent);
}

/* question card */
.learn-prog {
  margin-bottom: 20px;
}
.learn-prog .lp-bar {
  height: 6px;
  margin: 0 0 12px;
}
.lp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 13px;
  color: var(--text-2);
}
.lp-legend span {
  display: flex;
  align-items: center;
}
.q {
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  padding: 24px 30px 28px;
  animation: pop 0.35s var(--ease);
}
.q-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 34px;
}
.q-prompt {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.025em;
  margin: 8px 0 22px;
}
.q-prompt.q-long {
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 500;
  line-height: 1.42;
}
.q-shown {
  background: var(--surface-2);
  border-radius: 16px;
  padding: 14px 18px;
  margin: -6px 0 20px;
  font-size: 17px;
}
.q-shown .q-label {
  display: block;
  margin-bottom: 4px;
}
.q-ask {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 14px 16px;
  min-height: 58px;
  border-radius: 16px;
  border: 1.5px solid transparent;
  background: var(--surface-2);
  font-size: 16px;
  line-height: 1.35;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
}
.choice:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.choice:active:not(:disabled) {
  transform: scale(0.99);
}
.choice kbd {
  flex: none;
  background: var(--surface);
}
.choice:disabled {
  cursor: default;
  opacity: 0.55;
}
.choice.right {
  opacity: 1;
  border-color: var(--green);
  background: var(--green-soft);
}
.choice.right kbd {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.choice.wrong {
  opacity: 1;
  border-color: var(--red);
  background: var(--red-soft);
  animation: shake 0.3s;
}
.choice.wrong kbd {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.choices.two .choice {
  justify-content: center;
  font-weight: 500;
}
.written {
  display: flex;
  gap: 10px;
}
.written .btn {
  height: 54px;
}
.input.right {
  border-color: var(--green);
  background: var(--green-soft);
}
.input.wrong {
  border-color: var(--red);
  background: var(--red-soft);
}
.q-feedback:empty {
  display: none;
}
.fb {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  margin-top: 18px;
  animation: pop 0.25s var(--ease);
}
.fb > .ic {
  margin-top: 2px;
}
.fb strong {
  font-size: 16px;
  font-weight: 600;
}
.fb-ok {
  background: var(--green-soft);
  color: var(--green);
}
.fb-bad {
  background: var(--red-soft);
  color: var(--red);
}
.fb > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  flex: 1;
}
.fb-ok > div > strong {
  color: var(--green);
}
.fb-bad > div > strong {
  color: var(--red);
}
.fb-answer {
  font-size: 16px;
  font-weight: 500;
}
.fb-answer span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.fb-explain {
  font-size: 14px;
  color: var(--text-2);
}
.fb .link-btn {
  align-self: flex-start;
  padding: 0;
}
.fb-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

/* practice test */
.test-wrap {
  max-width: 820px;
  margin: 0 auto;
}
.test-setup {
  max-width: 520px;
  margin: 12px auto;
  background: var(--surface);
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.test-setup h2 {
  margin-bottom: 24px;
  font-size: 28px;
}
.range {
  width: 100%;
  accent-color: var(--accent);
}
.checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
  font-size: 16px;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.check.disabled {
  opacity: 0.5;
}
.test-paper {
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow-sm);
  padding: 36px clamp(20px, 5vw, 52px);
  margin-bottom: 110px;
}
.test-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 6px;
  gap: 12px;
}
.test-title h2 {
  font-size: 28px;
}
.test-section {
  margin: 30px 0 6px;
  font-size: 14px;
  color: var(--accent-ink);
}
.t-q {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.t-q:last-child {
  border-bottom: 0;
}
.t-num {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-2);
}
.t-q.ok .t-num {
  background: var(--green);
  color: #fff;
}
.t-q.bad .t-num {
  background: var(--red);
  color: #fff;
}
.t-main {
  flex: 1;
  min-width: 0;
}
.t-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.t-prompt {
  font-size: 18px;
  font-weight: 500;
  margin: 4px 0 14px;
  letter-spacing: -0.02em;
}
.t-shown {
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: 12px;
  margin-bottom: 12px;
}
.t-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.t-choices.two {
  flex-direction: row;
}
.t-choices.two .t-choice {
  flex: 1;
}
.t-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1.5px solid transparent;
  background: var(--surface-2);
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  transition: border-color 0.2s, background 0.2s;
}
.t-choice:hover {
  border-color: var(--border-strong);
}
.t-choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.t-choice input {
  accent-color: var(--accent);
  margin: 0;
}
.t-letter {
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  width: 14px;
}
.t-choice.right {
  border-color: var(--green);
  background: var(--green-soft);
}
.t-q.bad .t-choice:has(input:checked):not(.right) {
  border-color: var(--red);
  background: var(--red-soft);
}
.t-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  font-size: 15px;
}
.t-result:empty {
  display: none;
}
.t-ok,
.t-bad {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.t-ok {
  color: var(--green);
}
.t-bad {
  color: var(--red);
}
.t-correct {
  font-weight: 500;
}
.t-explain {
  color: var(--muted);
  font-size: 14px;
}
.test-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 8px 8px 22px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 980px;
  box-shadow: var(--shadow-lg), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  font-weight: 500;
  font-size: 15px;
  z-index: 10;
  white-space: nowrap;
}
.score-card {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  background: var(--surface);
  border-radius: 28px;
  padding: 30px;
  box-shadow: var(--shadow);
  animation: pop 0.4s var(--ease);
}
.score-ring {
  position: relative;
  flex: none;
}
.score-ring > div {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-ring strong {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}
.score-ring span {
  font-size: 12px;
  color: var(--muted);
}
.score-letter {
  font-size: 13px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 10px;
}
.grade-A .score-letter,
.grade-B .score-letter {
  background: var(--green-soft);
  color: var(--green);
}
.grade-D .score-letter,
.grade-F .score-letter {
  background: var(--red-soft);
  color: var(--red);
}
.score-card h2 {
  font-size: 24px;
}
.score-card p {
  margin: 8px 0 16px;
  font-size: 15px;
}

/* match */
.match-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  padding: 6px 14px;
  border-radius: 980px;
  box-shadow: var(--shadow-sm);
}
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px;
}
.match-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
.tile {
  min-height: 124px;
  padding: 14px;
  border-radius: 20px;
  border: 2px solid transparent;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  line-height: 1.35;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, opacity 0.3s, transform 0.3s var(--ease);
}
.tile span {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile.f {
  font-weight: 600;
}
.tile:hover {
  transform: translateY(-2px);
}
.tile.sel {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.tile.match-ok {
  border-color: var(--green);
  background: var(--green-soft);
}
.tile.match-bad {
  border-color: var(--red);
  background: var(--red-soft);
  animation: shake 0.3s;
}
.tile.gone {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

/* comet run */
.game-wrap {
  max-width: 980px;
  margin: 0 auto;
}
.game {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: calc(100vh - 220px);
  min-height: 380px;
  border-radius: 28px;
  overflow: hidden;
  background: #08122b;
  box-shadow: var(--shadow-lg);
  touch-action: none;
  user-select: none;
}
.game canvas {
  display: block;
  cursor: none;
}
.hud {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  color: #fff;
  pointer-events: none;
}
.hud-score {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.hud-score span {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.hud-score small {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 4px;
  letter-spacing: 0;
}
.hud-mid {
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: 980px;
  letter-spacing: 0;
}
.hud-hearts {
  display: flex;
  gap: 4px;
}
.hud-hearts span {
  color: rgba(255, 255, 255, 0.25);
}
.hud-hearts span.on {
  color: #ff453a;
}
.hud-hearts span.on svg {
  fill: #ff453a;
}
.game-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 10, 28, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
}
.game-overlay.show {
  display: flex;
}
.game-overlay.clear {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}
.ov-panel {
  width: 100%;
  max-width: 600px;
  margin: auto;
}
.ov-panel .q {
  padding: 18px 22px 20px;
}
.ov-panel .q-prompt {
  margin-bottom: 14px;
}
.ov-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #fff;
  margin-bottom: 12px;
  font-size: 15px;
}
.ov-head strong {
  font-size: 17px;
}
.ov-head span {
  opacity: 0.8;
}
.ov-panel.crash .ov-head .ic {
  color: #ff9f0a;
}
.ov-panel.bonus .ov-head .ic {
  color: #64d2ff;
}
.ov-center {
  max-width: 460px;
  text-align: center;
  background: var(--surface);
  color: var(--text);
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.ov-center p {
  font-size: 15px;
}
.ov-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ov-title .ic {
  color: var(--accent);
}
.ov-title h2 {
  font-size: 28px;
  letter-spacing: -0.03em;
}
.ov-count {
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 700;
  color: #fff;
  animation: countpop 0.45s var(--ease);
}
.ov-missed {
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ov-miss {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.ov-missed .q-label + .ov-miss {
  border-top: 0;
  padding-top: 0;
}
.ov-miss span {
  color: var(--muted);
}
.dot-star,
.dot-orb {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin: 0 1px;
}
.dot-star {
  background: #fcd34d;
}
.dot-orb {
  background: #3b82f6;
}

/* lightning */
.blitz {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.blitz-top {
  display: flex;
  align-items: center;
  gap: 20px;
}
.blitz-time {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}
.bt-bar {
  flex: 1;
  height: 6px;
  border-radius: 6px;
  background: var(--surface-3);
  overflow: hidden;
}
.bt-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.1s linear;
}
.blitz-time.low {
  color: var(--red);
}
.blitz-time.low .bt-bar i {
  background: var(--red);
}
.blitz-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}
.blitz-score small {
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 980px;
}
.blitz-card {
  min-height: 300px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  text-align: center;
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  border: 2px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.bc-prompt {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.8vw, 26px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.025em;
}
.bc-sep {
  display: flex;
  justify-content: center;
  color: var(--faint);
  transform: rotate(90deg);
}
.bc-shown {
  font-size: clamp(17px, 2.1vw, 20px);
  color: var(--text-2);
}
.bc-correct {
  margin-top: 8px;
  font-weight: 500;
  color: var(--red);
}
.blitz-card.flash-ok {
  background: var(--green-soft);
  border-color: var(--green);
}
.blitz-card.flash-bad {
  background: var(--red-soft);
  border-color: var(--red);
}
.blitz-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.blitz-btn {
  height: 68px;
  border-radius: 980px;
  border: 0;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.1s, background 0.2s;
}
.blitz-btn:active {
  transform: scale(0.98);
}
.blitz-btn.no {
  color: var(--red);
}
.blitz-btn.yes {
  color: var(--green);
}
.blitz-btn.no:hover {
  background: var(--red-soft);
}
.blitz-btn.yes:hover {
  background: var(--green-soft);
}

/* ================= INTRO ================= */
.i-hero {
  text-align: center;
  padding: 72px 22px 0;
  overflow: hidden;
}
.i-eyebrow {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.i-title {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin: 10px 0 0;
}
.i-title span {
  color: var(--faint);
}
.i-sub {
  font-size: clamp(19px, 2.2vw, 24px);
  color: var(--muted);
  max-width: 30em;
  margin: 22px auto 0;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
.i-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  margin-top: 34px;
  flex-wrap: wrap;
}
.i-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 19px;
}
.i-more .ic {
  transition: transform 0.3s var(--ease);
}
.i-more:hover .ic {
  transform: translateX(3px);
}

/* hero mockup */
.hero-stage {
  position: relative;
  max-width: 880px;
  margin: 64px auto 0;
  padding: 0 0 80px;
}
.device {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: 26px;
  box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.25), 0 30px 60px -30px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  text-align: left;
}
.device-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.dots {
  display: flex;
  gap: 7px;
}
.dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}
.dots i:nth-child(2) {
  background: #febc2e;
}
.dots i:nth-child(3) {
  background: #28c840;
}
.device-title {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.device-body {
  padding: 34px clamp(20px, 6vw, 70px) 38px;
  background: var(--bg);
}
.mini-top {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 22px;
}
.mini-prog {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.mini-prog i {
  display: block;
  width: 38%;
  height: 100%;
  background: var(--accent);
}
.mini-card,
.t-card {
  perspective: 1400px;
  height: clamp(190px, 30vw, 260px);
}
.mini-flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s var(--ease);
}
.mini-flip.flipped {
  transform: rotateY(180deg);
}
.mini-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  text-align: center;
}
.mini-face.back {
  transform: rotateY(180deg);
}
.mini-face div {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.mini-face.back div {
  font-size: clamp(18px, 2.6vw, 24px);
  font-weight: 500;
}
.mini-label {
  position: absolute;
  top: 16px;
  left: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
}
.mini-face em {
  position: absolute;
  bottom: 14px;
  font-style: normal;
  font-size: 12px;
  color: var(--faint);
}
.mini-rate {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 22px;
}
.mini-rate span {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  border-radius: 14px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.mini-rate small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.mini-rate .again {
  color: var(--red);
}
.mini-rate .hard {
  color: var(--orange);
}
.mini-rate .good {
  color: var(--green);
}
.mini-rate .easy {
  color: var(--accent);
}
.float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 14px 14px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  text-align: left;
  animation: bob 6s ease-in-out infinite;
}
.float strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
.float span {
  font-size: 13px;
  color: var(--muted);
}
.float-a {
  left: -60px;
  top: 34%;
}
.float-b {
  right: -50px;
  top: 14%;
  animation-delay: -3s;
}
.float-ic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ff9f0a;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
}
.float-ic.grade {
  background: #34c759;
}
@keyframes bob {
  50% {
    transform: translateY(-10px);
  }
}

/* bands */
.i-band {
  padding: 110px 22px;
}
.i-band.white {
  background: var(--surface);
}
.i-wrap {
  max-width: 1020px;
  margin: 0 auto;
}
.i-kicker {
  font-size: 19px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}
.i-h2 {
  font-size: clamp(40px, 5.6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.i-h2.center {
  text-align: center;
}
.i-lead {
  font-size: clamp(19px, 2vw, 21px);
  color: var(--muted);
  max-width: 36em;
  margin-top: 22px;
  line-height: 1.4;
}
.flow {
  display: grid;
  grid-template-columns: 1fr auto 1.15fr;
  gap: 28px;
  align-items: center;
  margin-top: 60px;
  padding: 40px;
  background: var(--bg);
  border-radius: 30px;
}
.flow-files,
.flow-cards,
.t-files {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.file-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 12px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
}
.file-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-chip b {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0;
}
.file-chip .pdf {
  background: #e5484d;
}
.file-chip .ppt {
  background: #f76b15;
}
.file-chip .doc {
  background: #0071e3;
}
.file-chip .img {
  background: #30a46c;
}
.flow-arrow {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
}
.gen-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.gen-card span {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
}
.gen-card strong {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.gen-card em {
  font-style: normal;
  font-size: 15px;
  color: var(--muted);
}
.flow.in .file-chip,
.flow.in .gen-card {
  animation: rise 0.7s var(--ease) both;
}
.flow.in .file-chip:nth-child(2) {
  animation-delay: 0.08s;
}
.flow.in .file-chip:nth-child(3) {
  animation-delay: 0.16s;
}
.flow.in .file-chip:nth-child(4) {
  animation-delay: 0.24s;
}
.flow.in .gen-card:nth-child(1) {
  animation-delay: 0.45s;
}
.flow.in .gen-card:nth-child(2) {
  animation-delay: 0.55s;
}
.flow.in .gen-card:nth-child(3) {
  animation-delay: 0.65s;
}

/* bento */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
}
.tile-wide {
  grid-column: span 2;
}
.bento .btile {
  display: block;
  text-align: left;
  min-height: 300px;
  padding: 36px;
  border-radius: 30px;
  border: 0;
  background: var(--surface);
  box-shadow: none;
  font-size: 17px;
  position: relative;
  overflow: hidden;
}
.bento .btile:hover {
  transform: none;
}
.bento .btile h3 {
  font-size: clamp(24px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 10px;
}
.bento .btile p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.4;
}
.tile-text {
  max-width: 26em;
}
.tile-ic {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 70px;
}
.timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-top: 64px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 2px;
  background: var(--accent-soft-2);
}
.timeline span {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.timeline i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--accent);
}
.score-mini {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 52px;
}
.score-mini strong {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--accent);
  line-height: 1;
}
.score-mini span {
  font-size: 15px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-soft);
  padding: 3px 10px;
  border-radius: 980px;
}
.bento .tile-dark {
  background: #08122b;
  color: #fff;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: 20px;
}
.bento .tile-dark p {
  color: rgba(255, 255, 255, 0.65);
}
.comet-art {
  width: 100%;
  height: auto;
  overflow: visible;
}
.comet-art .c1 {
  animation: fall 5s linear infinite;
}
.comet-art .c2 {
  animation: fall 4s linear infinite -1.6s;
}
.comet-art .c3 {
  animation: fall 6s linear infinite -3s;
}
.comet-art .flame {
  animation: flicker 0.2s ease-in-out infinite alternate;
  transform-origin: 0 12px;
}
@keyframes fall {
  from {
    transform: translateY(-40px);
  }
  to {
    transform: translateY(260px);
  }
}
@keyframes flicker {
  to {
    transform: scaleY(0.6);
  }
}
.steps3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 64px;
}
.steps3 b {
  display: block;
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: 18px;
}
.steps3 h3 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.steps3 p {
  color: var(--muted);
}
.i-final {
  text-align: center;
  padding: 130px 22px 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}
.i-foot {
  color: var(--muted);
  font-size: 14px;
  margin-top: -10px;
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.i-hero .reveal:nth-child(2) {
  transition-delay: 0.08s;
}
.i-hero .reveal:nth-child(3) {
  transition-delay: 0.16s;
}
.i-hero .reveal:nth-child(4) {
  transition-delay: 0.24s;
}
.i-hero .hero-stage.reveal {
  transform: translateY(60px) scale(0.97);
  transition-delay: 0.3s;
  transition-duration: 1.3s;
}
.i-hero .hero-stage.reveal.in {
  transform: none;
}
.bento .reveal:nth-child(3n + 2),
.steps3 .reveal:nth-child(2) {
  transition-delay: 0.1s;
}
.bento .reveal:nth-child(3n + 3),
.steps3 .reveal:nth-child(3) {
  transition-delay: 0.2s;
}

/* ================= TOUR ================= */
.tour-wrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.25s;
}
.tour-wrap.in {
  opacity: 1;
}
.tour {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border-radius: 32px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.3);
  padding: 14px 14px 26px;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.4s var(--ease);
  overflow: hidden;
}
.tour-wrap.in .tour {
  transform: none;
}
.tour-x {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-2);
}
.tour-x:hover {
  background: rgba(0, 0, 0, 0.1);
}
.tour-art {
  height: 290px;
  border-radius: 22px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  overflow: hidden;
}
.tour-art.slide-l {
  animation: slideL 0.45s var(--ease);
}
.tour-art.slide-r {
  animation: slideR 0.45s var(--ease);
}
@keyframes slideL {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}
@keyframes slideR {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
}
.tour-copy {
  padding: 26px 22px 0;
  text-align: center;
  min-height: 136px;
}
.tour-copy h2 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.tour-copy p {
  color: var(--muted);
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.42;
}
.tour-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 12px 0;
}
.tour-dots {
  display: flex;
  gap: 7px;
  padding-left: 10px;
}
.tour-dots i {
  width: 7px;
  height: 7px;
  border-radius: 7px;
  background: var(--border-strong);
  transition: width 0.35s var(--ease), background 0.35s;
}
.tour-dots i.on {
  width: 22px;
  background: var(--accent);
}
.tour-btns {
  display: flex;
  gap: 4px;
}
/* the mark on a white app-icon tile */
.t-logo {
  width: 108px;
  height: 108px;
  border-radius: 25px;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  animation: pop 0.6s var(--ease);
}
.t-files {
  width: 100%;
  max-width: 320px;
}
.tour-art .file-chip {
  animation: rise 0.6s var(--ease) both;
}
.tour-art .file-chip:nth-child(2) {
  animation-delay: 0.1s;
}
.tour-art .file-chip:nth-child(3) {
  animation-delay: 0.2s;
}
.t-card {
  width: 100%;
  max-width: 340px;
  height: 200px;
  cursor: pointer;
  outline: none;
}
.t-card:focus-visible .mini-face {
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.t-quiz {
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.t-quiz .t-q {
  display: block;
  border: 0;
  padding: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 16px;
  min-height: 50px;
}
.t-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.t-opts button {
  height: 46px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: var(--surface);
  font-size: 16px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, background 0.2s;
}
.t-opts button:hover:not(:disabled) {
  border-color: var(--accent);
}
.t-opts button:disabled {
  cursor: default;
}
.t-opts .right {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}
.t-opts .wrong {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}
.tour-art .t-comet {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background: #08122b;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.tour-art:has(.t-comet) {
  padding: 0;
}
.t-ready {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 16px;
}
.t-ready span {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow);
  animation: rise 0.6s var(--ease) both;
}
.t-ready span:nth-child(2) {
  animation-delay: 0.05s;
}
.t-ready span:nth-child(3) {
  animation-delay: 0.1s;
}
.t-ready span:nth-child(4) {
  animation-delay: 0.15s;
}
.t-ready span:nth-child(5) {
  animation-delay: 0.2s;
}
.t-ready span:nth-child(6) {
  animation-delay: 0.25s;
}

/* ---------- modal, toast, drop veil ---------- */
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s;
  overflow-y: auto;
}
.modal-wrap.in {
  opacity: 1;
}
.modal {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 26px;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.3s var(--ease);
  margin: auto;
}
.modal-wrap.in .modal {
  transform: none;
}
.modal-wide {
  max-width: 640px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.modal-title {
  font-size: 22px;
  margin-bottom: 8px;
}
.modal-head .modal-title {
  margin: 0;
}
.modal > p.muted {
  margin-bottom: 14px;
  font-size: 15px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}
.toasts {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 440px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 980px;
  background: rgba(29, 29, 31, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.3s, transform 0.3s var(--ease);
}
.toast.in {
  opacity: 1;
  transform: none;
}
.toast-error .ic {
  color: #ff6961;
}
.toast-ok .ic {
  color: #30d158;
}
.toast-info .ic {
  color: #64d2ff;
}
.confetti {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99;
}
.drop-veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 113, 227, 0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}
.drop-veil > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 34px 46px;
  border-radius: 24px;
  border: 2px dashed var(--accent);
  background: var(--surface);
  color: var(--accent);
  font-size: 17px;
  box-shadow: var(--shadow-lg);
}
body.dragging .drop-veil {
  display: flex;
}
body.dragging[data-view='home'] .drop-veil,
body.dragging[data-view='create'] .drop-veil {
  display: none;
}

/* ---------- print ---------- */
.print-title {
  font-size: 24px;
  margin-bottom: 16px;
  display: none;
}
.print-grid {
  display: grid;
  grid-template-columns: 1fr;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.print-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px dashed var(--border-strong);
  break-inside: avoid;
}
.print-card > div {
  padding: 16px 20px;
  min-height: 70px;
  display: flex;
  align-items: center;
  font-size: 15px;
}
.pc-f {
  font-weight: 600;
  border-right: 1px dashed var(--border-strong);
}
@media print {
  .no-print,
  .nav {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .view {
    padding: 0;
    max-width: none;
  }
  .print-title {
    display: block;
  }
  .print-grid {
    box-shadow: none;
    border: 1px solid #999;
  }
}

/* ---------- motion ---------- */
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
@keyframes shake {
  25%,
  75% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
}
@keyframes countpop {
  from {
    transform: scale(1.5);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 631 (easter egg in the paste box) ---------- */
.warp {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: #000;
  clip-path: circle(0 at var(--x) var(--y));
  animation: warp-open 0.7s cubic-bezier(0.7, 0, 0.2, 1) forwards;
}
.warp-name {
  font: 500 clamp(28px, 7vw, 64px) / 1 var(--mono);
  letter-spacing: 0.08em;
  color: #fff;
  opacity: 0;
  animation: warp-name 0.3s 0.4s forwards;
}
@keyframes warp-open {
  to {
    clip-path: circle(150vmax at var(--x) var(--y));
  }
}
@keyframes warp-name {
  to {
    opacity: 1;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .float-a {
    left: -16px;
  }
  .float-b {
    right: -12px;
  }
}
@media (max-width: 980px) {
  .two-col,
  .create {
    grid-template-columns: 1fr;
  }
  .sticky {
    position: static;
  }
  .mode-grid,
  .bento {
    grid-template-columns: 1fr 1fr;
  }
  .bento .tile-dark {
    grid-template-columns: 1fr;
  }
  .flow {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .flow-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }
}
@media (max-width: 760px) {
  .nav-links,
  .nav-right .nav-icon:not(.nav-burger),
  .nav-new {
    display: none;
  }
  .nav-burger {
    display: grid;
  }
  .nav-in {
    justify-content: space-between;
  }
  .nav-sheet {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    padding: 0 30px;
    transition: max-height 0.45s var(--ease), padding 0.45s var(--ease);
  }
  body.menu-open .nav-sheet {
    max-height: 100vh;
    padding: 18px 30px 40px;
  }
  body.menu-open {
    overflow: hidden;
  }
  body.menu-open .nav {
    background: var(--surface);
    height: 100vh;
  }
  .nav-sheet a {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text);
    padding: 6px 0;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.3s, transform 0.3s var(--ease);
  }
  body.menu-open .nav-sheet a {
    opacity: 1;
    transform: none;
  }
  .nav-sheet a.on {
    color: var(--accent);
  }
  .nav-sheet a:hover {
    text-decoration: none;
  }
  .view {
    padding: 28px 18px 72px;
  }
  .page-head h1 {
    font-size: 32px;
  }
  .card-table .tr {
    grid-template-columns: 28px minmax(0, 1fr) 30px;
  }
  .card-table .tr > :nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    font-size: 14px;
  }
  .card-table .tr > :nth-child(4),
  .card-table .tr > :nth-child(5) {
    display: none;
  }
  .card-table .tr > :nth-child(6) {
    grid-column: 3;
    grid-row: 1 / 3;
  }
  .card-table .th {
    display: none;
  }
  .deck-table .tr {
    grid-template-columns: minmax(0, 1fr) 70px;
  }
  .deck-table .tr > :nth-child(n + 2):not(:nth-child(5)) {
    display: none;
  }
  .help-table .tr,
  .help-table.keys .tr {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .float {
    display: none;
  }
  .i-band {
    padding: 80px 18px;
  }
  .bento,
  .steps3 {
    grid-template-columns: 1fr;
  }
  .tile-wide {
    grid-column: auto;
  }
  .bento .btile {
    min-height: 0;
    padding: 28px;
  }
  .tile-ic {
    margin-bottom: 32px;
  }
  .timeline span {
    font-size: 12px;
  }
  .flow {
    padding: 22px;
  }
  .steps3 {
    gap: 34px;
  }
}
@media (max-width: 640px) {
  .hide-sm {
    display: none !important;
  }
  .mode-grid,
  .review-fields {
    grid-template-columns: 1fr;
  }
  .mode-tile {
    min-height: 0;
  }
  .choices {
    grid-template-columns: 1fr;
  }
  .choices.two {
    grid-template-columns: 1fr 1fr;
  }
  .rate {
    gap: 6px;
  }
  .rate-btn kbd {
    display: none;
  }
  .q,
  .face {
    padding: 18px 18px 20px;
    border-radius: 22px;
  }
  .written {
    flex-direction: column;
  }
  .edit-head {
    display: none;
  }
  .edit-row {
    grid-template-columns: minmax(0, 1fr) 30px;
  }
  .edit-n,
  .edit-row .chip {
    display: none;
  }
  .edit-row [data-f='back'] {
    grid-column: 1;
  }
  .edit-row [data-del] {
    grid-column: 2;
    grid-row: 1;
  }
  .search {
    max-width: none;
  }
  .match-grid,
  .match-grid.cols-4 {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .tile {
    min-height: 96px;
    font-size: 14px;
    padding: 10px;
  }
  .game {
    aspect-ratio: 3 / 4;
    max-height: calc(100vh - 160px);
    border-radius: 22px;
  }
  .test-bar {
    left: 16px;
    right: 16px;
    transform: none;
    justify-content: space-between;
  }
  .print-card {
    grid-template-columns: 1fr;
  }
  .pc-f {
    border-right: 0;
  }
  .mode-head {
    grid-template-columns: auto 1fr auto;
  }
  .mode-title {
    justify-content: center;
  }
  .page-actions {
    width: 100%;
  }
  .i-hero {
    padding-top: 48px;
  }
  .hero-stage {
    margin-top: 44px;
    padding-bottom: 56px;
  }
  .device-body {
    padding: 22px 16px 24px;
  }
  .mini-rate {
    gap: 6px;
  }
  .mini-rate span {
    font-size: 12px;
  }
  .tour {
    border-radius: 26px;
  }
  .tour-art {
    height: 230px;
  }
  .tour-copy h2 {
    font-size: 25px;
  }
  .tour-copy p {
    font-size: 15px;
  }
  .t-ready {
    grid-template-columns: repeat(3, 58px);
  }
  .t-ready span {
    width: 58px;
    height: 58px;
  }
}
