/*
 &#x5E2;\&#x639; (Ayn\Ayn) Lookup -- a tools for transliteration of Arabic/Syriac text <br>to Hebrew writing system
and a convenience interface to on-line translation services/search engines.
<p>
Developed by Zeev Belkin ( https://zeevbelk.in ).<br>
© 2009, 2010, 2011, 2026 Ze'ev (Zeev, Vladimir) Belkin. All rights reserved.

 This file is a part of  &#x5E2;\&#x639; (Ayn\Ayn) Lookup and should  be used
 under the terms of the &#x5E2;\&#x639; (Ayn\Ayn) Lookup Source-Available License v3.0. See LICENSE.
 **/

:root {
  color-scheme: light;
  --page-bg: #dde4ec;
  --page-bg-strong: #eef3f8;
  --window-bg: #ffffff;
  --panel-bg: #f7f9fb;
  --panel-bg-strong: #ffffff;
  --line: #c7ced8;
  --line-strong: #94a0b2;
  --text: #15202b;
  --muted: #5b6675;
  --link: #4246ea;
  --tab-bg: #dbe2ea;
  --tab-bg-active: #ffffff;
  --tab-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --shadow: 0 18px 40px rgba(31, 42, 58, 0.15);
  --button-top: #ffffff;
  --button-bottom: #d7dee8;
  --button-border: #9eacbd;
  --primary-top: #fefefe;
  --primary-bottom: #d6edf9;
  --primary-border: #80aeca;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--page-bg-strong) 0%, var(--page-bg) 100%);
  color: var(--text);
  font-family: Tahoma, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.classic-shell {
  padding: 18px;
}

.window-shell {
  max-width: 1180px;
  margin: 0 auto;
  background: var(--window-bg);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.compact-window {
  max-width: 1080px;
}

.options-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
}

.options-shell .compact-window {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 860px;
}

.options-shell .window-header,
.options-shell .window-footer {
  flex: 0 0 auto;
}

.options-shell .window-header {
  padding: 8px 12px 6px;
  background: linear-gradient(180deg, #f3f3f3 0%, #e7e7e7 100%);
}

.options-shell .window-kicker,
.options-shell .window-subtitle {
  display: none;
}

.options-shell .window-title {
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 400;
}

.options-shell .tab-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

.options-shell #options-panels {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.options-shell #options-panels > .tab-panel {
  min-height: 0;
  overflow-y: auto;
}

.window-header {
  padding: 18px 22px 14px;
  background: linear-gradient(180deg, #fafcff 0%, #eef3f7 100%);
  border-bottom: 1px solid var(--line);
}

.window-kicker {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.window-title {
  margin: 0;
  font-family: "Palatino Linotype", Georgia, serif;
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 700;
}

.window-subtitle {
  margin: 8px 0 0;
  max-width: 78ch;
  color: var(--muted);
  line-height: 1.55;
}

.tab-frame {
  min-height: 640px;
}

.tab-strip {
  display: flex;
  gap: 6px;
  padding: 12px 14px 0;
  background: var(--tab-bg);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.tab-strip--nested {
  padding: 0 0 12px;
  background: transparent;
  border-bottom: 0;
}

.tab-button,
.primary-button,
.secondary-button,
.word-chip,
.variant-chip {
  font: inherit;
  border-radius: 8px;
  cursor: pointer;
}

.tab-button {
  border-style: solid;
  border-width: 1px 1px 0;
  border-color: #9baca0 #8a9c8f transparent #dde7de;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(231, 236, 232, 0.94) 100%);
  color: var(--text);
  padding: 6px 14px 7px;
  min-height: 34px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.tab-button.is-active {
  color: #99480c;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(224, 233, 223, 0.92) 100%);
  border-color: #9baca0 #8a9c8f transparent #dde7de;
  position: relative;
  top: 1px;
}

.tab-panel {
  display: none;
  padding: 16px;
}

.tab-panel.is-active {
  display: block;
}

.tab-panel--iframe,
.tab-panel--nested {
  padding: 0;
}

.doc-frame {
  display: block;
  width: 100%;
  min-height: 720px;
  height: 720px;
  border: 0;
  background: #fff;
}

.doc-frame--nested {
  min-height: 664px;
  height: 664px;
}

.lookup-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.field-label,
.footer-label {
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 116px;
  margin-top: 10px;
  padding: 14px 16px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.55;
}

textarea:focus,
.history-select:focus,
.option-item input:focus,
.option-item select:focus {
  outline: 2px solid rgba(66, 70, 234, 0.2);
  outline-offset: 1px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.action-row--spaced {
  justify-content: space-between;
}

.lookup-stack {
  display: grid;
  gap: 12px;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button {
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--button-border);
}

.primary-button {
  background: linear-gradient(180deg, var(--primary-top) 0%, var(--primary-bottom) 100%);
  border-color: var(--primary-border);
}

.secondary-button {
  background: linear-gradient(180deg, var(--button-top) 0%, var(--button-bottom) 100%);
}

.status-line,
.option-description,
.option-note,
.meta-label,
.link-note {
  color: var(--muted);
}

.status-line {
  margin: 0;
  line-height: 1.4;
}

.reading-shell {
  display: grid;
  gap: 10px;
  padding: 10px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.reading-meta-row,
.reading-original-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.script-chip {
  margin: 0;
  padding: 4px 10px;
  background: #eef3d8;
  border: 1px solid #c9d0b0;
  border-radius: 999px;
  font-weight: 700;
}

.reading-original {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.reading-pane {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 140px;
}

.reading-text {
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  line-height: 1.45;
  word-break: break-word;
}

.section-caption {
  margin: 0 0 10px;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.legacy-panel,
.legacy-link-group,
.option-group {
  background: var(--panel-bg-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.legacy-panel + .legacy-panel,
.legacy-panel + .note-list,
.note-list + .legacy-panel,
.legacy-link-group + .legacy-link-group {
  margin-top: 12px;
}

.summary-grid,
.options-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.options-grid--stacked {
  grid-template-columns: 1fr;
}

.tab-header {
  margin-top: -1em;
  text-align: left;
  padding-left: 1em;
}

.translit-header-link {
  color: black;
  font-size: 1.3em;
  font-weight: 300;
}

.translit-header-link a {
  color: black;
  font-weight: 600;
}

.meta-value {
  margin: 6px 0 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.legacy-transliteration {
  font-family: "Palatino Linotype", "Times New Roman", serif;
  font-size: 1.08rem;
}

.selectable-text {
  word-break: break-word;
}

.note-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.note-pill {
  margin: 0;
  padding: 6px 10px;
  background: #eef2f7;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.legacy-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.legacy-panel-header h2 {
  margin: 0;
  font-size: 1rem;
}

.legacy-panel-header p {
  margin: 0;
  color: var(--muted);
}

.parts-flow,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.word-chip,
.variant-chip {
  background: linear-gradient(180deg, #ffffff 0%, #edf2f7 100%);
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
}

.word-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

.word-chip-main,
.option-title,
.link-title {
  font-weight: 700;
}

.word-chip-sub {
  color: var(--muted);
  font-size: 0.84rem;
}

.part-separator {
  white-space: pre-wrap;
  line-height: 1.7;
}

.browser-shell {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #f7f7f7;
  overflow: hidden;
}

.service-strip {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 6px 6px 2px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f1f3f5 0%, #e5e9ee 100%);
}

.service-strip-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
  margin: 0 0 4px;
}

.service-strip-row:last-child {
  margin-bottom: 0;
}

.service-chip {
  display: inline-block;
  flex: 0 0 auto;
  width: auto;
  min-height: 0;
  min-width: 0;
  margin: 0;
  padding: 3px 9px 4px;
  border: 1px solid #b6bcc4;
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.18;
  cursor: pointer;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  text-align: left;
  box-shadow: none;
  vertical-align: top;
}

.service-chip.is-active {
  color: #000000;
  background: #fff82a;
  border-color: #c5bf55;
}

.service-chip:hover {
  background: #cff2ff;
  border-color: #aac8d8;
  filter: none;
}

.service-chip.is-active:hover {
  background: #fff82a;
  border-color: #c5bf55;
}

.preview-empty,
.preview-panel {
  min-height: 360px;
  background: #fff;
}

.preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.preview-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fbff 0%, #eef3f7 100%);
}

.preview-heading {
  display: grid;
  gap: 4px;
}

.preview-group {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preview-title {
  margin: 0;
  font-size: 1.15rem;
}

.preview-meta,
.preview-status {
  margin: 0;
  color: var(--muted);
}

.preview-status {
  padding: 10px 14px 0;
}

.preview-body {
  padding: 14px;
  overflow: auto;
}

.preview-document-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-style: italic;
}

.preview-document-heading,
.preview-subheading {
  margin: 0 0 10px;
  font-family: "Palatino Linotype", Georgia, serif;
}

.preview-paragraph {
  margin: 0 0 12px;
  line-height: 1.65;
}

.legacy-link-list {
  display: grid;
  gap: 8px;
}

.legacy-link-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f6f9 100%);
  text-decoration: none;
  color: inherit;
}

.legacy-link-item:hover,
.primary-button:hover,
.secondary-button:hover,
.word-chip:hover,
.variant-chip:hover,
.tab-button:hover {
  filter: brightness(0.99);
}

.window-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
}

.history-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 300px;
  min-width: 0;
}

.history-select {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  flex: 1 1 0;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.status-block {
  flex: 1 1 240px;
}

.option-group h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.option-list {
  display: grid;
  gap: 0;
}

.option-actions {
  display: flex;
  justify-content: flex-end;
  margin-block-start: 10px;
  padding-block-start: 10px;
  border-top: 1px solid #edf1f4;
}

[data-panel-id="translit"] {
  --option-row-padding: 6px;
}

.options-shell #options-panels > [data-panel-id="translit"].is-active {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

[data-panel-id="translit"] > .options-grid {
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: 0;
  min-height: 0;
}

.option-group--subtabs {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: 0;
}

.options-subpanels {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.options-subpanel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 12px;
}

.option-group-header .translit-header-link,
.options-subpanel .translit-header-link {
  margin: 0 0 12px;
}

@media (min-width: 640px) {
  [data-panel-id="translit"] .option-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
  }

  [data-panel-id="translit"] .option-list > * {
    grid-column: 1 / -1;
  }

  [data-panel-id="translit"] .option-item:is(
    [for="omitDageshFromUngeminatedDaletTav"],
    [for="useHatafPatah4AlifHamzaAbove"],
    [for="useHatafQamatz4WawHamzaAbove"],
    [for="useShvaForHamzaOnly"],
    [for="ignoreStandaloneMadda"]
  ) {
    grid-column: auto;
  }

  [data-option-subpanel-id="other"] .option-item {
    grid-column: auto;
  }

  [data-option-subpanel-id="other"] .option-item:nth-child(-n+2) {
    border-top: 0;
    padding-top: 0;
  }
}

.option-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: var(--option-row-padding, 10px) 0;
  border-top: 1px solid #edf1f4;
}

.option-item--select {
  grid-template-columns: minmax(0, 270px) minmax(180px, 260px);
  justify-content: start;
  align-items: center;
}

.translit-target-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;
}

.translit-target-row > .option-item--select {
  flex: 1 1 280px;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 150px);
}

.translit-target-row > .option-item[for="smartLatin"] {
  align-items: center;
  border-top: 0;
  padding: 0;
  white-space: nowrap;
}

.option-item--select select {
  width: 100%;
  min-height: 28px;
}

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

.option-item--disabled {
  opacity: 0.65;
}

.option-item--suboption {
  margin-inline-start: 28px;
  border-top: 0;
  padding-top: 0;
}

.option-item input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.option-copy {
  display: grid;
  gap: 3px;
}

.option-copy--standard {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  column-gap: 12px;
}

.option-standard {
  color: var(--muted);
  font-size: 0.9em;
  white-space: nowrap;
}

.option-with-references {
  padding: var(--option-row-padding, 10px) 0;
  border-top: 1px solid #edf1f4;
}

.option-with-references:first-child {
  border-top: 0;
  padding-top: 0;
}

.option-with-references > .option-item {
  border-top: 0;
  padding: 0;
}

.option-references {
  margin: 4px 0 0 28px;
  padding-inline-start: 18px;
  line-height: 1.4;
}

.option-with-suboptions {
  min-width: 0;
  padding: var(--option-row-padding, 10px) 0;
  border-top: 1px solid #edf1f4;
}

.option-with-suboptions:first-child {
  border-top: 0;
  padding-top: 0;
}

.option-with-suboptions > .option-item {
  border-top: 0;
  padding: 0;
}

.option-suboptions {
  min-width: 0;
  margin: 8px 0 0 28px;
  padding: 0;
  border: 0;
}

.option-suboptions legend {
  margin-bottom: 4px;
  padding: 0;
  color: var(--muted);
  font-size: 0.9em;
}

.option-suboptions .option-item {
  padding: 5px 0;
  border-top: 0;
}

.option-suboptions .option-item--select {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.option-suboptions .option-with-references {
  border-top: 0;
}

.option-suboptions .option-references {
  font-size: 0.9em;
}

.option-suboptions [hidden] {
  display: none;
}

.option-reading-details {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #edf1f4;
}

.option-reading-details > summary {
  cursor: pointer;
  font-weight: bold;
  padding: 4px 0;
}

.legacy-search-tab-panel {
  padding: 8px;
}

.legacy-search-shell {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  min-height: 392px;
  border: 1px solid #cfd5db;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #f4f4f4;
}

.legacy-search-subtabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0 12px 10px;
  border-right: 1px solid #d6dadd;
  background: linear-gradient(180deg, #f5f4f2 0%, #efefef 100%);
}

.legacy-search-subtab {
  width: 58px;
  min-height: 26px;
  padding: 4px 6px;
  border: 1px solid #bfc8cf;
  border-right-color: #b8c1c9;
  background: linear-gradient(180deg, #fefefe 0%, #ededed 100%);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}

.legacy-search-subtab.is-active {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-right-color: #ffffff;
  color: #b35a1f;
}

.legacy-search-panels {
  min-width: 0;
  padding: 12px 16px;
  background: #ffffff;
}

.legacy-search-subpanel {
  display: none;
}

.legacy-search-subpanel.is-active {
  display: block;
}

.legacy-search-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.legacy-search-list--lang {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 28px;
}

.legacy-search-list--lang > .legacy-search-option-group {
  grid-column: 1 / -1;
}

.legacy-search-option-group {
  display: grid;
  gap: 6px;
}

.legacy-search-option-group--living-arabic {
  min-width: 0;
  margin: 0;
  padding: 6px 11px 11px;
  border: 1px solid #cfd5db;
  box-shadow: inset 0 0 0 1px #f4f4f4;
}

.legacy-search-option-group-title {
  padding: 0 4px;
}

.legacy-search-checkbox-subgroups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-inline-start: 24px;
}

.legacy-search-checkbox-subgroup {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.legacy-search-checkbox-subgroup legend {
  margin: 0 0 5px;
  padding: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.legacy-search-checkbox-subgroup-list {
  display: grid;
  gap: 5px;
}

.legacy-search-checkbox-subgroup--columns {
  grid-column: 1 / -1;
}

.legacy-search-checkbox-subgroup--columns .legacy-search-checkbox-subgroup-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.legacy-search-checkbox-subgroup-list .legacy-search-suboption-checkbox {
  margin-inline-start: 0;
}

.legacy-search-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--text);
  font-size: 0.95rem;
}

.legacy-search-item input {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
}

.legacy-search-item--disabled {
  color: #7a838d;
}

.legacy-search-label {
  line-height: 1.3;
}

.legacy-search-suboption {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr);
  gap: 8px;
  align-items: center;
  margin-inline-start: 24px;
  color: var(--text);
  font-size: 0.9rem;
}

.legacy-search-suboption select {
  min-width: 0;
  max-width: 220px;
  padding: 3px 6px;
}

.legacy-search-suboption-checkbox {
  margin-inline-start: 24px;
  font-size: 0.9rem;
}

.legacy-search-suboption-label--inactive {
  opacity: 0.55;
}

.legacy-search-suboption-label--warning {
  color: #b42318;
  font-weight: 700;
}

.legacy-search-footnote {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.legacy-wiki-tab-panel {
  padding: 8px;
}

.legacy-wiki-shell {
  min-height: 392px;
  width: 100%;
  min-width: 0;
  padding: 14px 12px 12px;
  border: 1px solid #cfd5db;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #f4f4f4;
}

.legacy-wiki-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.legacy-wiki-group {
  min-width: 0;
  min-inline-size: 0;
  margin: 0;
  padding: 10px 10px 12px;
  border: 1px solid #cfd5db;
  background: #ffffff;
}

.legacy-wiki-group > legend {
  padding: 0 4px;
  color: #000000;
  font-size: 0.92rem;
}

.legacy-wiki-list {
  display: grid;
  gap: 7px;
  align-content: start;
}

.legacy-wiki-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: #000000;
  font-size: 0.95rem;
}

.legacy-wiki-item input {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
}

.legacy-wiki-label {
  line-height: 1.3;
}

.legacy-wiki-options {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 24px;
  margin-top: 10px;
}

.legacy-translation-tab-panel {
  padding: 8px;
}

.legacy-translation-shell {
  display: grid;
  gap: 8px;
  min-height: 392px;
  width: 100%;
  min-width: 0;
  padding: 14px 12px 12px;
  border: 1px solid #cfd5db;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #f4f4f4;
}

.legacy-translation-columns,
.legacy-translation-bottom {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.legacy-translation-group {
  max-width: 100%;
  min-width: 0;
  min-inline-size: 0;
  width: 100%;
  margin: 0;
  padding: 8px 10px 10px;
  border: 1px solid #cfd5db;
  background: #ffffff;
}

.legacy-translation-group > legend {
  padding: 0 4px;
  color: #000000;
  font-size: 0.92rem;
}

.legacy-translation-bottom .legacy-translation-group > legend {
  display: none;
}

.legacy-translation-list {
  display: grid;
  gap: 7px;
  align-content: start;
}

.legacy-translation-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--text);
  font-size: 0.95rem;
}

.legacy-translation-suboption {
  margin-inline-start: 24px;
  font-size: 0.9rem;
}

.legacy-translation-item input {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
}

.legacy-translation-label {
  line-height: 1.3;
}

.auxiliary-panel + .auxiliary-panel {
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

.doc-page {
  padding: 18px;
  background: #fff;
}

.doc-copy {
  max-width: 920px;
  margin: 0 auto;
  color: var(--text);
  line-height: 1.6;
}

.doc-copy h1,
.doc-copy h2 {
  font-family: "Palatino Linotype", Georgia, serif;
}

.doc-copy h1 {
  margin-top: 0;
}

.doc-copy a,
.doc-copy .link-like {
  color: var(--link);
}

.doc-copy ul,
.doc-copy ol {
  padding-left: 22px;
}

.mapping-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}

.mapping-table th,
.mapping-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: top;
}

.mapping-table th {
  text-align: left;
  background: #f4f7fa;
}

.mytd {
  font-size: 1.55rem;
  direction: rtl;
  text-align: center;
  font-family: "Palatino Linotype", "Times New Roman", serif;
}

.embedded-view {
  padding: 0;
  background: #fff;
}

.embedded-view .window-shell {
  max-width: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.embedded-view .window-header {
  padding: 14px 16px 12px;
}

.embedded-view .window-footer {
  position: sticky;
  bottom: 0;
}

.options-shell.embedded-view {
  background: #efefef;
}

.options-shell.embedded-view .window-shell {
  background: #efefef;
}

.options-shell.embedded-view .window-header {
  display: none;
}

.options-shell.embedded-view .tab-frame {
  min-height: 0;
}

.options-shell.embedded-view .tab-strip {
  padding: 6px 8px 0;
  background: linear-gradient(180deg, #eceff3 0%, #dfe5ec 100%);
  border-bottom: 1px solid #bcc6d0;
}

.options-shell.embedded-view .tab-panel {
  padding: 8px;
}

.options-shell.embedded-view .window-footer {
  justify-content: flex-end;
  padding: 8px 10px 10px;
  border-top: 1px solid #c6cdd7;
  background: linear-gradient(180deg, #f3f4f6 0%, #e3e7ec 100%);
}

.options-shell.embedded-view .status-block {
  display: none;
}

.result-page {
  padding: 0;
  height: 100vh;
  min-height: 0;
  background: #fff;
  max-width: 100vw;
  overflow-x: hidden;
  overflow-y: hidden;
}

.result-window-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow-x: hidden;
  width: 100%;
}

.result-tab-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.classic-main-tabs {
  gap: 3px;
  padding: 4px 6px 0;
  background: linear-gradient(180deg, #f6f6f6 0%, #e4e7eb 100%);
  border-bottom: 1px solid #bfc8d2;
}

.translit-font-controls {
  display: inline-flex;
  align-self: center;
  align-items: center;
  gap: 2px;
  margin: 0 2px 4px auto;
}

.lookup-progress-slot {
  display: inline-flex;
  flex: 0 0 22px;
  align-self: center;
  align-items: center;
  justify-content: flex-end;
  height: 18px;
  margin: 0 0 4px;
}

.lookup-progress {
  display: inline-flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
}

.lookup-progress[hidden] {
  display: none;
}

.lookup-progress-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #aebcca;
  border-top-color: #3f6f9d;
  border-radius: 50%;
  animation: lookup-progress-spin 0.8s linear infinite;
}

.browser-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

.browser-loading[hidden] {
  display: none;
}

.browser-loading-spinner {
  box-sizing: border-box;
  width: 64px;
  height: 64px;
  border: 6px solid #c3ced9;
  border-top-color: #3f6f9d;
  border-radius: 50%;
  animation: lookup-progress-spin 0.8s linear infinite;
}

@keyframes lookup-progress-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lookup-progress-spinner,
  .browser-loading-spinner {
    animation: none;
  }
}

.result-tab-panel {
  padding: 6px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

#lookup-panel.result-tab-panel.is-active {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.result-layout {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.translit-pane {
  height: 158px;
  min-height: 96px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #b8c1cc;
  background: #fff;
}

.translit-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.splitter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 10px;
  border: 1px solid #ccd3dc;
  border-top: 0;
  background: linear-gradient(180deg, #f4f5f6 0%, #dfe3e8 100%);
  cursor: row-resize;
  touch-action: none;
  user-select: none;
}

.splitter-bar:hover,
.splitter-bar:focus-visible,
.splitter-bar.is-dragging {
  background: linear-gradient(180deg, #eef4fa 0%, #cbd8e5 100%);
}

.splitter-bar:focus-visible {
  outline: 2px solid #547da5;
  outline-offset: -2px;
}

.result-page.is-resizing-panes {
  cursor: row-resize;
  user-select: none;
}

.result-page.is-resizing-panes iframe {
  pointer-events: none;
}

.grippy {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: #aab4bf;
}

.dict-vbox {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid #b8c1cc;
  background: #f2f2f2;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.tab-captions-box {
  --source-strip-inset: 3px;
  position: relative;
  z-index: 3;
  padding: var(--source-strip-inset);
  border-bottom: 1px solid #c5ccd6;
  background: #ece6e6;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.sanskrit-sandhi:not([hidden]) {
  display: flex;
  align-items: stretch;
  margin: calc(-1 * var(--source-strip-inset)) calc(-1 * var(--source-strip-inset)) var(--source-strip-inset);
  background: #ffffff;
  border-bottom: 1px solid #c5ccd6;
}

#sanskrit-sandhi-label,
#sanskrit-morphology-label {
  display: flex;
  flex: none;
  align-items: center;
  padding: 4px 7px;
  background: #eae6e6;
}

.sanskrit-sandhi ul {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
}

.sanskrit-sandhi li {
  padding: 4px 10px;
}

.sanskrit-sandhi li + li {
  border-top: 1px solid #c5ccd6;
}

.note-list--compact {
  gap: 6px;
  margin-top: 0;
}

.lookup-status--compact {
  min-height: 1.2rem;
  font-size: 0.88rem;
}

.dict-hbox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  height: 100%;
  min-height: 310px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

.dict-browser-shell {
  position: relative;
  overflow: hidden;
  background: #fff;
  height: 100%;
  min-height: 310px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.dict-pane-stack {
  position: relative;
  height: 100%;
  min-height: 310px;
  width: 100%;
  overflow: hidden;
  min-width: 0;
}

.dict-browser-pane {
  display: none;
  height: 100%;
  width: 100%;
  min-height: 310px;
  position: relative;
}

.dict-browser-pane.is-active {
  display: block;
}

.provider-verification {
  box-sizing: border-box;
  height: 74px;
  padding: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  overflow: auto;
  background: #fff8db;
  color: #302600;
  border-bottom: 1px solid #c8aa50;
}

.provider-verification span {
  flex-basis: 100%;
}

.dict-browser-pane.has-verification .dict-browser-frame {
  height: calc(100% - 74px);
  min-height: 236px;
}

.provider-rate-limit {
  padding: 6px;
  background: #fff8db;
  color: #302600;
}

.dict-browser-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 310px;
  border: 0;
  background: #fff;
  min-width: 0;
}

.classic-browser-empty {
  height: 100%;
  min-height: 310px;
  border: 0;
}

.browser-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 4px;
  border-left: 1px solid #c5ccd6;
  background: linear-gradient(180deg, #f4f6f8 0%, #e6eaf0 100%);
}

.browser-toolbar-button {
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--button-border);
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #e9edf2 100%);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.browser-toolbar-button--icon {
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  color: transparent;
  text-indent: -9999px;
  overflow: hidden;
}

#new-lookup {
  background-image: url("classic-toolbar/new_lookup.svg");
}

#zoom-in,
#translit-zoom-in {
  background-image: url("classic-toolbar/zoom_in.png");
}

#zoom-out,
#translit-zoom-out {
  background-image: url("classic-toolbar/zoom_out.png");
}

