/* The supplied mobile design: quiet serif pages, hairlines, and one green accent. */
:root {
  --page: #ffffff;
  --ink: #16181a;
  --soft: #3a3f44;
  --muted: #5a6066;
  --hairline: #e4e6e8;
  --border: #d5d8db;
  --field: #c4c8cc;
  --accent: #0f5b4a;
  --accent-hover: #093d32;
  --highlight: #d9ede7;
  --tint: #f4f5f6;
  --scrim: #e9ebec;
  --warning: #8a4b00;
  /* shadcn primitives use the same design tokens. */
  --background: var(--page);
  --foreground: var(--ink);
  --card: var(--page);
  --card-foreground: var(--ink);
  --popover: var(--page);
  --popover-foreground: var(--ink);
  --primary: var(--accent);
  --primary-foreground: #ffffff;
  --secondary: var(--tint);
  --secondary-foreground: var(--ink);
  --muted-foreground: var(--muted);
  --accent-foreground: var(--accent);
  --input: var(--field);
  --ring: var(--accent);
  --radius: 4px;
}

body {
  margin: 0;
  background: var(--page);
}

.reader-shell, .sheet-document {
  box-sizing: border-box;
  color: var(--ink);
  font-family: Newsreader, Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

:is(.reader-shell, .sheet-document) *, :is(.reader-shell, .sheet-document) *::before, :is(.reader-shell, .sheet-document) *::after {
  box-sizing: border-box;
}

.reader-shell {
  width: 100%;
  max-width: 720px;
  min-height: 100svh;
  margin-inline: auto;
  padding: 0 24px 32px;
}

.reader-shell.with-nav {
  padding-bottom: calc(94px + env(safe-area-inset-bottom, 0px));
}

:is(.reader-shell, .sheet-document) :is(h1, h2, h3, p) {
  margin-top: 0;
}

:is(.reader-shell, .sheet-document) :is(h1, h2, h3) {
  color: var(--ink);
  font-family: inherit;
  font-weight: 500;
}

:is(.reader-shell, .sheet-document) h1 {
  margin-bottom: 20px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -.02em;
}

:is(.reader-shell, .sheet-document) h2 {
  margin-bottom: 12px;
  font-size: 22px;
  line-height: 1.25;
}

:is(.reader-shell, .sheet-document) h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.3;
}

:is(.reader-shell, .sheet-document) p {
  margin-bottom: 16px;
}

:is(.reader-shell, .sheet-document) a {
  color: var(--accent);
  text-underline-offset: 3px;
}

:is(.reader-shell, .sheet-document) a:hover {
  color: var(--accent-hover);
}

:is(.reader-shell, .sheet-document) :is(button, input, select, textarea) {
  color: inherit;
  font: inherit;
  touch-action: manipulation;
}

:is(.reader-shell, .sheet-document) button {
  cursor: pointer;
}

:is(.reader-shell, .sheet-document) :is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

:is(.reader-shell, .sheet-document) svg {
  flex-shrink: 0;
  vertical-align: middle;
}

:is(.reader-shell, .sheet-document) :is(img, video, iframe) {
  max-width: 100%;
}

:is(.reader-shell, .sheet-document) .muted {
  color: var(--muted);
}

:is(.reader-shell, .sheet-document) .small {
  font-size: 14px;
}

/* Page headers and the three text navigation links. */
.reader-shell .site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.reader-shell .site-header.compact {
  min-height: 64px;
  margin-inline: -10px;
}

.reader-shell .wordmark {
  color: var(--ink);
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.reader-shell .wordmark span {
  color: inherit;
}

.reader-shell .header-account {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 14px;
}

.reader-shell :is(.language-pill, .language) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.reader-shell .sign-in-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
}

.reader-shell .site-footer {
  display: none;
}

.reader-shell .bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  max-width: 720px;
  min-height: calc(70px + env(safe-area-inset-bottom, 0px));
  margin-inline: auto;
  padding: 9px 24px calc(9px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--hairline);
  background: var(--page);
}

.reader-shell .bottom-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 44px;
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}

.reader-shell .bottom-nav svg {
  display: none;
}

.reader-shell .bottom-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 7px;
  text-decoration-thickness: 1px;
}

/* Ask: one question, an underline composer, threads, and modest poem cards. */
.reader-shell .home-intro {
  padding: 15px 0 24px;
}

