:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-rgb: 245, 245, 247;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --surface-subtle: #f2f2f7;
  --ink: #1d1d1f;
  --sub: #6e6e73;
  --tertiary: #98989d;
  --line: rgba(60, 60, 67, .14);
  --line-strong: rgba(60, 60, 67, .22);
  --accent: #007aff;
  --accent-strong: #0063d1;
  --accent-soft: rgba(0, 122, 255, .12);
  --ok: #248a5a;
  --ok-soft: rgba(52, 199, 89, .14);
  --bad: #d70015;
  --bad-soft: rgba(255, 59, 48, .12);
  --warn: #a05b00;
  --warn-soft: rgba(255, 149, 0, .13);
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 5px 16px rgba(0, 0, 0, .05);
  --shadow: 0 12px 34px rgba(0, 0, 0, .08), 0 2px 5px rgba(0, 0, 0, .03);
  --material: rgba(255, 255, 255, .72);
  --material-strong: rgba(255, 255, 255, .88);
  --ease-out: cubic-bezier(.2, .85, .25, 1);
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-optical-sizing: auto;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  position: relative;
  max-width: 900px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 18px 72px;
  color: var(--ink);
  background:
    radial-gradient(58rem 30rem at 12% -8%, rgba(90, 176, 255, .18), transparent 58%),
    radial-gradient(44rem 28rem at 96% 8%, rgba(191, 166, 255, .12), transparent 60%),
    var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
a { color: var(--accent); }
::selection { color: #fff; background: var(--accent); }

.topbar {
  position: sticky;
  top: 10px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin: 10px 0 8px;
  padding: 9px 12px 9px 16px;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: var(--radius);
  background: var(--material);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}
.topbar h1 { margin: 0; font-size: 1.08rem; font-weight: 760; letter-spacing: -.025em; }
.topbar h1 a { color: inherit; text-decoration: none; }
.topbar h1 a:hover { color: var(--accent); }
.topbar small { margin-left: 5px; color: var(--sub); font-size: .76rem; font-weight: 580; letter-spacing: -.01em; }
.top-actions { display: flex; align-items: center; gap: 7px; }
.app-switch { padding: 6px 4px; color: var(--sub); font-size: .78rem; font-weight: 680; text-decoration: none; white-space: nowrap; }
.app-switch:hover { color: var(--accent); }
.streak, .account-badge {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  max-width: 138px;
  overflow: hidden;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, .62);
  font-size: .79rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-badge { color: var(--accent); border-color: rgba(0, 122, 255, .18); background: var(--accent-soft); cursor: pointer; }
.account-badge.signed-in { color: var(--ok); border-color: rgba(52, 199, 89, .22); background: var(--ok-soft); }
.theme-toggle { display: inline-flex; align-items: center; gap: 5px; min-height: 31px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--sub); background: rgba(255, 255, 255, .62); cursor: pointer; font-size: .76rem; font-weight: 700; transition: transform 130ms var(--ease-out), color 150ms ease, background-color 150ms ease, border-color 150ms ease; }
.theme-toggle:hover { border-color: rgba(0, 122, 255, .24); color: var(--accent); background: var(--accent-soft); }
.theme-toggle:active { transform: scale(.96); }
.theme-toggle [data-theme-icon] { width: 14px; font-size: 1rem; line-height: 1; }

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 0 2px 23px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 16px;
  background: rgba(118, 118, 128, .11);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 11px;
  color: var(--sub);
  font-size: .84rem;
  font-weight: 680;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 120ms var(--ease-out);
}
.tabs a:hover { color: var(--ink); background: rgba(255, 255, 255, .52); }
.tabs a.active { color: var(--ink); background: var(--surface-solid); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.tabs a:active { transform: scale(.97); }

#screen { min-width: 0; }
.card {
  position: relative;
  margin-bottom: 14px;
  padding: 21px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card > :first-child { margin-top: 0; }
.card h2 { margin: 0 0 8px; font-size: 1.14rem; font-weight: 760; letter-spacing: -.025em; line-height: 1.25; }
.card h3 { margin: 18px 0 8px; font-size: .95rem; font-weight: 730; letter-spacing: -.012em; }
.muted { color: var(--sub); font-size: .9rem; line-height: 1.6; }
.muted b { color: var(--ink); font-weight: 730; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(166px, 1fr)); gap: 11px; }
body[data-route="home"] .tile-grid { margin-bottom: clamp(22px, 3vw, 30px); }
.tile {
  display: flex;
  min-height: 152px;
  flex-direction: column;
  align-items: flex-start;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
.tile:hover { border-color: rgba(0, 122, 255, .27); box-shadow: var(--shadow); transform: translateY(-2px); }
.tile:active { transform: scale(.975); }
.tile .t-icon { display: grid; width: 38px; height: 38px; place-items: center; margin-bottom: auto; border-radius: 12px; background: var(--accent-soft); font-size: 1.25rem; }
.tile:nth-child(2n) .t-icon { background: rgba(175, 82, 222, .12); }
.tile:nth-child(3n) .t-icon { background: rgba(255, 149, 0, .14); }
.tile .t-name { margin-top: 16px; font-size: .96rem; font-weight: 750; letter-spacing: -.014em; }
.tile .t-desc { display: block; margin-top: 3px; color: var(--sub); font-size: .78rem; line-height: 1.42; }

button.btn, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 76, 173, .18);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 730;
  letter-spacing: -.01em;
  text-decoration: none;
  transition: transform 130ms var(--ease-out), background-color 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
button.btn:hover, a.btn:hover { background: var(--accent-strong); box-shadow: 0 5px 14px rgba(0, 103, 209, .24); }
button.btn:active, a.btn:active { transform: scale(.97); box-shadow: none; }
button.btn.secondary, a.btn.secondary { border-color: rgba(0, 122, 255, .2); color: var(--accent); background: var(--accent-soft); box-shadow: none; }
button.btn.secondary:hover, a.btn.secondary:hover { background: rgba(0, 122, 255, .18); }
button.btn.ghost, a.btn.ghost { border-color: var(--line); color: var(--sub); background: rgba(255, 255, 255, .48); box-shadow: none; }
button.btn.ghost:hover, a.btn.ghost:hover { color: var(--ink); background: var(--surface-solid); }
button.btn:disabled { opacity: .46; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }

.notice {
  margin: 0 0 14px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 149, 0, .22);
  border-radius: var(--radius-sm);
  color: #825000;
  background: var(--warn-soft);
  font-size: .89rem;
  line-height: 1.55;
}
.notice.error { border-color: rgba(255, 59, 48, .25); color: var(--bad); background: var(--bad-soft); }

