:root {
  color-scheme: dark;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  color: #e0e4df;
  background: #000;
  font-synthesis: none;
  --green: #8ba581;
  --muted: #90988f;
  --line: #282e28;
  --panel: #050605;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: linear-gradient(#10141066 1px, transparent 1px),
    linear-gradient(90deg, #10141066 1px, transparent 1px), #000;
  background-size: 48px 48px;
  min-height: 100vh;
}
button,
input {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}
button:disabled {
  cursor: default;
}
a {
  color: inherit;
}
::selection {
  background: var(--green);
  color: #000;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  border-bottom: 1px solid var(--line);
  background: #000;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #f4f6f2;
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.6px;
  white-space: nowrap;
}
.mark {
  color: var(--green);
  font-size: 19px;
  font-weight: 400;
}
.cursor {
  color: var(--green);
}
.edition {
  color: #7b857b;
  font-size: 12px;
  letter-spacing: 1.5px;
}
header button,
footer button {
  background: #000;
  border: 1px solid var(--line);
  padding: 10px 14px;
  min-height: 40px;
  font-size: 12px;
  letter-spacing: 0.5px;
}
header button:hover,
footer button:hover {
  border-color: var(--green);
  color: var(--green);
}
main {
  width: 100%;
  padding: 28px 32px 24px;
}
.play {
  width: 100%;
}
.session-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--green);
  font-size: 12px;
  letter-spacing: 1.5px;
  padding: 0 0 24px;
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #3b4639;
  background: #020302;
  padding: 8px 8px 8px 20px;
  transition: border-color 0.15s;
}
.searchbox:focus-within {
  border-color: var(--green);
}
.prompt {
  color: var(--green);
  font-size: 22px;
  white-space: nowrap;
}
.searchbox input {
  min-width: 0;
  width: 100%;
  flex: 1;
  background: transparent;
  color: #f2f5ef;
  border: 0;
  outline: none;
  font-size: 18px;
  padding: 14px 0;
}
.searchbox input::placeholder {
  color: #697267;
}
.searchbox button {
  background: var(--green);
  color: #071004;
  border: 1px solid var(--green);
  padding: 15px 26px;
  min-height: 50px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}
