/* Cards: a desk and a ruled index card. Quiet grey-green page, and one object with character: the card you study
   is a real index card, red line on top, blue rules below. */
:root { --page: #eef1ee; --card: #ffffff; --ink: #1c2622; --soft: #56635d; --line: #d3dad5; --field: #f1f4f2; --act: #4d6b10; --on-act: #ffffff; --stop: #b3261e;
  --paper: #fffdf6; --paper-ink: #1d1b16; --rule: #b9d4ec; --red-rule: #e0787a; color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --page: #121614; --card: #1b211e; --ink: #edf2ee; --soft: #a3b0a9; --line: #2e3833; --field: #121614; --act: #b5d66a; --on-act: #141c05; --stop: #ff8a80; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 17px/1.5 "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
main { max-width: 640px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom)); display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
section { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--act); outline-offset: 2px; }
h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.home { all: unset; cursor: pointer; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.home:focus-visible { outline: 3px solid var(--act); outline-offset: 2px; }
h2 { font-size: clamp(26px, 6vw, 36px); line-height: 1.1; letter-spacing: -0.02em; margin: 0; overflow-wrap: anywhere; }
h3 { font-size: 18px; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
.lead { font-size: 20px; line-height: 1.4; max-width: 44ch; }
.counts { color: var(--soft); }
.hint { color: var(--soft); font-size: 15px; }
.note { color: var(--act); font-weight: 600; } .note:empty { display: none; }

.row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.grow { flex: 1 1 200px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 15px; min-width: 0; }
input:not([type="checkbox"]), textarea { width: 100%; min-height: 46px; border: 0; border-bottom: 2px solid var(--ink); border-radius: 4px 4px 0 0; background: var(--field); padding: 10px; font-size: 16px; font-weight: 400; }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 16px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--act); }
button { cursor: pointer; border: 0; border-radius: 999px; min-height: 48px; padding: 0 22px; font-weight: 700; background: var(--act); color: var(--on-act); }
button:disabled { opacity: .5; cursor: default; }
.quiet { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.small { min-height: 44px; padding: 0 14px; font-size: 14px; font-weight: 600; border-color: var(--line); }
.danger { border-color: var(--stop); color: var(--stop); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 12px; }
.card button { justify-self: start; }
summary { font-weight: 700; cursor: pointer; min-height: 32px; }

.decks, .list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.decks button { width: 100%; text-align: left; display: grid; gap: 2px; padding: 14px 16px; border-radius: 10px; background: var(--card); color: var(--ink); border: 1px solid var(--line); font-weight: 400; }
.decks b { font-size: 20px; overflow-wrap: anywhere; }
.decks span { color: var(--soft); font-size: 15px; }
.decks .due button { border-left: 6px solid var(--act); }
.list { gap: 0; }
.list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.list .ans { color: var(--soft); }

/* The index card */
.index-card { background-color: var(--paper); color: var(--paper-ink); border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 10px 24px rgba(0,0,0,.12); min-height: 250px; padding: 46px 22px 22px;
  display: grid; align-content: center; gap: 14px; text-align: center;
  background-image: linear-gradient(var(--red-rule), var(--red-rule)), repeating-linear-gradient(to bottom, transparent 0 29px, var(--rule) 29px 30px);
  background-size: 100% 2px, 100% 100%; background-position: 0 34px, 0 36px; background-repeat: no-repeat, repeat; }
.side { font-size: clamp(24px, 6vw, 34px); line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.answer { font-weight: 400; border-top: 2px dashed #b7b2a2; padding-top: 14px; }
#show { justify-self: center; min-width: 220px; min-height: 54px; font-size: 18px; }
.grades { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grades button { min-height: 62px; padding: 6px 4px; border-radius: 12px; display: grid; gap: 0; align-content: center; background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); }
.grades small { font-weight: 400; font-size: 13px; color: var(--soft); }
.grades [data-grade="again"] { border-color: var(--stop); color: var(--stop); }
.grades [data-grade="good"] { background: var(--act); color: var(--on-act); border-color: var(--act); } .grades [data-grade="good"] small { color: inherit; opacity: .85; }
.done { display: grid; gap: 14px; justify-items: start; font-size: 20px; }

footer { font-size: 14px; color: var(--soft); }
footer a { display: inline-block; padding: 4px 0; }
.noscript { padding: 16px; }
.doc { max-width: 68ch; display: block; } .doc h1 { margin: 16px 0; } .doc h2 { font-size: 20px; margin: 24px 0 8px; } .doc p, .doc ul { margin: 0 0 12px; }
@media (max-width: 480px) { .list li { grid-template-columns: minmax(0, 1fr) auto; } .list .ans { grid-column: 1; grid-row: 2; } .list button { grid-row: 1 / 3; grid-column: 2; } }
@media (max-width: 760px), (pointer: coarse) { input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; } }
