@font-face {
  font-family: Manrope;
  src: url('/static/fonts/Manrope-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #F4F1EA;
  --surface: #FFFFFF;
  --panel: #FAF8F3;
  --panel2: #FFFFFF;
  --line: #DAD2C7;
  --text: #1C1C24;
  --muted: #6F7380;
  --accent: #4F5BD5;
  --accent-hover: #4450C4;
  --accent-soft: #ECECF9;
  --red: #C56A57;
  --error-soft: #F8EFEB;
  --success: #5C8A63;
  --success-soft: #EDF3EC;
  --control: #FFFFFF;
  --on-accent: #FFFFFF;
  --overlay: rgba(28, 28, 36, .36);
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #0B0B0C;
  --panel: #111214;
  --panel2: #0B0B0C;
  --line: #23252A;
  --text: #F5F5F7;
  --muted: #9A9DA6;
  --accent: #6C7BFF;
  --accent-hover: #5C6AF0;
  --accent-soft: #1B1E35;
  --red: #D1786C;
  --error-soft: #251816;
  --success: #6FA07A;
  --success-soft: #162019;
  --control: #0B0B0C;
  --on-accent: #000000;
  --overlay: rgba(0, 0, 0, .7);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  font-family: Manrope, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
button:disabled { opacity: .45; cursor: default; }
a { color: var(--accent); }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
.app-shell { max-width: 650px; min-height: 100vh; min-height: 100dvh; margin: auto; display: flex; flex-direction: column; }
.topbar { padding: 18px 20px; min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 800; letter-spacing: -.035em; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 19px; font-weight: 800; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.level-badge { color: var(--accent); background: var(--accent-soft); border-radius: 7px; padding: 4px 7px; font-size: 11px; font-weight: 800; }
.level-badge:empty { display: none; }
.theme-switch { display: flex; align-items: center; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.theme-switch button { display: grid; place-items: center; width: 32px; height: 30px; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.theme-switch button[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); }
.theme-switch svg { width: 18px; height: 18px; }
.view { flex: 1; padding: 28px 20px 40px; overflow-x: hidden; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; margin: 0 0 8px; }
.page-title { font-size: 26px; font-weight: 800; line-height: 1.25; letter-spacing: -.045em; margin: 0 0 10px; overflow-wrap: anywhere; }
.subtitle { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 0 0 24px; }
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.hero h2 { font-size: 24px; font-weight: 800; line-height: 1.3; letter-spacing: -.035em; margin: 18px 0 10px; }
.hero p { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 14px 0; }
.card.soft { background: var(--panel2); }
.card-title { font-size: 18px; font-weight: 700; line-height: 1.35; letter-spacing: -.025em; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.6; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.row > * { min-width: 0; overflow-wrap: anywhere; }
.row > b { text-align: right; }
.row + .row { margin-top: 14px; }
.row .eyebrow { margin-bottom: 0; }
.pill { display: inline-block; border-radius: 7px; padding: 5px 9px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 600; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric { padding: 20px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.metric strong { display: block; font-size: 28px; font-weight: 800; line-height: 1.25; letter-spacing: -.045em; }
.metric span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.section-heading { font-size: 19px; font-weight: 700; letter-spacing: -.025em; margin: 28px 0 12px; }
.plan-list { display: grid; }
.plan-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.plan-item:first-child { padding-top: 0; }
.plan-item:last-child { border: 0; padding-bottom: 0; }
.plan-icon { flex-shrink: 0; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 16px; font-weight: 600; }
.plan-item b { font-size: 14px; font-weight: 700; }
.plan-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.btn { appearance: none; width: 100%; min-height: 48px; border: 1px solid transparent; border-radius: 12px; padding: 13px 16px; font-size: 14px; font-weight: 700; line-height: 1.5; cursor: pointer; transition: background .15s, border-color .15s; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.danger { background: var(--error-soft); color: var(--red); border-color: var(--red); }
.btn + .btn { margin-top: 10px; }
.choice-list { display: grid; gap: 10px; margin: 20px 0; }
.choice { display: flex; align-items: center; width: 100%; min-height: 52px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface); text-align: left; font-weight: 600; cursor: pointer; }
.choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.choice .letter { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; margin-right: 12px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.progress-track { height: 6px; margin: 18px 0 24px; border-radius: 8px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 8px; }
.word { font-size: 36px; font-weight: 800; line-height: 1.2; letter-spacing: -.045em; margin: 12px 0 8px; overflow-wrap: anywhere; }
.phonetic { color: var(--muted); font-size: 14px; }
.example { margin: 22px 0; font-size: 15px; line-height: 1.7; color: var(--text); }
.translation { font-size: 24px; font-weight: 800; margin: 16px 0 10px; }
.feedback.good { border-color: var(--success); background: var(--success-soft); }
.feedback.bad { border-color: var(--red); background: var(--error-soft); }
.feedback h2 { margin: 0 0 12px; font-size: 22px; font-weight: 800; }
.feedback.good h2 { color: var(--success); }
.feedback.bad h2 { color: var(--red); }
.field { display: block; margin: 0 0 18px; color: var(--muted); font-size: 12px; font-weight: 600; }
.field input, .field select { display: block; width: 100%; min-height: 48px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--control); color: var(--text); font-size: 14px; font-weight: 500; }
.field input::placeholder { color: var(--muted); opacity: .85; }
.field input:focus, .field select:focus { border-color: var(--accent); }
.toggle-line { display: flex; align-items: center; gap: 10px; margin: 22px 0; font-size: 14px; }
.toggle-line input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.bottom-nav { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 10px 6px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.bottom-nav.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bottom-nav button { appearance: none; display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 44px; padding: 3px 0; border: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 600; cursor: pointer; }
.bottom-nav button.active { color: var(--accent); }
.nav-icon { display: flex; }
.nav-icon svg { width: 21px; height: 21px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); max-width: min(90vw, 560px); width: max-content; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 13px; opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(8px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }
.spinner { width: 28px; height: 28px; margin: 0 auto 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: 48px 12px; }
.empty h2 { color: var(--text); font-size: 24px; font-weight: 800; letter-spacing: -.035em; }
.empty-icon { font-size: 32px; color: var(--accent); margin-bottom: 18px; }
.question { font-size: 21px; font-weight: 700; line-height: 1.5; letter-spacing: -.025em; margin: 12px 0; }
.footer-note { font-size: 12px; line-height: 1.65; color: var(--muted); text-align: center; margin: 22px 0; }
.admin-list, .event-list { display: grid; gap: 8px; margin: 12px 0; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.admin-row > span { min-width: 0; overflow-wrap: anywhere; }
.admin-row b { display: block; font-size: 14px; font-weight: 700; }
.admin-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.admin-row .status { flex-shrink: 0; font-size: 11px; color: var(--accent); }
.admin-row .status.blocked { color: var(--red); }
.event { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-size: 12px; overflow-wrap: anywhere; }
.event small { display: block; color: var(--muted); margin-top: 5px; }
.admin-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.admin-controls .btn { margin: 0; }
.activity-chart { height: 140px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 10px; }
.chart-day { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.chart-day small { font-size: 10px; color: var(--muted); }
.chart-count { font-size: 10px; color: var(--muted); }
.chart-bar { width: min(100%, 28px); background: var(--accent); border-radius: 4px 4px 0 0; }
.confirm-dialog { width: calc(100% - 40px); max-width: 380px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); }
.confirm-dialog::backdrop { background: var(--overlay); }
.confirm-dialog h2 { margin: 0 0 12px; font-size: 20px; font-weight: 700; }
.confirm-dialog p { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.confirm-dialog .admin-controls { margin-top: 0; }
@media (max-width: 359px) {
  .topbar { padding: 16px 14px; gap: 6px; }
  .brand { font-size: 14px; gap: 6px; }
  .level-badge { padding: 4px; font-size: 10px; }
  .view { padding: 24px 16px 32px; }
  .hero { padding: 20px; }
  .bottom-nav button { font-size: 9px; }
}
@media (min-width: 650px) {
  .app-shell { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .view { padding-left: 28px; padding-right: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.admin-tabs { display:flex; gap:4px; padding:4px; margin:0 0 24px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.admin-tabs button { flex:1; min-height:40px; padding:8px 5px; border:0; border-radius:8px; background:transparent; color:var(--muted); font-weight:700; cursor:pointer; }
.admin-tabs button[aria-pressed='true'] { background:var(--accent-soft); color:var(--accent); }
.outcome { flex-shrink:0; padding:3px 6px; font-size:10px; font-weight:700; border-radius:5px; color:var(--success); background:var(--success-soft); }
.outcome.rejected { color:var(--red); background:var(--error-soft); }
.outcome.error { color:var(--red); background:var(--error-soft); }
.event p { margin:10px 0 5px; }
.event details { margin-top:12px; }
.event summary { color:var(--accent); cursor:pointer; }
.event pre { white-space:pre-wrap; overflow-wrap:anywhere; max-width:100%; font-size:11px; line-height:1.7; color:var(--muted); }
.monitor-tools { margin:18px 0; }
.monitor-tools .toggle-line { font-size:12px; }
.server-status .row { display:grid; grid-template-columns:45% minmax(0,1fr); gap:12px; }
.server-status .row > span { overflow-wrap:normal; }
.admin-controls > * { min-width:0; }
.healthy { color:var(--success); }
