:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #e2e6eb;
  background: #0e1013;
  font-synthesis: none;
  --bg: #0e1013;
  --surface: #15181d;
  --elevated: #1b1f25;
  --line: #292e36;
  --muted: #8c95a3;
  --accent: #5b96ff;
  --accent-text: #071a36;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
svg {
  height: 19px;
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  width: 210px;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #111317;
  padding: 32px 17px 22px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -1.1px;
  margin: 0 15px;
  gap: 9px;
}
.brand-mark {
  background: var(--accent);
  color: #071a36;
  height: 28px;
  width: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 25px;
}
.brand-dot {
  color: var(--accent);
  margin-left: -8px;
}
.sidebar nav {
  display: grid;
  gap: 7px;
  margin-top: 44px;
}
.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: #8e97a4;
  background: transparent;
  border-radius: 7px;
  padding: 11px 13px;
  font-size: 12px;
  font-weight: 500;
  min-height: 42px;
}
.sidebar nav button.active {
  color: #c5d9ff;
  background: #18283f;
}
.sidebar nav button:hover {
  color: #e2e6eb;
  background: #1b2027;
}
.sidebar nav button.active:hover {
  background: #203657;
}
.count {
  margin-left: auto;
  background: #233e64;
  color: #c7dcff;
  font-size: 10px;
  font-weight: 550;
  border-radius: 4px;
  padding: 3px 6px;
}
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #b2bac6;
}
.sidebar-foot small {
  display: block;
  color: #707a89;
  font-size: 10px;
  margin-top: 4px;
}
.profile-dot {
  width: 26px;
  height: 26px;
  background: #192b44;
  border: 1px solid #36567d;
  border-radius: 50%;
}
.sidebar-foot .icon-button {
  margin-left: auto;
}
main {
  grid-column: 2;
  padding: 0 44px 45px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}