.reader-shell .home-intro h1 {
  max-width: 430px;
  margin-bottom: 24px;
  font-size: 30px;
  line-height: 1.12;
}

.reader-shell .home-intro > .small {
  margin: 12px 0 0;
}

:is(.reader-shell, .sheet-document) .eyebrow {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

:is(.reader-shell, .sheet-document) .search-form {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  box-shadow: none;
}

:is(.reader-shell, .sheet-document) .search-form input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  height: auto;
  padding: 6px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  box-shadow: none;
}

:is(.reader-shell, .sheet-document) input::placeholder, :is(.reader-shell, .sheet-document) textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

:is(.reader-shell, .sheet-document) .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  box-shadow: none;
}

:is(.reader-shell, .sheet-document) .icon-button svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8px;
}

:is(.reader-shell, .sheet-document) .send-circle {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
}

:is(.reader-shell, .sheet-document) .send-circle:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.reader-shell .thread-list {
  margin-bottom: 24px;
}

.reader-shell .thread-list > h2 {
  margin-bottom: 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.reader-shell .thread-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-height: 50px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 17px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.reader-shell .thread-row > span:last-child {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.reader-shell .section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-top: 14px;
}

.reader-shell .section-heading h2 {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.reader-shell .section-heading a {
  flex-shrink: 0;
  font-size: 14px;
}

.reader-shell .poem-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.reader-shell .poem-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 136px;
  padding: 16px 14px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--page);
  color: var(--ink);
  text-decoration: none;
  box-shadow: none;
}

.reader-shell .poem-card:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.reader-shell .card-ar {
  margin: 0 0 18px;
  font-family: Amiri, "Noto Naskh Arabic", serif;
  font-size: 24px;
  line-height: 1.45;
  text-align: right;
  overflow-wrap: anywhere;
}

.reader-shell .card-ar.second-half {
  margin-top: -12px;
  font-size: 20px;
}

.reader-shell .card-caption {
  margin-top: auto;
}

.reader-shell .card-caption h3 {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
}

.reader-shell .card-caption p {
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
}

:is(.reader-shell, .sheet-document) .review-label {
  display: inline-block;
  color: var(--warning);
  font-size: 13px;
  line-height: 1.35;
}

:is(.reader-shell, .sheet-document) .section-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

/* Hairline library rows and horizontal, keyboard-accessible sorting chips. */
:is(.reader-shell, .sheet-document) .page-heading {
  margin-bottom: 22px;
  padding-top: 14px;
}

:is(.reader-shell, .sheet-document) .page-heading h1 {
  margin-bottom: 12px;
  font-size: 26px;
}

:is(.reader-shell, .sheet-document) .page-heading p:last-child {
  margin-bottom: 0;
}

:is(.reader-shell, .sheet-document) .chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -2px;
  padding: 16px 2px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

:is(.reader-shell, .sheet-document) .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
}

:is(.reader-shell, .sheet-document) .chip.selected, :is(.reader-shell, .sheet-document) .chip[aria-current="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.reader-shell .library-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  text-decoration: none;
}

.reader-shell .library-row h2 {
  margin: 0 0 3px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.25;
}

.reader-shell .library-row p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.reader-shell .library-row .row-ar {
  color: var(--ink);
  font-family: Amiri, "Noto Naskh Arabic", serif;
  font-size: 24px;
  line-height: 1.5;
  text-align: right;
  overflow-wrap: anywhere;
}

/* Reader: the Arabic stays prominent, with translations aligned to the page. */
.reader-shell .reading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  padding: 0;
}

.reader-shell .reading-actions form {
  margin: 0;
}

.reader-shell .action-count {
  margin-inline-start: 2px;
  font-size: 12px;
}

:is(.reader-shell, .sheet-document) .icon-button[aria-pressed="true"] {
  color: var(--accent);
}

.reader-shell .poem-heading {
  padding: 5px 0 18px;
  text-align: center;
}

.reader-shell .poem-heading h1 {
  margin-bottom: 3px;
  font-family: Amiri, "Noto Naskh Arabic", serif;
  font-size: 32px;
  line-height: 1.6;
  letter-spacing: 0;
}

.reader-shell .poem-heading h2 {
  margin-bottom: 4px;
  font-size: 18px;
  font-weight: 400;
}

.reader-shell .poem-heading p {
  margin-bottom: 8px;
}

