/* Shared neutral palette and control sizing with the Gospel reader. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-strong: #f7f7f8;
  --ink: #18181b;
  --muted: #52525b;
  --line: #e5e5e9;
  --line-strong: #c9c9d1;
  --accent: #202024;
  --accent-strong: #202024;
  --accent-soft: #f0f0f2;
  --on-accent: #ffffff;
  --link: #2859b8;
  --focus: #4169d8;
  --warning: #98680f;
  --shadow-soft: 0 8px 32px #00000012;
  --language-tabs-height: 52px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111113;
  --panel: #19191c;
  --panel-strong: #222226;
  --ink: #f0f0f2;
  --muted: #bcbcc5;
  --line: #333339;
  --line-strong: #52525d;
  --accent: #eeeeef;
  --accent-strong: #eeeeef;
  --accent-soft: #2a2a30;
  --on-accent: #17171a;
  --link: #a6c1ff;
  --focus: #9bbaff;
  --warning: #d6b365;
  --shadow-soft: 0 8px 32px #00000040;
}

/* Entry-only documents fill their host frame at every viewport size. */
html[data-embed="true"] body {
  padding: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
}

html[data-embed="true"] .language-tabs,
html[data-embed="true"] .search-pane,
html[data-embed="true"] .entry-close,
html[data-embed="true"] .entry-actions,
html[data-embed="true"] .entry-action-status {
  display: none;
}

html[data-embed="true"] .app-shell {
  display: block;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

html[data-embed="true"] .entry-pane {
  position: static;
  height: 100%;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  pointer-events: auto;
  transform: none;
  transition: none;
  visibility: visible;
}

html[data-embed="true"] .entry-header {
  position: static;
  display: block;
  margin: 0;
  padding: 0 0 16px;
  background: none;
  backdrop-filter: none;
}

html[data-embed="true"] .entry-header h2 {
  overflow: visible;
  font-size: 28px;
  white-space: normal;
  overflow-wrap: anywhere;
}

html[data-embed="true"] .entry-header p {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}

html[data-embed="true"] .entry-header .entry-gloss {
  font-size: 15px;
}

html[data-embed="true"] .empty-state {
  min-height: 0;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 470px) minmax(0, 1fr);
  height: calc(100dvh - var(--biblical-nav-height, 0px) - var(--language-tabs-height));
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.language-tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: stretch;
  height: var(--language-tabs-height);
  padding: 0 20px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.language-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.language-tabs button[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent-strong);
}

.language-tabs span {
  margin-inline-start: 6px;
  font-weight: 400;
}

.language-tabs button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -5px;
}

.result-lemma,
.entry-header h2 {
  unicode-bidi: isolate;
}

.app-shell[data-language="hebrew"] .key-grid button,
.app-shell[data-language="hebrew"] .mark-grid button:not(.wide-key) {
  font-size: 22px;
}

.tdot-rich p,
.tdot-rich h3 {
  margin-bottom: 1em;
}

.tdot-page {
  display: block;
  margin: 1.5em 0 0.5em;
  color: var(--muted);
  font: 12px ui-sans-serif, system-ui, sans-serif;
}

.search-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.topbar {
  display: flex;
  align-items: center;
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--ink);
  font-family: inherit;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.05;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar #status,
.entry-header p,
.result-meta {
  color: var(--muted);
}

.topbar #status {
  margin-top: 6px;
  font-size: 13px;
}

.dictionary-picker {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.dictionary-picker {
  padding: 16px 20px 0;
}

.dictionary-picker select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0 12px;
  color: var(--ink);
  cursor: pointer;
}

.dictionary-picker select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.search-box {
  display: grid;
  gap: 8px;
  padding: 14px 20px;
  color: var(--muted);
  font-size: 13px;
}

.search-box input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0 14px;
  color: var(--ink);
  font-size: 22px;
  box-shadow: none;
}

.search-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.recent-toggle,
.history-clear {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  padding: 6px 10px;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.recent-toggle[aria-pressed="true"],
.recent-toggle:hover,
.history-clear:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.recent-toggle:focus-visible,
.history-clear:focus-visible,
.history-remove:focus-visible,
.result-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.search-box input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.keyboard {
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--line);
}

.keyboard:not([open]) {
  padding-bottom: 0;
}

