@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600&display=swap');

:root {
  /* THEME - Edit these colours to customise the desk. */
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  background: #c7c1c5;
  --ink: #302a33;
  --muted: #625766;
  --line: #9c909e;
  --primary: #302a33;
  --accent: #dec4fa;
  --paper: #e6dfe8;
  color-scheme: light;
  --accent-ink: #71408f;
  --surface-soft: #d8cedd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .5;
  cursor: default;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent-ink);
  outline-offset: 4px;
}

::selection {
  background: var(--accent);
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

p {
  line-height: 1.65;
}

h1 {
  font-weight: 500;
  letter-spacing: -1.5px;
  font-size: 40px;
  margin-bottom: 10px;
}

h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.5px;
  margin-bottom: 12px;
}

h3 {
  font-size: 18px;
  font-weight: 500;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 1.7px;
  color: var(--muted);
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.fine-print {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}

/* NAVIGATION - Sidebar and saved passages. */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: #111216;
  color: #e9e9ee;
  padding: 36px 22px 25px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 23px;
  letter-spacing: -.7px;
}

.brand-mark {
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid #62636c;
  border-radius: 2px;
  width: 42px;
  height: 48px;
  font-family: 'Noto Sans JP', sans-serif;
}

.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.7px;
  margin-top: 6px;
  color: #9c9da7;
}

nav {
  display: grid;
  gap: 8px;
  margin: 49px 0 35px;
}

nav a {
  padding: 13px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13px;
  border-radius: 2px;
  color: #bebfc8;
}

nav a>span {
  font-size: 20px;
  width: 22px;
}

nav a.active {
  background: var(--accent);
  color: #35203f;
}

nav a:not(.active):hover {
  background: #25262c;
}

nav small {
  margin-left: auto;
  font-size: 11px;
}

.recent-heading {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #9c9da7;
  margin: 0 11px 16px;
}

#recent-passages {
  display: grid;
  gap: 7px;
}

.recent-link {
  padding: 10px 12px;
  border-radius: 2px;
  text-align: left;
  border: 0;
  background: transparent;
  color: #d4d4de;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-link:hover,
.recent-link.current {
  background: #25262c;
}

.recent-link small {
  display: block;
  font-size: 9px;
  color: #9c9da7;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-empty {
  font-size: 11px;
  color: #9c9da7;
  padding: 0 12px;
  line-height: 1.8;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 40px 10px 0;
}

.sidebar-bottom p {
  font: 23px 'Noto Sans JP', sans-serif;
  color: #e9e9ee;
  margin-bottom: 10px;
}

.sidebar-bottom small {
  font-size: 10px;
  color: #9c9da7;
}

.sidebar-bottom a {
  display: block;
  font-size: 11px;
  margin-top: 24px;
}

.sidebar-bottom .archive-link {
  color: #9c9da7;
  font-size: 10px;
  margin-top: 16px;
}

/* WORKSPACE - Header and page layout. */

.workspace {
  margin-left: 238px;
}

.topbar {
  height: 79px;
  margin: 0 40px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  font-size: 9px;
  letter-spacing: 1.6px;
  color: var(--muted);
}

.quiet {
  border: 0;
  background: transparent;
  font-size: 12px;
  padding: 7px 0;
  letter-spacing: 0;
}

.quiet:hover {
  color: var(--accent-ink);
}

main {
  max-width: 1460px;
  margin: auto;
  padding: 36px 40px 40px;
  min-height: calc(100vh - 135px);
}

#main:focus {
  outline: none;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 30px;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-head .eyebrow {
  margin-bottom: 12px;
}

/* CONTROLS - Buttons, forms and interaction states. */

.button {
  border: 1px solid var(--line);
  border-radius: 2px;
  min-height: 42px;
  padding: 11px 16px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  font-size: 12px;
  white-space: nowrap;
}

.button:hover {
  background: var(--surface-soft);
}

.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #e6dfe8;
}

.button.primary:hover {
  background: #393b44;
}

.button.lime {
  background: var(--accent);
  border-color: var(--accent);
}

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

/* READING DESK - Panels and Japanese reading area. */

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 25px;
  min-width: 0;
}

.desk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(285px, .9fr);
  gap: 23px;
  align-items: start;
}

.reading-column {
  min-width: 0;
}

.lookup-panel {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 17px;
}

.section-heading h2 {
  margin: 0;
}

.passage-title {
  font-size: 23px;
  font-weight: 500;
  border: 0;
  background: transparent;
  width: 100%;
  padding: 0;
  margin: 0 0 10px;
  letter-spacing: -.5px;
}

.source-field {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 100%;
  font-size: 12px;
  color: var(--muted);
}

.passage-meta {
  border-bottom: 1px solid var(--line);
  padding-bottom: 21px;
  margin-bottom: 20px;
}

.reading-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tabs {
  display: flex;
  padding: 3px;
  border-radius: 2px;
  background: var(--surface-soft);
  gap: 3px;
}