.topbar {
  height: 77px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: #7f8998;
  font-size: 11px;
}
.online-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}
.online-indicator i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #70a5ff;
}
.mobile-brand {
  display: none;
}
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 35px 0 28px;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  font-weight: 550;
  margin: 0;
  line-height: 1.3;
}
h2 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.2px;
  margin: 0;
}
.title-actions {
  display: flex;
  gap: 8px;
}
.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid #303741;
  background: #1b2027;
  color: #d6dce5;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  min-height: 36px;
}
.btn:hover {
  background: #252c35;
  border-color: #44505c;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn.primary:hover {
  background: #83b0ff;
}
.btn.small {
  padding: 6px 10px;
  min-height: 30px;
  font-size: 10px;
}
.btn.text-button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn.text-button:hover {
  color: #dce4ed;
  background: #1d2229;
}
.btn.danger {
  color: #c98c8c;
}
.btn.icon-button {
  padding: 5px;
  min-height: 28px;
  background: transparent;
  border: 0;
}
.btn.close {
  font-size: 25px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  min-height: 28px;
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.stats > div {
  padding: 21px 23px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.stats > div + div {
  border-left: 1px solid var(--line);
}
.stats span {
  font-size: 11px;
  color: var(--muted);
}
.stats strong {
  font-size: 32px;
  letter-spacing: -1px;
  font-weight: 450;
  line-height: 1;
}
.review-strip {
  background: #141f31;
  border: 1px solid #2c4262;
  border-radius: 9px;
  margin-top: 18px;
  padding: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #91add3;
  font-weight: 600;
  text-transform: uppercase;
}
.review-strip h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin-top: 8px;
  color: #e1eaff;
}
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 31px 0 14px;
}
.section-label h2 {
  font-size: 13px;
  font-weight: 550;
}
.section-label > span {
  font-size: 10px;
  color: var(--muted);
}
.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.subject-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 21px 18px;
  text-align: left;
  color: inherit;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.subject-card:hover {
  background: #1b2026;
  border-color: #3d5a83;
}
.subject-icon {
  height: 35px;
  width: 35px;
  background: color-mix(in srgb, var(--subject) 12%, transparent);
  color: var(--subject);
  border: 1px solid color-mix(in srgb, var(--subject) 15%, transparent);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 19px;
  flex-shrink: 0;
}
.subject-copy strong {
  font-size: 12px;
  font-weight: 500;
  display: block;
}
.subject-copy small {
  font-size: 10px;
  color: #778291;
  display: block;
  margin-top: 6px;
}
.due-count {
  margin-left: auto;
  text-align: right;
  font-size: 16px;
  color: #b8d2fc;
  font-weight: 450;
}
.due-count small {
  display: block;
  font-size: 9px;
  color: #849bbd;
  margin-top: 5px;
}
.review-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 13px;
  font-size: 11px;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #8f7955;
  border-radius: 50%;
  margin-right: 6px;
}
.dot.online {
  background: #70a5ff;
}
.onboarding-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
.toolbar input {
  flex: 1;
  min-width: 120px;
}
.toolbar select {
  min-width: 155px;
}
input,
select,
textarea {
  background: #15191f;
  color: #dce2ea;
  border: 1px solid #333b47;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  min-height: 38px;
  width: 100%;
}
input::placeholder,
textarea::placeholder {
  color: #697382;
}
textarea {
  line-height: 1.7;
  resize: vertical;
}
label {
  display: block;
  font-size: 11px;
  color: #aab4c2;
  margin: 17px 0 8px;
}
label input,
label select {
  display: block;
  margin-top: 8px;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 24px;
  margin-bottom: 20px;
}
.tabs button {
  background: transparent;
  color: #7e8999;
  padding: 0 0 13px;
  font-size: 12px;
  position: relative;
}
.tabs button.active {
  color: #d6e5ff;
}
.tabs button.active:after {
  content: "";
  position: absolute;
  height: 2px;
  bottom: -1px;
  background: var(--accent);
  left: 0;
  right: 0;
}
.tabs button span {
  margin-left: 8px;
  color: #717c8b;
  font-size: 10px;
}
.question-list {
  display: grid;
  gap: 14px;
}
.question-item {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  overflow: hidden;
}
.question-meta {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 10px;
  color: #9eb7dc;
}
.question-item h2 {
  font-size: 19px;
  line-height: 1.5;
  letter-spacing: -0.3px;
  font-weight: 500;
  margin: 13px 0 17px;
}
.answer {
  font-size: 13px;
  color: #b3bdca;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.question-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.source {
  display: block;
  border-top: 1px solid #293039;
  margin-top: 18px;
  padding-top: 13px;
  font-size: 10px;
  color: #727f90;
  line-height: 1.7;
}
.source summary {
  cursor: pointer;
  list-style: revert;
}
.source a {
  color: #9ac1ff;
}
.source p {
  font-size: 11px;
}
.status {
  padding: 4px 7px;
  border: 1px solid #314b70;
  background: #1b2c46;
  border-radius: 4px;
  color: #accbfa;
  font-size: 9px;
  white-space: nowrap;
}
.question-meta .status {
  margin-left: auto;
}
.status.warn {
  background: #2b2420;
  color: #d2ad84;
  border-color: #493729;
}
.card-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 17px 0;
}
.card-media figure {
  margin: 0;
  background: #101317;
  border: 1px solid #303741;
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
}
.card-media figure a {
  display: block;
}
.card-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  background: #15191e;
}
.card-media figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  font-size: 9px;
  color: var(--muted);
}
.card-media figcaption > div {
  display: flex;
  gap: 5px;
}
.card-media .btn {
  font-size: 9px;
}
.practice {
  max-width: 760px;
  margin: 30px auto;
}
.practice-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.practice-track {
  height: 3px;
  background: #252b33;
  margin: 13px 0 24px;
  border-radius: 3px;
}
.practice-track i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.flashcard {
  background: var(--surface);
  border: 1px solid #303741;
  border-radius: 10px;
  padding: 34px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: start;
}
.flashcard h1 {
  font-size: 27px;
  line-height: 1.5;
  letter-spacing: -0.6px;
  margin: 23px 0 32px;
}
.flashcard > .btn {
  margin-top: auto;
}
.flashcard .answer {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  width: 100%;
}
.flashcard .card-media {
  width: 100%;
}
.rate {
  margin-top: 27px;
  text-align: center;
}
.rate p {
  font-size: 12px;
  color: #b7c2cf;
}
.rating-buttons {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  margin-top: 17px;
}
.rating-buttons button {
  border: 1px solid #343e49;
  background: #1d242c;
  color: #c4cdd8;
  border-radius: 6px;
  padding: 13px 0;
  font-size: 13px;
}
.rating-buttons button:nth-child(-n + 2) {
  background: #2a2020;
  border-color: #4b3434;
  color: #c9a0a0;
}
.rating-buttons button:nth-child(n + 5) {
  background: #192b46;
  border-color: #315381;
  color: #bed7ff;
}
.rating-buttons button:hover {
  background: var(--accent);
  color: #071a36;
  border-color: var(--accent);
}
.rating-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #778393;
  margin-top: 10px;
}
.keyboard-hint {
  text-align: center;
  font-size: 10px;
  color: #6f7a8a;
  margin: 20px;
}
.panel,
.settings-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 23px;
}
.practice-settings {
  display: flex;
  align-items: end;
  gap: 15px;
}
.practice-settings label {
  margin: 0;
  flex: 1;
}
.practice-settings .btn {
  height: 39px;
}
.hint {
  font-size: 11px;
  color: #7e8a9a;
  line-height: 1.8;
}
.empty {
  padding: 65px 20px;
  text-align: center;
  border: 1px dashed #303942;
  border-radius: 9px;
  margin-top: 20px;
  color: #738192;
}
.empty p {
  font-size: 13px;
  line-height: 1.7;
  margin: 18px 0 23px;
  color: #91a0b0;
}
.empty svg {
  width: 27px;
  height: 27px;
}
.empty .btn svg {
  width: 18px;
  height: 18px;
}
.service-status {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 0 21px;
  font-size: 11px;
  color: #a5b0bd;
}
.service-status > span {
  margin-left: auto;
  color: #7a8696;
}
.notebook-list {
  border-top: 1px solid var(--line);
}
.notebook {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.file-icon {
  background: #1d232c;
  border: 1px solid #2c3743;
  display: grid;
  place-items: center;
  color: #8c9fb8;
  border-radius: 7px;
  width: 38px;
  height: 44px;
  flex-shrink: 0;
}
.notebook-info {
  min-width: 0;
  flex: 1;
}
.notebook h2 {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.notebook p {
  font-size: 10px;
  color: #798697;
  margin: 7px 0 0;
}
.notebook .question-actions {
  margin: 0;
  justify-content: end;
}
.error-text {
  color: #d59b8b !important;
  line-height: 1.7;
}
.settings-block {
  margin-bottom: 17px;
}
.settings-block h2 {
  font-size: 14px;
  margin-bottom: 20px;
}
.settings-block dl {
  margin: 0;
}
.settings-block dl > div {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  font-size: 11px;
  border-bottom: 1px solid #262d36;
  padding: 12px 0;
}
.settings-block dt {
  color: #7e899a;
}
.settings-block dd {
  margin: 0;
  text-align: right;
  color: #bec8d4;
  overflow-wrap: anywhere;
}
.settings-block > p {
  font-size: 12px;
  color: #9facbc;
}
.settings-block p.hint {
  font-size: 11px;
  color: #7e8a9a;
}
.settings-block summary {
  font-size: 12px;
  cursor: pointer;
}
.done {
  text-align: center;
  margin: 90px auto;
}
.done h1 {
  font-size: 30px;
  margin: 23px 0 13px;
}
.done p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 28px;
}
.done-check {
  display: grid;
  place-items: center;
  background: #192f4f;
  border: 1px solid #345b8c;
  color: var(--accent);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: auto;
}
.done-check svg {
  width: 25px;
  height: 25px;
}
dialog {
  max-width: 560px;
  width: calc(100% - 30px);
  max-height: min(90vh, calc(100dvh - 32px));
  border: 1px solid #394451;
  border-radius: 12px;
  padding: 27px;
  background: #151a21;
  color: #e1e7ee;
  box-shadow: 0 30px 100px #0007;
}
dialog::backdrop {
  background: #06090dba;
  backdrop-filter: blur(5px);
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.dialog-top h2 {
  font-size: 22px;
  letter-spacing: -0.6px;
  font-weight: 500;
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-row > label {
  flex: 1;
  min-width: 0;
}
.form-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
  margin-top: 24px;
}
.dialog-error {
  color: #dd9e93;
  font-size: 12px;
  line-height: 1.7;
}
.upload-zone {
  border: 1px dashed #375d91;
  border-radius: 8px;
  background: #17253b;
  text-align: center;
  padding: 25px 15px;
  margin-top: 22px;
  color: #b9d1f5;
}
.upload-zone input {
  border: 0;
  background: transparent;
  font-size: 12px;
  max-width: 100%;
}
.upload-zone input::file-selector-button {
  border: 1px solid #42679c;
  border-radius: 6px;
  background: #243b60;
  color: #e0ebff;
  padding: 9px 12px;
  margin-right: 10px;
  font: inherit;
  cursor: pointer;
}
.upload-zone label {
  color: #b9d1f5;
}
.login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 390px;
  min-height: 100vh;
  margin: auto;
  padding: 35px 20px;
}
.login .brand {
  font-size: 31px;
  margin: 0 0 55px;
}
.login section {
  width: 100%;
}
.login h1 {
  font-size: 26px;
  margin-bottom: 29px;
}
.login label {
  margin-top: 20px;
}
.login .btn {
  width: 100%;
  margin-top: 15px;
  min-height: 42px;
}
.login > small {
  font-size: 10px;
  color: #576577;
  margin-top: 50px;
}
.loading {
  margin: 70px;
  font-size: 13px;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 100px);
  background: #5b96ff;
  color: #071a36;
  padding: 13px 19px;
  border-radius: 7px;
  font-size: 12px;
  max-width: 90%;
  opacity: 0;
  transition:
    transform 0.2s,
    opacity 0.2s;
  z-index: 10;
  box-shadow: 0 5px 25px #0006;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  main {
    padding-left: 65px;
    padding-right: 65px;
  }
  .subject-card {
    padding: 24px 20px;
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .sidebar {
    width: 180px;
    padding: 27px 10px 20px;
  }
  .brand {
    font-size: 23px;
    margin-left: 12px;
  }
  .sidebar nav button {
    padding: 10px;
    font-size: 11px;
    gap: 10px;
  }
  main {
    padding: 0 25px 35px;
  }
  .subject-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .notebook {
    flex-wrap: wrap;
  }
  .notebook .question-actions {
    flex-basis: 100%;
    margin-left: 55px;
    justify-content: start;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    width: 100%;
    height: calc(68px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid #2b343f;
    padding: 0 6px env(safe-area-inset-bottom);
    background: #11161df5;
    z-index: 5;
    backdrop-filter: blur(10px);
  }
  .sidebar > .brand,
  .sidebar-foot {
    display: none;
  }
  .sidebar nav {
    display: flex;
    margin: 0;
    height: 100%;
    justify-content: space-around;
    gap: 0;
  }
  .sidebar nav button {
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 9px 2px;
    font-size: 9px;
    flex: 1;
    min-width: 0;
    border-radius: 0;
    position: relative;
  }
  .sidebar nav button.active {
    background: none;
    color: var(--accent);
  }
  .sidebar nav button.active:hover {
    background: none;
  }
  .count {
    position: absolute;
    right: 1px;
    top: 5px;
    font-size: 8px;
    padding: 2px 4px;
  }
  .sidebar nav svg {
    width: 19px;
    height: 19px;
  }
  main {
    padding: 0 18px calc(98px + env(safe-area-inset-bottom));
  }
  .topbar {
    height: 65px;
    font-size: 10px;
  }
  .topbar > span:first-of-type {
    margin-left: auto;
    margin-right: 15px;
  }
  .mobile-brand {
    display: block;
    font-weight: 650;
    font-size: 23px;
    letter-spacing: -0.9px;
    color: #c2d9ff;
  }
  .online-indicator {
    font-size: 9px;
  }
  .page-title {
    padding: 27px 0 22px;
    gap: 12px;
    align-items: center;
  }
  h1 {
    font-size: 26px;
  }
  .page-title .btn {
    padding: 8px 10px;
    font-size: 10px;
  }
  .page-title .btn svg {
    width: 16px;
    height: 16px;
  }
  .title-actions {
    gap: 6px;
  }
  .stats > div {
    padding: 17px 13px;
    gap: 12px;
  }
  .stats span {
    font-size: 9px;
  }
  .stats strong {
    font-size: 28px;
  }
  .review-strip {
    padding: 19px;
    align-items: start;
    flex-direction: column;
    gap: 18px;
    margin-top: 13px;
  }
  .review-strip h2 {
    font-size: 19px;
  }
  .review-strip .btn {
    align-self: stretch;
  }
  .subject-grid {
    gap: 9px;
  }
  .subject-card {
    padding: 17px 11px;
    gap: 9px;
  }
  .subject-icon {
    width: 29px;
    height: 29px;
    border-radius: 7px;
    font-size: 17px;
  }
  .subject-copy strong {
    font-size: 11px;
  }
  .subject-copy small {
    font-size: 9px;
    margin-top: 5px;
  }
  .due-count {
    font-size: 14px;
  }
  .due-count small {
    font-size: 8px;
  }
  .section-label {
    margin-top: 26px;
  }
  .toolbar {
    gap: 8px;
    margin-bottom: 20px;
  }
  .toolbar select {
    min-width: 120px;
    width: 135px;
  }
  .question-item {
    padding: 19px;
  }
  .question-item h2 {
    font-size: 17px;
  }
  .question-meta {
    font-size: 9px;
  }
  .answer {
    font-size: 12px;
    line-height: 1.85;
  }
  .question-actions {
    gap: 6px;
  }
  .card-media {
    grid-template-columns: 1fr;
  }
  .practice {
    margin-top: 21px;
  }
  .flashcard {
    padding: 24px;
    min-height: 310px;
  }
  .flashcard h1 {
    font-size: 23px;
  }
  .rating-buttons {
    gap: 4px;
  }
  .rating-buttons button {
    font-size: 11px;
    padding: 13px 0;
    border-radius: 5px;
  }
  .practice-settings {
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
  }
  .practice-settings label {
    min-width: 110px;
  }
  .practice-settings .btn {
    width: 100%;
    margin-top: 7px;
  }
  .settings-block {
    padding: 20px;
  }
  .settings-block dl > div {
    gap: 15px;
    font-size: 10px;
  }
  .settings-block dd {
    max-width: 67%;
  }
  .notebook {
    gap: 12px;
  }
  .file-icon {
    width: 31px;
    height: 38px;
  }
  .notebook .question-actions {
    margin-left: 43px;
  }
  .notebook .status {
    font-size: 8px;
  }
  .notebook h2 {
    font-size: 12px;
  }
  .service-status {
    font-size: 10px;
    gap: 2px;
  }
  .service-status > span {
    font-size: 9px;
  }
  .review-hint {
    font-size: 10px;
  }
  .onboarding-actions {
    flex-wrap: wrap;
  }
  dialog {
    padding: 22px;
  }
  #toast {
    bottom: 80px;
  }
  .login {
    padding-bottom: 40px;
  }
  .empty {
    padding: 45px 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Keep controls usable on touch screens without adding interface chrome. */
.subject-copy {
  min-width: 0;
}
.subject-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subject-icon svg {
  width: 19px;
  height: 19px;
}
.icon-button {
  min-width: 32px;
}
body:has(dialog[open]) {
  overflow: hidden;
}
@media (max-width: 700px) {
  .page-title {
    flex-wrap: wrap;
  }
  .page-title h1 {
    min-width: 0;
  }
  .title-actions {
    flex-wrap: wrap;
    margin-left: auto;
  }
  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .btn {
    min-height: 40px;
  }
  .btn.small {
    min-height: 36px;
    font-size: 11px;
  }
  .btn.close {
    min-width: 36px;
    min-height: 36px;
  }
  .page-title .btn {
    min-height: 38px;
    font-size: 11px;
  }
  .sidebar nav button {
    line-height: 12px;
  }
  .stats span {
    font-size: 10px;
  }
  .subject-copy small {
    font-size: 10px;
  }
  .due-count small {
    font-size: 9px;
  }
  .question-meta {
    font-size: 10px;
  }
  .tabs button {
    min-height: 40px;
  }
  .card-media figcaption {
    font-size: 10px;
  }
  .card-media figcaption > div {
    flex-wrap: wrap;
  }
  .rating-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .rating-buttons button {
    min-height: 44px;
    font-size: 14px;
  }
  .rating-labels {
    font-size: 10px;
  }
  .login {
    min-height: 100dvh;
  }
  #toast {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 360px) {
  .subject-grid {
    grid-template-columns: 1fr;
  }
  .page-title .title-actions {
    width: 100%;
    margin-left: 0;
  }
  .page-title .title-actions .btn {
    flex: 1;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

.rating-buttons button {
  min-height: 76px;
  padding: 12px 5px;
  cursor: pointer;
}
.rating-buttons strong {
  display: block;
  font-size: 20px;
  line-height: 1.3;
}
.rating-buttons span {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
}
.check-setting {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #c4cdd8;
  cursor: pointer;
}
.check-setting input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  flex: 0 0 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}
.check-setting small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin-top: 5px;
}
.settings-form {
  max-width: 850px;
}
.settings-form .settings-block label {
  margin-top: 18px;
}
.settings-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.settings-form .form-row > label {
  min-width: 0;
  flex: 1;
}
.settings-block > summary {
  font-size: 14px;
  padding: 3px 0;
}
.settings-block[open] > summary {
  margin-bottom: 22px;
}
.settings-block summary .status {
  margin-left: 10px;
  font-size: 10px;
}
.settings-save {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  margin: 8px 0 30px;
}
.settings-save .dialog-error {
  margin-right: auto;
}
.practice-settings {
  flex-wrap: wrap;
}
.practice-settings .check-setting {
  flex: 1 1 180px;
  min-height: 39px;
}
html[data-text-size="large"] .flashcard h1 {
  font-size: 32px;
}
html[data-text-size="large"] .flashcard .answer,
html[data-text-size="large"] .question-item .answer {
  font-size: 18px;
  line-height: 1.8;
}
html[data-text-size="large"] .question-item h2 {
  font-size: 22px;
}
html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 640px) {
  .settings-save {
    align-items: stretch;
    flex-direction: column;
  }
  .settings-save .btn {
    width: 100%;
  }
  .check-setting small {
    font-size: 12px;
  }
  html[data-text-size="large"] .flashcard h1 {
    font-size: 28px;
  }
}