.reader-shell .poem-byline {
  color: var(--ink);
  font-size: 17px;
}

.reader-shell .reading-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 8px 20px;
  margin-top: 12px;
  font-size: 14px;
}

.reader-shell .reading-meta a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
}

.reader-shell .reading-meta svg {
  width: 15px;
  height: 15px;
}

.reader-shell .translation-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

:is(.reader-shell, .sheet-document) .text-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  overflow-x: auto;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}

:is(.reader-shell, .sheet-document) .text-tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 5px;
  min-height: 46px;
  padding: 0 5px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
}

:is(.reader-shell, .sheet-document) .text-tabs a[aria-current="page"] {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

:is(.reader-shell, .sheet-document) .text-tabs .tab-count {
  font-size: 13px;
}

:is(.reader-shell, .sheet-document) .context {
  margin-block: 16px;
  padding: 12px 14px;
  border-radius: 4px;
  background: var(--tint);
  color: var(--soft);
}

:is(.reader-shell, .sheet-document) .context p:last-child {
  margin-bottom: 0;
}

.reader-shell .verse {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 0;
  padding: 16px 0 18px;
  scroll-margin-top: 20px;
}

.reader-shell .verse.is-excerpt-match {
  margin-inline: -12px;
  padding-inline: 12px;
  background: #f0f7f4;
  box-shadow: inset 2px 0 var(--accent);
}

.reader-shell .verse.excerpt-match-start {
  border-start-start-radius: 4px;
  border-start-end-radius: 4px;
}

.reader-shell .verse.excerpt-match-end {
  border-end-start-radius: 4px;
  border-end-end-radius: 4px;
}

.reader-shell .excerpt-match-label {
  grid-column: 1 / -1;
  grid-row: 1;
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 14px;
}

.reader-shell .excerpt-match-start .line-number {
  grid-row: 2;
}

.reader-shell .line-number {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  min-height: 44px;
  padding-top: 6px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: underline;
}

.reader-shell .verse-content {
  display: contents;
  min-width: 0;
}

:is(.reader-shell, .sheet-document) .arabic-verse {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  color: var(--ink);
  font-family: Amiri, "Noto Naskh Arabic", serif;
  font-size: 22px;
  line-height: 1.7;
  text-align: right;
  overflow-wrap: anywhere;
}

.reader-shell .verse .arabic-verse {
  grid-column: 2;
}

:is(.reader-shell, .sheet-document) .arabic-verse p {
  margin: 0;
}

:is(.reader-shell, .sheet-document) .verse-translation {
  margin: 10px 0 0;
  color: var(--soft);
  font-size: 17px;
  font-style: italic;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.reader-shell .verse .verse-translation, .reader-shell .verse .verse-notes, .reader-shell .verse .review-label, .reader-shell .verse .selection-note {
  grid-column: 1 / -1;
}

.reader-shell .verse-notes {
  margin: 8px 0 0;
  font-size: 13px;
}

.reader-shell .verse-notes a {
  color: var(--muted);
}

:is(.reader-shell, .sheet-document) .arabic-word {
  color: inherit;
  text-decoration: none;
}

:is(.reader-shell, .sheet-document) .note-highlight {
  background: var(--highlight);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 5px;
}

:is(.reader-shell, .sheet-document) .translated-phrase {
  color: inherit;
  text-decoration: none;
}

:is(.reader-shell, .sheet-document) .translated-phrase:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.reader-shell .selection-note {
  margin-top: 12px;
  font-size: 14px;
}

.reader-shell .reading-end {
  margin: 24px 0 0;
  padding: 20px 0;
  color: var(--muted);
  font-size: 16px;
  text-align: center;
}

/* Sources, notes, recitations, and the remaining forms share the same language. */
:is(.reader-shell, .sheet-document) .source-quote {
  margin: 20px 0;
  padding: 0;
  color: var(--ink);
  font-family: Amiri, "Noto Naskh Arabic", serif;
  font-size: 24px;
  line-height: 1.7;
  text-align: right;
  overflow-wrap: anywhere;
}

:is(.reader-shell, .sheet-document) .source-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}

:is(.reader-shell, .sheet-document) .source-row h2, :is(.reader-shell, .sheet-document) .source-row h3 {
  margin-bottom: 5px;
  font-size: 18px;
  font-weight: 400;
}

:is(.reader-shell, .sheet-document) .source-row p {
  margin-bottom: 8px;
}

:is(.reader-shell, .sheet-document) .source-row .small {
  overflow-wrap: anywhere;
}

:is(.reader-shell, .sheet-document) .source-row a svg {
  width: 16px;
}

:is(.reader-shell, .sheet-document) .source-row form {
  margin-top: 12px;
}

:is(.reader-shell, .sheet-document) .passage-text {
  margin: 24px 0;
  color: var(--ink);
  font-family: Amiri, "Noto Naskh Arabic", serif;
  font-size: 22px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

:is(.reader-shell, .sheet-document) .empty {
  padding: 24px 0;
  color: var(--muted);
}

:is(.reader-shell, .sheet-document) .primary-button, :is(.reader-shell, .sheet-document) .secondary-button, :is(.reader-shell, .sheet-document) [data-slot="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  height: auto;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  box-shadow: none;
}

:is(.reader-shell, .sheet-document) .primary-button:hover, :is(.reader-shell, .sheet-document) [data-slot="button"]:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

:is(.reader-shell, .sheet-document) .secondary-button, :is(.reader-shell, .sheet-document) [data-slot="button"][data-variant="outline"] {
  border-color: var(--border);
  background: var(--page);
  color: var(--ink);
}

:is(.reader-shell, .sheet-document) .secondary-button:hover, :is(.reader-shell, .sheet-document) [data-slot="button"][data-variant="outline"]:hover {
  border-color: var(--accent);
  background: var(--page);
  color: var(--accent);
}

:is(.reader-shell, .sheet-document) .icon-button[data-slot="button"] {
  width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}

:is(.reader-shell, .sheet-document) .send-circle[data-slot="button"] {
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
}

:is(.reader-shell, .sheet-document) .icon-button[data-slot="button"][aria-pressed="true"] {
  color: var(--accent);
}

:is(.reader-shell, .sheet-document) button:disabled, :is(.reader-shell, .sheet-document) fieldset:disabled {
  cursor: not-allowed;
  opacity: .55;
}

:is(.reader-shell, .sheet-document) fieldset {
  min-width: 0;
  margin: 20px 0;
  padding: 0;
  border: 0;
}

:is(.reader-shell, .sheet-document) legend {
  margin-bottom: 12px;
}

:is(.reader-shell, .sheet-document) .form-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-block: 7px;
  border-bottom: 1px solid var(--hairline);
}

:is(.reader-shell, .sheet-document) :is(input, select, textarea) {
  max-width: 100%;
}

:is(.reader-shell, .sheet-document) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), :is(.reader-shell, .sheet-document) select {
  min-height: 44px;
}

