:root {
  color-scheme: light;
  --paper: #f7f5ed;
  --ink: #272238;
  --quiet: #625c70;
  --edge: #ded7e9;
  --accent: #533783;
  --tint: #eee7fa;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
p, h1, h2 { margin: 0; }
.desk { width: min(100% - 32px, 640px); margin: 0 auto; padding: 41px 0 24px; }
.masthead { display: flex; align-items: center; gap: 13px; margin-bottom: 29px; }
.mark {
  display: grid;
  place-items: center;
  width: 51px;
  height: 51px;
  border-radius: 14px;
  font-size: 24px;
  font-weight: 800;
  background: var(--accent);
  color: white;
}
.brand { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 750; color: var(--accent); }
h1 { font-size: 26px; letter-spacing: -.035em; line-height: 1.15; }
.toolbar, .pack-picker, .card-top, .navigation { display: flex; align-items: center; }
.toolbar, .card-top, .navigation { justify-content: space-between; }
.toolbar { gap: 18px; margin-bottom: 12px; }
.pack-picker { gap: 8px; color: var(--quiet); font-size: 13px; font-weight: 650; }
.pack-picker select {
  min-height: 40px;
  max-width: 40vw;
  padding: 0 28px 0 10px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  color: var(--ink);
  background: #fffefa;
  font: inherit;
}
.progress { display: grid; gap: 4px; text-align: right; font-size: 12px; font-weight: 650; color: var(--quiet); }
progress { width: 122px; height: 6px; accent-color: var(--accent); }
.card {
  background: #fffefa;
  border: 1px solid var(--edge);
  border-radius: 22px;
  padding: 22px clamp(16px, 5vw, 32px) 24px;
  box-shadow: 0 8px 22px #2f214b0a;
}
.card-top { color: var(--quiet); font-size: 12px; font-weight: 700; }
#pack-name { background: var(--tint); color: #472d73; padding: 5px 9px; border-radius: 6px; }
#position { font-variant-numeric: tabular-nums; }
.word { text-align: center; padding: 24px 0; }
h2 { font-size: clamp(30px, 7.7vw, 60px); font-weight: 850; letter-spacing: -.065em; line-height: 1.18; text-wrap: balance; }
#pronunciation { margin-top: 6px; font-size: 15px; color: var(--accent); }
#meaning { margin-top: 9px; font-size: clamp(17px, 3.7vw, 21px); font-weight: 680; text-wrap: balance; }
.context { padding: 15px 17px; border-radius: 13px; background: #f4f1f8; line-height: 1.5; font-size: 14px; }
.context p + p { margin-top: 4px; }
#register { color: var(--accent); font-size: 12px; font-weight: 750; }
#example { font-weight: 720; margin-top: 11px; }
#translation, #polite-row { color: var(--quiet); }
#polite { font-weight: 650; }
.actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 16px; }
button {
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
button:disabled { opacity: .43; cursor: default; }
button:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.secondary { color: var(--accent); background: transparent; border-color: var(--edge); }
.secondary:hover:not(:disabled) { background: var(--tint); }
.reject { background: #f8e9e9; color: #7c2e41; border-color: #f0d1da; }
.reject[aria-pressed="true"], .reject:hover:not(:disabled) { background: #8e3850; color: white; }
.approve { background: var(--accent); color: white; }
.approve:hover:not(:disabled) { background: #412769; }
.approve[aria-pressed="true"], .reject[aria-pressed="true"] { box-shadow: inset 0 0 0 2px currentColor; }
.navigation { margin-top: 12px; gap: 6px; }
.navigation button { flex-shrink: 0; }
#status { font-size: 12px; color: var(--quiet); text-align: center; }
#comment-form { margin-top: 15px; }
#comment-form label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 6px; }
textarea {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid #a69ab7;
  border-radius: 9px;
  resize: vertical;
  font: inherit;
  color: var(--ink);
  background: #fffefa;
}
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
#retry { margin-top: 12px; }
.attribution, #source-row { color: var(--quiet); font-size: 12px; line-height: 1.5; }
.attribution { margin-top: 20px; }
.attribution a, #source-link { color: var(--accent); }

@media (max-width: 470px) {
  .desk { padding-top: 22px; }
  .masthead { margin-bottom: 19px; }
  .card { padding-top: 16px; }
  .word { padding: 19px 0; }
  .context { padding: 12px; }
  .actions button { padding-inline: 4px; }
}
