/* Headword: a card catalog on a steel desk, after hours. */

:root {
  color-scheme: dark;
  --desk: #192024;
  --desk-deep: #131a1d;
  --desk-line: #2f3a3f;
  --card: #242b33;
  --rule: #34425a;
  --red: #df5d75;
  --red-text: #f08a9d;
  --ink: #e6e7e1;
  --ink-soft: #a2aab0;
  --ok: #62c08f;

  --type: "Courier Prime", "Courier New", monospace;
  --ui: "Schibsted Grotesk", system-ui, sans-serif;

  /* One ruled line on a card. All card text sits on this rhythm. */
  --line: 30px;
  /* Distance from the top of a line of card text to the rule under it. */
  --rule-at: 24px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 26px -12px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--desk);
  color: var(--ink);
  font: 400 16px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--card);
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

.noscript {
  max-width: 1180px;
  margin: 40px auto;
  padding: 0 32px;
}

/* Top bar ----------------------------------------------------------------- */

.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 32px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  font: 700 22px/1 var(--type);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--red);
}

#nav {
  display: flex;
  gap: 4px;
}

#nav[hidden] {
  display: none;
}

#nav button {
  border: 0;
  background: none;
  padding: 6px 12px;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: 3px;
}

#nav button:hover {
  color: var(--ink);
  background: rgba(230, 231, 225, 0.07);
}

#nav button[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--ink);
  border-radius: 0;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 32px 96px;
}

main:focus {
  outline: none;
}

.page-title {
  font: 700 clamp(28px, 3.2vw, 36px) / 1.15 var(--ui);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

p {
  max-width: 62ch;
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: 600 15px/1.2 var(--ui);
  text-decoration: none;
  transition: background-color 120ms, color 120ms, transform 80ms;
}

.btn:hover {
  background: rgba(230, 231, 225, 0.08);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--card);
}

.btn-primary:hover {
  background: #c9ccc3;
}

.btn-quiet {
  border-color: transparent;
  padding-inline: 0;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.btn-quiet:hover {
  background: none;
  color: var(--ink);
}

.btn-danger {
  border-color: var(--red-text);
  color: var(--red-text);
}

.btn-small {
  min-height: 34px;
  padding: 4px 14px;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 24px;
}

/* The card ------------------------------------------------------------------ */

.card {
  position: relative;
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: 3px;
  font-family: var(--type);
  font-size: 17px;
  color: var(--ink);
}

/* The punch hole for the drawer rod. */
.card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--desk);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 30px 12px;
  border-bottom: 2px solid var(--red);
}

.hw {
  font: 700 clamp(30px, 4vw, 40px) / 1.1 var(--type);
  letter-spacing: -0.01em;
  min-height: 1.1em;
  overflow-wrap: anywhere;
}

.caret {
  display: inline-block;
  width: 0.55em;
  height: 0.12em;
  margin-left: 2px;
  background: var(--red);
  vertical-align: baseline;
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.card-corner {
  flex: none;
  font-size: 14px;
  color: var(--ink-soft);
}

.card-body {
  padding: calc(var(--line) - var(--rule-at)) 30px calc(var(--line) * 1.5);
  line-height: var(--line);
  /* The first rule lands one line below the red rule, like a real card.
     The top layer covers the repeat that would sit right under the red rule. */
  background-image: linear-gradient(var(--card), var(--card)),
    linear-gradient(to bottom, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px));
  background-size: 100% 4px, 100% var(--line);
  background-position: 0 0, 0 1px;
  background-repeat: no-repeat, repeat;
}

.card-body p {
  max-width: none;
}

.gap {
  margin-top: var(--line);
}

.gap-top {
  margin-top: 24px;
}

.pron {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 16px;
}

.pron > * {
  min-height: var(--line);
  display: inline-flex;
  align-items: center;
}

.pos {
  font-style: italic;
}

.ipa {
  font-family: "Charis SIL", "Doulos SIL", "Gentium Plus", "Segoe UI", "Lucida Sans Unicode", sans-serif;
  font-size: 16px;
  color: var(--ink-soft);
}