.searchbox button:hover {
  background: #a0b497;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.toolbar > div {
  display: flex;
  gap: 8px;
}
.toolbar button {
  background: #000;
  border: 1px solid var(--line);
  padding: 11px 16px;
  min-height: 44px;
  font-size: 12px;
  letter-spacing: 0.6px;
}
.toolbar button:hover:enabled {
  border-color: var(--green);
  color: var(--green);
}
.toolbar button:disabled {
  color: #525a51;
  border-color: #1c211c;
}
article {
  background: #030403;
  border: 1px solid #343d32;
  padding: 32px 36px;
  min-height: 360px;
  position: relative;
  overflow-wrap: anywhere;
}
article::before {
  content: '';
  position: absolute;
  left: -1px;
  top: -1px;
  width: 40px;
  height: 2px;
  background: var(--green);
}
.word-meta {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0 30px;
}
h2 {
  font-family: inherit;
  font-size: clamp(56px, 7vw, 104px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -5px;
  color: var(--green);
  margin: 0;
}
.entry-head h2 {
  text-shadow: none;
}
.sense {
  margin: 24px 0;
}
.pos {
  font-size: 12px;
  color: #919b8e;
  margin-bottom: 16px;
  line-height: 1.7;
}
.definition {
  font:
    400 clamp(22px, 2.2vw, 32px) / 1.8 'SFMono-Regular',
    Consolas,
    'Liberation Mono',
    monospace;
  margin: 0;
  color: #e1e8de;
}
.token {
  font: inherit;
  line-height: 1.45;
  padding: 1px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #515e49;
  color: inherit;
  transition:
    color 0.12s,
    background 0.12s;
}
.token:hover {
  color: var(--green);
  background: #12210d;
  border-color: var(--green);
}
.note {
  font-size: 14px;
  line-height: 1.8;
  color: #a0aa9a;
}
.sense-note {
  margin-top: 14px;
  font-size: 12px;
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}
.choices button,
.pill {
  border: 1px solid #48543f;
  background: #060806;
  padding: 12px 18px;
  min-height: 44px;
  font-size: 15px;
}
.choices button:hover,
.pill:hover {
  border-color: var(--green);
}
.sense-status {
  margin: 0 0 18px;
}
.journey {
  margin-top: 24px;
  border: 1px solid var(--line);
  background: #030403;
  padding: 20px 24px;
}
.journey-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #9ca596;
  font-size: 12px;
  letter-spacing: 1px;
}
#trail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
#trail button {
  background: #020302;
  border: 1px solid #30382c;
  padding: 8px 12px;
  font-size: 14px;
  color: #929f88;
  min-height: 36px;
}
#trail button.current {
  border-color: #7baa5b;
  color: var(--green);
  background: #0b1306;
}
#trail button:hover {
  border-color: var(--green);
  color: var(--green);
}
.challenge {
  display: flex;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--line);
  background: #030403;
  margin-top: 24px;
  padding: 24px;
}
.spark {
  font-size: 24px;
  color: var(--green);
  align-self: flex-start;
}
.challenge > div {
  flex: 1;
}
.challenge strong {
  font-size: 16px;
  font-weight: 500;
  color: #d2dfca;
}
.challenge p {
  font-size: 14px;
  line-height: 1.8;
  color: #9aa791;
  margin: 12px 0 0;
}
.challenge button {
  background: #000;
  border: 1px solid #4a5b40;
  padding: 14px 20px;
  min-height: 44px;
  color: #bdd3ad;
  font-size: 12px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.challenge button:hover {
  border-color: var(--green);
  color: var(--green);
}
#challengeStatus {
  font-size: 13px;
  line-height: 1.8;
  color: var(--green);
  max-width: 340px;
}
#challengeStatus:empty {
  display: none;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #1d241a;
  color: #8a9682;
  font-size: 12px;
}
.sentence-pair {
  display: block;
  margin: 0 0 0.8em;
}
.sentence-pair:last-child {
  margin-bottom: 0;
}
.sentence-es {
  display: block;
}
.english {
  display: block;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  letter-spacing: normal;
  line-height: 1.8;
  color: #909d87;
  margin-top: 7px;
  text-transform: none;
  cursor: inherit;
}
.definition .english {
  font-size: 15px;
  color: #a0ad96;
}
.note .english {
  font-size: 13px;
  color: #8e9e82;
}
dialog {
  background: #050705;
  color: #d9e2d3;
  border: 1px solid #698057;
  max-width: 760px;
  width: calc(100% - 32px);
  max-height: 86vh;
  padding: 28px;
}
dialog::backdrop {
  background: #000d;
}
dialog #close {
  float: right;
  border: 1px solid #425437;
  background: #000;
  padding: 10px 14px;
  color: #c5d9b6;
  font-size: 12px;
}
dialog h2 {
  font-size: 32px;
  letter-spacing: -1px;
  margin: 24px 0;
}
dialog p,
dialog li {
  font-size: 15px;
  line-height: 1.8;
}
dialog a {
  color: #b1d594;
  text-underline-offset: 4px;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 28px 0;
}
.stats strong {
  display: block;
  font-size: 32px;
  color: var(--green);
}
.stats span {
  font-size: 12px;
  color: #a0af94;
}
@media (max-width: 700px) {
  header {
    padding: 20px 16px;
    gap: 12px;
  }
  .brand {
    font-size: 16px;
    gap: 9px;
    letter-spacing: -0.7px;
  }
  .mark {
    font-size: 15px;
  }
  .edition {
    display: none;
  }
  header button {
    font-size: 11px;
    padding: 9px 10px;
  }
  main {
    padding: 22px 14px;
  }
  .session-strip {
    font-size: 11px;
    letter-spacing: 0.8px;
    padding-bottom: 22px;
  }
  label {
    font-size: 11px;
  }
  .searchbox {
    padding-left: 12px;
    gap: 10px;
  }
  .prompt {
    font-size: 18px;
  }
  .searchbox input {
    font-size: 16px;
    padding: 13px 0;
  }
  .searchbox button {
    font-size: 11px;
    padding: 14px 12px;
    min-height: 48px;
    letter-spacing: 0.5px;
  }
  .toolbar {
    margin: 12px 0;
    gap: 8px;
  }
  .toolbar > div {
    gap: 6px;
  }
  .toolbar button {
    font-size: 11px;
    padding: 10px 12px;
    letter-spacing: 0;
  }
  article {
    padding: 26px 20px;
    min-height: 300px;
  }
  h2 {
    font-size: clamp(46px, 15vw, 70px);
    letter-spacing: -3px;
  }
  .entry-head {
    margin: 20px 0 26px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .word-meta {
    font-size: 11px;
    letter-spacing: 0.7px;
  }
  .definition {
    font-size: 23px;
    line-height: 1.85;
  }
  .definition .english {
    font-size: 14px;
    line-height: 1.8;
  }
  .pos {
    font-size: 12px;
    margin-bottom: 12px;
  }
  .journey {
    padding: 18px;
  }
  .journey-title {
    font-size: 11px;
    letter-spacing: 0;
  }
  .challenge {
    padding: 20px 16px;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .challenge > div {
    flex: 1;
    min-width: 200px;
  }
  .challenge button {
    margin-left: 37px;
  }
  .challenge strong {
    font-size: 14px;
  }
  .challenge p {
    font-size: 13px;
  }
  .spark {
    font-size: 20px;
  }
  #challengeStatus {
    max-width: none;
    margin-left: 37px;
  }
  footer {
    gap: 16px;
    font-size: 11px;
  }
  dialog {
    padding: 22px;
  }
  dialog h2 {
    font-size: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.word-unit {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  vertical-align: baseline;
}
.word-unit > .token {
  max-width: 100%;
  white-space: normal;
}
.word-unit.has-punctuation > .token {
  max-width: calc(100% - var(--punct-width, 1ch));
}

.reading-options {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 22px;
  max-width: 100%;
}
.reading-options label {
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}
.reading-options select {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  border: 1px solid #394535;
  border-radius: 0;
  background: #070a06
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12' viewBox='0 0 16 12'%3E%3Cpath d='m3 4 5 5 5-5' fill='none' stroke='%238ba581' stroke-width='1.5'/%3E%3C/svg%3E")
    no-repeat right 16px center;
  color: #b9c3b4;
  padding: 12px 44px 12px 14px;
  font: inherit;
  font-size: 14px;
  text-overflow: ellipsis;
  cursor: pointer;
}
.reading-options select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.sense-status {
  font-size: 13px;
  color: #8f9d87;
}
.sense-status .english {
  font-size: 12px;
}
.form-note {
  margin: -14px 0 26px;
  padding: 10px 0 10px 14px;
  border-left: 2px solid #3f5a34;
  font-size: 15px;
  line-height: 1.6;
  color: #c9d5c1;
}
.form-note .sentence-pair {
  margin: 0 0 8px;
}
.form-note .sentence-pair:last-child {
  margin-bottom: 0;
}
.form-note .english {
  margin-top: 1px;
  font-size: 13px;
  color: #8e9e82;
}
.form-note .form-use {
  font-size: 13px;
  color: #9aa791;
}
.form-note .form-use .english {
  font-size: 12px;
  color: #7f8d76;
}
.form-note .form-main + .form-main {
  margin-top: 10px;
}
.lemma-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.lemma-link:hover {
  color: #d2f0c0;
}
@media (max-width: 700px) {
  .form-note {
    margin: -6px 0 22px;
    font-size: 14px;
  }
}
.nowrap {
  white-space: nowrap;
}

/* Search suggestions (custom combobox) */
.searchbox {
  position: relative;
}
#suggestions {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: -1px;
  right: -1px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  border: 1px solid var(--green);
  background: #020302;
  max-height: 320px;
  overflow-y: auto;
}
#suggestions li {
  padding: 10px 20px;
  cursor: pointer;
  color: #c9d5c1;
}
#suggestions li[aria-selected='true'],
#suggestions li:hover {
  background: #0f1a0c;
  color: var(--green);
}