.tabs button {
  border: 0;
  background: transparent;
  padding: 8px 13px;
  border-radius: 2px;
  font-size: 11px;
}

.tabs button.active {
  background: var(--paper);
  box-shadow: 0 1px 3px #20212415;
}

.text-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.text-actions .quiet {
  font-size: 11px;
}

.reading-text {
  font: 400 24px/2.25 'Noto Sans JP', sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 200px;
  padding: 7px 0 22px;
  letter-spacing: .02em;
}

.token {
  font: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 3px;
  display: inline;
  white-space: pre-wrap;
  letter-spacing: inherit;
  text-align: inherit;
}

.token:hover,
.token.selected {
  background: var(--accent);
  box-shadow: 0 2px var(--accent-ink);
}

.reading-text rt {
  font-size: 10px;
  letter-spacing: 0;
  color: var(--accent-ink);
}

.reading-help {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin: 0;
}

/* SCREENSHOTS AND EDITOR */

.dropzone {
  border: 1px dashed var(--line);
  border-radius: 2px;
  padding: 21px;
  background: var(--surface-soft);
  margin-bottom: 17px;
  display: flex;
  align-items: center;
  gap: 17px;
  cursor: pointer;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 47px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 25px;
  flex-shrink: 0;
}

.dropzone strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 5px;
}

.dropzone small {
  font-size: 11px;
  color: var(--muted);
}

body.dragging .panel {
  border-color: var(--accent-ink);
}

label {
  display: block;
  font-size: 12px;
  margin: 15px 0 8px;
}

input,
textarea,
select {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 11px 12px;
  border-radius: 2px;
  margin-top: 7px;
}

textarea {
  resize: vertical;
  line-height: 1.8;
}

#passage-text {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 19px;
  min-height: 225px;
  margin: 0;
}

.empty-editor-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.save-status {
  font-size: 10px;
  color: var(--muted);
}

.passage-footer {
  border-top: 1px solid var(--line);
  padding-top: 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 21px;
}

.lookup-icon {
  font: 40px 'Noto Sans JP', sans-serif;
  color: var(--muted);
  margin: 24px 0 15px;
}

.lookup-empty {
  font-size: 13px;
  color: var(--muted);
}

.lookup-form {
  display: flex;
  gap: 7px;
  margin-bottom: 20px;
}

.lookup-form input {
  min-width: 0;
  margin: 0;
}

.lookup-form button {
  padding: 10px 12px;
}

.selection-context {
  border-left: 2px solid var(--accent-ink);
  padding-left: 13px;
  font: 14px/1.9 'Noto Sans JP', sans-serif;
  margin: 0 0 17px;
  overflow-wrap: anywhere;
  color: var(--muted);
}

/* DICTIONARY AND ANNOTATIONS */

.dictionary-entry {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.dictionary-entry h3 {
  font: 26px 'Noto Sans JP', sans-serif;
  margin: 0 0 9px;
}

.dictionary-entry .reading {
  font: 14px 'Noto Sans JP', sans-serif;
  color: var(--accent-ink);
}

.dictionary-entry ol {
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 12px;
}

.dictionary-entry li {
  margin: 5px 0;
}

.dictionary-entry .button {
  font-size: 11px;
  min-height: 34px;
  padding: 7px 12px;
}

.conversion {
  padding: 10px 12px;
  border-radius: 2px;
  background: var(--surface-soft);
  font-size: 11px;
  line-height: 1.8;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}

.conversion strong {
  font-size: 16px;
  font-weight: 500;
}

.lookup-footer {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}

.lookup-footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.note-section {
  margin-top: 25px;
}

.annotation {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.annotation:first-child {
  border-top: 0;
}

.annotation blockquote {
  margin: 0 0 10px;
  padding: 9px 13px;
  background: var(--surface-soft);
  border-left: 2px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 14px/1.9 'Noto Sans JP', sans-serif;
}

.annotation p {
  font-size: 12px;
  margin: 6px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.annotation strong {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
}

.annotation .note-actions {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.note-actions .quiet {
  font-size: 10px;
}

.annotation-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
}

.screenshot-details {
  margin: 0 0 20px;
}

.screenshot-details summary {
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 0;
}

.screenshot-details img {
  width: 100%;
  max-height: 330px;
  object-fit: contain;
  background: var(--surface-soft);
  border-radius: 2px;
  margin: 8px 0;
}

.screenshot-details .actions {
  justify-content: space-between;
}

.saved-toolbar {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.saved-toolbar input {
  margin: 0;
  max-width: 440px;
}

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

.passage-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.passage-card>button {
  padding: 23px;
  text-align: left;
  background: transparent;
  border: 0;
  flex: 1;
}

.passage-card>button:hover {
  background: var(--surface-soft);
}

.passage-card h2 {
  font-size: 20px;
  overflow-wrap: anywhere;
}

.passage-card .excerpt {
  font: 15px/1.9 'Noto Sans JP', sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 115px;
  overflow: hidden;
  margin-bottom: 17px;
}

.passage-card .card-meta {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.passage-card .card-source {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.passage-card .card-bottom {
  padding: 0 23px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}

.empty-library {
  text-align: center;
  padding: 55px 20px;
}

.empty-library p {
  font-size: 13px;
  color: var(--muted);
}

footer {
  padding: 0 40px 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
  color: var(--muted);
}

dialog {
  width: min(500px, calc(100% - 30px));
  max-height: 92vh;
  overflow: auto;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}

dialog::backdrop {
  background: #10101888;
  backdrop-filter: blur(3px);
}

dialog p {
  font-size: 13px;
}

dialog .fine-print {
  font-size: 11px;
}

dialog .section-heading {
  align-items: flex-start;
}

dialog .button {
  margin-top: 6px;
}

.icon-button {
  height: 33px;
  width: 33px;
  font-size: 21px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  flex-shrink: 0;
}

.form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

#ocr-dialog {
  width: min(820px, calc(100% - 30px));
}

#crop-area {
  position: relative;
  max-width: 100%;
  width: fit-content;
  margin: auto;
  touch-action: none;
  user-select: none;
  cursor: crosshair;
  line-height: 0;
}

#ocr-image {
  max-width: 100%;
  max-height: 45vh;
  display: block;
  object-fit: contain;
}

#crop-selection {
  position: absolute;
  border: 2px solid var(--accent-ink);
  background: #dec4fa33;
  pointer-events: none;
}

.ocr-toolbar {
  display: flex;
  gap: 15px;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: space-between;
  margin: 15px 0;
}

.ocr-toolbar label {
  margin: 0;
}

.ocr-toolbar select {
  margin-top: 5px;
  font-size: 12px;
}

.ocr-toolbar .quiet {
  font-size: 11px;
}

#ocr-status {
  color: var(--muted);
  font-size: 12px;
  min-height: 20px;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 15px;
  background: var(--accent);
  padding: 12px;
  z-index: 50;
}

.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

#toast {
  position: fixed;
  bottom: 24px;
  left: calc(50% + 119px);
  transform: translateX(-50%);
  max-width: 85vw;
  background: var(--primary);
  color: #fff;
  border-radius: 2px;
  font-size: 12px;
  padding: 13px 20px;
  box-shadow: 0 4px 20px #0002;
  z-index: 50;
  display: none;
}