:is(.reader-shell, .sheet-document) :is(input[type="checkbox"], input[type="radio"]) {
  width: 18px;
  height: 18px;
  margin-inline-end: 6px;
  vertical-align: middle;
  accent-color: var(--accent);
}

:is(.reader-shell, .sheet-document) textarea {
  display: block;
  width: 100%;
  min-height: 110px;
  margin: 8px 0 20px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--page);
  color: var(--ink);
  line-height: 1.45;
  resize: vertical;
  box-shadow: none;
}

.reader-shell main > form:not(.search-form), .sheet-document > form {
  display: grid;
  gap: 12px;
}

.reader-shell main > form:not(.search-form) > input:not([type="hidden"]), .reader-shell main > form:not(.search-form) > label > input:not([type="checkbox"]):not([type="radio"]), .reader-shell main > form:not(.search-form) > select {
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--page);
  box-shadow: none;
}

:is(.reader-shell, .sheet-document) .source-row form select {
  width: 100%;
  margin: 8px 0 18px;
}

.reader-shell .recitation-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
  border: 0;
  border-radius: 4px;
  background: var(--ink);
}

.reader-shell .recitation-embed[data-provider="instagram"] {
  width: 100%;
  max-width: 540px;
  margin: 0 auto 16px;
  container-type: inline-size;
}

.reader-shell .recitation-player[data-provider="instagram"] {
  display: block;
  aspect-ratio: auto;
  /* The portrait video needs space for Instagram's header and controls too. */
  height: calc(100cqw * 16 / 9 + 200px);
  margin-bottom: 0;
  background: var(--page);
}

/* Fetched notes, sign-in, and sources retain their styling inside the Drawer. */
.sheet-document {
  width: 100%;
  min-width: 0;
  padding: 8px 24px 24px;
  background: var(--page);
  overflow-wrap: anywhere;
}