.resp {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.say-btns {
  gap: 6px;
}

.say {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px 0 7px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: 500 13px/1 var(--ui);
}

.say:hover {
  border-color: var(--ink);
}

.say:active {
  transform: translateY(1px);
}

.say-inline {
  height: 22px;
  width: 26px;
  padding: 0;
  justify-content: center;
  vertical-align: -4px;
  margin-left: 4px;
}

.say-big {
  height: 26px;
  padding: 0 14px 0 11px;
  border-radius: 15px;
  font-size: 14px;
  border-color: var(--ink);
}

.listen-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.def {
  font-size: 18px;
}

.ex mark,
.opt-text mark {
  background: none;
  color: inherit;
  font-weight: 700;
}

.lbl {
  font-style: italic;
  color: var(--ink-soft);
}

.note {
  color: var(--ink-soft);
}

.mine {
  border-left: 3px solid var(--red);
  margin-left: -15px;
  padding-left: 12px;
}

.hint {
  color: var(--ink-soft);
  font-style: italic;
}

.blank {
  display: inline-block;
  width: 7.5em;
  height: 1em;
  vertical-align: -3px;
  border-bottom: 2px solid var(--ink);
}

/* Cards stacked behind the current one, one edge per remaining card. */
.stack {
  position: relative;
}

.stack::before,
.stack::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.stack::before {
  transform: translate(7px, 7px);
  opacity: 0.75;
}

.stack::after {
  transform: translate(14px, 14px);
  opacity: 0.5;
}

.stack > .card {
  z-index: 1;
}

.stage[data-depth="1"] .stack::after,
.stage[data-depth="0"] .stack::after,
.stage[data-depth="0"] .stack::before {
  display: none;
}

.stage.arrive .card {
  animation: arrive 320ms var(--ease) both;
}

@keyframes arrive {
  from {
    transform: translate(10px, 12px);
  }
  to {
    transform: none;
  }
}

.card.is-filing {
  transition: transform 240ms ease-in, opacity 240ms ease-in;
  transform: translate(60px, -14px) rotate(2.5deg);
  opacity: 0;
}

/* Fields ------------------------------------------------------------------- */

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-weight: 600;
  font-size: 15px;
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1.5px solid var(--desk-line);
  border-radius: 4px;
  background: var(--card);
  line-height: 1.4;
}

.input:hover {
  border-color: var(--ink-soft);
}

.input[aria-invalid="true"] {
  border-color: var(--red-text);
}

textarea.input {
  resize: vertical;
}

select.input {
  padding-right: 32px;
}

.help {
  font-size: 14px;
  color: var(--ink-soft);
}

.error {
  font-size: 14px;
  font-weight: 600;
  color: var(--red-text);
}

.error:empty {
  display: none;
}

/* A writing slip: ruled like a card so a sentence lands on the lines. */
.area {
  display: block;
  width: 100%;
  padding: 0 14px;
  border: 1.5px solid var(--desk-line);
  border-radius: 3px;
  font: 17px/var(--line) var(--type);
  background-color: var(--card);
  background-image: linear-gradient(to bottom, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px));
  background-size: 100% var(--line);
  background-position: 0 calc(var(--rule-at) + 1px - var(--line));
  background-attachment: local;
  resize: vertical;
}

.area:focus-visible {
  border-color: var(--ink);
  outline-offset: 1px;
}

.card .area {
  margin-left: -12px;
  padding: 0 10px;
  border-width: 0 0 0 2px;
  border-color: var(--red);
  border-radius: 0;
  background-color: transparent;
  background-image: none;
}

.card .area:focus-visible {
  outline: none;
  border-left-color: var(--ink);
  background-color: rgba(223, 93, 117, 0.07);
}

.own {
  margin-top: 28px;
}

.own .field label {
  font-size: 16px;
}

/* Typed answers, inside the card, one ruled line tall. */
.typed {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0 12px;
}

/* The underline doubles as the ruled line it sits on. */
.typed-input {
  flex: 1 1 200px;
  height: calc(var(--rule-at) + 1px);
  margin-bottom: calc(var(--line) - var(--rule-at) - 1px);
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background: transparent;
  font: 700 19px/1 var(--type);
}