.keyboard summary {
  padding: 10px 0;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.keyboard summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.learning-panel {
  flex-shrink: 0;
  margin-top: auto;
  padding: 0 20px;
  border-top: 1px solid var(--line);
}

.learning-panel summary {
  cursor: pointer;
  padding: 14px 0;
  color: var(--muted);
  font-size: 12px;
}

.learning-panel summary:hover,
.learning-panel details[open] summary {
  color: var(--accent-strong);
}

.learning-panel summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.recommendation-card strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.recommendation-card a {
  color: inherit;
  text-decoration: none;
}

.recommendation-card a:hover {
  text-decoration: underline;
}

.recommendation-card span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.recommendation-card {
  margin: 0 0 16px;
  border-left: 3px solid var(--accent-strong);
  padding: 8px 10px;
  background: var(--accent-soft);
}

.key-grid,
.mark-grid {
  display: grid;
  gap: 6px;
}

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

.mark-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-top: 8px;
}

.keyboard button {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mark-grid .wide-key {
  grid-column: span 2;
}

.keyboard button:hover {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
}

.results {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px 12px;
}

.history-header h2 {
  color: var(--accent-strong);
  font-size: 14px;
}

.history-header p,
.history-empty {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: flex;
  align-items: center;
  gap: 4px;
}

.history-list .result-item {
  min-width: 0;
  flex: 1;
}

.history-remove {
  flex: 0 0 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.history-remove:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.history-empty {
  padding: 8px 10px;
  font-size: 13px;
}

.result-item {
  display: grid;
  width: 100%;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 11px 10px;
  text-align: left;
  cursor: pointer;
}

.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.result-item:hover,
.result-item.active {
  border-color: var(--line-strong);
  background: var(--accent-soft);
}

.result-lemma {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-dictionary {
  flex: 0 0 auto;
  max-width: 130px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 2px 7px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-snippet {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.entry-pane {
  min-width: 0;
  min-height: 0;
  padding: 34px;
  overflow: auto;
  background: var(--panel);
}

.entry {
  max-width: 980px;
  margin: 0 auto;
}

.entry-header {
  position: relative;
  display: grid;
  grid-template-areas: "title" "actions";
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.entry-header h2 {
  color: var(--ink);
  font-size: 38px;
  line-height: 1.1;
}

.entry-title {
  grid-area: title;
  min-width: 0;
}

.entry-gloss {
  max-width: 680px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

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

.entry-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

.entry-display-toggle {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
}

.display-mode-button {
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: transparent;
  padding: 8px 11px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.display-mode-button:last-child {
  border-right: 0;
}

.display-mode-button.active {
  background: var(--accent-strong);
  color: var(--on-accent);
}

.entry-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.entry-action-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entry-action-button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.entry-action-button:focus-visible,
.display-mode-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.entry-action-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.entry-action-status {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 2;
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent-strong);
  color: var(--on-accent);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.entry-action-status:not(:empty) {
  opacity: 1;
}

.entry-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.entry-close {
  display: none;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
}

.entry-back-icon {
  font-size: 28px;
  line-height: 0.8;
}

.entry-text {
  padding-top: 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.65;
}

.entry-source {
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.entry-text p {
  margin: 0;
}

.entry-text p + p {
  margin-top: 0.8em;
}

.entry-link {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.entry-link:hover {
  color: var(--accent);
}

.entry-mode-original {
  max-width: 980px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

.entry-intro {
  margin-bottom: 22px;
  padding: 16px 18px;
  border-left: 4px solid var(--line-strong);
  background: var(--panel-strong);
  color: var(--muted);
}

.entry-intro h3 {
  margin: 0 0 6px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.meaning-list {
  display: grid;
  gap: 18px;
}

.meaning {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.meaning:first-child {
  border-top: 0;
  padding-top: 0;
}

.meaning-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  font-weight: 800;
}

.meaning-body {
  display: grid;
  gap: 12px;
}

.meaning-lead {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.subsection-list {
  display: grid;
  gap: 12px;
}

.subsection {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
}

.subsection-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--accent-strong);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.subsection-greek {
  grid-template-columns: 24px minmax(0, 1fr);
  padding-left: 2px;
}

.subsection-greek .subsection-marker {
  width: 20px;
  height: 20px;
  margin-top: 5px;
  background: var(--accent-soft);
  font-size: 12px;
}

.subsection-body {
  display: grid;
  gap: 8px;
}

.subsection-lead {
  color: var(--muted);
  font-weight: 700;
}

.transliteration {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9em;
}

.gloss {
  color: var(--accent-strong);
  font-style: italic;
}

.bdag-rich {
  max-width: 900px;
  color: var(--ink);
}

.source-original {
  max-width: 620px;
}

.source-original figure {
  margin: 0 0 24px;
}

.source-original svg {
  display: block;
  width: 100%;
  height: auto;
}

.source-original figcaption {
  color: var(--muted);
  font: 12px/1.5 ui-sans-serif, system-ui, sans-serif;
  margin-top: 8px;
}

.montanari-subsense {
  display: inline-block;
  border: 1px solid currentColor;
  padding: 0 .25em;
  margin: .5em .25em 0 0;
  font-weight: 800;
  line-height: 1.25;
}

.bdag-mode-original .bdag-rich,
.bdag-mode-original .lexicon-rich {
  max-width: 980px;
  font-size: 16px;
  line-height: 1.48;
}

.bdag-rich strong {
  color: var(--ink);
  font-weight: 800;
}

.bdag-rich em {
  color: var(--ink);
  font-style: italic;
}

.bdag-sense-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin: 0 4px 0 8px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  vertical-align: 2px;
}

.bdag-clean {
  max-width: 980px;
}

.bdag-clean-intro {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
}

.bdag-clean-list {
  display: grid;
  gap: 28px;
}

.bdag-clean-sense {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 18px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.bdag-clean-sense:first-child {
  padding-top: 0;
  border-top: 0;
}

.bdag-clean-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.bdag-clean-body {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.72;
}

.bdag-clean-body > strong:first-child,
.bdag-clean-body > strong:first-child + strong {
  color: var(--ink);
  font-size: 1.04em;
}

.bdag-clean strong {
  font-weight: 800;
}

.bdag-clean em {
  color: var(--ink);
  font-style: italic;
}

.dash {
  color: var(--warning);
}

.empty-state {
  display: grid;
  min-height: calc(100vh - 56px);
  place-items: center;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  text-align: center;
}

.dictionary-choice {
  display: grid;
  gap: 8px;
}

.dictionary-choice p {
  color: var(--accent-strong);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dictionary-choice strong {
  color: var(--ink);
  font-size: 24px;
}

@media (max-width: 820px) {
  .recent-words {
    scroll-margin-top: calc(var(--language-tabs-height) + 12px);
  }

  .recent-toggle,
  .history-clear,
  .history-remove {
    min-height: 44px;
  }

  .history-remove {
    flex-basis: 44px;
  }

  body {
    height: auto;
    min-height: 100%;
    overflow: auto;
    padding-top: var(--language-tabs-height);
  }

  .language-tabs {
    position: fixed;
    inset: 0 0 auto;
  }

  body.entry-open {
    overflow: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    display: block;
    min-height: calc(100dvh - var(--biblical-nav-height, 0px) - var(--language-tabs-height));
    height: auto;
    overflow: visible;
  }

  .search-pane {
    min-height: calc(100dvh - var(--biblical-nav-height, 0px) - var(--language-tabs-height));
    height: auto;
    border-right: 0;
  }

  .entry-pane {
    position: fixed;
    inset: var(--language-tabs-height) 0 var(--biblical-nav-height, 0px);
    z-index: 20;
    padding: 18px;
    overflow: auto;
    background: var(--bg);
    pointer-events: none;
    transform: translateX(100%);
    transition:
      transform 180ms ease,
      visibility 0s linear 180ms;
    visibility: hidden;
  }

  .entry-open .entry-pane {
    pointer-events: auto;
    transform: translateX(0);
    transition: transform 180ms ease;
    visibility: visible;
  }

  .results {
    flex: none;
    max-height: none;
    overflow: visible;
  }

  .empty-state {
    min-height: calc(100dvh - 36px);
  }

  .entry-header {
    position: static;
    top: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "back title" "actions actions";
    column-gap: 8px;
    align-items: center;
    margin: -18px -18px 0;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(12px);
  }

  .entry-title {
    min-width: 0;
  }

  .entry-actions {
    gap: 6px;
    margin-top: 8px;
  }

  .entry-tools {
    gap: 4px;
  }

  .entry-action-button {
    width: 40px;
    height: 40px;
  }

  .entry-action-status {
    inset-inline-end: 12px;
  }

  .entry-heading {
    gap: 8px;
    min-width: 0;
  }

  .entry-header h2 {
    overflow: hidden;
    font-size: 20px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .entry-header p {
    display: none;
  }

  .entry-header .entry-gloss {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .entry-close {
    grid-area: back;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 36px;
    padding: 0 6px;
    font-weight: 600;
  }

  .entry-text {
    padding-top: 18px;
  }

  .meaning {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
  }

  .meaning-number {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .subsection {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
  }

  .key-grid,
  .mark-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

/* Searchable embedded catalogues keep their own results/entry navigation. */
html[data-embed="search"]{--language-tabs-height:0px;--biblical-nav-height:0px}
html[data-embed="search"] body{padding:0;height:100%;overflow:hidden;background:var(--panel)}
html[data-embed="search"] .language-tabs,
html[data-embed="search"] .dictionary-picker,
html[data-embed="search"] .topbar,
html[data-embed="search"] .learning-panel,
html[data-embed="search"] .entry-actions,
html[data-embed="search"] .entry-action-status{display:none}
html[data-embed="search"] .app-shell{display:block;height:100dvh;min-height:0;overflow:hidden}
html[data-embed="search"] .search-pane{height:100%;min-height:0;overflow:auto;padding:16px;border:0}
html[data-embed="search"] .entry-pane{position:fixed;inset:0;z-index:20;padding:16px;overflow:auto;background:var(--panel);pointer-events:none;transform:translateX(100%);visibility:hidden}
html[data-embed="search"] .entry-open .entry-pane{pointer-events:auto;transform:none;visibility:visible}
html[data-embed="search"] .entry-close{display:inline-flex}

/* A single same-word navigation row works in the app and in embedded entries. */
.entry-dictionaries{position:sticky;top:-44px;z-index:3;background:var(--panel);padding-bottom:8px;display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;margin:0 0 18px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif}
.dictionary-word{flex:1;min-width:0;color:var(--muted);overflow-wrap:anywhere}
.dictionary-word>span{color:var(--ink)}
.dictionary-word-links{order:3;display:flex;gap:2px;width:100%;padding:3px;border:1px solid var(--line);border-radius:8px;background:var(--panel-strong)}
.dictionary-word-links a{display:flex;flex:1;align-items:center;justify-content:center;min-height:44px;min-width:0;padding:6px 8px;border-radius:6px;text-decoration:none;white-space:nowrap;color:var(--muted)}
.dictionary-word-links a:hover{background:var(--accent-soft);color:var(--ink)}
.dictionary-word-links a[aria-current="page"]{background:var(--accent);color:var(--on-accent)}
.dictionary-search-link{display:inline-flex;align-items:center;min-height:44px;color:var(--link);text-decoration:none}
.dictionary-search-link:hover{text-decoration:underline;text-underline-offset:3px}
.entry-link,.entry-source a{color:var(--link)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.search-box input,.dictionary-picker select{min-height:44px;border-radius:8px;font-size:16px}
.keyboard button{min-height:40px}
.entry-header h2{font-family:Georgia,"Times New Roman",serif;font-weight:500;line-height:1.4}
.entry-gloss{font-weight:400;line-height:1.6}
.bdag-clean-body{font-size:18px;line-height:1.75}
.entry-text{overflow-wrap:anywhere}
html[data-embed] .entry-pane{padding:20px 24px}
html[data-embed="search"] .dictionary-picker{display:grid;padding:0 0 12px}
html[data-embed="search"] .search-box{padding:0 0 12px}
html[data-embed="search"] .keyboard{padding-inline:0}
html[data-embed="search"] .entry-header{position:static;margin:0;padding:0 0 16px;background:var(--panel);backdrop-filter:none}
html[data-embed="search"] .entry-header h2{font-size:28px;white-space:normal;overflow-wrap:anywhere}
html[data-embed="search"] .entry-header p{display:block;white-space:normal;overflow:visible}
html[data-embed="search"] .entry-close{justify-content:flex-start;min-height:44px}
@media(max-width:480px){
  html[data-embed] .entry-pane{padding:16px}
  .dictionary-word-links a{padding-inline:4px;font-size:12px}
  .entry-dictionaries{gap:0 8px}
  .entry-text,.bdag-clean-body{font-size:17px}
}
@media(prefers-reduced-motion:reduce){.entry-pane,.entry-action-status{transition:none}}