#open-selected-service {
  background-image: url("classic-toolbar/new_tab.png");
}

.browser-toolbar-button--google-ai-mode {
  background-image: url("classic-toolbar/new_tab_ai_mode.svg");
}

#browser-back {
  background-image: url("classic-toolbar/back.png");
}

#reload-selected-preview {
  background-image: url("classic-toolbar/reload.png");
}

.browser-toolbar-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.result-tab-frame .tab-panel--iframe {
  min-height: 0;
  padding: 0;
}

.result-tab-frame .tab-panel--iframe.is-active {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

#about-panel.is-active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.result-page .result-doc-frame {
  min-height: 0;
  height: 100%;
}

.result-footer {
  padding: 6px 8px;
  border-top: 1px solid #bcc4cf;
  background: linear-gradient(180deg, #f5f6f8 0%, #e6eaef 100%);
}

.search-dialog-body {
  margin: 0;
  min-height: 100vh;
  height: 100vh;
  background: #eceff3;
  display: grid;
  place-items: stretch;
  overflow: hidden;
}

.search-dialog-shell {
  display: grid;
  min-height: 100vh;
  height: 100vh;
  padding: 4px;
}

.search-dialog-form {
  display: grid;
  min-height: 0;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid #b8c1cc;
  background: #fff;
}

.search-dialog-label {
  font-weight: 700;
  line-height: 1.2;
}

.search-dialog-textarea {
  min-height: 0;
  height: 100%;
  margin-top: 0;
  padding: 6px 8px;
  font-size: 12pt;
  line-height: 1.25;
  resize: none;
}

.search-dialog-actions {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.search-dialog-actions .secondary-button {
  min-height: 28px;
  padding: 4px 10px;
}

.manual-lookup-dialog {
  width: min(560px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #eceff3;
  color: var(--text);
  box-shadow: var(--shadow);
}

.manual-lookup-dialog::backdrop {
  background: rgba(21, 32, 43, 0.3);
}

.manual-lookup-dialog .search-dialog-form {
  height: auto;
  grid-template-rows: auto auto auto auto auto;
  gap: 8px;
  padding: 12px;
}

.manual-lookup-dialog .search-dialog-textarea {
  height: clamp(80px, 30vh, 220px);
}

.manual-lookup-dialog .search-dialog-actions {
  justify-content: flex-end;
}

.manual-lookup-hint,
.manual-lookup-error {
  margin: 0;
  font-size: 12px;
}

.manual-lookup-hint {
  color: var(--muted);
}

.manual-lookup-error {
  color: #9b2020;
}

.translit-frame-body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: #fff;
  color: var(--text);
  font-family: Tahoma, "Segoe UI", sans-serif;
}

.translit-frame-container {
  min-height: 156px;
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  font-size: 26px;
  line-height: 1.5;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.translit-result {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.translit-word {
  cursor: pointer;
}

/* Ornate Arabic parentheses do not mirror automatically in an LTR paragraph. */
.translit-verse-number {
  direction: rtl;
  unicode-bidi: isolate;
  white-space: nowrap;
}

.translit-word:hover,
.translit-word.is-active {
  color: #d53131;
}

.lift-shadda {
  display: inline-block;
  position: relative;
  top: -0.3em;
  /*margin-left: -0.25em;*/
}

.translit-pair:hover .translit-word {
  color: #d53131;
}

.translit-pair-separator {
  color: var(--muted);
}

.translit-word--transliterated,
.translit-word--kana {
  white-space: nowrap;
}

@media (max-width: 920px) {
  .doc-frame,
  .doc-frame--nested {
    height: 620px;
    min-height: 620px;
  }
}

@media (max-width: 720px) {
  .legacy-search-list--lang {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .classic-shell {
    padding: 10px;
  }

  .window-header,
  .tab-panel {
    padding: 14px;
  }

  .tab-strip {
    padding: 10px 10px 0;
  }

  .action-row--spaced,
  .window-footer,
  .legacy-panel-header,
  .history-group,
  .preview-toolbar,
  .reading-meta-row,
  .reading-original-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .options-shell .status-block {
    flex-basis: auto;
  }

  .history-select {
    min-width: 0;
    width: 100%;
  }

  .dict-hbox {
    grid-template-columns: 1fr;
  }

  .browser-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: 0;
    border-top: 1px solid #c5ccd6;
  }

  .legacy-translation-columns,
  .legacy-translation-bottom {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .legacy-search-list--lang {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 480px) {
  .options-shell {
    padding: 0;
  }

  .options-shell .window-footer {
    gap: 0;
    padding-block: 6px;
  }
}