textarea, input[type=text], input[type=password], input[type=search], select {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, .8);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .025);
  font-size: .94rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.58; }
textarea:hover, input[type=text]:hover, input[type=password]:hover, input[type=search]:hover, select:hover { border-color: var(--line-strong); }
textarea:focus, input[type=text]:focus, input[type=password]:focus, input[type=search]:focus, select:focus { border-color: var(--accent); background: var(--surface-solid); box-shadow: 0 0 0 4px rgba(0, 122, 255, .14); }
label.fld { display: block; margin: 17px 0 6px; color: var(--ink); font-size: .84rem; font-weight: 700; }
.check-row { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--sub); font-size: .85rem; cursor: pointer; }
.check-row input { width: auto; accent-color: var(--accent); }

.quiz-progress { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--sub); font-size: .82rem; font-weight: 650; }
.quiz-q { margin: 20px 0 7px; font-size: clamp(1.12rem, 3vw, 1.35rem); font-weight: 760; letter-spacing: -.025em; line-height: 1.42; }
.quiz-hint { margin-bottom: 16px; color: var(--sub); font-size: .9rem; }
.choices { display: grid; gap: 8px; }
.choice {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, .65);
  cursor: pointer;
  text-align: left;
  transition: transform 130ms var(--ease-out), border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
