:root {
  color-scheme: light;
  --paper: #f7f5ed;
  --white: #fffefa;
  --ink: #1e271f;
  --muted: #536153;
  --line: #d6dcd0;
  --line-strong: #b8c4b5;
  --forest: #24533a;
  --forest-hover: #193f2b;
  --wash: #e9efdf;
  --lime: #d9ee96;
  --red: #a53835;
  --ease: cubic-bezier(.22, 1, .36, 1);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.5; min-height: 100dvh; }
a { color: var(--forest); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2.5px solid #4c7c41; outline-offset: 2px; }
h1, h2, p { margin: 0; }
h1, h2 { letter-spacing: -.04em; line-height: 1.1; text-wrap: balance; }
h2 { font-size: 1.55rem; }
img { display: block; }
button, input, select { font: inherit; }
.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid transparent; border-radius: .6rem; cursor: pointer;
  background: var(--forest); color: #fff; font-size: .9rem; font-weight: 620;
  padding: .6rem 1.05rem; min-height: 44px; text-decoration: none;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease),
    transform 90ms var(--ease), opacity 150ms var(--ease);
}
.button:hover, button:hover { background: var(--forest-hover); }
.button:active, button:not(:disabled):active { transform: scale(.98); }
button[aria-busy="true"], button:disabled { opacity: .52; cursor: default; transform: none; }
button.secondary, .button.secondary { color: var(--ink); border-color: var(--line); background: var(--white); }
button.secondary:hover, .button.secondary:hover { background: var(--wash); border-color: var(--line-strong); }
button.text-button {
  min-height: 32px; padding: .2rem .1rem; display: inline-flex; align-items: center;
  color: var(--forest); background: transparent; border: 0; font-size: .85rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}
