/* Additions for the working site, in the Reading Room style. */
.narrow { max-width: 760px; }
.small { font-size: 14px; color: var(--dim); }
html[lang="ar"] .small { font-size: 16px; }
.muted.small { color: var(--dim); }
.err { color: #f0a08a; }
.inline { display: inline; }
.linkish { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.linklike { cursor: pointer; color: var(--lamp); font-size: 15px; }
.site-foot nav { align-items: baseline; flex-wrap: wrap; }
.site-foot nav a, .site-foot .linkish { color: var(--dim); }
.site-foot nav a:hover, .site-foot .linkish:hover { color: var(--paper); }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .ctas { justify-content: center; }
.btn { font-family: var(--body); }

/* Language chooser */
.choose-body { min-height: 100vh; }
.choose { padding-top: 110px; }
.choose .motto-ar { font-family: "Aref Ruqaa", serif; color: var(--lamp); font-size: clamp(30px, 4vw, 46px); margin-bottom: 46px; }
.choose-row { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.choice { background: var(--night-2); border: 1px solid var(--line); color: var(--paper); border-radius: 10px; padding: 26px 34px; min-width: 260px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; text-align: start; }
.choice:hover { border-color: var(--lamp); }
.choice b { font-family: "Cormorant Garamond", serif; font-size: 34px; font-weight: 500; }
.choice.ar b { font-family: "Aref Ruqaa", serif; font-weight: 400; }
.choice span { color: var(--dim); font-size: 16px; }
.choice.ar span { font-family: "Amiri", serif; font-size: 18px; }
.choose-note { color: var(--dim); margin-top: 34px; font-size: 16px; }
.choose-note span { font-family: "Amiri", serif; font-size: 18px; }

/* Book page */
.edition-line { margin-top: 14px; color: var(--dim); font-size: 15px; }
.bh .ctas { margin-top: 30px; }
.toc-paper .part:first-child h3 { display: none; }
.part li.done a .t::after { content: "  \2713"; color: #3f7a5a; }
.part .pencil { color: #b98f3e; font-size: .8em; }
.part li .n:empty { visibility: hidden; }
.how .btn { margin-top: 14px; }
.pass-on { color: var(--ok); margin-top: 12px; }
.print-note { margin-top: 26px; }

/* Reader: manuscript content on paper */
.chapter h4 { font-family: var(--display); font-size: 1.2em; font-weight: 600; color: var(--ink); margin: 1.2em 0 .4em; }
html[lang="ar"] .chapter h4 { font-weight: 400; }
.chapter ul { padding-inline-start: 1.4em; margin-bottom: 1em; }
html[lang="ar"] .chapter ol { list-style-type: arabic-indic; }
.chapter hr { border: 0; border-top: 1px solid var(--rule); margin: 1.6em 0; }
.chapter a { color: #8a6a2c; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.chapter code { font-size: .9em; background: #ebe0c8; padding: 0 4px; border-radius: 3px; }
.chapter blockquote p { margin-bottom: .4em; }
.chapter :target { background: linear-gradient(transparent 60%, rgba(227,182,94,.35) 60%); }
.tbl { overflow-x: auto; margin: 0 0 1.2em; max-width: 100%; }
.tbl table { border-collapse: collapse; font-size: .82em; min-width: 100%; }
.tbl th, .tbl td { border: 1px solid var(--rule); padding: 8px 10px; text-align: start; vertical-align: top; color: var(--ink-2); line-height: 1.5; }
.tbl th { background: #ebe0c8; color: var(--ink); font-weight: 600; }
.unit-end { margin-top: 22px; }
.done-btn { font-size: 16px; }
.note-box textarea { width: 100%; min-height: 120px; background: var(--night); color: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font: 15px/1.5 var(--body); resize: vertical; }
html[lang="ar"] .note-box textarea { font-size: 17px; }
.note-box textarea:focus { outline: none; border-color: var(--lamp); }
.note-status { margin-top: 6px; min-height: 1em; }
.rail .box .small { margin-top: 10px; }

/* Answer boxes */
.answer { scroll-margin-top: 90px; }
.answer.locked p { font-size: 16px; color: var(--ink-soft); margin: 0; }
html[lang="ar"] .answer.locked p { font-size: 18px; }
.answer .lbl span { overflow-wrap: anywhere; }
.answer textarea { display: block; }
.answer .astat { font-size: 14px; color: var(--ink-soft); }
.answer .astat.ok { color: #3f7a5a; }
.answer .astat.warn { color: #9a5a2c; }
.answer .astat.rec { color: #b03a2e; }
.answer .astat.rec::before { content: "\25CF  "; }
.answer .fb:disabled { opacity: .5; }
.transcript { margin-top: 10px; padding: 12px; border: 1px dashed var(--lamp-dim); border-radius: 4px; background: var(--paper-hi); }
.transcript textarea { min-height: 70px; }
.conflict { margin-top: 10px; padding: 10px 12px; background: #f5dcc8; border-radius: 4px; }
.conflict pre { white-space: pre-wrap; font: 15px/1.5 var(--body); margin: 6px 0; color: var(--ink-2); }
.conflict button { border: 0; border-radius: 30px; padding: 6px 14px; margin-inline-end: 6px; cursor: pointer; }
.conflict .save { background: var(--ink); color: var(--paper); }
.conflict .speak { background: none; border: 1px solid var(--rule); }
.fb-out .working { margin-top: 12px; color: #8a6a2c; font-style: italic; }
.fb-out .working::after { content: " \2026"; }
.fb-out .err { color: #9a3a2c; margin-top: 10px; font-size: 15px; }
.pass-inline { margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.pass-inline small { color: var(--ink-soft); }
.pass-inline .gold { color: #8a6a2c; }
.fb-card { margin-top: 14px; background: var(--paper-hi); border: 1px solid var(--rule); border-inline-start: 3px solid var(--lamp); border-radius: 4px; padding: 14px 16px; font-size: 16px; color: var(--ink-2); }
html[lang="ar"] .fb-card { font-size: 18px; }
.fb-card p, .fb-card li { max-width: none !important; margin-bottom: .5em !important; line-height: 1.55 !important; }
.fb-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.fb-head b { font-family: var(--display); font-size: 20px; color: var(--ink); }
.fb-head small { color: var(--ink-soft); font-size: 12px; }
.fb-card h5 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #8a6a2c; margin: 8px 0 4px; font-weight: 500; }
html[lang="ar"] .fb-card h5 { letter-spacing: 0; font-size: 15px; }
.fb-card ul { list-style: none; padding: 0 !important; }
.fb-card ul li { padding-inline-start: 20px; position: relative; }
.fb-card ul li::before { position: absolute; inset-inline-start: 0; }
.fb-card ul.y li::before { content: "\2713"; color: #3f7a5a; }
.fb-card ul.n li::before { content: "\2192"; color: #9a7a3c; }
html[dir="rtl"] .fb-card ul.n li::before { content: "\2190"; }
.fb-card .flag { color: #9a5a2c; }
.fb-card .teacher { margin-top: 10px; padding: 10px 12px; background: #e6efe8; border-radius: 4px; }
.fb-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.fb-foot .gold { color: #8a6a2c; }
.fb-foot .rq { color: #3f7a5a; }
details.earlier { margin-top: 10px; font-size: 15px; color: var(--ink-soft); }
details.earlier summary { cursor: pointer; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(8,12,20,.7); display: grid; place-items: center; z-index: 80; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { background: var(--night-2); border: 1px solid rgba(227,182,94,.4); border-radius: 10px; padding: 26px; max-width: 520px; color: var(--moon); }
.modal-card .row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* Panels and forms */
.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--night-2); padding: 26px 28px 28px; margin-bottom: 28px; }
.panel h2 { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--lamp); font-weight: 500; margin-bottom: 16px; }
html[lang="ar"] .panel h2 { letter-spacing: 0; font-size: 17px; }
.signin-panel { margin-top: 70px; }
.signin-panel h1 { font-size: 46px; margin: 8px 0 10px; }
.form { display: grid; gap: 16px; margin-top: 20px; }
.form label { display: grid; gap: 6px; font-size: 16px; color: var(--moon); }
.form input, .form textarea { background: var(--night); color: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 11px 13px; font: 17px var(--body); }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--lamp); }
.form .btn { justify-self: start; }
.list a.what:hover { color: var(--lamp); }
.feedback .fb-sum { margin-bottom: 10px; color: var(--ink-2); }
.feedback .teacher { margin: 10px 0; padding: 10px 12px; background: #e6efe8; border-radius: 4px; color: var(--ink-2); }
.feedback .teacher h3 { font-size: 18px; }
.side .row label { font-size: 15px; }

/* Search */
.search-wrap { padding-top: 60px; }
.search-wrap h1 { font-size: 46px; margin-bottom: 20px; }
.searchbar { display: flex; gap: 10px; margin-bottom: 16px; }
.searchbar input { flex: 1; min-width: 0; background: var(--night-2); color: var(--paper); border: 1px solid var(--line); border-radius: 30px; padding: 12px 18px; font: 18px var(--body); }
.searchbar input:focus { outline: none; border-color: var(--lamp); }
.results { list-style: none; margin-top: 18px; }
.results li a { display: block; padding: 16px 0; border-top: 1px solid var(--line); }
.results li a:hover .what { color: var(--lamp); }
.results .what { color: var(--paper); font-size: 18px; }
.results .where { color: var(--dim); font-size: 16px; margin-top: 4px; }
html[lang="ar"] .results .where { font-size: 18px; }
.results mark { background: rgba(227,182,94,.3); color: var(--paper); border-radius: 2px; }

/* Admin */
.admin { padding-top: 40px; }
.admin h1 { font-size: 40px; margin: 6px 0 10px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.admin-table th, .admin-table td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-grid .panel { margin-bottom: 0; }
.pre { white-space: pre-wrap; font: 15px/1.55 var(--body); color: var(--moon); max-height: 420px; overflow: auto; }
.entry { border-bottom: 1px solid var(--line); padding: 8px 0; }
.teacher-guide h2, .teacher-guide h3 { font-family: var(--display); color: var(--ink); margin: 1em 0 .4em; }

@media (max-width: 960px) {
  .admin-grid { grid-template-columns: 1fr; }
  .rail .note-box { display: block; }
}
@media (max-width: 560px) {
  .choice { min-width: 0; width: 100%; }
  .panel { padding: 20px; }
  .facts div { padding-inline-end: 16px; margin-inline-end: 16px; }
}

/* Utility classes (no inline styles: the content security policy forbids them) */
.pt40 { padding-top: 40px; } .pt20 { padding-top: 20px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt28 { margin-top: 28px; }
.ink-gold { color: #8a6a2c; }
progress.meter { -webkit-appearance: none; appearance: none; display: block; width: 100%; max-width: 420px; height: 6px; border: 0; border-radius: 6px; background: var(--night-4); overflow: hidden; margin: 14px 0 8px; }
progress.meter::-webkit-progress-bar { background: var(--night-4); border-radius: 6px; }
progress.meter::-webkit-progress-value { background: var(--lamp); border-radius: 6px; }
progress.meter::-moz-progress-bar { background: var(--lamp); border-radius: 6px; }

/* Reading-only release: many books */
.results .book-name { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--lamp); margin-bottom: 2px; }
.part-intro { font-style: italic; opacity: .8; margin: 4px 0 10px; }
.part-intro p { margin: 0 0 6px; }
.chapter p.verse { text-align: start; margin-inline-start: 1.2em; }
.chapter hr.dots { border: 0; text-align: center; margin: 28px 0; }
.chapter hr.dots::after { content: "\2022\00a0\00a0\2022\00a0\00a0\2022"; color: var(--lamp); letter-spacing: .3em; }
.book-hero .tcover { max-width: 300px; }
/* Wide tables scroll inside their box instead of stretching the page on phones */
.layout > * { min-width: 0; }
.chapter { overflow-wrap: anywhere; }
.chapter .tbl { overflow-x: auto; max-width: 100%; }

/* Figures and chapter subtitles from docx-built books (The Manual That Never Came). Figures span the text column. */
.chapter .unit-sub { font-family: var(--display); font-style: italic; font-size: 1.35em; color: var(--ink-soft); margin: -.2em 0 1.2em; }
.chapter figure.plate { margin: 2em 0; }
.chapter figure.plate img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 4px; background: #fff; }
.chapter figure.plate figcaption { text-align: center; font-size: 15px; font-style: italic; color: var(--ink-soft); max-width: 34em; margin: 10px auto 0; line-height: 1.5; }
/* Small Lights: each entry's main idea is set large under its number, with a rule beneath, as in print. */
.chapter p.lead { font-family: var(--display); font-size: 1.4em; line-height: 1.35; color: var(--ink); text-align: start; hyphens: manual; margin: .1em 0 1em; padding-bottom: .7em; border-bottom: 1px solid var(--rule); }
.chapter p.night-sub { font-family: var(--display); font-style: italic; font-size: 1.3em; line-height: 1.4; color: var(--ink-soft); text-align: start; margin: -.2em 0 1.4em; }
.chapter p.coda { font-size: .72em; letter-spacing: .22em; line-height: 1.8; color: var(--ink-soft); text-align: start; margin: 2.2em 0; }
/* Man. You. Well.: indented italic passages with a rule, the dedication, and the Appendix D template, as in print. */
.chapter p.aside { font-style: italic; font-size: .95em; color: var(--ink-2); border-inline-start: 2px solid var(--rule); padding-inline-start: 1em; margin-inline-start: .4em; text-align: start; }
.chapter p.dedication { font-style: italic; text-align: center; line-height: 1.7; }
.chapter p.template { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .8em; background: var(--paper-hi); border: 1px solid var(--rule); border-radius: 3px; padding: 8px 12px; margin: .4em 0; text-align: start; overflow-wrap: anywhere; }
.part-intro .unit-sub { font-style: italic; }
/* The Coin: the large indented italic lines (what the mirror says, sentences said aloud), as in print. */
.chapter p.voice { font-family: var(--display); font-style: italic; font-size: 1.22em; line-height: 1.75; color: var(--ink); margin-inline-start: 1.2em; text-align: start; }

/* Share a selected passage */
.share-bar { position: absolute; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; width: max-content; max-width: min(560px, calc(100vw - 16px));
  background: var(--night-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); font-family: var(--body); }
.share-bar[hidden] { display: none; }
.share-bar .share-k { color: var(--lamp); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; padding: 0 6px; }
html[lang="ar"] .share-bar .share-k { letter-spacing: 0; text-transform: none; font-size: 16px; }
.share-bar a, .share-bar button { color: var(--paper); background: none; border: 1px solid transparent; border-radius: 6px; padding: 6px 9px; font: inherit; font-size: 15px; cursor: pointer; text-decoration: none; line-height: 1.2; }
.share-bar a:hover, .share-bar button:hover, .share-bar a:focus-visible, .share-bar button:focus-visible { border-color: var(--lamp); color: var(--lamp); outline: none; }
@media (pointer: coarse) { .share-bar a, .share-bar button { padding: 10px 11px; } }

/* Shared passage page */
.quote-page { padding: 70px 0 90px; }
.quote-card { padding: 46px 48px; margin-bottom: 30px; }
.quote-card blockquote p { font-family: "Cormorant Garamond", serif; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.45; }
html[lang="ar"] .quote-card blockquote p { font-family: "Amiri", serif; font-size: clamp(24px, 3vw, 32px); line-height: 1.9; }
.quote-card figcaption { margin-top: 22px; font-size: 16px; }
@media (max-width: 600px) { .quote-card { padding: 30px 22px; } }