.choice:hover:not(:disabled) { border-color: rgba(0, 122, 255, .5); background: var(--accent-soft); }
.choice:active:not(:disabled) { transform: scale(.985); }
.choice.correct { border-color: rgba(52, 199, 89, .5); color: #17643f; background: var(--ok-soft); font-weight: 740; }
.choice.wrong { border-color: rgba(255, 59, 48, .45); color: var(--bad); background: var(--bad-soft); }
.choice:disabled { cursor: default; }
.hint-mask { margin-bottom: 12px; padding: 14px; border-radius: 14px; color: var(--accent); background: var(--accent-soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.18rem; letter-spacing: .09em; }
.hint-mask.revealed { color: var(--ok); background: var(--ok-soft); font-weight: 760; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }
.feedback { margin-top: 14px; padding: 12px 14px; border: 1px solid transparent; border-radius: 14px; line-height: 1.6; }
.feedback.ok { border-color: rgba(52, 199, 89, .25); background: var(--ok-soft); }
.feedback.bad { border-color: rgba(255, 59, 48, .2); background: var(--bad-soft); }
.result-big { margin: 16px 0 8px; color: var(--accent); font-size: clamp(2.2rem, 7vw, 3.2rem); font-weight: 790; letter-spacing: -.065em; line-height: 1; text-align: center; }

.pattern-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 13px; }
.pattern-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.pattern-tabs::-webkit-scrollbar { display: none; }
.pattern-tab {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--sub);
  background: rgba(255, 255, 255, .58);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
  transition: transform 130ms var(--ease-out), color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}