/* Header actions and the English display toggle */
.header-actions {
  display: flex;
  gap: 8px;
}
body.english-tap .english:not(.revealed) {
  filter: blur(5px);
  cursor: pointer;
  user-select: none;
}
body.english-tap .english:not(.revealed):hover {
  filter: blur(3px);
}

/* Save button beside the headword */
.entry-head {
  align-items: baseline;
}
.save {
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  color: #9aa791;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  white-space: nowrap;
}
.save[aria-pressed='true'],
.save:hover {
  border-color: var(--green);
  color: var(--green);
}

/* Saved words and history controls */
.saved-words {
  margin-top: 12px;
}
#saved {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.saved-word {
  display: inline-flex;
  border: 1px solid var(--line);
}
.saved-word button {
  background: none;
  border: 0;
  padding: 8px 12px;
  color: #c9d5c1;
}
.saved-word button:hover {
  color: var(--green);
}
.saved-word .remove {
  border-left: 1px solid var(--line);
  color: #7f8d76;
}
.link-button {
  margin-top: 12px;
  background: none;
  border: 0;
  padding: 0;
  font-size: 12px;
  color: #7f8d76;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-button:hover {
  color: var(--green);
}
@media (max-width: 700px) {
  .header-actions button {
    font-size: 10px;
    padding: 8px;
  }
  .save {
    margin-left: 0;
  }
}

/* Spanish only: every English line and the English toggle are hidden (data is unchanged). */
.english,
#englishToggle {
  display: none !important;
}

/* Report a wrong word or definition */
.report {
  margin-top: 18px;
}
.report-toggle {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 6px 10px;
}
.report-toggle:hover,
.report-toggle[aria-expanded='true'] {
  border-color: var(--green);
  color: var(--green);
}
.report-form {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 13px;
}
.report-title {
  margin: 0 0 8px;
  color: var(--muted);
}
.report-options label {
  display: block;
  line-height: 1.9;
}
.report-form textarea {
  width: 100%;
  margin-top: 10px;
  background: #000;
  color: inherit;
  border: 1px solid var(--line);
  font: inherit;
  padding: 8px;
}
.report-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.report-actions button {
  background: none;
  border: 1px solid var(--line);
  color: inherit;
  font: inherit;
  font-size: 12px;
  padding: 6px 12px;
}
.report-actions button[type='submit'] {
  border-color: var(--green);
  color: var(--green);
}
.report-status:empty {
  display: none;
}