.typed-input:focus-visible {
  outline: none;
  border-bottom-color: var(--red);
  background: rgba(223, 93, 117, 0.08);
}

.card-body .btn {
  min-height: 0;
  height: calc(var(--line) - 2px);
  padding: 0 12px;
  font-size: 14px;
}

.card-body .btn-quiet {
  padding-inline: 0;
}

.typed-more {
  display: flex;
  gap: 20px;
  flex-basis: 100%;
  margin-top: calc(var(--line) * 0.5 - 1px);
}

.card-body .error {
  flex-basis: 100%;
  line-height: var(--line);
  font-family: var(--ui);
}

/* Options ------------------------------------------------------------------ */

.prompt {
  font-weight: 600;
  font-size: 17px;
  margin-bottom: 16px;
}

.step {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.options {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.options-words {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
  width: 100%;
  padding: 12px 16px 12px 12px;
  border: 1.5px solid transparent;
  border-radius: 4px;
  background: rgba(36, 43, 51, 0.72);
  text-align: left;
  font-size: 16px;
  line-height: 1.45;
  transition: background-color 120ms, border-color 120ms;
}

.option:hover:not([disabled]) {
  background: var(--card);
  border-color: var(--ink);
}

.option:active:not([disabled]) {
  transform: translateY(1px);
}

.options-words .option {
  font: 700 18px/1.3 var(--type);
  align-items: center;
}

.key {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--desk-line);
  border-radius: 3px;
  font: 600 13px/1 var(--ui);
  color: var(--ink-soft);
}

.option[disabled] {
  cursor: default;
}

.option.is-correct {
  background: var(--card);
  border-color: var(--ok);
}

.option.is-correct .key {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--card);
}

.option.is-wrong {
  border-color: var(--red-text);
}

.option.is-wrong .opt-text {
  text-decoration: line-through;
  text-decoration-color: var(--red);
}

.option.is-wrong .key {
  background: var(--red-text);
  border-color: var(--red-text);
  color: var(--card);
}

.option.is-dim {
  opacity: 0.5;
}

.feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 24px;
  padding: 14px 0 0;
  border-top: 1.5px solid var(--desk-line);
}

.verdict {
  font-weight: 600;
  font-size: 17px;
  max-width: 46ch;
}

.feedback.ok .verdict {
  color: var(--ok);
}

.verdict-line.ok {
  color: var(--ok);
}

/* Placement ---------------------------------------------------------------- */

.placement {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 56px;
  align-items: start;
}

.placement-intro {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 14px;
  justify-items: start;
}

.placement-go {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1.5px solid var(--desk-line);
  width: 100%;
}

.count {
  font-weight: 600;
  min-width: 6.5em;
}

.slips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 10px;
}

.slip {
  position: relative;
  width: 100%;
  min-height: 52px;
  padding: 12px 34px 12px 14px;
  border: 1.5px solid transparent;
  border-radius: 3px;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  text-align: left;
  font: 400 16px/1.2 var(--type);
  overflow-wrap: anywhere;
  transition: border-color 120ms, transform 120ms var(--ease);
}

.slip:hover {
  border-color: var(--desk-line);
}

.slip[aria-pressed="true"] {
  border-color: var(--ink);
  font-weight: 700;
}

/* A red tick, drawn rather than typed. */
.slip[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 13px;
  margin-top: -9px;
  border: solid var(--red);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(40deg);
}

.solo {
  max-width: 680px;
}

/* Placement result */

.result {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 64px;
  align-items: start;
}

.result-head {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.level-name {
  font: 700 clamp(44px, 6vw, 64px) / 1 var(--type);
  letter-spacing: -0.02em;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--red);
}

.fine {
  font-size: 14px;
  color: var(--ink-soft);
}

.result-bands {
  display: grid;
  gap: 22px;
}

.band-row {
  padding-top: 14px;
  border-top: 1.5px solid var(--desk-line);
}

.band-row h3 {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}