.pattern-tab span { margin-left: 3px; opacity: .7; font-size: .72rem; }
.pattern-tab:hover { color: var(--accent); border-color: rgba(0, 122, 255, .3); }
.pattern-tab.active { border-color: transparent; color: #fff; background: var(--accent); }
.pattern-tab:active { transform: scale(.97); }
.pattern-toolbar > .btn { flex: 0 0 auto; }
.pattern-list { overflow: hidden; border: 1px solid rgba(255, 255, 255, .7); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.pattern-list-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 19px; border-bottom: 1px solid var(--line); }
.pattern-list-head h2 { margin: 1px 0 0; font-size: 1.07rem; letter-spacing: -.02em; }
.pattern-count { color: var(--sub); font-size: .82rem; font-weight: 700; }
.pattern-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 11px; padding: 19px; }
.pattern-row + .pattern-row { border-top: 1px solid var(--line); }
.pattern-number { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: .75rem; font-weight: 760; }
.pattern-content .p-text { font-size: 1.03rem; font-weight: 750; line-height: 1.47; }
.pattern-content .p-mean { margin: 4px 0 11px; color: var(--sub); font-size: .9rem; }
.pattern-content .p-ex { padding: 10px 12px; border-radius: 11px; color: #4b5568; background: rgba(0, 122, 255, .07); font-size: .89rem; line-height: 1.55; }
.pattern-content .p-ex span { display: block; margin-bottom: 3px; color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.stage-badge { display: inline-flex; padding: 3px 7px; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: .68rem; font-weight: 780; letter-spacing: .05em; }

.topic-cat { margin: 27px 2px 9px; color: var(--sub); font-size: .76rem; font-weight: 760; letter-spacing: .06em; text-transform: uppercase; }
.q-item { padding: 15px 0; }
.q-item + .q-item { border-top: 1px solid var(--line); }
.q-en { font-size: .98rem; font-weight: 690; line-height: 1.55; }
.answer-en { color: var(--ink); font-size: 1.02rem; line-height: 1.9; white-space: pre-wrap; }
.answer-ko { margin-top: 13px; padding: 13px 0 0; border-top: 1px dashed var(--line-strong); color: var(--sub); line-height: 1.72; white-space: pre-wrap; }
.vocab-chip { display: inline-flex; align-items: center; gap: 6px; margin: 4px 5px 4px 0; padding: 6px 9px; border: 1px solid rgba(0, 122, 255, .12); border-radius: 10px; background: var(--accent-soft); font-size: .87rem; }
.vocab-chip b { color: var(--accent); }
.vocab-chip button { width: 19px; height: 19px; padding: 0; border: 0; border-radius: 999px; color: var(--accent); background: rgba(255, 255, 255, .72); cursor: pointer; font-size: .95rem; line-height: 1; }

table.vtable { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.vtable th, table.vtable td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.vtable th { color: var(--sub); font-size: .75rem; font-weight: 750; letter-spacing: .02em; }
table.vtable tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: .68rem; font-weight: 780; }
.badge.b1 { color: var(--bad); background: var(--bad-soft); }
.badge.b2 { color: var(--warn); background: var(--warn-soft); }
.badge.b3 { color: var(--ok); background: var(--ok-soft); }

.app-picker { padding: clamp(22px, 7vh, 74px) 0 20px; }
.app-picker-head { max-width: 560px; margin: 0 auto 28px; text-align: center; }
.app-picker-head h2 { margin: 7px 0 9px; font-size: clamp(1.55rem, 5vw, 2.2rem); font-weight: 780; letter-spacing: -.045em; line-height: 1.18; }
.app-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.app-choice { display: flex; min-height: 292px; flex-direction: column; padding: 25px; border: 1px solid rgba(255, 255, 255, .76); border-radius: var(--radius-lg); color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; transition: transform 200ms var(--ease-out), box-shadow 200ms ease, border-color 200ms ease; }
.app-choice:hover { border-color: rgba(0, 122, 255, .3); box-shadow: var(--shadow); transform: translateY(-3px); }
.app-choice-icon { display: grid; width: 50px; height: 50px; place-items: center; margin-bottom: 19px; border-radius: 16px; background: var(--accent-soft); font-size: 1.65rem; }
.app-choice.jlpt .app-choice-icon { background: rgba(255, 59, 48, .1); }
.app-choice-title { font-size: 1.22rem; font-weight: 780; letter-spacing: -.03em; }
.app-choice-level { margin: 3px 0 17px; color: var(--accent); font-size: .84rem; font-weight: 730; }
.app-choice.jlpt .app-choice-level, .app-choice.jlpt .app-choice-link { color: #d70015; }
.app-choice-desc { color: var(--sub); font-size: .9rem; line-height: 1.6; }
.app-choice-link { margin-top: auto; padding-top: 24px; color: var(--accent); font-size: .9rem; font-weight: 760; }
.app-picker-actions { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }

.foot { margin-top: 40px; color: var(--tertiary); font-size: .75rem; text-align: center; }
.admin-mode .topbar { justify-content: flex-start; }
.admin-login { max-width: 430px; margin: 52px auto 14px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { min-width: 700px; }
.admin-table th, .admin-table td { vertical-align: top; }
.admin-table input { min-width: 155px; }
.admin-row-actions { margin-top: 8px; }
.admin-row-actions .btn { min-height: 33px; padding: 6px 11px; font-size: .8rem; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(0, 122, 255, .36); outline-offset: 3px; }
body[data-route="account"] #screen, body[data-route="register"] #screen { max-width: 480px; margin: clamp(28px, 9vh, 86px) auto 0; }
body[data-route="account"] .card, body[data-route="register"] .card { padding: 26px; box-shadow: var(--shadow); }

@media (max-width: 620px) {
  body { padding: 0 12px 42px; }
  .topbar { top: 6px; align-items: flex-start; margin-top: 6px; padding: 10px 11px 10px 14px; border-radius: 18px; }
  .topbar h1 { max-width: 148px; line-height: 1.25; }
  .topbar small { display: block; margin: 2px 0 0; }
  .top-actions { align-items: flex-end; flex-direction: column; gap: 4px; }
  .app-switch { padding: 0; }
  .theme-toggle-label { display: none; }
  .streak { display: none; }
  .account-badge { max-width: 104px; }
  .tabs { margin-bottom: 17px; border-radius: 14px; }
  .tabs a { padding: 8px 10px; font-size: .81rem; }
  .card { padding: 18px; border-radius: 18px; }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .tile { min-height: 138px; padding: 14px; border-radius: 16px; }
  .tile .t-icon { width: 34px; height: 34px; font-size: 1.1rem; }
  .tile .t-name { margin-top: 13px; font-size: .89rem; }
  .tile .t-desc { font-size: .74rem; }
  .pattern-toolbar { align-items: stretch; flex-direction: column; }
  .pattern-toolbar > .btn { align-self: flex-start; }
  .pattern-row { padding: 16px; grid-template-columns: 25px minmax(0, 1fr); gap: 9px; }
  .input-row { align-items: stretch; flex-direction: column; }
  .input-row .btn { width: 100%; }
  .app-picker { padding-top: 26px; }
  .app-choice-grid { grid-template-columns: 1fr; }
  .app-choice { min-height: 220px; padding: 21px; border-radius: 23px; }
  .app-choice-icon { margin-bottom: 14px; }
  .app-choice-link { padding-top: 18px; }
}

@media (max-width: 390px) {
  .tile-grid { grid-template-columns: 1fr; }
  .tile { min-height: 116px; }
  .tile .t-icon { margin-bottom: 0; }
  .tile .t-name { margin-top: 10px; }
  .btn-row > .btn { flex: 1 1 auto; }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-rgb: 0, 0, 0;
  --surface: rgba(28, 28, 30, .78);
  --surface-solid: #1c1c1e;
  --surface-subtle: #2c2c2e;
  --ink: #f5f5f7;
  --sub: #a1a1a6;
  --tertiary: #767680;
  --line: rgba(235, 235, 245, .16);
  --line-strong: rgba(235, 235, 245, .25);
  --accent: #0a84ff;
  --accent-strong: #409cff;
  --accent-soft: rgba(10, 132, 255, .2);
  --ok: #30d158;
  --ok-soft: rgba(48, 209, 88, .16);
  --bad: #ff453a;
  --bad-soft: rgba(255, 69, 58, .17);
  --warn: #ff9f0a;
  --warn-soft: rgba(255, 159, 10, .18);
  --material: rgba(28, 28, 30, .76);
  --material-strong: rgba(28, 28, 30, .9);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .2), 0 6px 19px rgba(0, 0, 0, .2);
  --shadow: 0 16px 38px rgba(0, 0, 0, .38), 0 2px 5px rgba(0, 0, 0, .2);
}
html[data-theme="dark"] body { background: radial-gradient(48rem 25rem at 8% -12%, rgba(10, 132, 255, .17), transparent 60%), radial-gradient(38rem 24rem at 100% 3%, rgba(191, 90, 242, .11), transparent 60%), var(--bg); }
html[data-theme="dark"] .topbar, html[data-theme="dark"] .tabs, html[data-theme="dark"] .card, html[data-theme="dark"] .tile, html[data-theme="dark"] .pattern-list, html[data-theme="dark"] .app-choice { border-color: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .topbar { border-top-color: rgba(255, 255, 255, .17); }
html[data-theme="dark"] .tabs { background: rgba(118, 118, 128, .24); }
html[data-theme="dark"] .tabs a:hover { background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .tabs a.active { background: #3a3a3c; box-shadow: none; }
html[data-theme="dark"] .streak, html[data-theme="dark"] .account-badge, html[data-theme="dark"] .theme-toggle, html[data-theme="dark"] textarea, html[data-theme="dark"] input[type=text], html[data-theme="dark"] input[type=password], html[data-theme="dark"] input[type=search], html[data-theme="dark"] select, html[data-theme="dark"] .choice, html[data-theme="dark"] .pattern-tab, html[data-theme="dark"] button.btn.ghost, html[data-theme="dark"] a.btn.ghost { background: rgba(44, 44, 46, .82); }
html[data-theme="dark"] textarea:focus, html[data-theme="dark"] input[type=text]:focus, html[data-theme="dark"] input[type=password]:focus, html[data-theme="dark"] input[type=search]:focus, html[data-theme="dark"] select:focus { background: #2c2c2e; }
html[data-theme="dark"] .choice.correct { color: #7ef3a0; }
html[data-theme="dark"] .pattern-content .p-ex { color: #c7d7f7; background: rgba(10, 132, 255, .15); }
html[data-theme="dark"] .notice { color: #ffd19b; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .card, .tile, .pattern-list, .app-choice { background: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .topbar, .card, .tile, .pattern-list, .app-choice, .tabs { border-color: var(--line-strong); }
  .muted { color: var(--ink); }
}