#toast.visible {
  display: block;
}

#storage-warning {
  background: #fff0d5;
  padding: 13px 25px;
  font-size: 13px;
  color: #75491e;
}

.loading {
  color: var(--muted);
}

@media(min-width: 1600px) {
  main {
    padding-top: 46px;
  }

  .panel {
    padding: 31px;
  }

  .reading-text {
    font-size: 27px;
  }

  .desk-grid {
    gap: 27px;
  }

  .page-head {
    margin-bottom: 37px;
  }
}

@media(max-width: 1150px) {
  .sidebar {
    width: 210px;
    padding-left: 17px;
    padding-right: 17px;
  }

  .workspace {
    margin-left: 210px;
  }

  main {
    padding: 30px 25px;
  }

  .topbar {
    margin: 0 25px;
  }

  .desk-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, .9fr);
    gap: 17px;
  }

  .panel {
    padding: 20px;
  }

  h1 {
    font-size: 35px;
  }

  .page-head {
    align-items: flex-start;
  }

  .reading-text {
    font-size: 22px;
  }

  .sidebar-bottom p {
    font-size: 20px;
  }

  #toast {
    left: calc(50% + 105px);
  }
}

@media(max-width: 930px) {
  .desk-grid {
    grid-template-columns: 1fr;
  }

  .lookup-panel {
    position: static;
    max-height: none;
  }

  .reading-text {
    min-height: 150px;
  }

  .sidebar {
    width: 195px;
  }

  .workspace {
    margin-left: 195px;
  }

  .brand {
    font-size: 20px;
  }

  .brand small {
    font-size: 7px;
  }

  #toast {
    left: calc(50% + 97px);
  }
}

@media(max-width: 650px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 20px 20px 14px;
  }

  .brand {
    font-size: 22px;
  }

  .brand-mark {
    height: 38px;
    width: 35px;
    font-size: 21px;
  }

  nav {
    display: flex;
    margin: 22px 0 0;
    gap: 10px;
  }

  nav a {
    flex: 1;
    padding: 10px;
    font-size: 12px;
  }

  .recent-heading,
  #recent-passages,
  .sidebar-bottom {
    display: none;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    height: 58px;
    margin: 0 20px;
    font-size: 8px;
  }

  .topbar .quiet {
    font-size: 10px;
  }

  main {
    padding: 26px 18px;
  }

  .page-head {
    display: block;
    margin-bottom: 23px;
  }

  h1 {
    font-size: 32px;
  }

  .page-head>.actions {
    margin-top: 18px;
  }

  .panel {
    padding: 19px;
  }

  .passage-title {
    font-size: 22px;
  }

  .text-actions {
    gap: 10px;
  }

  .saved-grid {
    grid-template-columns: 1fr;
  }

  .reading-text {
    font-size: 23px;
    line-height: 2.3;
  }

  .dropzone {
    padding: 16px 12px;
    gap: 12px;
  }

  .dropzone small {
    font-size: 10px;
  }

  .page-head .eyebrow {
    font-size: 9px;
  }

  footer {
    padding: 0 20px 24px;
    flex-wrap: wrap;
    font-size: 9px;
  }

  #toast {
    left: 50%;
    width: max-content;
  }

  .form-pair {
    grid-template-columns: 1fr;
    gap: 0;
  }

  dialog {
    padding: 21px;
  }

  .ocr-toolbar {
    gap: 10px;
  }

  .ocr-toolbar .button {
    padding: 10px;
    font-size: 11px;
  }

  .section-heading h2 {
    font-size: 20px;
  }

  .lookup-panel {
    scroll-margin-top: 15px;
  }
}