button.text-button:hover { background: transparent; text-decoration-thickness: 2px; }
button.muted-action { color: var(--muted); }
button.muted-action:hover { color: var(--red); }
kbd {
  display: inline-flex; align-items: center; padding: .15rem .42rem;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: .35rem;
  color: var(--ink); background: var(--white); font: 500 .8em/1.25 ui-monospace, SFMono-Regular, monospace;
  white-space: nowrap;
}
kbd.kbd-warn { border-color: #dfb4b2; background: #fdf3f2; color: var(--red); }
.muted { color: var(--muted); }
.count { font-size: .86rem; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.logo { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.35rem; font-weight: 760; color: var(--ink); text-decoration: none; letter-spacing: -.05em; }
.logo img { inline-size: 32px; block-size: 32px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }

.settings-page { max-width: 660px; margin: 0 auto; padding: 26px 24px max(36px, env(safe-area-inset-bottom)); }
.settings-page > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 1rem; font-size: .92rem; }
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: 14px; }
.settings-page h1 { font-size: clamp(1.85rem, 4.2vw, 2.35rem); }
.settings-page h2 { font-size: 1.08rem; letter-spacing: -.02em; }
.save-badge {
  font-size: .78rem; font-weight: 600; color: #7a4b10; background: #fbf1de;
  border: 1px solid #ead4aa; border-radius: 999px; padding: .15rem .58rem;
}
.panel {
  padding: 20px 22px 18px; background: var(--white); border: 1px solid var(--line);
  border-radius: 1rem; box-shadow: 0 1px 2px rgba(20, 35, 24, .04);
}
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: .86rem; font-weight: 680; padding: 0; color: var(--ink); }
.providers {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  margin: .45rem 0 1rem; padding: 4px; background: var(--paper);
  border: 1px solid var(--line); border-radius: .75rem;
}
.providers label { position: relative; text-align: center; font-weight: 620; font-size: .9rem; cursor: pointer; }
.providers input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.providers span {
  display: flex; align-items: center; justify-content: center; min-height: 38px;
  padding: .4rem .35rem; border-radius: .5rem; color: var(--muted);
  transition: background-color 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.providers label:hover span { color: var(--ink); }
.providers input:checked + span {
  background: var(--white); color: var(--forest);
  box-shadow: 0 1px 3px rgba(20, 35, 24, .1), 0 0 0 1px rgba(36, 83, 58, .18);
}
.providers input:focus-visible + span { outline: 2.5px solid #4c7c41; outline-offset: 1px; }
.field { margin: .82rem 0; }
.field label, .field .label-row { display: block; font-size: .86rem; font-weight: 680; margin-bottom: .3rem; }
.field .label-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.field .label-row label { margin-bottom: 0; }
.field-link { font-size: .82rem; font-weight: 550; }
.field input, .field select, .quiz select {
  width: 100%; min-height: 44px; padding: .5rem .72rem; border: 1px solid var(--line-strong);
  border-radius: .55rem; color: var(--ink); background: var(--white); font-size: .93rem;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.field input:hover, .field select:hover { border-color: #8ea18c; }
.field input:focus, .field select:focus { border-color: var(--forest); outline: none; box-shadow: 0 0 0 3px rgba(36, 83, 58, .14); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { padding-right: 4.1rem; }
.input-toggle {
  position: absolute; right: 5px; min-height: 34px; padding: 0 .55rem;
  background: transparent; border: 0; border-radius: .4rem;
  color: var(--muted); font-size: .8rem; font-weight: 600;
}
.input-toggle:hover { background: var(--paper); color: var(--ink); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.field-grid .field { margin: .6rem 0 .85rem; }
#thinking-field[hidden] + .field { grid-column: 1 / -1; }
#message { margin-top: .72rem; min-height: 1.35rem; font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
#message.success { color: var(--forest); font-weight: 620; }
#message.error { color: var(--red); font-weight: 560; }
.study-tools { display: grid; gap: .95rem; margin-top: 1.25rem; }
.study-tools section { border-top: 1px solid var(--line); padding: .95rem 0 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.shortcuts { display: flex; gap: .55rem 1.25rem; flex-wrap: wrap; margin-top: .6rem; font-size: .88rem; color: var(--muted); }
.shortcuts span { display: inline-flex; align-items: center; gap: .42rem; }

.site { max-width: 1100px; margin: auto; padding: 27px 30px 56px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.site-header nav { display: flex; gap: 1.15rem; font-size: .91rem; }
.hero { display: grid; grid-template-columns: 1.08fr .92fr; gap: 2.8rem; align-items: center; margin: clamp(3.2rem, 9vw, 7rem) 0 4rem; }
.hero h1 { font-size: clamp(3.2rem, 6.5vw, 5.6rem); max-width: 11ch; }
.hero-copy p { max-width: 39ch; font-size: 1.08rem; color: var(--muted); margin: 1.2rem 0 1.45rem; }
.practice { background: var(--wash); padding: 1.45rem; border-radius: 1.3rem; }
.practice > div { border-radius: .85rem; background: var(--white); padding: clamp(1rem, 3vw, 1.65rem); }
.practice legend { font-size: 1.3rem; letter-spacing: -.032em; margin-bottom: .65rem; line-height: 1.25; }
.practice label, .quiz label { display: flex; cursor: pointer; align-items: center; gap: .55rem; padding: .48rem .62rem; border-radius: .45rem; }
.practice label:has(input:checked), .quiz label:has(input:checked) { background: var(--wash); }
.practice input, .quiz input { accent-color: var(--forest); }
.practice button { margin-top: .9rem; }
.answer { margin-top: .65rem; color: var(--forest); font-size: .9rem; }
.practice .correct { background: var(--lime); color: #213419; }
.install { border-top: 1px solid var(--line); padding-top: 1.6rem; }
.install ol { padding-left: 1.25rem; }
.install li { padding: .15rem .2rem; }
.site-footer { margin-top: 2rem; padding-top: 1.35rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.quiz { max-width: 740px; padding-block: 20px 44px; }
.quiz h1 { margin: 1.4rem 0 .4rem; font-size: clamp(2.15rem, 5vw, 3.1rem); }
.quiz .panel { margin-top: .75rem; padding: 16px 20px; }
.quiz .qtext { margin-bottom: .38rem; font-weight: 680; }
.quiz .ablock > label { max-width: 26rem; padding-block: .36rem; }
.quiz select { width: auto; min-height: 36px; padding-block: .27rem; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; margin: 3.1rem 0 2.6rem; }
  .site { padding-inline: 20px; }
}
@media (max-width: 520px) {
  .settings-page { padding: 18px 16px max(28px, env(safe-area-inset-bottom)); }
  .panel { padding: 16px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .panel .actions { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