.sheet-document .page-heading {
  padding-top: 8px;
}

.sheet-document .page-heading h1 {
  font-size: 26px;
}

.sheet-document .site-header, .sheet-document .site-footer, .sheet-document .bottom-nav {
  display: none;
}

.sheet-document .note .small {
  font-size: 13px;
}

.sheet-document .note > p {
  margin-bottom: 10px;
}

.sheet-document #composer {
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  background: var(--page);
}

.sheet-document #composer h2 {
  font-size: 18px;
}

.sheet-document #composer form {
  display: grid;
  gap: 8px;
}

.sheet-document #composer textarea {
  margin-bottom: 8px;
}

.sheet-document #composer .primary-button {
  justify-self: end;
}

/* Specific compositions override the registry's default button sizing. */
.reader-shell .header-title {
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.reader-shell .language-pill[data-slot="button"] {
  min-height: 44px;
  padding: 0 13px;
  font-size: 14px;
}

:is(.reader-shell, .sheet-document) .send-circle[data-slot="button"] {
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0;
}

:is(.reader-shell, .sheet-document) .chip[data-slot="button"] {
  min-height: 44px;
  padding: 0 15px;
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}

:is(.reader-shell, .sheet-document) .chip[data-slot="button"].selected {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

:is(.reader-shell, .sheet-document) .section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sheet-document .section-heading h2 {
  font-size: 18px;
}

.sheet-document .source-citation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-document .source-citation > div {
  min-width: 0;
}

.sheet-document .source-citation > a {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 44px;
  font-size: 14px;
}

.sheet-document .source-citation p {
  margin-bottom: 0;
}

.sheet-document .sign-in-sheet fieldset {
  display: grid;
  gap: 16px;
  margin: 24px 0 16px;
}

.sheet-document .sign-in-sheet fieldset > label {
  font-size: 14px;
}

.sheet-document .sign-in-sheet [data-slot="input"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--field);
  border-radius: 999px;
  background: var(--page);
}

.sheet-document .sign-in-sheet [data-slot="button"] {
  width: 100%;
}

.sheet-document .notes-sheet .page-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}

.sheet-document .notes-sheet .text-tabs {
  justify-content: flex-start;
}

:is(.reader-shell, .sheet-document) .note-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
}

.reader-shell .saved-tabs {
  justify-content: flex-start;
  gap: 12px;
}

.reader-shell .saved-tabs a {
  font-size: 14px;
}

.reader-shell .chat-messages {
  display: grid;
  gap: 20px;
  padding: 20px 0 28px;
}

.reader-shell .chat-message-user {
  justify-self: end;
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 16px 16px 4px 16px;
  background: var(--tint);
}

.reader-shell .chat-message p:last-child {
  margin-bottom: 0;
}

.reader-shell .chat-result-card {
  display: block;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--page);
  box-shadow: none;
}

.reader-shell .chat-result-card .source-quote {
  margin: 0 0 20px;
  text-align: center;
}

.reader-shell .chat-result-card h2 {
  font-size: 22px;
}

.reader-shell .chat-result-card p {
  margin-bottom: 10px;
}

.reader-shell .chat-result-card [data-slot="button"] {
  width: 100%;
  margin-top: 8px;
}

.reader-shell .chat-composer {
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  background: var(--page);
}

.reader-shell .approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reader-shell .approval-actions [data-slot="button"] {
  flex: 1;
  min-width: 90px;
  padding-inline: 14px;
}

.reader-shell .recitation-submit[data-slot="button"] {
  min-height: 44px;
  padding: 0 8px;
  background: transparent;
  color: var(--accent);
}

.reader-shell .sheet-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reader-shell .sheet-list-row > div {
  min-width: 0;
}

.reader-shell .sheet-list-row > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
}

.reader-shell .print-options {
  gap: 0;
  margin-top: 20px;
}

.reader-shell .print-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
}

.reader-shell .print-option-row > span,
.reader-shell .print-option-row > legend {
  font-size: 15px;
}

.reader-shell .print-option-row legend {
  float: left;
  width: auto;
  margin: 0 auto 0 0;
  padding: 10px 0;
}

.reader-shell .print-option-row select {
  max-width: 65%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--page);
  font-size: 14px;
}