/* SCREENSHOTS AND EDITOR */

.dropzone {
  width: 100%;
  text-align: left;
}

.dropzone>span:last-child {
  min-width: 0;
}

#source-link {
  display: inline-block;
  font-size: 10px;
  margin-top: 8px;
}

.conjugation-search form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.conjugation-search label {
  margin: 0;
}

.conjugation-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  font-size: 11px;
  color: var(--muted);
}

.conjugation-examples .quiet {
  padding: 4px 8px;
  background: var(--surface-soft);
  border-radius: 2px;
  font-size: 13px;
}

.conjugation-overview {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 28px 0 20px;
}

.conjugation-overview h2 {
  font: 34px 'Noto Sans JP', sans-serif;
  margin-bottom: 12px;
}

.conjugation-overview p {
  margin-bottom: 8px;
  max-width: 650px;
  overflow-wrap: anywhere;
}

.conjugation-type-badge {
  font: 11px 'DM Sans', sans-serif;
  display: inline-block;
  vertical-align: middle;
  padding: 8px 12px;
  background: var(--surface-soft);
  border-radius: 2px;
  white-space: nowrap;
}

.conjugation-controls {
  flex-shrink: 0;
  display: grid;
  gap: 12px;
}

.conjugation-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 12px;
}

.conjugation-check input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

.conjugation-families {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 23px 0;
}

.conjugation-families button {
  padding: 9px 13px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
}

.conjugation-families button.active {
  background: var(--primary);
  color: #fff;
}

.conjugation-group {
  margin: 18px 0;
  padding: 23px 25px;
}

.conjugation-group h2 {
  font-size: 19px;
}

.conjugation-table-wrap {
  overflow: auto;
}

.conjugation-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: fixed;
  min-width: 620px;
}

.conjugation-table th,
.conjugation-table td {
  padding: 16px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.conjugation-table thead th {
  font-size: 10px;
  letter-spacing: .8px;
  color: var(--muted);
  font-weight: 500;
  padding-top: 10px;
}

.conjugation-table tbody th {
  font-size: 12px;
  font-weight: 500;
  width: 28%;
}

.conjugation-table th small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  display: block;
  line-height: 1.7;
  margin-top: 7px;
}

.conjugation-form-text {
  font: 21px/1.7 'Noto Sans JP', sans-serif;
  display: block;
}

.conjugation-table td small {
  font: 12px/1.8 'Noto Sans JP', sans-serif;
  color: var(--muted);
}

.conjugation-rule {
  border-left: 3px solid var(--accent-ink);
  padding: 10px 15px;
  font-size: 13px;
  background: var(--surface-soft);
  line-height: 1.8;
}

.conjugation-branch {
  padding: 17px 20px;
}

.conjugation-branch strong {
  font: 24px 'Noto Sans JP', sans-serif;
}

.conjugation-branch p {
  margin: 10px 0 0;
  font-size: 12px;
}

#conjugation-status {
  margin: 14px 0;
  min-height: 20px;
}

.dictionary-entry [data-conjugate] {
  margin-left: 12px;
}

.conjugation-overview>div:first-child {
  min-width: 0;
}

@media(max-width: 1100px) {
  .conjugation-search form {
    grid-template-columns: 1fr 1fr;
  }

  .conjugation-search form>.button {
    grid-column: 1/-1;
    justify-self: start;
  }

  .conjugation-overview {
    align-items: flex-start;
  }

  .conjugation-overview h2 {
    font-size: 29px;
  }

  .conjugation-type-badge {
    display: table;
    margin-top: 10px;
  }
}

