/* Dawawin base styles. Tokens first, then layout, then components. */

@font-face {
  font-family: Vazirmatn;
  src: url("../fonts/Vazirmatn-Arabic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: Vazirmatn;
  src: url("../fonts/Vazirmatn-Latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: IRMitra;
  src: url("../fonts/IRMitra.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: IRMitra;
  src: url("../fonts/IRMitra-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Mtif Lotus";
  src: url("../fonts/MtifLotus-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Mtif Lotus";
  src: url("../fonts/MtifLotus-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ground: #F6F5F2;
  --paper: #FFFFFF;
  --ink: #24130A;
  --ink-soft: #5E5249;
  --line: #E5E2DC;
  --hero: #BA9873;
  --hero-chip: #F3E9DC;
  --hero-track: #E9DCCB;
  --cocoa: #2A160C;
  --cream: #FEF3C7;
  --footer-ground: #2E2F31;
  --footer-text: #D9D9D6;
  --footer-muted: #A9A9A5;
  --footer-line: #45474A;
  --footer-strong: #F5F5F2;
  --font-ui: Vazirmatn, Tahoma, sans-serif;
  --font-book: IRMitra, serif;
  --font-prose: "Mtif Lotus", IRMitra, serif;
  --radius-lg: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font-ui); line-height: 1.7; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.container { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.spacer { flex-grow: 1; }
.muted { color: var(--ink-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.misra { margin: 0; white-space: nowrap; text-align: justify; text-align-last: justify; }

/* Header */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 44px; height: 44px; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; }
.brand__name { font-family: var(--font-book); font-size: 26px; font-weight: 700; line-height: 1.1; }
.brand__tagline { font-size: 11px; color: var(--ink-soft); }
.site-nav { display: flex; gap: 22px; flex-wrap: wrap; font-size: 15px; }
.site-nav a[aria-current] { font-weight: 700; box-shadow: inset 0 -2px 0 currentColor; }
.btn-outline { font-size: 15px; border: 1px solid #D3CCC2; border-radius: 10px; padding: 9px 18px; }

/* Home hero: the book image touches the box's left and bottom edges so it reads as part of the box. */
.home { padding-top: 24px; }
.hero { background: var(--hero); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-wrap: wrap; align-items: stretch; }
.hero__text { flex: 3 1 560px; min-width: 0; padding: 56px 48px; display: flex; flex-direction: column; gap: 18px; justify-content: center; }
.hero__heading { display: flex; align-items: center; gap: 4px; }
.hero__logo { flex-shrink: 0; width: 72px; height: 72px; object-fit: contain; }
.hero__title { margin: 0; font-family: var(--font-book); font-weight: 700; font-size: 42px; line-height: 1.4; }
.hero__lead { margin: 0; font-size: 17px; line-height: 1.9; max-width: 720px; }
.hero__book { flex: 2 1 360px; min-width: 0; align-self: stretch; display: flex; }
.hero__book img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: left bottom; }

.search { display: flex; flex-direction: column; gap: 14px; }
.search__toggles { display: flex; flex-wrap: wrap; gap: 12px; }
.segmented { display: flex; gap: 4px; margin: 0; border: 0; background: var(--hero-track); border-radius: 14px; padding: 4px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 700; }
.segmented input:checked + span { background: var(--cocoa); color: var(--cream); }
.segmented input:focus-visible + span { outline: 2px solid var(--cocoa); outline-offset: 2px; }
.search__box { display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 18px; padding: 8px; box-shadow: 0 2px 10px rgba(36, 19, 10, 0.12); }
.search__box svg { margin-right: 10px; flex-shrink: 0; }
.search__box input { flex-grow: 1; min-width: 0; height: 44px; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; color: #0F172A; }
.search__box button { flex-shrink: 0; min-height: 48px; padding: 0 26px; border: 0; border-radius: 13px; background: var(--cocoa); color: var(--cream); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.suggestions__label { font-weight: 700; }
.suggestions a { background: var(--hero-chip); border-radius: 10px; padding: 7px 12px; }
/* Homepage hero: a slimmer search box, as on the old site (field 50px, button 36px, thin border). */
.hero .search { gap: 10px; }
.hero .search__toggles { gap: 8px; }
.hero .segmented { gap: 2px; padding: 3px; border-radius: 10px; }
.hero .segmented span { min-height: 28px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; }
.hero .search__box { gap: 8px; padding: 6px; border-radius: 16px; border: 1px solid rgba(36, 19, 10, 0.16); box-shadow: inset 0 2px 4px rgba(36, 19, 10, 0.05), 0 8px 16px -6px rgba(36, 19, 10, 0.22); }
.hero .search__box svg { width: 18px; height: 18px; margin-right: 8px; }
.hero .search__box input { height: 36px; font-size: 14px; }
.hero .search__box button { min-height: 36px; padding: 0 20px; border-radius: 11px; font-size: 14px; }
.hero .suggestions { gap: 6px; font-size: 12px; }
.hero .suggestions a { padding: 4px 10px; border-radius: 8px; }

.panel { background: var(--paper); border: 1px solid #ECE8E1; border-radius: var(--radius-lg); padding: 28px; margin-top: 28px; }
.panel--poets { padding: 24px; }
.panel__title { margin: 0 0 12px; font-family: var(--font-book); font-size: 28px; font-weight: 700; }

/* Homepage poet cards: portrait photo, name and death year over a dark fade, verse count badge. */
/* Four large cards per row on desktop, as on the previous site; fewer on smaller screens. */
.poet-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1024px) { .poet-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .poet-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.poet-card { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--radius-lg); overflow: hidden; background: #030712; color: #FFFFFF; }
.poet-card:hover { text-decoration: none; }
.poet-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.poet-card:hover img { transform: scale(1.04); }
.poet-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 35%, rgba(0, 0, 0, 0) 60%); }
.poet-card__count { position: absolute; z-index: 1; top: 14px; left: 14px; background: rgba(0, 0, 0, 0.65); color: #F1F5F9; font-size: 12px; font-weight: 700; border-radius: 12px; padding: 4px 10px; }
.poet-card__text { position: absolute; z-index: 1; right: 18px; left: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 2px; }
.poet-card__name { font-size: 20px; font-weight: 800; }
.poet-card__death { font-size: 13px; color: #E2E8F0; }

/* Homepage «بیت برگزیده»: one random couplet on a line, with its poet and a link to the poem. */
.featured__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.featured__head h2 { margin: 0; font-family: var(--font-book); font-size: 24px; font-weight: 700; }
.featured__another { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid #D9D2C7; border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.featured__another:disabled { opacity: 0.6; cursor: wait; }
.featured__poem { padding: 32px 0 28px; }
.featured__poem .poem-body { font-size: 26px; }
.featured__star { align-self: center; color: var(--hero); font-family: var(--font-ui); font-size: 16px; line-height: 1; }
.featured__poem.is-stepped .featured__star { display: none; }
.featured__meta { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; padding-top: 14px; border-top: 1px solid #EFEDE8; font-size: 14px; }
.featured__poet { font-weight: 700; margin-left: 10px; }
.featured__trail { color: var(--ink-soft); font-size: 13px; }
.featured__more { font-weight: 700; }

/* Reading pages */
.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 12px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 18px; padding-bottom: 14px; font-size: 13px; color: #5F5F5F; }

/* Book page: a white sheet with a running header, the poem and the source page number. */
.book-page { background: var(--paper); border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 28px rgba(0, 0, 0, 0.05); padding: 56px 80px 110px; }
.running-header { text-align: center; font-family: var(--font-book); font-weight: 700; font-size: 15px; line-height: 1.25; padding-bottom: 1px; border-bottom: 2.25px solid #111; white-space: pre-wrap; }
.poem-title { text-align: center; margin: 170px 0 40px; font-family: var(--font-book); }
.poem-title h1 { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.5; }
.poem-title--none { margin: 110px 0 0; }  /* a bare «غزل شمارهٔ ۱»: no title shown, only for screen readers */
.page-number { text-align: center; margin-top: 44px; font-family: var(--font-book); font-size: 16px; color: #4A4A4A; }

/* Couplets: both hemistichs share the width of the poem's longest one (set by poem.js as --wem). */
.poem { --wem: 12; }
.poem-body { font-family: var(--font-book); font-size: 22px; line-height: 2.05; color: #1F1F1F; }
/* The couplet box hugs the poem, so the verse number keeps a fixed distance from the text, not from the page edge. */
.bayt { position: relative; display: flex; width: fit-content; margin: 0 auto; align-items: baseline; gap: 1.6em; }
.bayt .m { display: block; flex: none; width: calc(var(--wem) * 1em); white-space: nowrap; text-align: justify; text-align-last: justify; }
.bayt .n { position: absolute; top: 0; right: -62px; width: 28px; height: 2.05em; display: flex; align-items: center; justify-content: center; }
.bayt .n span { font-family: var(--font-ui); font-size: 13px; line-height: 1; color: #737373; }
.poem.is-stepped .bayt { flex-direction: column; align-items: stretch; gap: 0; width: calc(var(--wem) * 1.25em + 26px); max-width: 100%; margin: 0 auto 0.35em; padding-right: 26px; }
.poem.is-stepped .bayt { margin-bottom: 0.7em; }
.poem.is-stepped .bayt .m { line-height: 1.8; }
.poem.is-stepped .bayt .m:last-child { align-self: flex-end; }
.poem.is-stepped .bayt .n { height: 1.8em; }
.poem.is-stepped .bayt .n { right: 0; width: 22px; }
.line { margin: 0; text-align: center; white-space: nowrap; }
.line--centered { margin: 0.6em 0; }
.prose { margin: 0 0 1em; text-align: justify; line-height: 2; white-space: normal; }
.note { margin: 0.8em 0; text-align: center; font-family: var(--font-ui); font-size: 14px; color: #6B6B6B; }
.restricted-note { margin: 32px 0 0; text-align: center; font-size: 13px; color: #6B6B6B; }

.poem-info { margin-top: 22px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 10px; background: #FAFAF8; }
.poem-info dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 24px; font-size: 14px; }
.poem-info dt { color: #6B6B6B; font-size: 12px; margin-bottom: 2px; }
.poem-info dd { margin: 0; }
.poem-info .wide { grid-column: 1 / -1; }
/* Qafiye and radif side by side in one cell, so the radif never drops to the next row on its own. */
.poem-info .rhyme-pair { display: flex; gap: 28px; min-width: 0; }
.poem-info .rhyme-pair > div { min-width: 0; }
.poem-info .rhyme-pair:has(.is-editing) { grid-column: 1 / -1; }
.poem-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 28px 0 0; font-size: 14px; }

/* Poet and section pages */
.person-header { display: flex; align-items: center; gap: 24px; padding: 32px 0 8px; }
.person-header__image { width: 120px; height: 160px; object-fit: cover; border-radius: 16px; }
.person-header h1, .list-header h1 { margin: 0; font-family: var(--font-book); font-size: 40px; font-weight: 700; line-height: 1.4; }
.bio { margin: 16px 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px; }
.bio summary { cursor: pointer; font-weight: 700; }
.bio p { line-height: 2.1; text-align: justify; }
.life { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; font-size: 0.92em; }
.life__places { display: grid; gap: 4px; margin: 0 0 10px; }
.life__places div { display: flex; gap: 10px; }
.life__places dt { font-weight: 700; min-width: 88px; }
.life__places dd { margin: 0; }
.life__title { font-size: 1em; margin: 12px 0 4px; }
.life__sources, .life__list { margin: 0; padding-inline-start: 22px; line-height: 1.9; }
.life__sources li { overflow-wrap: anywhere; }
.reigns p { margin: 4px 0; line-height: 1.9; }
.life__greats { margin: 4px 0; padding-inline-start: 1.2em; line-height: 1.9; }
.work-note { margin-bottom: 14px; }
.work-note__facts { margin: 0 0 6px; font-size: 0.92em; }
/* A tie's arrow sits at the end of its own line; the note opens below the line. */
/* A short tie stays on one line; a long one (Jami's list of works offered to Soltan Hosein) wraps within the screen. */
.tie__kind { display: inline-block; max-width: 100%; white-space: normal; }
.tie__note { font-size: 0.92em; color: var(--ink-soft); margin: 4px 0 6px; }
.work-note__mss { font-size: 0.92em; color: var(--ink-soft); }
.work-note__mss-title { font-size: 1em; font-weight: 700; margin: 10px 0 2px; color: var(--ink-soft); }
.reigns__region + .reigns__region { border-top: 1px solid var(--line); margin-top: 8px; }
.list-subtitle { font-family: var(--font-book); font-size: 26px; margin: 28px 0 12px; }
.works { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.works > li { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; }
.works__title { font-family: var(--font-book); font-size: 22px; font-weight: 700; }
/* Sub-sections are a plain numbered list in columns, like a book's table of contents. */
.works__parts, .section-grid { list-style: persian; margin: 10px 0 0; padding: 0 22px 0 0; columns: 3 220px; column-gap: 36px; }
.works__parts li, .section-grid li { break-inside: avoid; padding: 3px 0; color: var(--ink-soft); font-size: 13px; }
.works__parts a, .section-grid a { font-size: 15px; color: var(--ink); }
.list-header { padding: 24px 0 12px; }
.list-header__person { color: var(--ink-soft); font-size: 15px; }
.section-grid { margin-bottom: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 40px 14px 20px; }
.poem-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.poem-list li + li { border-top: 1px solid #EFEDE8; }
.poem-list a { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; padding: 12px 20px; }
.poem-list a:hover { background: #FAF8F4; text-decoration: none; }
.poem-list__title { font-weight: 700; min-width: 140px; }
.poem-list__line { font-family: var(--font-book); font-size: 18px; color: #3A3A3A; }

/* Commentaries under a poem */
.commentaries { margin-top: 28px; }
.commentaries > h2 { font-family: var(--font-book); font-size: 26px; margin: 0 0 12px; }
.commentary { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.commentary summary { cursor: pointer; padding: 14px 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.commentary__title { font-weight: 700; font-size: 17px; }
.commentary__author { color: var(--ink-soft); font-size: 14px; }
.commentary__block { padding: 4px 20px 12px; border-top: 1px solid #EFEDE8; }
.commentary__block h3 { margin: 12px 0 6px; font-size: 14px; color: var(--ink-soft); }
.commentary__note p { margin: 0 0 10px; line-height: 2.1; text-align: justify; }
.commentary__kind { display: inline-block; font-size: 12px; font-weight: 700; color: #6B4F2E; background: #F3E9DC; border-radius: 6px; padding: 1px 8px; margin-bottom: 4px; }

/* Arabic divans */
.poem--ar .poem-body { line-height: 2.2; }
.person-header__alt { margin: 0; font-size: 18px; color: var(--ink-soft); }
.era-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.era-jump a { border: 1px solid #D9D2C7; border-radius: 999px; padding: 6px 14px; font-size: 14px; background: var(--paper); }
.ar-poets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.ar-poets a { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-family: var(--font-book); font-size: 18px; }
.ar-poets .muted { font-family: var(--font-ui); font-size: 12px; }

/* Dictionary: search box with Dehkhoda's portrait on the left, resting on the box's bottom edge. */
.lex-hero { display: flex; flex-wrap: wrap; align-items: stretch; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px; }
.lex-hero__main { flex: 3 1 440px; min-width: 0; padding: 36px 32px; display: flex; flex-direction: column; gap: 18px; justify-content: center; }
.lex-hero__portrait { flex: 0 1 230px; align-self: flex-end; width: 230px; height: auto; display: block; }
.lex-hero__head { display: flex; align-items: center; gap: 12px; }
.lex-hero__badge { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; background: var(--cocoa); color: var(--cream); display: flex; align-items: center; justify-content: center; font-family: var(--font-book); font-size: 22px; font-weight: 700; }
.lex-hero__title { margin: 0; font-family: var(--font-book); font-size: 28px; font-weight: 700; line-height: 1.3; }
.lex-hero__sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.lex-form { display: flex; flex-direction: column; gap: 12px; }
.lex-form__box { display: flex; gap: 8px; padding: 6px; border: 1px solid #CFCCC4; border-radius: 14px; background: var(--paper); }
.lex-form__box input { flex-grow: 1; min-width: 0; height: 44px; padding: 0 12px; border: 0; outline: none; font: inherit; font-size: 16px; background: transparent; }
.lex-form__box button { flex-shrink: 0; min-height: 44px; padding: 0 24px; border: 0; border-radius: 10px; background: var(--cocoa); color: var(--cream); font: inherit; font-weight: 700; cursor: pointer; }
.lex-form--compact { margin-bottom: 20px; }
.lex-modes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; border: 0; font-size: 13px; }
.lex-modes legend { float: right; margin-left: 6px; font-weight: 700; }
.lex-modes label { cursor: pointer; }
.lex-modes input { position: absolute; opacity: 0; pointer-events: none; }
.lex-modes span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid #D9D2C7; border-radius: 999px; }
.lex-modes input:checked + span { background: var(--cocoa); border-color: var(--cocoa); color: var(--cream); }
.lex-modes input:focus-visible + span { outline: 2px solid var(--cocoa); outline-offset: 2px; }
.lex-samples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.lex-samples > span { font-weight: 700; margin-left: 4px; }
.lex-samples a { background: #F4F1EA; border-radius: 8px; padding: 5px 10px; }
.lex-results__list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.lex-results__list li + li { border-top: 1px solid #EFEDE8; }
.lex-results__list a { display: flex; flex-direction: column; gap: 2px; padding: 12px 20px; }
.lex-results__list a:hover { background: #FAF8F4; text-decoration: none; }
.lex-results__key { font-family: var(--font-book); font-size: 20px; font-weight: 700; }
.lex-results__snippet { font-size: 13px; color: var(--ink-soft); line-height: 1.9; }
.lex-results__snippet mark { background: #F3E3C8; color: var(--ink); border-radius: 3px; padding: 0 1px; }
@media (max-width: 720px) { .lex-hero__portrait { display: none; } .lex-hero__main { padding: 24px 18px; } }
.lex-page .lex-headword { margin: 48px 0 24px; text-align: center; font-family: var(--font-book); font-size: 34px; }
.lex-entry + .lex-entry { margin-top: 28px; padding-top: 20px; border-top: 1px solid #EFEDE8; }
.lex-entry__head { font-family: var(--font-book); font-size: 22px; margin: 0 0 8px; }
.lex-entry__body { font-family: var(--font-book); font-size: 19px; line-height: 2.1; text-align: justify; }
.dk-marker { color: #8A6A43; }
.dk-hl { font-weight: 700; }
.dk-pron { color: #2F6B4F; }
.dk-src { color: #9A3B2E; }

/* Footer */
.site-footer { margin-top: 64px; background: var(--footer-ground); color: var(--footer-text); }
.site-footer .container { padding-top: 16px; }
.site-footer a { color: var(--footer-text); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 36px; padding: 40px 0; }
.footer-grid nav { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer-heading { font-weight: 700; color: var(--footer-strong); margin-bottom: 4px; }
.footer-about { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.footer-about p { margin: 0; font-size: 14px; line-height: 2; max-width: 420px; }
.footer-brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-book); font-size: 32px; font-weight: 700; color: var(--footer-strong); }
.footer-brand img { object-fit: contain; }
.footer-brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.footer-brand__tagline { font-family: var(--font-ui); font-size: 13px; font-weight: 400; color: var(--footer-muted); margin-top: 4px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 20px 0 28px; border-top: 1px solid var(--footer-line); font-size: 13px; color: var(--footer-muted); }
.footer-bottom__links { display: flex; gap: 18px; }
.footer-bottom__links a { color: var(--footer-muted); }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .site-nav { display: none; }
  .book-page { padding: 28px 14px 64px; }
  .poem-title { margin-top: 96px; }
  .poem-title--none { margin-top: 64px; }
  .person-header h1, .list-header h1 { font-size: 32px; }
  .hero__text { padding: 28px 20px; }
  .hero__title { font-size: 32px; }
  .hero__logo { width: 52px; height: 52px; }
  /* phones: 16px keeps iOS from zooming in on focus; toggles stay easy to tap */
  .hero .search__box input { font-size: 16px; }
  .hero .search__box button { padding: 0 14px; }
  .hero .segmented span { min-height: 32px; }
  .panel--poets { padding: 12px; margin-top: 20px; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Search page: one white panel holding the box, the shortcuts, the option toggles and the filter panel. */
.search-page { padding-top: 24px; }
.search-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.search__box--panel { box-shadow: none; border: 1px solid #D3CCC2; }
.search-more > summary { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--ground); cursor: pointer; list-style: none; font-size: 14px; }
.search-more > summary::-webkit-details-marker { display: none; }
.search-more__title { font-weight: 700; flex-shrink: 0; }
.search-more__now { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 13px; }
.search-more__arrow { flex-shrink: 0; margin-right: auto; transition: transform .15s; }
.search-more[open] > summary { margin-bottom: 14px; }
.search-more[open] .search-more__now { display: none; }
.search-more[open] .search-more__arrow { transform: rotate(180deg); }
.search-more__body { display: flex; flex-direction: column; gap: 14px; }
.search-tips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; padding: 10px 14px; background: var(--ground); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.search-tips code { font-family: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 2px 8px; margin-right: 4px; }
.search-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px; background: var(--ground); border: 1px solid var(--line); border-radius: 12px; }
.search-option { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-option__label { font-size: 14px; font-weight: 700; }
.segmented--light { background: #ECE8E1; }
.segmented--light span { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.filter-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.6fr) minmax(0, 1.3fr); gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.filter-group { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.filter-group legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.filter-group__find { min-height: 38px; padding: 0 12px; border: 1px solid #D3CCC2; border-radius: 10px; font: inherit; font-size: 13.5px; background: var(--paper); }
.filter-group__list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-left: 4px; }
.filter-group__list label { display: flex; align-items: baseline; gap: 6px; padding: 4px 6px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.filter-group__list label:hover { background: var(--ground); }
.filter-group__list label[hidden] { display: none; }
.filter-group__list input { accent-color: var(--cocoa); flex-shrink: 0; }
.filter-group__list small { margin-right: auto; color: var(--ink-soft); font-size: 12px; }
.filter-group__none { margin: 0; color: var(--ink-soft); font-size: 13px; }
.filter-panel__actions { grid-column: 1 / -1; display: flex; gap: 10px; }
.filter-panel__actions .btn-solid { min-height: 40px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--cocoa); color: var(--cream); font: inherit; font-weight: 700; cursor: pointer; }
.filter-panel__clear { min-height: 40px; padding: 0 16px; border: 1px solid #D3CCC2; border-radius: 10px; background: var(--paper); font: inherit; cursor: pointer; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.active-filters a { background: var(--hero-chip); border-radius: 10px; padding: 6px 12px; font-size: 13.5px; font-weight: 700; }
.active-filters a span { margin-right: 4px; color: #8A6A43; }
.search-card { margin-top: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 24px; }
.search-card h2 { margin: 0 0 14px; font-size: 16px; }
.search-card h2 small { font-weight: 400; color: var(--ink-soft); font-size: 13px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; }
.chip small { font-weight: 400; color: var(--ink-soft); font-size: 12px; }
.chip[aria-pressed="true"] { background: var(--cocoa); border-color: var(--cocoa); color: var(--cream); }
.chip[aria-pressed="true"] small { color: var(--cream); }
.search-results { margin-top: 20px; }
.search-msg { margin: 28px 0; text-align: center; color: var(--ink-soft); }
.hit__form { margin-right: 6px; padding: 1px 8px; border-radius: 6px; background: var(--ground); color: var(--ink-soft); font-size: 12px; }
.search-count { margin: 0 0 12px; color: var(--ink-soft); font-size: 14px; }
.poet-hit { display: inline-block; margin: 0 0 12px 8px; background: var(--hero-chip); border-radius: 10px; padding: 7px 14px; font-weight: 700; font-size: 14px; }
.hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hit { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.search-results .export-inline { justify-content: center; margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.hit:hover { border-color: #D3CCC2; box-shadow: 0 2px 10px rgba(60, 40, 20, .06); }
.hit__text { font-family: var(--font-book); font-size: 21px; line-height: 2; color: #1F1F1F; }
.hit__bayt { display: flex; justify-content: center; gap: 2.4em; }
.hit__m { white-space: nowrap; flex: none; text-align: justify; text-align-last: justify; }
.hit__bayt.is-stepped { flex-direction: column; gap: 0; width: calc(var(--wem) * 1.2em); max-width: 100%; margin: 0 auto; }
.hit__bayt.is-stepped .hit__m:last-child { align-self: flex-end; }
.hit__line { margin: 0; text-align: center; }
.hit__prose { margin: 0; text-align: justify; font-size: 19px; }
.hit mark { background: #F3E3C8; color: inherit; border-radius: 3px; padding: 0 1px; }
.hit__meta { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #EFEDE8; font-size: 13px; }
.hit__poet { font-weight: 700; margin-left: 8px; }
.hit__title { color: var(--ink-soft); }
.hit__more { font-weight: 700; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 24px; font-size: 14px; }
.pager a, .pager span { min-width: 38px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border-radius: 10px; }
.pager a { background: var(--paper); border: 1px solid var(--line); }
.pager__current { background: var(--cocoa); color: var(--cream); font-weight: 700; }
@media (max-width: 860px) {
  .search-panel { padding: 16px; }
  .filter-panel { grid-template-columns: minmax(0, 1fr); }
  .filter-panel { gap: 12px; padding: 12px; }
  .filter-group__list { max-height: 150px; }
  .search-more > summary { padding: 8px 12px; flex-wrap: wrap; }
  .search-more__now { white-space: normal; order: 3; flex-basis: 100%; }
  .filter-group--forms .filter-group__list { flex-direction: row; flex-wrap: wrap; max-height: none; }
  }
/* On narrow screens couplets go stepped, as on poem pages. */
@media (max-width: 720px) {
  .hit { padding: 16px 14px 12px; }
  .hit__text { font-size: 18px; }
  .hit__bayt { flex-direction: column; gap: 0; }
  .hit__bayt:not(.is-justified) .hit__m { white-space: normal; }
  .hit__m:last-child { align-self: flex-end; }
}

/* Metres: /metres/ and /metres/<id>/ */
.metres-banner { margin: 16px 0 0; }
.metres-banner img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #d0d0c8; user-select: none; pointer-events: none; }
.metres-banner figcaption { margin-top: 4px; padding: 0 8px; font-size: 11px; color: #94a3b8; user-select: none; }
@media (max-width: 640px) { .metres-banner img { border-radius: 16px; } .metres-banner figcaption { font-size: 10px; padding: 0 6px; } }
.metres-index { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; margin: 8px 0 4px; padding: 14px 18px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; scroll-margin-top: 12px; }
.metres-index__title { margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); font-family: var(--font-book); font-size: 20px; font-weight: 700; }
.metres-index__list { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.metres-index__list a { display: block; padding: 1px 9px; border: 1px solid #E3DDD3; border-radius: 999px; background: var(--ground); font-size: 13px; line-height: 1.8; }
.metres-index__list a:hover { border-color: var(--hero); background: var(--hero-chip); text-decoration: none; }
.metres-lang__up { margin-inline-start: 10px; font-family: var(--font-ui); font-size: 12px; font-weight: 400; color: var(--ink-soft); vertical-align: middle; }
@media (max-width: 640px) { .metres-index { grid-template-columns: 1fr; padding: 12px 14px 14px; } }
/* the «وزن‌یاب» box on the metres page (the finder itself: corpus/metre-finder.css) */
.metres-finder { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; padding: 12px 18px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.metres-finder label { font-size: 15px; }
.metres-finder label a { font-weight: 700; }
.metres-finder__row { display: flex; gap: 8px; }
.metres-finder input { flex: 1; min-width: 0; min-height: 44px; padding: 6px 12px; border: 1px solid #D9D2C7; border-radius: 10px; background: #FFFDF9; font-family: var(--font-book); font-size: 20px; color: var(--ink); }
@media (max-width: 560px) { .metres-finder { padding: 12px 14px; } .metres-finder__row { flex-direction: column; } }
.metres-lang { margin-top: 18px; }
.metres-lang__title { font-family: var(--font-book); font-size: 30px; margin: 26px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.bahr { margin: 22px 0 8px; scroll-margin-top: 12px; }
.bahr__title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 8px; font-family: var(--font-book); font-size: 26px; font-weight: 700; }
.bahr__count { font-family: var(--font-ui); font-size: 13px; font-weight: 400; color: var(--ink-soft); }
.bahr__feet { margin: -4px 0 10px; font-family: var(--font-book); font-size: 18px; color: #4A4A4A; }
.metre-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.metre-list li + li { border-top: 1px solid #EFEDE8; }
.metre-list a { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: baseline; padding: 10px 20px; color: inherit; }
.metre-list a:hover { background: #FAF8F4; text-decoration: none; }
.metre-list__rhythm { font-family: var(--font-book); font-size: 21px; line-height: 1.7; }
.metre-list__name { grid-column: 1; font-size: 14px; color: var(--ink-soft); }
.metre-list__count { grid-column: 2; grid-row: 1; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.metre-header h1 { font-size: 34px; }
.metre-header__name { margin: 2px 0 6px; font-family: var(--font-book); font-size: 20px; }
.metre-poets { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; max-height: 236px; overflow-y: auto; }
.metre-poets a { border: 1px solid #D9D2C7; border-radius: 999px; padding: 4px 12px; font-size: 14px; background: var(--paper); }
.metre-poets a[aria-current] { background: var(--ink, #2B2B2B); border-color: transparent; color: #fff; }
.metre-poets a[aria-current] .muted { color: #E6E0D6; }
@media (max-width: 720px) {
  .metre-list a { padding: 10px 14px; }
  .metre-list__rhythm { font-size: 19px; }
  .metre-header h1 { font-size: 27px; }
}
.poem-list__tag { display: inline-block; margin-inline-start: 6px; padding: 0 8px; border: 1px solid #D9D2C7; border-radius: 999px; font-size: 11px; font-weight: 400; color: var(--ink-soft); vertical-align: middle; }
.dual-metre { display: inline-block; margin-inline-start: 4px; padding: 0 7px; border: 1px solid #D9D2C7; border-radius: 999px; font-size: 11px; font-weight: 400; vertical-align: middle; }
.dual-metres span:not(.muted) { display: block; }

/* Forms and accounts */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field textarea, .field select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #D3CCC2; border-radius: 10px; background: var(--paper); font: inherit; font-size: 16px; color: var(--ink); }
.field textarea { resize: vertical; }
.field--check label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.field--check input { width: 18px; min-height: 0; height: 18px; padding: 0; accent-color: var(--cocoa); }
.note-item__private { color: #8A6A43; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--cocoa); outline-offset: 1px; border-color: var(--cocoa); }
.field small { font-size: 12px; }
.field--error input { border-color: #A3361F; }
.field__error, .form-error { color: #A3361F; }
.form-error { background: #FBEAE5; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.form-error p { margin: 0; }
.btn-primary { align-self: flex-start; min-height: 44px; padding: 0 26px; border: 0; border-radius: 10px; background: var(--cocoa); color: var(--cream); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-link { border: 0; background: none; padding: 4px 0; color: var(--ink-soft); font: inherit; font-size: 13px; cursor: pointer; }
.btn-link:hover { color: #A3361F; text-decoration: underline; }
button.btn-outline { background: var(--paper); color: var(--ink); font-family: inherit; cursor: pointer; }
.flash { list-style: none; margin: 0 0 16px; padding: 0; }
.flash li { background: #EEF3E8; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.flash li.flash--error { background: #FBEAE5; color: #A3361F; }

.auth { display: flex; justify-content: center; padding: 48px 16px 64px; }
.auth-card { width: 100%; max-width: 440px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; }
.auth-card h1 { margin: 0 0 20px; font-family: var(--font-book); font-size: 30px; font-weight: 700; line-height: 1.4; }
.auth-card .btn-primary { align-self: stretch; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 20px 0 0; font-size: 14px; color: var(--ink-soft); }
.auth-links a { color: var(--ink); text-decoration: underline; }

.account { padding-bottom: 48px; }
.account-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0 8px; }
.account-header h1 { margin: 0; font-family: var(--font-book); font-size: 34px; font-weight: 700; line-height: 1.4; }
.account-header p { margin: 0; font-size: 14px; }
/* The tabs wrap onto a second line rather than scroll sideways. */
.account-tabs { display: flex; flex-wrap: wrap; gap: 2px 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.account-tabs a { padding: 9px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 15px; }
@media (max-width: 640px) { .account-tabs a { padding: 7px 10px; font-size: 14px; } }
.account-tabs a[aria-current] { border-color: var(--cocoa); font-weight: 700; }
.account-tabs a:hover { text-decoration: none; background: var(--paper); }
.account-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.account-side { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.account-side h2, .account-forms h2, .collection-head h2 { margin: 0 0 10px; font-size: 16px; }
.collection-list { list-style: none; margin: 0 0 12px; padding: 0; font-size: 14px; }
.collection-list a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; }
.collection-list a[aria-current] { background: var(--cocoa); color: var(--cream); }
.collection-list a[aria-current] .muted { color: #E6E0D6; }
.collection-new summary { cursor: pointer; font-size: 14px; color: var(--ink-soft); }
.collection-new .form { margin-top: 10px; }
.collection-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 12px; }
.collection-head p { margin: 0; font-size: 14px; }
.mark-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mark { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.mark__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.mark__poet { font-weight: 700; }
.mark__title { color: var(--ink-soft); }
.mark__kind { margin-inline-start: auto; font-size: 13px; }
.mark__bayt { display: flex; flex-wrap: wrap; gap: 0 32px; margin: 10px 0 0; font-family: var(--font-book); font-size: 19px; line-height: 1.9; }
.mark__note { margin: 10px 0 0; padding: 8px 12px; background: var(--ground); border-radius: 8px; font-size: 14px; }
.mark__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; font-size: 13px; }
.mark__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mark__tags a { background: var(--hero-chip); border-radius: 999px; padding: 1px 10px; }
.account-empty { padding: 32px; text-align: center; color: var(--ink-soft); background: var(--paper); border: 1px dashed var(--line); border-radius: 14px; }
.account-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.account-forms section { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
@media (max-width: 760px) {
  .account-layout, .account-forms { grid-template-columns: minmax(0, 1fr); }
  .account-header h1 { font-size: 28px; }
  .auth-card { padding: 24px 18px; }
}

/* Poem page, signed-in users: couplet numbers open a menu; bookmarked couplets and the reading position. */
.poem[data-poem] .bayt .n { cursor: pointer; }
.poem[data-poem] .bayt .n span { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.poem[data-poem] .bayt .n:hover span, .poem[data-poem] .bayt .n:focus-visible span { background: var(--hero-chip); color: var(--ink); }
.poem[data-poem] .bayt .n:focus-visible { outline: none; }
.poem .bayt.is-marked .n span { background: var(--cocoa); color: var(--cream); }
.poem .bayt.is-reading .n span { box-shadow: 0 0 0 2px var(--hero); }
.couplet-menu { position: absolute; z-index: 20; display: flex; flex-direction: column; min-width: 190px; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(36, 19, 10, 0.14); }
.couplet-menu button { padding: 9px 12px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; color: var(--ink); text-align: right; cursor: pointer; }
.couplet-menu button:hover, .couplet-menu button:focus-visible { background: var(--ground); outline: none; }
.poem-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px; font-size: 14px; }
.poem-tools[hidden] { display: none; }
.poem-tools__mark { min-height: 38px; padding: 0 16px; border: 1px solid #D3CCC2; border-radius: 10px; background: var(--paper); font: inherit; color: var(--ink); cursor: pointer; }
.poem-tools__mark[aria-pressed="true"] { background: var(--cocoa); border-color: var(--cocoa); color: var(--cream); }
.poem-tools__continue { text-decoration: underline; }
.poem-tools__hint { font-size: 13px; }

/* Editorial: suggestions, review queue, history */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.chips a, .chips > span { border: 1px solid #D9D2C7; border-radius: 999px; padding: 4px 12px; font-size: 14px; background: var(--paper); }
.chips a[aria-current] { background: var(--cocoa); border-color: var(--cocoa); color: var(--cream); }
.chips a[aria-current] .muted { color: #E6E0D6; }
.chips a:hover { text-decoration: none; }
.queue-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; font-size: 14px; }
.queue-filters p { margin: 0; }
.queue-meta { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); }
.queue-text { margin: 8px 0 0; font-size: 15px; white-space: pre-line; }
.queue-reason { margin: 6px 0 0; font-size: 13px; }
.tag { display: inline-block; background: var(--hero-chip); color: var(--ink); border-radius: 6px; padding: 0 8px; margin-inline-end: 4px; font-size: 12px; }
.diff { margin: 8px 0 0; font-family: var(--font-book); font-size: 19px; line-height: 2; }
.diff del { color: #A3361F; background: #FBEAE5; text-decoration: line-through; border-radius: 4px; padding: 0 3px; }
.diff ins { color: #2F6B2F; background: #E7F1E2; text-decoration: none; border-radius: 4px; padding: 0 3px; }
.status--approved { color: #2F6B2F; }
.status--rejected { color: #A3361F; }
.btn-sm { padding: 5px 14px; font-size: 14px; }
.review-h { margin: 18px 0 4px; font-size: 15px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.review-actions .btn-outline { min-height: 44px; }
.thread { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.thread__msg { padding: 10px 14px; border-radius: 12px; background: var(--ground); margin-inline-end: 12%; }
.thread__msg--sender { background: var(--paper); border: 1px solid var(--line); margin-inline: 12% 0; }
.thread__who { margin: 0; font-size: 13px; color: var(--ink-soft); }
.thread__body { margin: 4px 0 0; font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.thread-state { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); }
.thread-reply { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.thread-reply textarea { width: 100%; min-height: 88px; padding: 8px 12px; border: 1px solid #D3CCC2; border-radius: 10px; background: var(--paper); font: inherit; font-size: 16px; color: var(--ink); resize: vertical; }
.thread-reply button { align-self: flex-start; min-height: 44px; }
.mark--unread { border-color: var(--cocoa); box-shadow: 0 0 0 1px var(--cocoa); }
.tab-badge { display: inline-block; min-width: 18px; margin-inline-start: 4px; padding: 0 5px; border-radius: 999px; background: #A3361F; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.tag--wait { background: #FBEAE5; }
.tag--reply { background: #E7F1E2; }
.suggest-bayt { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 32px; margin: 0 0 20px; padding: 16px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; font-family: var(--font-book); font-size: 21px; line-height: 1.9; }
.suggest-prose { margin: 0 0 20px; padding: 16px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; font-family: var(--font-book); font-size: 19px; line-height: 2; text-align: justify; }
.suggest-form { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.suggest-form .field input { font-family: var(--font-book); font-size: 19px; }
.suggest-form .field:has(#id_source_ref) input { font-family: var(--font-ui); font-size: 16px; }
.kind-choice { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.kind-choice legend { margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.kind-choice label { position: relative; }
.kind-choice input { position: absolute; opacity: 0; pointer-events: none; }
.kind-choice span { display: inline-block; border: 1px solid #D9D2C7; border-radius: 999px; padding: 6px 14px; font-size: 14px; background: var(--paper); cursor: pointer; }
.kind-choice input:checked + span { background: var(--cocoa); border-color: var(--cocoa); color: var(--cream); }
.kind-choice input:focus-visible + span { outline: 2px solid var(--cocoa); outline-offset: 2px; }
.suggest-note { margin: 0; font-size: 13px; }
.commentary__note p.commentary__by { margin-top: -4px; font-size: 13px; color: var(--ink-soft); text-align: right; }
.commentary__by a, .commentary__block h3 a { text-decoration: underline; }
.poem-tools__suggest { text-decoration: underline; }
.today-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 40px; }
@media (max-width: 760px) { .today-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Editions: the printed source a text follows */
.edition { display: flex; gap: 12px; align-items: flex-start; }
.edition__cover { flex: none; width: 56px; height: 80px; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.edition__text { display: flex; flex-direction: column; gap: 1px; font-size: 14px; line-height: 1.7; }
.edition__title { font-weight: 700; }
.editions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 32px; }
.editions .edition { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.editions--section { margin: 0 0 20px; }
.poem-list + .editions { margin-top: 24px; }
.editions__label { grid-column: 1 / -1; font-size: 13px; color: var(--ink-soft); }

/* Avatars, contributors, site management */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; object-fit: cover; background: var(--hero-chip); color: var(--cocoa); font-weight: 700; }
.avatar--sm { width: 32px; height: 32px; font-size: 14px; }
.avatar--lg { width: 56px; height: 56px; font-size: 22px; }
.avatar--xl { width: 112px; height: 112px; font-size: 44px; }
.avatar-field { display: flex; gap: 16px; align-items: center; }
.check { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.account-header__who { flex-grow: 1; }
.contributor-header { display: flex; gap: 20px; align-items: center; padding: 20px 0 16px; }
.contributor-header h1 { margin: 0; font-family: var(--font-book); font-size: 34px; line-height: 1.4; }
.contributor-header p { margin: 0; }
.contributor-header .contributor-header__bio { margin-top: 8px; font-size: 15px; line-height: 1.9; }
.contributor .crumbs { padding-top: 16px; }
.contributors { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.contributors a { display: flex; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.contributors a:hover { text-decoration: none; border-color: #D3CCC2; }
.contributors a > span:last-child { display: flex; flex-direction: column; font-size: 14px; }
/* «تحریریه»: writers with photos, then every annotation and correction */
.writers { list-style: none; margin: 4px 0 22px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.writers a { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px 10px 14px; font-size: 13px; line-height: 1.6; }
.writers a:hover { text-decoration: none; border-color: #D3CCC2; }
.writers strong { font-size: 16px; color: var(--ink); }
.writers .avatar--lg { width: 104px; height: 104px; font-size: 40px; }
.entry-filter { margin: 0 0 14px; }
/* A contributor's notes as a book (editorial/book.js cuts the flow into pages of 22 lines). */
.book { max-width: 870px; padding-bottom: 40px; }
.book-sheet { padding: 44px 128px 40px; margin-bottom: 26px; }
.book-flow, .book-body { display: flow-root; margin-top: 22px; font-family: var(--font-prose); font-size: 21px; line-height: 1.7; color: #1F1F1F; }
.book-body { min-height: var(--bk-h, 0); }
.book-sheet .running-header { display: flex; justify-content: space-between; gap: 16px; text-align: right; }
.book-rights { max-width: 870px; margin: -10px auto 56px; text-align: center; font-size: 13.5px; line-height: 2; color: var(--ink-soft); }
.bk-gap { height: 1em; }
.bk-gap--half { height: 0.5em; }
.bk-gap--poem { height: 2.2em; }
.bk-p { margin: 0; text-align: justify; overflow-wrap: anywhere; }
.bk-cut { text-align-last: justify; }
.bk-title { font-weight: 700; }
.bk-ref { color: var(--ink-soft); font-size: 17px; }
.bk-poet { margin: 0 0 2px; text-align: center; font-size: 27px; font-weight: 700; line-height: 1.6; }
.bk-head { margin: 0 0 4px; text-align: center; font-size: 19px; font-weight: 700; line-height: 1.6; }
.bk-head a { color: var(--cocoa); }
.bk-where { margin: 0; font-size: 15px; line-height: 1.8; color: var(--ink-soft); }
.bk-where a { color: inherit; }
.bk-where { position: relative; }
/* the author's pencil, in the left margin beside the note; shown on hovering the note (always on touch screens) */
.bk-where .bk-edit { position: absolute; left: -64px; top: 50%; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-top: -17px; border-radius: 50%; color: var(--cocoa); opacity: 0; transition: opacity 0.15s, background 0.15s; }
.bk-where .bk-edit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bk-where.is-hover .bk-edit, .bk-where .bk-edit:focus-visible { opacity: 1; }
.bk-where .bk-edit:hover { background: var(--hero-chip); }
@media (hover: none) { .bk-where .bk-edit { opacity: 0.6; } }
.bk-part { margin: 0; padding: 4.5em 0 1em; text-align: center; font-size: 34px; font-weight: 700; line-height: 1.6; }
.bk-part__by { display: block; margin-top: 6px; font-size: 20px; font-weight: 400; color: var(--ink-soft); }
/* a section's opening page carries no running header, as in a book (the space stays) */
.book-sheet.is-opening .running-header { visibility: hidden; }
.bk-poem { padding: 4px 0 6px; }
.bk-poem .poem-body { font-size: 22px; }
.bk-diff .diff { margin: 0; text-align: center; font-size: 21px; }
.writers-more { margin: -12px 0 20px; font-size: 14px; }
.manage-users__hide { font-size: 13px; white-space: nowrap; }
.manage-users__who { margin-inline-end: auto; }
.manage-users__hide label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.entries { margin-bottom: 24px; }
.entry__poem { margin: 14px 0 10px; padding: 14px 0 16px; border-block: 1px solid #EFEDE8; }
.entry__poem .poem-body { font-size: 22px; }
.entry .diff { margin: 10px 0 0; text-align: center; font-size: 22px; }
.entry__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.entry__meta .tag { margin: 0; }
.entry__who { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 700; }
.entry__who .avatar--sm { width: 26px; height: 26px; font-size: 12px; }
.entry__title { margin: 10px 0 0; font-weight: 700; }
.entry__text { margin: 8px 0 0; font-size: 15.5px; line-height: 2; overflow-wrap: anywhere; }
.entry__ref { margin: 6px 0 0; font-size: 13px; }
@media (max-width: 560px) {
  .writers { gap: 6px; }
  .writers a { padding: 10px 4px 8px; gap: 4px; font-size: 11px; border-radius: 12px; }
  .writers strong { font-size: 12.5px; line-height: 1.5; }
  .writers .avatar--lg { width: 58px; height: 58px; font-size: 24px; }
  .entry__poem { padding: 10px 0 12px; }
  .book-sheet { padding: 22px 30px 24px; margin-inline: -4px; }
  .book-flow, .book-body { margin-top: 14px; font-size: 18.5px; line-height: 1.7; }
  .bk-poet { font-size: 23px; }
  .bk-part { padding-top: 3.2em; font-size: 28px; }
  .bk-part__by { font-size: 17px; }
  .bk-where .bk-edit { left: -32px; width: 30px; height: 30px; margin-top: -15px; }
  .bk-head { font-size: 17px; }
  .bk-poem .poem-body { font-size: 19px; }
  .bk-diff .diff { font-size: 18px; }
  .mark.entry { padding: 12px 14px; }
}
.commentary__avatar { width: 22px; height: 22px; font-size: 11px; vertical-align: middle; margin-inline-end: 4px; }
.stat-tiles { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat-tiles li { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 13px; }
.stat-tiles__n { font-size: 28px; font-weight: 700; color: var(--ink); }
.manage-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.manage-links a { display: flex; flex-direction: column; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; font-size: 14px; }
.manage-links a:hover { text-decoration: none; border-color: #D3CCC2; }
.manage-links strong { font-size: 16px; }
.manage-intro { margin: 0 0 16px; font-size: 14px; }
.manage-intro a { text-decoration: underline; }
.manage-section { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.manage-section h2 { margin: 0 0 6px; font-size: 18px; }
.manage-section > p { margin: 0 0 12px; font-size: 14px; }
.manage-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; align-items: end; }
.switch { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; }
.switch input, .radio-list input { width: 18px; height: 18px; accent-color: var(--cocoa); }
.radio-list { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.radio-list legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.radio-list label { display: flex; align-items: center; gap: 8px; }
.manage-search { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.manage-search input, .manage-search select { flex: 1 1 200px; min-height: 42px; padding: 6px 12px; border: 1px solid #D3CCC2; border-radius: 10px; font: inherit; background: var(--paper); }
.manage-search .manage-search__n { flex: 0 0 90px; }
.manage-search button { min-height: 42px; }
.manage-found { list-style: none; margin: 0 0 16px; padding: 0; border: 1px dashed var(--line); border-radius: 10px; }
.manage-found li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; font-size: 14px; }
.manage-found li + li { border-top: 1px solid var(--line); }
.manage-poets { list-style: none; margin: 0; padding: 0; }
.manage-poets li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.manage-poets__pic img, .manage-poets__noimg { width: 42px; height: 56px; border-radius: 6px; object-fit: cover; display: flex; align-items: center; justify-content: center; background: var(--ground); font-size: 10px; color: var(--ink-soft); }
.manage-poets__name { flex-grow: 1; font-size: 15px; }
.manage-poets__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.manage-poets__actions form { display: flex; gap: 2px; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 15px; cursor: pointer; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.manage-upload label { cursor: pointer; }
.manage-featured { list-style: none; margin: 0; padding: 0; }
.manage-featured li { padding: 10px 0; border-top: 1px solid var(--line); }
.manage-users { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.manage-users li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; }
.manage-users li + li { border-top: 1px solid var(--line); }
.spelling-lists { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.spelling-lists a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 14px; }
.spelling-lists a[aria-current] { border-color: var(--ink); }
.spelling-cases ul { list-style: none; margin: 0 0 12px; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.spelling-cases li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.spelling-cases li + li { border-top: 1px solid var(--line); }
.spelling-case { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.spelling-case > span { display: flex; flex-direction: column; gap: 4px; }
.spelling-case__line { font-family: var(--font-verse, inherit); font-size: 17px; }
.spelling-case__change { font-size: 14px; }
.spelling-case__change del { color: #9B3B2E; }
.spelling-case__change ins { color: #2F6B3A; text-decoration: none; }
.spelling-case a { font-size: 13px; }
.spelling-case__buttons { display: flex; gap: 6px; flex-shrink: 0; }
.spelling-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.manage-users__who { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.manage-users__role select { min-height: 38px; padding: 4px 10px; border: 1px solid #D3CCC2; border-radius: 10px; font: inherit; background: var(--paper); }
@media (max-width: 760px) {
  .manage-row { grid-template-columns: minmax(0, 1fr); }
  .manage-poets li, .manage-users li { flex-wrap: wrap; }
  .contributor-header { flex-direction: column; text-align: center; }
}

/* Annotations under their couplets, switched on by the reader (corpus/notes.js) */
.notes-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px; font-size: 14px; }
.notes-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 12px; border: 1px solid #D3CCC2; border-radius: 999px; background: var(--paper); font: inherit; color: var(--ink); cursor: pointer; }
.notes-switch__track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #D3CCC2; transition: background 0.15s; }
.notes-switch__track span { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: #FFF; transition: right 0.15s; }
.notes-switch[aria-checked="true"] .notes-switch__track { background: var(--cocoa); }
.notes-switch[aria-checked="true"] .notes-switch__track span { right: 16px; }
.notes-switch:focus-visible { outline: 2px solid var(--cocoa); outline-offset: 2px; }
.notes-sources { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.notes-sources[hidden] { display: none; }
.notes-sources label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.notes-sources input { width: 16px; height: 16px; accent-color: var(--cocoa); }
.bayt-notes, .poem-notes { max-width: 640px; margin: 10px auto 26px; font-family: var(--font-ui); font-size: 14.5px; line-height: 2; text-align: right; }
.poem-notes { margin-bottom: 28px; }
.bayt-notes[hidden], .poem-notes[hidden], .note-item[hidden] { display: none; }
/* A reader's note sits on the paper itself: only its own type and some space set it apart from the verses. */
.note-item { padding: 0 2.2em; }
.note-item__text p + p { margin-top: 4px; }
.note-was span { font-family: var(--font-book); font-size: 1.12em; }
.note-item + .note-item { margin-top: 10px; }
.note-item p { margin: 0; }
.note-item__head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 12px; }
.note-item__src { font-weight: 700; color: #6B4F2E; }
.note-item__kind { background: #F3E9DC; color: #6B4F2E; border-radius: 6px; padding: 0 7px; }
.note-item__text { text-align: justify; }
.note-item__by { font-size: 12.5px; color: var(--ink-soft); }
.note-item__by a { text-decoration: underline; }
@media (max-width: 720px) { .bayt-notes, .poem-notes { font-size: 14px; margin-bottom: 20px; } .note-item { padding: 0 1.2em; } }
.poem-notes { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.poem-notes__title { margin: 0 0 8px; font-weight: 700; font-size: 14px; color: var(--ink-soft); }

/* Rhyme explorer (/qawafi/) */
.qawafi { --bar: #A5591C; --bar-b: #2470A6; --track: #F1EDE6; padding-bottom: 48px; }
.qawafi .rhyme { font-family: var(--font-book); font-size: 1.15em; }
.qawafi-form { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.qawafi-form__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.qawafi-form__wide { grid-column: span 3; }
.qawafi-form__modes { display: flex; gap: 14px; font-size: 13px; }
.qawafi-form__modes label { font-weight: 400; display: inline-flex; gap: 4px; align-items: center; }
.qawafi-form__modes input { width: auto; min-height: 0; }
.qawafi-switch { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; margin: 16px 0 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); font-size: 14px; }
.qawafi-switch__item { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-weight: 400; }
.qawafi-switch__note { flex-basis: 100%; font-size: 12px; }
.qawafi-switch__item label { display: inline-flex; gap: 4px; align-items: center; }
.qawafi-switch input { width: auto; min-height: 0; margin: 0; accent-color: var(--cocoa); }
.couplet-list { list-style: none; margin: 0 0 16px; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.couplet-list li + li { border-top: 1px solid #EFEDE8; }
.couplet-list a { display: flex; flex-direction: column; gap: 6px; padding: 12px 20px; color: var(--ink); }
.couplet-list a:hover { background: #FAF8F4; text-decoration: none; }
.couplet-list__src { font-size: 13px; color: var(--ink-soft); }
.couplet-list__bayt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 32px; font-family: var(--font-book); font-size: 18px; }
@media (max-width: 720px) { .couplet-list__bayt { grid-template-columns: 1fr; } }
.qawafi-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; }
.qawafi-h2 { margin: 0 0 4px; font-size: 20px; }
.qawafi-h2 .muted { font-size: 15px; font-weight: 400; }
.qawafi-h3 { margin: 18px 0 8px; font-size: 16px; }
.qawafi-h3 .muted { font-size: 13px; font-weight: 400; }
.qawafi-label { margin: 14px 0 4px; font-size: 14px; font-weight: 600; }
.qawafi-results { margin-top: 24px; }
.qawafi-results .poem-list { margin-top: 14px; }
.qawafi-empty { padding: 20px; color: var(--ink-soft); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row a { border: 1px solid #D9D2C7; border-radius: 999px; padding: 2px 12px; font-size: 14px; background: var(--paper); }
.chip-row a:hover { border-color: var(--bar); text-decoration: none; }
.chip-row--scroll { max-height: 220px; overflow-y: auto; }
.chip-row--tall { max-height: 420px; }

.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0 10px; }
.stat-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-tile { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; }
.stat-tile__n { font-size: 28px; font-weight: 800; line-height: 1.3; }
.stat-tile__l { font-size: 13px; color: var(--ink-soft); }

.chart-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-top: 18px; scroll-margin-top: 16px; }
.chart-card__sub { margin: 0 0 14px; font-size: 13px; }
.chart-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; }

/* horizontal bars: label · bar · value; the bar grows from the right (the RTL start) */
.hbar { list-style: none; margin: 0; padding: 0; }
.hbar a, .hbar__row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 8.5em; align-items: center; gap: 10px; padding: 3px 6px; border-radius: 8px; }
.hbar a:hover { background: #FAF6EF; text-decoration: none; }
.hbar a:hover .hbar__bar { background: #7E4214; }
.hbar__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar__track { display: block; height: 18px; }
.hbar__bar { display: block; height: 100%; min-width: 2px; background: var(--bar); border-radius: 4px 0 0 4px; }
.hbar__val { font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbar__val .muted { font-size: 12px; }
.hbar--wide li + li { margin-top: 8px; }
.hbar--compact a { grid-template-columns: 9em minmax(0, 1fr) 3em; }
.hbar__examples { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0 0; padding-inline-start: calc(7.5em + 16px); font-size: 13px; color: var(--ink-soft); }
.hbar__examples a { display: inline; padding: 0; text-decoration: underline; text-decoration-color: #D9D2C7; }

/* vertical bars for the rawi letters */
.vbar { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 2px; height: 220px; }
.vbar li { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; }
.vbar__val { height: 20px; font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.vbar__track { flex: 1; width: 100%; max-width: 24px; display: flex; align-items: flex-end; }
.vbar__bar { display: block; width: 100%; min-height: 2px; background: var(--bar); border-radius: 4px 4px 0 0; }
.vbar li:hover .vbar__bar { background: #7E4214; }
.vbar__label { height: 26px; font-family: var(--font-book); font-size: 18px; line-height: 26px; border-top: 1px solid var(--line); width: 100%; text-align: center; }
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--ink-soft); }
.chart-table table, .compare-facts { border-collapse: collapse; margin-top: 6px; }
.chart-table td, .chart-table th, .compare-facts td, .compare-facts th { padding: 3px 12px; border-bottom: 1px solid #EFEDE8; text-align: start; }

/* shared zamins */
.zamin-list { list-style: none; margin: 0; padding: 0; }
.zamin-list a { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) minmax(0, 1fr) 8.5em; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 8px; }
.zamin-list li + li a { border-top: 1px solid #F3F1EC; }
.zamin-list a:hover { background: #FAF6EF; text-decoration: none; }
.zamin-list__metre { font-size: 13px; color: var(--ink-soft); }

/* two poets: bars grow out from the label in the middle */
.compare-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 14px; }
.compare-form select { min-height: 40px; padding: 4px 10px; border: 1px solid #D3CCC2; border-radius: 10px; font: inherit; background: var(--paper); max-width: 100%; }
.compare-legend { display: flex; gap: 18px; font-size: 14px; margin-bottom: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.sw--a { background: var(--bar); }
.sw--b { background: var(--bar-b); }
.compare-facts { font-size: 14px; margin-bottom: 8px; }
.butterfly { list-style: none; margin: 0; padding: 0; }
.butterfly li { display: grid; grid-template-columns: 3.4em minmax(0, 1fr) 6em minmax(0, 1fr) 3.4em; align-items: center; gap: 4px; padding: 2px 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.butterfly li:hover { background: #FAF6EF; }
.butterfly__side { display: flex; height: 16px; }
.butterfly__side--a { justify-content: flex-end; }
.butterfly__bar { display: block; height: 100%; }
.butterfly__side--a .butterfly__bar { background: var(--bar); border-radius: 0 4px 4px 0; }
.butterfly__side--b .butterfly__bar { background: var(--bar-b); border-radius: 4px 0 0 4px; }
.butterfly__label { text-align: center; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.butterfly li > .butterfly__val:last-child { text-align: end; }
.rawi-index section { scroll-margin-top: 16px; }

@media (max-width: 720px) {
  .qawafi-form__grid { grid-template-columns: 1fr; }
  .qawafi-form__wide { grid-column: auto; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-card { padding: 16px 14px; }
  .chart-split { grid-template-columns: 1fr; }
  .hbar a, .hbar__row { grid-template-columns: 5.5em minmax(0, 1fr) 6.5em; gap: 6px; }
  .hbar__examples { padding-inline-start: 0; }
  .zamin-list a { grid-template-columns: minmax(0, 1fr) 6.5em; }
  .zamin-list__metre { grid-column: 1 / -1; grid-row: 2; }
  .zamin-list .hbar__track { display: none; }
  .vbar__label { font-size: 14px; }
  .vbar__val { font-size: 9px; }
}
.qawafi-form__rhyme { display: flex; gap: 8px; align-items: flex-end; }
.qawafi-form__part { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.qawafi-form__part--grow { flex: 1 1 auto; min-width: 0; }
.qawafi-form__part small { font-size: 12px; }
/* Every top-row field has one caption line of the same height between its label and its control, so the controls sit on one line. */
.qawafi-form__cap { display: flex; align-items: center; height: 22px; line-height: 22px; }
.qawafi-form__rhyme select { width: auto; min-width: 7.5em; }
.qawafi-form__rhyme input { width: 100%; min-width: 0; }

/* Research hub: tools grouped by kind; tools still being built are shown greyed with «به‌زودی». */
.research-page { padding-bottom: 48px; }
.research-group { margin-top: 26px; }
.research-group h2 { margin: 0 0 12px; font-family: var(--font-book); font-size: 24px; font-weight: 700; }
.research-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.research-tool { display: flex; flex-direction: column; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; color: var(--ink); scroll-margin-top: 16px; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
a.research-tool:hover { text-decoration: none; border-color: var(--hero); box-shadow: 0 4px 14px rgba(42, 22, 12, 0.08); }
.research-tool__name { font-size: 17px; font-weight: 700; }
.research-tool__desc { font-size: 14px; line-height: 1.9; color: var(--ink-soft); }
.research-tool.is-soon { background: transparent; border-style: dashed; }
.research-tool.is-soon .research-tool__name { color: var(--ink-soft); }
.research-tool__soon { margin-inline-start: 6px; padding: 2px 8px; border-radius: 10px; background: var(--hero-chip); color: #7A5634; font-size: 11px; font-weight: 700; vertical-align: 2px; }
@media (max-width: 640px) { .research-tools { grid-template-columns: 1fr; } }

/* Persian poets index (/poets/) */
.poets-page { padding-bottom: 56px; }
.poets-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 4px 0 24px; }
.poets-search { flex: 1 1 320px; max-width: 520px; }
.poets-search input { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; padding: 12px 18px; border: 1px solid #D9D2C7; border-radius: 999px; background: var(--paper); color: var(--ink); }
.poets-search input:focus { outline: 2px solid var(--hero); outline-offset: 1px; }
.poets-view { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--hero-track); }
.poets-view a { padding: 8px 16px; border-radius: 999px; font-size: 14px; color: var(--ink); }
.poets-view a:hover { text-decoration: none; background: var(--hero-chip); }
.poets-view a[aria-current] { background: var(--paper); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.poets-cards { margin-bottom: 28px; }
.poets-note { background: var(--hero-chip); border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 1.9; }
.poets-group { scroll-margin-top: 16px; }
.poets-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.poets-list a { display: flex; gap: 12px; align-items: center; height: 100%; box-sizing: border-box; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; color: var(--ink); }
.poets-list a:hover { text-decoration: none; border-color: var(--hero); }
.poets-list img { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.poets-list img.poets-list__mark { object-fit: contain; background: var(--hero-chip); padding: 6px; box-sizing: border-box; }
.poets-list a > span { display: flex; flex-direction: column; min-width: 0; }
.poets-list__name { font-family: var(--font-book); font-size: 19px; line-height: 1.5; }
.poets-list .muted { font-size: 12px; }
.poets-minor { margin: 12px 0 0; font-family: var(--font-book); font-size: 17px; line-height: 2; }
.poets-minor .muted { font-family: var(--font-ui); font-size: 13px; margin-inline-end: 6px; }
@media (max-width: 640px) { .poets-list { grid-template-columns: 1fr; } .poets-view { width: 100%; justify-content: center; } }
.poets-page [hidden] { display: none !important; }
.poet-card--noimg { background: var(--hero); }
.poet-card--noimg img.poet-card__mark { inset: 18% 22% auto; width: 56%; height: auto; aspect-ratio: 1; object-fit: contain; opacity: 0.9; }
.poet-card--noimg:hover img.poet-card__mark { transform: none; }

/* Poem page: the qafiye field, editable by experts (corpus/qafiye-edit.js). */
.qafiye-field.is-editing { grid-column: 1 / -1; }
.qafiye-field.is-editing > dt { display: none; }
.qafiye-edit { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: 4px; vertical-align: middle; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; opacity: 0; transition: opacity .15s; }
.qafiye-field:hover .qafiye-edit, .radif-field:hover .qafiye-edit, .qafiye-edit:focus-visible { opacity: 1; }
.qafiye-edit:hover { background: #EFECE6; color: var(--ink); }
@media (hover: none) { .qafiye-edit { opacity: 1; } }
.qafiye-manual { font-size: 12px; }
.qafiye-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.qafiye-form label { display: inline-flex; flex-direction: column; gap: 2px; font-size: 12px; color: #6B6B6B; }
.qafiye-form__buttons { display: inline-flex; flex-wrap: wrap; gap: 6px; align-self: flex-end; }
.qafiye-form__vowels { align-self: flex-end; }
.qafiye-form .qafiye-form__radif input { width: 12em; }
.radif-field[hidden] { display: none; }
.qafiye-form input { width: 9em; min-height: 38px; padding: 0 10px; border: 1px solid #CFCCC4; border-radius: 8px; background: var(--paper); font: inherit; font-size: 18px; }
.qafiye-form__vowels { display: inline-flex; gap: 4px; }
.qafiye-form__vowels button, .qafiye-form__cancel { min-height: 38px; padding: 0 10px; border: 1px solid #D9D2C7; border-radius: 8px; background: var(--paper); font: inherit; font-size: 16px; cursor: pointer; }
.qafiye-form__save { min-height: 38px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--cocoa); color: var(--cream); font: inherit; font-weight: 700; cursor: pointer; }
.qafiye-form__save:disabled { opacity: .6; }
.qafiye-form__hint, .qafiye-form__error { flex-basis: 100%; margin: 2px 0 0; font-size: 12px; }
.qafiye-form__error { color: #9A3B2E; }
.life-links { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0 8px; font-size: 0.95em; }
.life-links a { color: var(--cocoa); padding: 4px 0; }
.life-links span { color: var(--ink-soft); }
.about-poet { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 4px; }
/* Poet page header. Without a banner: the poet's portrait, lightly blurred and darkened, fills the band, the sharp
   portrait large on it beside the name. With a banner (a header designed for the poet): the banner whole, the name on it. */
.person-hero { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 32px;
  margin: 24px 0 8px; padding: 32px 40px; background: #2A160C; color: #FFF; }
.person-hero__bg { position: absolute; inset: -16px; z-index: -1; background-size: cover; background-position: center 30%;
  filter: blur(6px) saturate(1.1) brightness(0.62); }
.person-hero__image { flex: none; width: 264px; height: 352px; object-fit: cover; border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); border: 3px solid rgba(255, 255, 255, 0.9); }
.person-hero__text { min-width: 0; }
.person-hero h1 { margin: 0; font-family: var(--font-book); font-size: 48px; font-weight: 700; line-height: 1.35;
  color: #FFF; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); }
.person-hero p { margin: 8px 0 0; color: rgba(255, 255, 255, 0.9); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45); }
.person-hero .person-hero__alt { margin: 0; font-size: 18px; }
.person-hero--banner { display: block; padding: 0; background: var(--paper); }
.person-hero__banner { display: block; width: 100%; height: auto; }
.person-hero--banner .person-hero__text { position: absolute; inset: auto 0 0 0; padding: 48px 32px 22px;
  background: linear-gradient(to top, rgba(20, 10, 4, 0.72), rgba(20, 10, 4, 0)); }
/* A banner and a portrait both: the portrait small beside the name, on the banner. */
.person-hero--banner .person-hero__text { display: flex; align-items: flex-end; gap: 20px; }
.person-hero__words { min-width: 0; }
.person-hero__thumb { flex: none; width: 120px; height: 160px; object-fit: cover; border-radius: 12px;
  border: 3px solid rgba(255, 255, 255, 0.9); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); }
.person-hero__caption { margin: 6px 0 4px; font-size: 13px; line-height: 1.8; color: var(--ink-soft); text-align: left; }
.person-hero-admin__caption { display: flex; gap: 6px; flex: 1 1 260px; }
.person-hero-admin__caption input { flex: 1; min-width: 0; font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.person-hero-admin { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 4px 0; font-size: 14px; }
.person-hero-admin form { display: inline-flex; }
.person-hero-admin label { cursor: pointer; }
@media (max-width: 720px) {
  .person-hero { flex-direction: column; gap: 14px; margin-top: 16px; padding: 22px 16px 18px; text-align: center; }
  .person-hero__image { width: 168px; height: 224px; border-radius: 14px; }
  .person-hero h1 { font-size: 30px; }
  .person-hero p { font-size: 14px; }
  .person-hero--banner { padding: 0; text-align: right; }
  .person-hero--banner .person-hero__text { position: static; padding: 12px 16px 14px; background: var(--paper); align-items: center; gap: 14px; }
  .person-hero__thumb { width: 72px; height: 96px; border-radius: 10px; border-width: 2px; margin-top: -48px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
  .person-hero--banner h1 { color: var(--ink); text-shadow: none; }
  .person-hero--banner p { color: var(--ink-soft); text-shadow: none; }
}
/* The poet's header cut down to a band atop section pages (mid) and poems (slim); the whole band links to the poet. */
.person-band { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 16px;
  margin-top: 16px; padding: 0 24px; border-radius: 14px; background: #2A160C; color: #FFF; }
.person-band:hover { text-decoration: none; }
.person-band--mid { height: 180px; }
.person-band--slim { height: 76px; border-radius: 12px; }
.person-band__banner { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.person-band--banner::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to left, rgba(20, 10, 4, 0.7), rgba(20, 10, 4, 0.15) 70%); }
.person-band__bg { position: absolute; inset: -16px; z-index: -1; background-size: cover; background-position: center 30%;
  filter: blur(6px) saturate(1.1) brightness(0.62); }
.person-band__image { flex: none; object-fit: cover; border: 2px solid rgba(255, 255, 255, 0.9); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
.person-band--mid .person-band__image { width: 105px; height: 140px; border-radius: 12px; }
.person-band--slim .person-band__image { width: 52px; height: 52px; border-radius: 50%; }
.person-band__name { font-family: var(--font-book); font-weight: 700; line-height: 1.3; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55); }
.person-band--mid .person-band__name { font-size: 36px; }
.person-band--slim .person-band__name { font-size: 24px; }
.person-band--banner .person-band__name { align-self: flex-end; padding-bottom: 16px; }
.person-band--slim.person-band--banner .person-band__name { align-self: center; padding-bottom: 0; }
@media (max-width: 720px) {
  .person-band { margin-top: 10px; padding: 0 14px; gap: 12px; }
  .person-band--mid { height: 120px; }
  .person-band--slim { height: 56px; border-radius: 10px; }
  .person-band--mid .person-band__image { width: 72px; height: 96px; border-radius: 10px; }
  .person-band--slim .person-band__image { width: 38px; height: 38px; }
  .person-band--mid .person-band__name { font-size: 26px; }
  .person-band--slim .person-band__name { font-size: 19px; }
  .person-band--banner .person-band__name { padding-bottom: 10px; }
}

/* Footer pages: about, sources, contact… (core/site_page.html) */
.static-page { padding-bottom: 48px; }
.static-page__lead { color: var(--ink-soft); font-size: 1.08em; line-height: 2; margin: 6px 0 0; }
.static-page__body { line-height: 2.1; }
.static-page__body p, .static-page__body li { text-align: justify; }
.static-page__body h2, .static-page h2 { margin: 30px 0 8px; font-family: var(--font-book); font-size: 24px; font-weight: 700; }
.static-page__body h3, .static-page h3 { margin: 20px 0 4px; font-size: 1.08em; }
.static-page__body ul, .static-page__body ol { padding-inline-start: 22px; }
.static-page__body li { margin-bottom: 6px; }
.static-page__body a { color: var(--cocoa); }
.static-page__updated { margin-top: 32px; font-size: 13px; border-top: 1px solid var(--line); padding-top: 10px; }
.contact-list { display: grid; gap: 6px; margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px; }
.contact-list div { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.contact-list dt { font-weight: 700; min-width: 110px; }
.contact-list dd { margin: 0; }
.contact-form { margin-top: 10px; }
.contact-form .form { max-width: 560px; }
.contact-form__trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sources-list dl { margin: 0; }
.sources-list__poet { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sources-list__poet dt { font-weight: 700; }
.sources-list__poet dt a { color: inherit; }
.sources-list__poet dd { margin: 2px 0 0; padding-inline-start: 14px; line-height: 1.9; font-size: 0.95em; }
.manage-pages, .manage-messages { list-style: none; margin: 0; padding: 0; }
.manage-pages li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.manage-messages li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.manage-messages li.is-unread { border-inline-start: 3px solid var(--cocoa); padding-inline-start: 12px; }
.manage-messages__head { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; }
.manage-messages__body { line-height: 2; white-space: normal; overflow-wrap: anywhere; }
/* A note under a poet's works, e.g. on works attributed to them that are not theirs. */
.works-note { margin: 0 0 14px; padding: 14px 18px; border-inline-start: 3px solid var(--hero); background: var(--hero-chip);
  border-radius: 10px; font-size: 15px; line-height: 2; }
.works-note p { margin: 0 0 8px; }
.works-note p:last-child { margin-bottom: 0; }
.works-note a { overflow-wrap: anywhere; color: var(--cocoa); text-decoration: underline; text-underline-offset: 3px; }

/* Research API: its guide, the reader's key page and the admin's approvals. */
.api-guide { padding-bottom: 48px; }
.api-guide section { margin-top: 30px; scroll-margin-top: 16px; }
.api-guide h2 { margin: 0 0 10px; font-family: var(--font-book); font-size: 24px; }
.api-guide p, .api-guide li { line-height: 2; }
.api-guide code, .api-keys code, .api-manage code { font-family: Consolas, "Courier New", monospace; font-size: 0.88em; background: var(--hero-chip); border-radius: 5px; padding: 1px 5px; unicode-bidi: isolate; }
.api-guide pre { margin: 10px 0; background: #2A2B2D; color: #EDEDE8; border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.7; text-align: left; }
.api-guide pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.api-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.api-toc a { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 5px 14px; font-size: 14px; }
.api-endpoint { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-top: 12px; }
.api-endpoint h3 { margin: 0 0 6px; font-family: Consolas, "Courier New", monospace; font-size: 16px; text-align: right; }
.api-endpoint p { margin: 6px 0; }
.api-keys section { margin-bottom: 26px; }
.api-keys h2, .api-manage h2 { margin: 0 0 10px; font-size: 19px; }
.api-secret { background: #EEF3E8; border-radius: 14px; padding: 16px 18px; }
.api-secret__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.api-secret__row code { font-size: 15px; word-break: break-all; padding: 6px 10px; background: var(--paper); }
.api-purpose { margin: 8px 0 12px; padding: 10px 14px; border-inline-start: 3px solid var(--hero); background: var(--paper); border-radius: 0 8px 8px 0; line-height: 1.9; }
.api-note { background: var(--hero-chip); border-radius: 10px; padding: 10px 14px; }
.api-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0 18px; }
.api-facts div { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.api-facts dt { font-size: 13px; color: var(--ink-soft); }
.api-facts dd { margin: 2px 0 0; font-weight: 700; }
.api-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.api-past { margin: 0; padding: 0 18px 0 0; line-height: 2; }
.api-manage { margin-bottom: 28px; }
.api-manage__item { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 12px; }
.api-manage__item header { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.api-manage__item header .muted { font-size: 13px; }
.api-manage__use { font-size: 14px; }
.api-manage__limits, .api-manage__decide { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.api-manage__limits input { width: 100px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.api-manage__decide input { flex: 1 1 220px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
@media (max-width: 640px) { .api-facts { grid-template-columns: 1fr; } .api-guide pre { font-size: 12px; } }
/* A count of what waits, beside a /manage/ tab. */
.tab-count { display: inline-block; min-width: 20px; margin-inline-start: 4px; padding: 0 6px; border-radius: 10px; background: #A3361F; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }

/* ارجاع‌ساز */
.cite-page { padding-bottom: 48px; }
.cite-page h2 { margin: 0 0 4px; font-family: var(--font-book); font-size: 24px; }
.cite-address, .cite-pick__poet { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cite-address label, .cite-pick__poet label, .cite-pick__poem label { font-size: 14px; font-weight: 700; }
.cite-address__row { display: flex; gap: 8px; }
.cite-address__row input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid #D3CCC2; border-radius: 10px; background: var(--paper); font: inherit; }
.cite-address .btn-primary { align-self: auto; white-space: nowrap; }
.cite-poem, .cite-pick { margin-top: 26px; }
.cite-couplets { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; }
.cite-couplets label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cite-couplets select, .cite-pick__poem select { max-width: 100%; min-height: 40px; padding: 6px 8px; border: 1px solid #D3CCC2; border-radius: 8px; background: var(--paper); font: inherit; }
.cite-list { display: grid; gap: 12px; margin-top: 18px; }
.cite-item { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.cite-item h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink-soft); }
.cite-item__hint { margin: 0 0 6px; font-size: 13px; }
.cite-item__text { margin: 0 0 10px; line-height: 2; font-size: 16px; overflow-wrap: anywhere; }
.cite-files { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.cite-pick__trail { line-height: 2; }
.cite-pick__list { margin: 8px 0 0; padding: 0 20px 0 0; columns: 2 220px; line-height: 2.1; }
.cite-pick__poem { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.cite-pick__poem select { flex: 1 1 260px; }
@media (max-width: 520px) { .cite-address__row { flex-direction: column; } .cite-address .btn-primary { align-self: stretch; } }
/* Search filters: forms and centuries share the middle column. */
.filter-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.filter-group--centuries .filter-group__list { max-height: 220px; }
@media (max-width: 860px) { .filter-group--centuries .filter-group__list { flex-direction: row; flex-wrap: wrap; max-height: none; } }

/* دفتر پژوهش */
.poem-tools__book, .conc-book { min-height: 38px; padding: 0 16px; border: 1px solid #D3CCC2; border-radius: 10px; background: var(--paper); font: inherit; color: var(--ink); cursor: pointer; }
.hit__add { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.hit__add:hover { text-decoration: underline; }
.conc-book { min-height: 0; padding: 1px 10px; font-size: 12.5px; }
.nb-moved { margin: 0 0 14px; font-size: 14px; }
.nb-intro p { margin: 0 0 16px; line-height: 2; }
.nb-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.nb-list a { display: flex; flex-direction: column; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; color: var(--ink); }
.nb-list a:hover { text-decoration: none; border-color: var(--hero); }
.nb-list strong { font-size: 17px; }
.nb-list .muted { font-size: 13px; }
.nb-list__desc { font-size: 14px; color: var(--ink-soft); }
.nb-new summary, .nb-edit summary, .nb-controls__edit summary { cursor: pointer; color: var(--ink-soft); font-size: 14px; }
.nb-new .form, .nb-edit .form { margin-top: 12px; max-width: 520px; }
.nb-back { margin: 0 0 8px; font-size: 14px; }
.nb-shared { padding: 28px 12px 48px; }
.nb-head__title { margin: 0; font-family: var(--font-book); font-size: 28px; }
.nb-head__desc { margin: 6px 0 0; line-height: 2; }
.nb-head { margin-bottom: 14px; }
.nb-toolbar, .nb-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; }
.nb-share code { font-size: 13px; word-break: break-all; background: var(--hero-chip); border-radius: 6px; padding: 2px 8px; }
.nb-share form { display: inline; }
.nb-entries { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 12px; }
.nb-entry { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; scroll-margin-top: 16px; }
.nb-entry--heading { background: transparent; border: 0; border-bottom: 2px solid var(--cocoa); border-radius: 0; padding: 18px 0 8px; }
.nb-entry--heading h3 { margin: 0; font-family: var(--font-book); font-size: 22px; }
.nb-entry__head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; color: var(--ink); }
.nb-entry__poet { font-weight: 700; }
.nb-entry__text { margin: 10px 0 4px; font-family: var(--font-book); font-size: 19px; line-height: 2; }
.nb-bayt { display: flex; flex-wrap: wrap; gap: 0 32px; margin: 0; }
.nb-entry__small { font-family: var(--font-ui); font-size: 13px; margin: 4px 0; }
.nb-entry__note { margin: 8px 0; padding: 8px 12px; background: var(--hero-chip); border-radius: 10px; line-height: 2; font-size: 15px; }
.nb-entry__cite { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); line-height: 1.9; }
.nb-controls { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.nb-controls__edit { flex: 1 1 260px; }
.nb-controls__edit .form { margin-top: 10px; }
.nb-controls__move { display: flex; gap: 10px; }
.nb-controls__move button[disabled] { opacity: 0.3; cursor: default; }
.nb-add-heading { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 14px; font-weight: 700; }
.nb-add-heading__row { display: flex; gap: 8px; }
.nb-add-heading__row input { flex: 1; min-width: 0; min-height: 42px; padding: 6px 12px; border: 1px solid #D3CCC2; border-radius: 10px; font: inherit; font-weight: 400; background: var(--paper); }
.nb-remove { margin-top: 22px; }
.nb-dialog { width: min(440px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 0; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25); }
.nb-dialog::backdrop { background: rgba(20, 12, 6, 0.45); }
.nb-dialog__form { display: flex; flex-direction: column; gap: 8px; padding: 20px; }
.nb-dialog h2 { margin: 0; font-size: 18px; }
.nb-dialog__what { margin: 0 0 6px; color: var(--ink-soft); font-size: 14px; }
.nb-dialog__label { font-size: 13px; font-weight: 700; }
.nb-dialog__label span { font-weight: 400; color: var(--ink-soft); }
.nb-dialog select, .nb-dialog input, .nb-dialog textarea { min-height: 40px; padding: 6px 10px; border: 1px solid #D3CCC2; border-radius: 10px; font: inherit; background: var(--paper); }
.nb-dialog__msg { margin: 0; min-height: 1.4em; font-size: 14px; color: #A3361F; }
.nb-dialog__msg.is-ok { color: #2F6B3A; }
.nb-dialog__actions { display: flex; gap: 8px; }
.nb-dialog__actions .btn-primary { align-self: auto; }
@media (max-width: 520px) { .nb-bayt { flex-direction: column; } .nb-entry { padding: 12px 14px; } .nb-entry__text { font-size: 17px; } }

/* خروجی متن */
.export-page { padding-bottom: 48px; }
.export-page h2 { font-family: var(--font-book); font-size: 22px; margin: 0 0 6px; }
.export-box { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin: 12px 0; }
.export-box p { margin: 0 0 10px; }
.export-formats { display: flex; flex-wrap: wrap; gap: 8px; }
.export-sub { margin: 14px 0 0; font-size: 14px; }
.export-about { margin-top: 30px; }
.export-about li { line-height: 2; }
.export-inline { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 4px 0 12px; font-size: 13.5px; }

/* دفتر پژوهش as one book page: every entry on the same paper, separated only by space and a thin ornament; the
   owner's tools appear with «ویرایش». */
.nb-book { margin-top: 14px; }
.nb-book__head { text-align: center; margin: 110px 0 36px; font-family: var(--font-book); }
.nb-book__head h1 { margin: 0; font-size: 32px; font-weight: 700; line-height: 1.5; }
.nb-book__desc { margin: 10px auto 0; max-width: 560px; font-size: 18px; line-height: 2; color: #4A4A4A; }
.nb-book__by { margin: 8px 0 0; font-size: 16px; color: #5E5249; }
.nb-chapter { margin: 56px 0 8px; text-align: center; scroll-margin-top: 16px; }
.nb-chapter h2 { margin: 0; font-family: var(--font-book); font-size: 26px; font-weight: 700; }
.nb-chapter h2::after { content: ""; display: block; width: 72px; margin: 10px auto 0; border-bottom: 1.5px solid #1F1F1F; }
.nb-piece { margin: 34px 0 0; scroll-margin-top: 16px; }
.nb-piece + .nb-piece::before { content: "*"; display: block; margin: -12px 0 22px; text-align: center; font-family: var(--font-book); color: #9A948C; letter-spacing: 1em; }
.nb-piece__title { margin: 0 0 10px; text-align: center; font-family: var(--font-book); font-size: 19px; font-weight: 700; }
.nb-piece__title a { color: inherit; }
.nb-poem .poem-body { font-size: 21px; }
.nb-small { margin: 4px 0; text-align: center; font-size: 13px; color: var(--ink-soft); }
.nb-note { max-width: 640px; margin: 10px auto 0; font-size: 15px; line-height: 2; color: #4A3B2E; text-align: right; }
.nb-chapter .nb-note { text-align: center; }
.nb-cite { max-width: 640px; margin: 8px auto 0; font-size: 12.5px; line-height: 1.9; color: #7A7168; text-align: center; }
.nb-empty { margin: 40px 0; text-align: center; color: var(--ink-soft); }
.nb-book:not(.is-editing) .nb-controls, .nb-book:not(.is-editing) .nb-tools { display: none; }
.nb-book.is-editing .nb-piece, .nb-book.is-editing .nb-chapter { outline: 1px dashed #E0D9CE; outline-offset: 10px; border-radius: 4px; }
.nb-book .nb-controls { max-width: 640px; margin: 14px auto 0; font-family: var(--font-ui); text-align: right; }
.nb-tools--meta { margin-top: 14px; font-family: var(--font-ui); font-size: 14px; text-align: right; }
.nb-book .nb-add-heading { margin-top: 48px; font-family: var(--font-ui); }
.nb-edit-toggle[aria-pressed="true"] { background: var(--cocoa); border-color: var(--cocoa); color: var(--cream); }
@media (max-width: 720px) {
  .nb-book__head { margin-top: 64px; }
  .nb-book__head h1 { font-size: 26px; }
  .nb-poem .poem-body { font-size: 19px; }
}
/* Each chapter of a notebook on its own sheet, its title well down the page. */
.nb-page + .nb-page { margin-top: 28px; }
.nb-page--chapter .nb-chapter:first-of-type { margin-top: 150px; }
.nb-page--chapter .nb-chapter:first-of-type h2 { font-size: 30px; }
@media (max-width: 720px) {
  .nb-page + .nb-page { margin-top: 18px; }
  .nb-page--chapter .nb-chapter:first-of-type { margin-top: 90px; }
  .nb-page--chapter .nb-chapter:first-of-type h2 { font-size: 25px; }
}

/* Admin overview: who keeps private notes, and how many (siteadmin/overview.html). */
.private-writers { margin: 0 0 24px; padding: 16px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.private-writers h2 { margin: 0; font-size: 16px; }
.private-writers > p { margin: 2px 0 10px; font-size: 13px; }
.private-writers ol { list-style: none; margin: 0; padding: 0; max-width: 420px; }
.private-writers li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid #EFEDE8; }
/* «افزودن به دفتر»: the poem's couplets to tick */
.nb-dialog__couplets { margin: 4px 0 0; padding: 0; border: 0; min-width: 0; }
.nb-dialog__couplets legend { padding: 0; margin-bottom: 6px; }
.nb-dialog__list { max-height: 200px; overflow-y: auto; border: 1px solid #D3CCC2; border-radius: 10px; padding: 4px; background: var(--paper); }
.nb-dialog__couplet { display: flex; align-items: baseline; gap: 8px; padding: 5px 6px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.nb-dialog__couplet:hover { background: var(--ground); }
.nb-dialog__couplet input { accent-color: var(--cocoa); flex-shrink: 0; }
.nb-dialog__n { min-width: 1.6em; color: var(--ink-soft); font-size: 12px; }
@media (max-width: 520px) { .nb-dialog__list { max-height: 34vh; } }
.nb-dialog { max-height: 92vh; overflow-y: auto; }
.nb-dialog .nb-dialog__couplet { margin: 0; padding: 3px 6px; line-height: 1.7; }
/* Search: the order of results */
.search-order { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: -4px 0 12px; font-size: 13.5px; }
.search-order a { color: var(--ink-soft); }
.search-order a:hover { color: var(--ink); text-decoration: underline; }
.search-order [aria-current] { font-weight: 700; color: var(--ink); }
.search-order [aria-hidden] { color: #C9C2B8; }