.reader-shell .print-choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.reader-shell .print-choice {
  position: relative;
  cursor: pointer;
}

.reader-shell .print-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.reader-shell .print-choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
}

.reader-shell .print-choice input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.reader-shell .print-choice input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.reader-shell .create-sheet-button[data-slot="button"] {
  width: 100%;
  margin-top: 24px;
}

/* Translation language panels and immutable version choices. */
.reader-shell .language-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 0;
  min-height: 76px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.reader-shell .language-row > div {
  min-width: 0;
}

.reader-shell .language-row > div > a {
  color: var(--ink);
  font-size: 18px;
  text-decoration: none;
}

.reader-shell .language-row p {
  margin: 4px 0 0;
  font-size: 13px;
}

.reader-shell .language-row [data-slot="button"] {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 14px;
}

.reader-shell .language-row > form {
  /* Keep the named form controls in their original form while the button and
     its appended progress occupy separate tracks in the language row. */
  display: contents;
}

.reader-shell .language-row > form > [data-slot="button"] {
  grid-column: 2;
  grid-row: 1;
}

.reader-shell .language-row > form > .action-progress {
  grid-column: 1 / -1;
  grid-row: 2;
}

.reader-shell .versions-heading {
  margin-top: 28px;
}

.reader-shell .version-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 16px;
  text-decoration: none;
}

.reader-shell .version-row small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.reader-shell .version-radio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--field);
  border-radius: 999px;
}

.reader-shell .version-row[aria-current="true"] .version-radio {
  border-color: var(--ink);
}

.reader-shell .version-row[aria-current="true"] .version-radio::after {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ink);
  content: "";
}

.reader-shell .wide-button[data-slot="button"] {
  width: 100%;
  margin-top: 20px;
}

.reader-shell .more-languages {
  margin: 24px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.reader-shell .more-languages summary {
  padding: 14px 0;
  color: var(--accent);
  cursor: pointer;
}

.reader-shell .more-languages form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
}

.reader-shell .more-languages select {
  flex: 1;
  min-width: 100px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px;
  background: var(--page);
}

.reader-shell [dir="rtl"], .sheet-document [dir="rtl"] {
  font-family: Amiri, "Noto Naskh Arabic", Georgia, serif;
}

.reader-shell .verse-translation[dir="auto"], .sheet-document .verse-translation[dir="auto"] {
  font-family: Newsreader, Georgia, "Times New Roman", serif;
}

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

.skip {
  position: fixed;
  z-index: 100;
  top: -100px;
  left: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--page);
  color: var(--accent);
}

.skip:focus {
  top: 10px;
}

@media (min-width: 600px) {
  .reader-shell {
    padding-inline: 32px;
  }
  .reader-shell .home-intro {
    padding-top: 26px;
  }
  .reader-shell .poem-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .reader-shell .poem-card {
    min-height: 160px;
    padding: 18px;
  }
  .reader-shell .verse {
    grid-template-columns: 22px minmax(0, 1fr);
    column-gap: 14px;
    padding-block: 20px;
  }
  .reader-shell .verse .arabic-verse {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    text-align: center;
  }
}

@media (max-width: 360px) {
  .reader-shell, .sheet-document {
    padding-inline: 20px;
  }
  .reader-shell .header-account {
    gap: 8px;
    font-size: 13px;
  }
  .reader-shell .wordmark {
    font-size: 20px;
  }
  .reader-shell .language-pill {
    padding-inline: 10px;
  }
  .reader-shell .poem-gallery {
    gap: 10px;
  }
  .reader-shell .poem-card {
    padding-inline: 12px;
  }
  :is(.reader-shell, .sheet-document) .text-tabs {
    justify-content: flex-start;
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reader-shell *, .sheet-document * {
    scroll-behavior: auto;
    transition-duration: 0s;
    animation-duration: 0s;
  }
}

/* Coherent source readings keep earlier wording and its reader context available. */
.reader-shell .source-readings{margin:0 0 26px;padding:14px 0;border-block:1px solid var(--hairline)}
.reader-shell .source-readings p{margin:0 0 10px}
.reader-shell .source-readings p:last-child{margin-bottom:0}
.reader-shell .source-readings details{margin:0}
.reader-shell .source-readings summary{color:var(--accent);cursor:pointer}
.reader-shell .source-readings details[open] summary{margin-bottom:12px}

.retry-search-draft{margin:2rem 0}