@media(max-width: 650px) {
  nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  nav a {
    font-size: 10px;
    padding: 10px 5px;
    gap: 4px;
  }

  nav a>span {
    width: auto;
    font-size: 15px;
  }

  nav small {
    display: none;
  }

  .conjugation-search form {
    grid-template-columns: 1fr;
  }

  .conjugation-search form>.button {
    width: 100%;
  }

  .conjugation-overview {
    display: block;
  }

  .conjugation-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    gap: 8px;
  }

  .conjugation-controls .button {
    font-size: 10px;
    padding: 10px;
  }

  .conjugation-group {
    padding: 18px 12px;
  }

  .conjugation-table {
    min-width: 0;
    table-layout: fixed;
  }

  .conjugation-table th,
  .conjugation-table td {
    padding: 12px 5px;
  }

  .conjugation-table tbody th {
    font-size: 10px;
  }

  .conjugation-table th small {
    font-size: 9px;
  }

  .conjugation-form-text {
    font-size: 16px;
  }

  .conjugation-table td small {
    font-size: 10px;
  }

  .conjugation-families button {
    font-size: 11px;
    padding: 9px;
  }

  .conjugation-branch strong {
    font-size: 19px;
  }
}

/* THEME TOGGLE AND DARK MODE */

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 19px;
  flex-shrink: 0;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 7px 10px;
  white-space: nowrap;
}

.theme-toggle[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent-ink);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6d9ed;
  --muted: #b1a1ba;
  --line: #514357;
  --primary: #45364c;
  --paper: #17131b;
  background: #171419;
  color: var(--ink);
  --accent: #dec4fa;
  --accent-ink: #d9aaf6;
  --surface-soft: #202127;
}

:root[data-theme="dark"] ::selection {
  background: #483053;
  color: #f4e4ff;
}

:root[data-theme="dark"] :where(input,textarea,select) {
  background: #171419;
  border-color: var(--line);
}

:root[data-theme="dark"] :where(input,textarea)::placeholder {
  color: var(--muted);
  opacity: 1;
}

:root[data-theme="dark"] :where(.passage-title,.source-field) {
  background: transparent;
}

:root[data-theme="dark"] :where(.tabs,.dropzone,.conversion,.annotation blockquote,.conjugation-examples .quiet,.conjugation-type-badge,.conjugation-rule) {
  background: #17131b;
}

:root[data-theme="dark"] :where(.dropzone,.drop-icon) {
  border-color: var(--line);
}

:root[data-theme="dark"] :where(.token:hover,.token.selected) {
  background: #483053;
  box-shadow: 0 2px #cf9feb;
}

:root[data-theme="dark"] :where(.selection-context,.dictionary-entry .reading,.reading-text rt) {
  color: #d9aaf6;
}

:root[data-theme="dark"] .button:hover {
  background: #25262e;
}

:root[data-theme="dark"] .button.primary:hover {
  background: #41434f;
}

:root[data-theme="dark"] :where(.button.lime,.skip-link) {
  color: #35203f;
}

:root[data-theme="dark"] .button.lime:hover {
  background: #efd4ff;
}

:root[data-theme="dark"] .quiet:hover {
  color: #dec4fa;
}

:root[data-theme="dark"] .passage-card>button:hover {
  background: #25262e;
}

:root[data-theme="dark"] .screenshot-details img {
  background: #171419;
}

:root[data-theme="dark"] dialog::backdrop {
  background: #080810b8;
}

:root[data-theme="dark"] #storage-warning {
  background: #473823;
  color: #f3d7aa;
}

:root[data-theme="dark"] .conjugation-check input {
  accent-color: var(--accent);
}

@media(max-width: 650px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 58px;
    padding: 12px 0;
    gap: 10px;
  }

  .topbar-actions {
    gap: 12px;
    margin-left: auto;
  }

  .topbar .theme-toggle {
    padding: 7px 8px;
  }
}

@media(prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

/* WIREFRAME — CSS 3D, no model downloads or graphics libraries.
   Change --object-size, the colour, or the 32s duration below. */
.wireframe-module {
  --object-size: 64px;
  --wire-colour: #cf9feb;
  border-top: 1px solid #35363f;
  border-bottom: 1px solid #35363f;
  margin: -12px 10px 28px;
  padding: 12px 0;
}

.wireframe-caption {
  display: flex;
  justify-content: space-between;
  color: #9c9da7;
  font-size: 9px;
  letter-spacing: 1px;
}

.wireframe-stage {
  height: 132px;
  display: grid;
  place-items: center;
  perspective: 500px;
  overflow: hidden;
  background-image: radial-gradient(#454652 1px, transparent 1px);
  background-size: 16px 16px;
  margin: 10px 0;
}

.wireframe-object {
  width: var(--object-size);
  height: var(--object-size);
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(35deg);
  animation: wireframe-spin 32s linear infinite;
}

.wire-face,
.wire-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--wire-colour);
  backface-visibility: visible;
}

.wire-face::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent calc(50% - .5px), #cf9feb45 50%, transparent calc(50% + .5px)),
    linear-gradient(90deg, transparent calc(50% - .5px), #cf9feb45 50%, transparent calc(50% + .5px));
}

.wire-face.front {
  transform: translateZ(calc(var(--object-size) / 2));
}

.wire-face.back {
  transform: rotateY(180deg) translateZ(calc(var(--object-size) / 2));
}

.wire-face.left {
  transform: rotateY(-90deg) translateZ(calc(var(--object-size) / 2));
}