.band-row h3 span {
  font-weight: 400;
  color: var(--ink-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 3px;
  font: 400 15px/1.4 var(--type);
}

.chip-known {
  background: var(--card);
  font-weight: 700;
}

.chip-missed {
  background: var(--card);
  color: var(--red-text);
  text-decoration: line-through;
}

.chip-unticked {
  border: 1px dashed var(--desk-line);
  color: var(--ink-soft);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: none;
}

.legend .chip {
  font-size: 13px;
}

/* Home --------------------------------------------------------------------- */

.home {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 72px;
  align-items: start;
}

.today-card .card-body {
  font-size: 19px;
  min-height: calc(var(--line) * 6);
}

.home-side {
  display: grid;
  gap: 36px;
  padding-top: 4px;
}

.side-block h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.side-note {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* Drawer fronts: a label holder on the steel. */
.drawers {
  display: grid;
  gap: 6px;
}

.drawer {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 8px 14px 8px 8px;
  border: 0;
  border-radius: 3px;
  background: var(--desk-deep);
  box-shadow: inset 0 -2px 0 var(--desk-line);
  text-align: left;
  transition: background-color 120ms;
}

.drawer:hover {
  background: #1d2529;
}

.drawer-name {
  padding: 4px 8px;
  background: var(--card);
  border: 1px solid var(--desk-line);
  font: 700 14px/1.3 var(--type);
  text-align: center;
}

.drawer-count {
  font-size: 14px;
  color: var(--ink);
}

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-width: 300px;
}

.week li {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.week .mark {
  width: 100%;
  height: 28px;
  border-radius: 2px;
  border: 1.5px solid var(--desk-line);
}

.week .did .mark {
  background: var(--ink);
  border-color: var(--ink);
}

.week .today .mark {
  box-shadow: 0 0 0 2px var(--desk), 0 0 0 3.5px var(--red);
}

.week .day {
  font-size: 13px;
  color: var(--ink-soft);
}

.coming li {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--desk-line);
  font-size: 15px;
}

.coming li span:last-child {
  font-weight: 600;
}

/* Pocket */

.pocket {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1.5px solid var(--desk-line);
}

.pocket h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pocket > p {
  color: var(--ink-soft);
}

.pocket-words {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 4px;
}

.pocket-word {
  display: inline-block;
  padding: 8px 14px;
  border: 1.5px solid transparent;
  border-radius: 3px;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  font: 700 18px/1.2 var(--type);
}

button.pocket-word:hover {
  border-color: var(--ink);
}

.pocket-word[aria-pressed="true"] {
  border-color: var(--ok);
  color: var(--ok);
}

.pocket .btn {
  margin-top: 14px;
}

/* Session ------------------------------------------------------------------ */

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 680px;
  margin: -16px 0 20px;
}

.session-bar .btn-quiet {
  padding-left: 0;
}

.left {
  font-size: 14px;
  color: var(--ink-soft);
}

.session-grid {
  display: grid;
  grid-template-columns: minmax(0, 680px) minmax(180px, 1fr);
  gap: 72px;
  align-items: start;
}

.tray {
  position: sticky;
  top: 24px;
  padding-top: 40px;
}

.tray h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.tray-list {
  display: grid;
  gap: 4px;
}

.tray-list li {
  padding: 6px 10px;
  border-left: 3px solid var(--ok);
  background: rgba(36, 43, 51, 0.7);
  font: 700 15px/1.3 var(--type);
}

.tray-list li.latest {
  animation: drop-in 300ms var(--ease) both;
}

@keyframes drop-in {
  from {
    transform: translateX(-16px);
    opacity: 0;
  }
}

/* Summary */

.summary {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 72px;
  align-items: start;
}

.summary .pocket {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.sum-list {
  margin-top: 24px;
  border-top: 1.5px solid var(--desk-line);
}

.sum-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--desk-line);
}

.sum-word {
  font: 700 17px/1.3 var(--type);
}

.sum-tag {
  font-size: 14px;
  color: var(--ink-soft);
}

.sum-when {
  font-size: 14px;
  min-width: 9em;
  text-align: right;
}

/* Catalog ------------------------------------------------------------------ */

.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
}

.catalog-head p {
  color: var(--ink-soft);
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: 16px 28px;
  align-items: end;
  margin-bottom: 36px;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.seg button {
  min-height: 40px;
  padding: 6px 13px;
  border: 1.5px solid transparent;
  border-radius: 4px;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
}

.seg button:hover {
  color: var(--ink);
  border-color: var(--desk-line);
}

.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--card);
  border-color: var(--ink);
}