.wire-face.right {
  transform: rotateY(90deg) translateZ(calc(var(--object-size) / 2));
}

.wire-face.top {
  transform: rotateX(90deg) translateZ(calc(var(--object-size) / 2));
}

.wire-face.bottom {
  transform: rotateX(-90deg) translateZ(calc(var(--object-size) / 2));
}

.wire-ring {
  inset: -17px;
  border-radius: 50%;
  border-color: #cf9feb55;
}

.ring-x {
  transform: rotateX(90deg);
}

.ring-y {
  transform: rotateY(90deg);
}

.wireframe-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: #bebfc8;
  font-size: 10px;
}

.wireframe-control:hover {
  color: #fff;
}

@keyframes wireframe-spin {
  from {
    transform: rotateX(-22deg) rotateY(35deg) rotateZ(0deg);
  }
  to {
    transform: rotateX(338deg) rotateY(395deg) rotateZ(360deg);
  }
}

:root[data-motion="paused"] .wireframe-object {
  animation-play-state: paused;
}

@media(max-width: 650px) {
  .wireframe-module {
    display: none;
  }

  h1 {
    font-size: 32px;
  }
}

@media(prefers-reduced-motion: reduce) {
  .wireframe-object {
    animation: none;
  }

  .button,
  .tabs button,
  nav a {
    transition: none;
  }
}

/* PHYSICAL CONSOLE — Housing, worn surfaces and inset displays.
   Edit these material colours independently of the reading-screen palette. */
:root {
  --housing: #b9b0b7;
  --housing-edge: #897d8c;
  --screen: #e6dfe8;
  --screen-glow: #75439230;
  --key-top: #e3dbe5;
  --key-bottom: #b8acbf;
  --key-shadow: #807286;
}

:root[data-theme="dark"] {
  --housing: #302932;
  --housing-edge: #56465b;
  --screen: #17131b;
  --screen-glow: #b65de51c;
  --key-top: #493e50;
  --key-bottom: #2f2635;
  --key-shadow: #100d13;
}