.drawer-group {
  margin-bottom: 40px;
  scroll-margin-top: 24px;
}

.drawer-label {
  display: inline-flex;
  gap: 12px;
  align-items: baseline;
  padding: 6px 14px;
  margin-bottom: 10px;
  background: var(--card);
  border: 1px solid var(--desk-line);
  font: 700 16px/1.3 var(--type);
}

.drawer-label span {
  font-weight: 400;
  color: var(--ink-soft);
}

.entries {
  background: var(--card);
  border-radius: 3px;
  box-shadow: var(--shadow);
}

.entry {
  display: grid;
  grid-template-columns: minmax(150px, 2fr) minmax(0, 6fr) 88px;
  gap: 20px;
  align-items: baseline;
  width: 100%;
  padding: 11px 20px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  text-align: left;
}

.entries li:last-child .entry {
  border-bottom: 0;
}

.entry:hover {
  background: #2a323b;
}

.e-word {
  font: 700 17px/1.3 var(--type);
}

.e-def {
  font-size: 15px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.e-status {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.st-new {
  color: var(--ink-soft);
  font-weight: 400;
}

.st-learning {
  color: var(--red-text);
}

.st-filed,
.st-mastered {
  color: var(--ok);
}

.empty {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 32px 0;
}

.add-form {
  margin-bottom: 36px;
  padding: 24px 28px 28px;
  background: var(--desk-deep);
  border-radius: 4px;
}

.add-form h2 {
  font-size: 18px;
  margin-bottom: 18px;
}

.add-grid {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 18px 24px;
}

.add-grid .field:nth-child(n + 3) {
  grid-column: 1 / -1;
}

.add-form .actions {
  margin-top: 20px;
}

/* Word dialog -------------------------------------------------------------- */

dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100svh - 48px);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--desk);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--desk-line), 0 30px 60px -20px rgba(0, 0, 0, 0.8);
}

dialog::backdrop {
  background: rgba(8, 11, 13, 0.72);
}

.dialog-inner {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 32px;
  padding: 28px;
}

.dialog-panel {
  display: grid;
  gap: 20px;
  align-content: start;
}

.dialog-panel .actions {
  margin-top: 0;
}

.dialog-panel .field .actions {
  margin-top: 6px;
}

.saved {
  font-size: 14px;
  color: var(--ok);
  font-weight: 600;
}

/* Settings ----------------------------------------------------------------- */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 64px;
  margin-top: 28px;
  max-width: 960px;
}

.settings-grid > section {
  display: grid;
  gap: 16px;
  align-content: start;
  padding-top: 16px;
  border-top: 1.5px solid var(--desk-line);
}

.settings-grid h2 {
  font-size: 18px;
}

.settings-grid .actions {
  margin-top: 0;
}

.settings-grid .field .input {
  max-width: 360px;
}

/* Small screens ------------------------------------------------------------ */

@media (max-width: 760px) {
  :root {
  color-scheme: dark;
    --line: 28px;
  }

  .topbar {
    padding: 16px 18px 0;
  }

  main {
    padding: 28px 18px 72px;
  }

  #nav button {
    padding: 6px 8px;
  }

  .card {
    font-size: 16px;
  }

  .card-head,
  .card-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .placement,
  .result,
  .home,
  .session-grid,
  .summary,
  .dialog-inner,
  .settings-grid,
  .catalog-tools,
  .add-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .placement-intro,
  .tray {
    position: static;
  }

  .tray {
    padding-top: 0;
  }

  .slips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .slip {
    padding-right: 28px;
    font-size: 15px;
  }

  .slip[aria-pressed="true"]::after {
    right: 11px;
  }

  .options-words {
    grid-template-columns: minmax(0, 1fr);
  }

  .entry {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
  }

  .e-def {
    grid-column: 1 / -1;
    grid-row: 2;
    white-space: normal;
  }

  .catalog-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .dialog-inner {
    padding: 18px;
  }

  .sum-list li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sum-tag {
    grid-row: 2;
  }

  .stack::before,
  .stack::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