body {
  padding: 12px;
  background: #151216;
  background-image:
    radial-gradient(ellipse at 50% 0, #5b3c6350, transparent 70%),
    url('console-grain.svg');
}

.console-shell {
  position: relative;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  width: 100%;
  max-width: none;
  margin: auto;
  padding: 18px;
  gap: 20px;
  border: 2px solid var(--housing-edge);
  border-radius: 30px;
  background-color: var(--housing);
  background-image:
    linear-gradient(172deg, #ffffff10 0, transparent 26%, #00000018 82%),
    repeating-linear-gradient(118deg, transparent 0 112px, #ffffff05 113px, transparent 114px 170px),
    url('console-grain.svg');
  box-shadow:
    inset 0 2px 1px #ffffff24,
    inset 0 -5px 2px #00000050,
    0 30px 90px #00000080;
}

.console-shell::before,
.console-shell::after {
  content: '';
  position: absolute;
  bottom: 10px;
  width: 9px;
  height: 9px;
  border: 1px solid #140f18;
  border-radius: 50%;
  background: linear-gradient(45deg, #716475 42%, #16111a 45% 55%, #716475 58%);
  box-shadow: 0 1px 0 #ffffff25;
}

.console-shell::before {
  left: 11px;
}

.console-shell::after {
  right: 11px;
}

.sidebar {
  position: static;
  width: auto;
  padding: 26px 14px 20px;
  border: 1px solid #171219;
  border-radius: 17px;
  background: #211b24 url('console-grain.svg');
  box-shadow: inset 0 2px 7px #00000095, 0 1px 0 #ffffff24;
  overflow: visible;
}

.brand {
  font-size: 21px;
  gap: 10px;
}

.brand-mark {
  color: #e8d2f5;
  border-color: #65506f;
  border-radius: 7px;
  background: #18111e;
  box-shadow: inset 0 2px 5px #00000080;
  text-shadow: 0 0 12px #c573ef60;
}

.brand small {
  font-size: 7px;
  letter-spacing: 1.2px;
  color: #b4a0be;
}

nav {
  gap: 12px;
  margin: 32px 0;
}

nav a,
nav a:not(.active):hover {
  color: #d7c8df;
  background: linear-gradient(#423747, #2a222f);
  border: 1px solid #57455f;
  border-bottom: 3px solid #130e17;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 #ffffff12, 0 3px 4px #00000030;
  padding: 13px 10px;
}

nav a.active {
  background: linear-gradient(#60416f, #402b4e);
  color: #f0dcff;
  border-color: #9160a4;
  border-bottom-color: #201127;
  text-shadow: 0 0 10px #cc81ff70;
}

nav a.active::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #deb3ff;
  box-shadow: 0 0 8px #bd6fe9;
  margin-left: auto;
  flex-shrink: 0;
}

.recent-heading,
.recent-link small,
.recent-empty,
.sidebar-bottom small,
.sidebar-bottom .archive-link {
  color: #ad9cb6;
}

.recent-link {
  color: #ddcde6;
}

.recent-link:hover,
.recent-link.current {
  background: #3b2c44;
}

.sidebar-bottom {
  padding: 30px 9px 0;
}

.sidebar-bottom p {
  color: #decbe9;
  font-size: 20px;
}

.workspace {
  min-width: 0;
  margin: 0;
  padding: 0 8px;
  background: transparent;
}

.topbar {
  margin: 0;
  height: auto;
  min-height: 82px;
  padding: 12px 4px 18px;
  border-bottom: 1px solid var(--housing-edge);
  color: var(--ink);
}

.topbar,
.eyebrow,
.recent-heading,
.brand small,
.module-label,
.console-instruments,
.wireframe-caption,
.wireframe-control,
.save-status,
footer {
  font-family: 'Courier New', monospace;
}

.console-id {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 1.4px;
  line-height: 1.5;
}

.console-id small {
  display: block;
  font-size: 8px;
  letter-spacing: .8px;
  color: var(--muted);
  margin-top: 5px;
}

.status-lamp,
.module-light {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cf9feb;
  box-shadow: 0 0 9px #c475ed80, inset 0 1px 1px #ffffff70;
  flex-shrink: 0;
}

.topbar-actions {
  gap: 10px;
}

.topbar-actions .quiet,
.button,
.tabs button,
.conjugation-families button {
  color: var(--ink);
  background: linear-gradient(var(--key-top), var(--key-bottom));
  border: 1px solid var(--housing-edge);
  border-bottom: 3px solid var(--key-shadow);
  border-radius: 5px;
  padding: 11px 14px;
  box-shadow: inset 0 1px 0 #ffffff18, 0 2px 2px #00000020;
  transition: background-color 120ms ease;
}

.topbar-actions .quiet {
  font-size: 11px;
  white-space: nowrap;
}

.button.primary,
.button.lime,
.tabs button.active,
.conjugation-families button.active {
  color: #f4e3ff;
  border-color: #9465aa;
  border-bottom-color: #311b3e;
  background: linear-gradient(#79568e, #4f345f);
  box-shadow: inset 0 1px 0 #e8b7ff30, 0 2px 3px #00000040;
}

.button:hover,
:root[data-theme="dark"] .button:hover,
.topbar-actions .quiet:hover {
  background: linear-gradient(var(--key-top), var(--key-top));
}

.button.primary:hover,
.button.lime:hover,
:root[data-theme="dark"] .button.primary:hover,
:root[data-theme="dark"] .button.lime:hover {
  color: #fff;
  background: linear-gradient(#89659d, #664576);
}

.button:active,
.topbar-actions .quiet:active,
nav a:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px #00000040;
}

.theme-toggle[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--housing-edge);
}

.console-instruments {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 6px;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1px;
}

.signal-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 15px;
}

.signal-bars i {
  width: 5px;
  height: 7px;
  background: var(--accent-ink);
  opacity: .65;
}

.signal-bars i:nth-child(3n) {
  height: 15px;
}

.signal-bars i:nth-child(3n + 1) {
  height: 11px;
}

.console-dial {
  width: 30px;
  height: 30px;
  margin-left: auto;
  border: 3px solid var(--housing-edge);
  border-radius: 50%;
  background: linear-gradient(130deg, #5c4d62, #211926);
  box-shadow: 0 2px 3px #00000060;
  position: relative;
}

.console-dial::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 8px;
  background: #d1ace9;
  left: 11px;
  top: 2px;
  transform: rotate(25deg);
}

main {
  max-width: none;
  padding: 10px 0 24px;
  min-height: 650px;
}

.page-head {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 22px 24px;
  margin-bottom: 22px;
  background: var(--screen);
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, #83619807 3px 4px);
  box-shadow: inset 0 3px 9px #00000055, 0 1px 0 #ffffff15;
}

h1 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -1.3px;
  margin-bottom: 8px;
}

.page-head .eyebrow {
  color: var(--accent-ink);
  font-size: 9px;
  letter-spacing: 1.5px;
}

.desk-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(275px, 1fr);
  gap: 20px;
}

.panel,
.passage-card,
dialog {
  border: 1px solid var(--housing-edge);
  border-radius: 12px;
  background: var(--screen);
  box-shadow:
    0 0 0 5px #00000018,
    inset 0 2px 5px #00000045,
    0 2px 1px #ffffff12;
}

.panel {
  padding: 22px;
}

.module-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: var(--accent-ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.passage-title {
  font-size: 21px;
}

.tabs {
  padding: 4px;
  background: var(--housing);
  box-shadow: inset 0 1px 4px #00000040;
  border-radius: 6px;
}

.tabs button {
  padding: 8px 13px;
}

input,
textarea,
select {
  border-radius: 5px;
  box-shadow: inset 0 2px 4px #00000015;
}

.passage-title,
.source-field {
  box-shadow: none;
}

.reading-text,
#passage-text {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  box-shadow: inset 0 2px 8px #00000020, 0 0 24px var(--screen-glow);
}

.reading-help {
  margin-top: 18px;
}

.dropzone {
  background: var(--surface-soft);
  border: 1px dashed var(--housing-edge);
  border-radius: 6px;
}

.lookup-panel {
  position: static;
  max-height: none;
}

/* SENTENCE FOCUS AND TRANSLATION — Companion displays beside the passage. */
.signal-column {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.sentence-controls {
  margin-bottom: 20px;
}

.sentence-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.sentence-navigation label {
  margin: 0;
  color: var(--accent-ink);
  font: 12px 'Courier New', monospace;
}

.sentence-navigation .button {
  min-width: 44px;
}

.sentence-controls select {
  text-overflow: ellipsis;
}

.sentence-actions {
  margin-top: 18px;
}

.sentence-focused .reading-text {
  min-height: 190px;
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 2;
}

.sentence-focused .screenshot-details img {
  max-height: 260px;
  object-fit: contain;
  object-position: left center;
}

.focus-source {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.focus-selection {
  display: block;
  margin: 0 0 12px;
}

.translation-panel h2 {
  font-size: 21px;
}

.translation-panel .button {
  white-space: normal;
  text-align: center;
}

.translation-panel textarea {
  line-height: 1.75;
}

.translation-panel [aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
}

.lookup-icon {
  color: var(--accent-ink);
  text-shadow: 0 0 20px var(--screen-glow);
}

.lookup-panel h2 {
  font-size: 21px;
}

.quiet:hover,
:root[data-theme="dark"] .quiet:hover {
  color: var(--accent-ink);
}

.wireframe-module {
  margin: 0 0 25px;
  padding: 14px 10px 8px;
  background: #120d18;
  border: 2px solid #493651;
  border-radius: 10px;
  box-shadow: inset 0 2px 12px #000, 0 1px 0 #ffffff14;
}

.wireframe-caption {
  font-size: 7px;
  color: #c59ddd;
}

.wireframe-stage {
  height: 128px;
  position: relative;
  background-image: radial-gradient(#80549b50 1px, transparent 1px);
}

.wireframe-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, #00000030 0 1px, transparent 1px 4px),
    radial-gradient(ellipse, transparent 40%, #08040e80 100%);
  border-radius: 4px;
}

.wireframe-object {
  filter: drop-shadow(0 0 4px #b160d960);
}

.wireframe-control {
  color: #c4a8d4;
}

footer {
  margin: 0;
  padding: 18px 4px 6px;
  border-top: 1px solid var(--housing-edge);
  font-size: 9px;
  color: var(--muted);
}

/* WORD SIGNAL — Grammar labels and secondary dictionary spellings. */
.grammar-label {
  display: inline-block;
  padding: 6px 8px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent-ink);
  background: var(--surface-soft);
  font: 11px/1.5 'Courier New', monospace;
}

.alternate-spelling,
.other-dictionary-matches {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
}

.alternate-spelling summary,
.other-dictionary-matches summary {
  cursor: pointer;
  color: var(--muted);
}

.alternate-spelling p,
.other-dictionary-matches > p {
  margin: 12px 0 0;
}

.spelling-note {
  margin-bottom: 10px;
}

/* RESPONSIVE CONSOLE — Controls stay usable when the housing narrows. */
@media(max-width: 1150px) {
  body {
    padding: 10px;
  }

  .console-shell {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .page-head {
    flex-wrap: wrap;
  }

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

  .lookup-panel {
    position: static;
    max-height: none;
  }
}

@media(max-width: 650px) {
  body {
    padding: 8px;
  }

  .console-shell {
    display: block;
    padding: 10px;
    border-radius: 18px;
  }

  .sidebar {
    padding: 16px 10px 12px;
    border-radius: 10px;
  }

  nav {
    margin: 20px 0 0;
    gap: 6px;
  }

  nav a,
  nav a:not(.active):hover {
    font-size: 9px;
    padding: 10px 5px;
    gap: 4px;
  }

  nav a.active::after {
    display: none;
  }

  .workspace {
    padding: 0 3px;
  }

  .topbar {
    margin: 0;
    padding: 20px 0 16px;
  }

  .topbar-actions {
    margin: 0;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-actions .quiet {
    font-size: 10px;
    padding: 9px;
  }

  .console-instruments {
    gap: 12px;
    font-size: 8px;
    padding: 12px 0;
  }

  .console-instruments > span:nth-of-type(2) {
    display: none;
  }

  .page-head {
    padding: 20px 16px;
    gap: 16px;
  }

  h1 {
    font-size: 28px;
  }

  .panel {
    padding: 18px 14px;
  }

  .reading-text,
  #passage-text {
    padding: 14px 10px;
  }

  .dropzone {
    padding: 14px 10px;
    gap: 10px;
  }

  .drop-icon {
    width: 32px;
    height: 38px;
  }

  footer {
    line-height: 1.7;
  }
}

@media(prefers-reduced-motion: reduce) {
  .button,
  .tabs button,
  nav a {
    transition: none;
  }
}
