:root {
  color-scheme: light;
  /* Al-Husna: metallic gold and taupe sampled from the supplied logo.
     Darker gold is used for readable text; bright gold stays decorative. */
  --logo-gold: #f0c848;
  --logo-bronze: #906818;
  --logo-taupe: #a09070;
  --bg: #faf8f2;
  --surface: #fffefa;
  --surface-alt: #f2eee3;
  --ink: #342e22;
  --muted: #756b57;
  --accent: #806014;
  --accent-soft: #f5edda;
  --accent-hover: #61470d;
  --gold: #b08a20;
  --border: #e7dfcd;
  --card-border: #d8c79c;
  --selection-bg: #f1dfa0;
  --selection-ink: #34270b;
  --shadow-rgb: 67, 49, 16;
  --hero-bg: linear-gradient(115deg, #58431b 0%, #3b301e 48%, #28231b 100%);
  --hero-muted: #dfd2b3;
  --hero-highlight: #fff6d7;
  --brand-gradient: linear-gradient(115deg, #b28a27, #f0c848 48%, #f4e482 72%, #c2992e);
  --button-ink: #30240c;
  --toast-bg: #51401d;
  --toast-ink: #fff8e4;
  /* Compatibility aliases for the existing component palette. */
  --green: var(--accent);
  --green-soft: var(--accent-soft);
  --sidebar-width: 248px;
  --ui-font: 'Noto Kufi Arabic', Tahoma, sans-serif;
  --book-font: 'Amiri', Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 100px; }
body.asma-app { margin: 0; min-height: 100vh; display: block; background: var(--bg); color: var(--ink); font: 400 14px/1.9 var(--ui-font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
button { border: 0; background: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
.collection-count strong, .entry-number, .pagination { font-variant-numeric: tabular-nums; }
button:disabled { opacity: .4; cursor: not-allowed; }
::selection { background: var(--selection-bg); color: var(--selection-ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; border-radius: 4px; }
.icon { width: 21px; height: 21px; flex-shrink: 0; vertical-align: middle; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; color: var(--muted); transition: color .18s, background .18s; flex-shrink: 0; }
.icon-button:hover { color: var(--green); background: var(--green-soft); }
.skip-link { position: fixed; top: -100px; right: 20px; padding: 12px 24px; background: var(--surface); border: 2px solid var(--green); z-index: 100; }
.skip-link:focus { top: 12px; }
.sidebar { position: fixed; inset-block: 0; right: 0; width: var(--sidebar-width); background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; padding: 38px 23px 24px; z-index: 30; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 15px; padding: 0 12px; margin-bottom: 53px; }
.brand.organisation-brand { justify-content: center; padding: 0; margin-bottom: 32px; }
.organisation-logo { display: block; width: 170px; max-width: 100%; height: auto; object-fit: contain; }
.sponsor-brand { display: flex; flex-direction: column; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.sponsor-logo { display: block; width: 120px; max-width: 100%; height: auto; object-fit: contain; }
.sidebar-sponsor { padding-top: 18px; border-top: 1px solid var(--border); margin-top: auto; flex-shrink: 0; }
.mobile-branding { display: none; }
.about-logo { margin: 0 auto 24px; }
@media (max-height: 820px) and (min-width: 1001px) {
  .sidebar { padding-top: 22px; padding-bottom: 18px; }
  .brand.organisation-brand { margin-bottom: 22px; }
  .sidebar .organisation-logo { width: 140px; }
  .sidebar-sponsor .sponsor-logo { width: 100px; }
}
[data-theme="dark"] .organisation-logo, [data-theme="dark"] .sponsor-logo { background: #fff; border-radius: 7px; padding: 6px; }
.brand-emblem { display: inline-flex; width: 49px; height: 54px; border: 1px solid var(--gold); border-radius: 24px 24px 11px 11px; align-items: center; justify-content: center; font: 42px/1 var(--book-font); color: var(--green); position: relative; }
.brand-emblem::before { content: ''; position: absolute; inset: 4px; border: 1px solid color-mix(in srgb, var(--gold) 36%, transparent); border-radius: inherit; }
.brand strong, .mobile-brand strong { display: block; font: 700 36px/1.4 var(--book-font); }
.brand small { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; }
.nav-caption { font-size: 12px; color: var(--muted); margin: 0 17px 13px; }
.desktop-nav { display: grid; gap: 8px; }
.nav-link { display: flex; align-items: center; gap: 14px; min-height: 49px; padding: 11px 16px; border-radius: 9px; color: var(--muted); font-size: 14px; width: 100%; text-align: right; transition: background .18s, color .18s; }
.nav-link:hover { background: var(--surface-alt); color: var(--green); }
.nav-link.active { color: var(--green); background: var(--green-soft); font-weight: 600; }
.nav-link.active::after { content: ''; width: 5px; height: 5px; background: var(--green); border-radius: 50%; margin-inline-start: auto; }
.fav-count:not(:empty) { margin-inline-start: auto; background: var(--green-soft); color: var(--green); font-size: 12px; min-width: 24px; text-align: center; border-radius: 6px; }
.nav-link.active:has(.fav-count:not(:empty))::after { display: none; }
.sidebar-divider { height: 1px; background: var(--border); margin: 25px 14px 17px; }
.sidebar-note { margin: auto 10px 38px; padding-top: 50px; text-align: center; }
.tiny-star { font-size: 38px; color: var(--gold); }
.sidebar-note p { font: 24px/1.8 var(--book-font); margin: 15px 0; }
.note-line { display: block; width: 25px; height: 1px; background: var(--card-border); margin: 18px auto; }
.sidebar-note small { font-size: 10px; color: var(--muted); }
.sidebar-bottom { padding-top: 19px; border-top: 1px solid var(--border); text-align: center; font-size: 10px; color: var(--muted); }
.sidebar-bottom small { display: block; font-size: 9px; margin-top: 5px; color: var(--muted); }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-inline-end: 7px; }
.app-body { margin-right: var(--sidebar-width); min-width: 0; }
.topbar { height: 82px; padding: 0 44px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 20px; position: sticky; top: 0; z-index: 20; }
.breadcrumb { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 12px; }
.breadcrumb .icon { width: 12px; height: 12px; opacity: .55; }
.breadcrumb span { color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 19px; }
.quick-search { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 12px; }
.quick-search .icon { width: 18px; }
kbd { font: 12px/1.5 sans-serif; border: 1px solid var(--border); border-radius: 4px; padding: 3px 5px; color: var(--muted); direction: ltr; }
.quick-search kbd { margin-right: 37px; }
.topbar-separator { width: 1px; height: 23px; background: var(--border); }
.mobile-brand, .mobile-nav, .mobile-about { display: none; }
main { max-width: 1510px; margin: auto; padding: 36px 44px 26px; }
main:focus { outline: none; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 29px; }
.eyebrow { color: var(--green); font-size: 12px; margin-bottom: 8px; }
.welcome h1, .page-heading h1 { font-size: 28px; font-weight: 600; line-height: 1.8; letter-spacing: -.8px; }
.heading-dot { color: var(--gold); }
.welcome p:not(.eyebrow), .page-heading > p:last-child { color: var(--muted); font-size: 13px; margin-top: 5px; }
.welcome-mark { color: var(--gold); font: 22px var(--book-font); padding-inline-start: 15px; }
.hero { min-height: 319px; border-radius: 17px; overflow: hidden; background: var(--hero-bg); position: relative; color: var(--hero-highlight); display: flex; align-items: center; justify-content: space-between; box-shadow: inset 0 0 0 1px #f0c84830, 0 8px 28px rgba(var(--shadow-rgb), .08); }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .13; background-image: radial-gradient(var(--logo-gold) .6px, transparent .6px); background-size: 7px 7px; mask-image: linear-gradient(to right, #000, transparent); }
.hero::after { content: ''; position: absolute; width: 400px; height: 400px; border: 1px solid #d1c39715; border-radius: 50%; right: -250px; bottom: -270px; box-shadow: 0 0 0 30px #d1c39705, 0 0 0 65px #d1c39704; pointer-events: none; }
.hero-content { padding: 31px 39px 33px; position: relative; z-index: 2; flex: 1; }
.hero-kicker { color: var(--hero-muted); font-size: 10px; display: flex; align-items: center; gap: 8px; }
.hero-kicker > span { width: 19px; height: 1px; background: var(--logo-gold); }
.hero h1 { font: 43px/1.55 var(--book-font); margin: 14px 0 10px; color: var(--hero-highlight); }
.hero p { color: var(--hero-muted); font-size: 13px; line-height: 2.1; margin-bottom: 22px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 15px; min-height: 44px; padding: 10px 20px; border-radius: 8px; font-size: 13px; transition: background .2s, transform .2s, box-shadow .2s; }
.button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 5px 12px rgba(var(--shadow-rgb), .12); }
.button .icon { width: 18px; }
.button-cream { background: var(--brand-gradient); color: var(--button-ink); border: 1px solid #efd476; }
.button-cream:hover { background: #f5dc78; }
.button-primary { background: var(--green); color: var(--surface); }
.button-outline { border: 1px solid var(--border); background: var(--surface); }
.hero-art { width: 345px; height: 345px; flex-shrink: 0; position: relative; margin: 0 0 0 20px; display: grid; place-items: center; color: var(--logo-gold); }
.art-orbit { border: 1px solid #f0c84838; border-radius: 50%; position: absolute; }
.orbit-one { inset: 12px; }
.orbit-two { inset: 0; border-style: dashed; opacity: .7; }
.art-diamond { width: 220px; height: 220px; position: absolute; border: 1px solid #f0c84880; border-radius: 4px; transform: rotate(var(--diamond-angle)); transform-origin: center; animation: diamond-spin 60s linear infinite; }
.diamond-one { --diamond-angle: 45deg; }
.diamond-two { --diamond-angle: 15deg; }
.diamond-three { --diamond-angle: 75deg; }
@keyframes diamond-spin {
  from { transform: rotate(var(--diamond-angle)); }
  to { transform: rotate(calc(var(--diamond-angle) + 360deg)); }
}
.calligraphy-medallion { border: 1px solid #f0c84870; border-radius: 50%; background: radial-gradient(circle at 45% 35%, #6a5224, #3b301c 75%); width: 214px; height: 214px; display: flex; align-items: center; justify-content: center; flex-direction: column; position: relative; box-shadow: 0 0 0 8px #f0c84809, 0 0 0 9px #f0c84830; }
.medallion-small { position: absolute; top: calc(50% + 38px); left: 32px; font: 20px/1.7 var(--book-font); margin: 0; text-align: left; }
.allah { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font: 94px/1 var(--book-font); color: #f6de7a; }
.medallion-caption { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font: 18px/1.3 var(--book-font); color: var(--hero-muted); }
.collection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin: 24px 0 38px; }
.collection-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; column-gap: 18px; min-width: 0; min-height: 218px; padding: 28px 30px 22px; border: 1px solid var(--card-border); border-radius: 15px; background: var(--surface); box-shadow: 0 5px 18px rgba(var(--shadow-rgb), .04); transition: transform .2s, box-shadow .2s, border-color .2s; }
.collection-card::before { content: ''; position: absolute; top: -1px; right: 22px; left: 22px; height: 3px; border-radius: 3px; background: var(--brand-gradient); }
.collection-card:hover { transform: translateY(-3px); box-shadow: 0 9px 26px rgba(var(--shadow-rgb), .1); border-color: var(--gold); }
.collection-card h2 { grid-column: 1; grid-row: 1; align-self: center; color: var(--green); font-size: clamp(22px, 2vw, 30px); line-height: 1.7; font-weight: 600; }
.collection-icon { grid-column: 2; grid-row: 1 / 3; align-self: center; display: grid; place-items: center; width: 70px; height: 74px; border-radius: 18px; background: var(--green-soft); color: var(--green); }
.collection-icon .icon { width: 32px; height: 32px; }
.collection-count { grid-column: 1; grid-row: 2; display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 12px; color: var(--muted); font-size: 14px; }
.collection-count strong { color: var(--ink); font-size: 40px; line-height: 1.8; font-weight: 500; }
.collection-action { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; color: var(--green); font-size: 14px; border-top: 1px solid var(--border); margin-top: 16px; padding-top: 15px; }
.collection-action .icon { width: 21px; height: 21px; }
.collection-attributes .collection-icon { background: var(--surface-alt); color: var(--accent); }
.collection-attributes::before { background: linear-gradient(90deg, var(--logo-taupe), #d9c9a3, var(--logo-taupe)); }
.home-columns { display: grid; grid-template-columns: minmax(0, 1fr) 249px; gap: 25px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-heading .eyebrow { font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.section-heading h2 { font-size: 22px; font-weight: 500; }
.text-link { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--green); }
.text-link:hover { color: var(--accent-hover); }
.text-link .icon { width: 16px; height: 16px; }
.entry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.featured-grid { gap: 13px; }
.entry-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; min-width: 0; transition: transform .2s, box-shadow .2s, border-color .2s; }
.entry-card:hover { transform: translateY(-3px); box-shadow: 0 7px 20px rgba(var(--shadow-rgb), .08); border-color: var(--gold); }
.entry-number { position: absolute; right: 15px; top: 13px; font: 12px/1.9 var(--ui-font); color: var(--muted); }
.save-button { position: absolute; top: 3px; left: 2px; z-index: 2; }
.save-button .icon { width: 16px; height: 16px; }
.is-saved { color: var(--green); }
.is-saved .icon { fill: var(--green); stroke: var(--green); }
.entry-link { display: block; padding: 39px 17px 0; border-radius: inherit; text-align: center; }
.entry-link h3 { font: 33px/1.65 var(--book-font); color: var(--green); margin: 7px 0 0; overflow-wrap: anywhere; }
.attribute-card .entry-link h3 { color: var(--ink); }
.entry-type { color: var(--muted); font-size: 10px; display: block; margin-top: 0; }
.entry-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 21px; border-top: 1px solid var(--border); padding: 11px 0; color: var(--muted); font-size: 10px; text-align: right; }
.entry-card-bottom > span { display: flex; align-items: center; gap: 5px; }
.entry-card-bottom .icon { width: 13px; height: 13px; }
.entry-card-bottom > .icon { color: var(--green); }
.explore-bottom { font-size: 10px; color: var(--muted); text-align: center; margin: 22px 0 5px; }
.explore-bottom .icon { width: 15px; color: var(--gold); margin-left: 5px; }
.discovery-rail { padding-top: 5px; }
.reading-card { position: relative; overflow: hidden; background: var(--accent-soft); border: 1px solid var(--card-border); border-radius: 12px; padding: 19px 21px 23px; }
.rail-title { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--card-border); }
.rail-title .icon { width: 17px; }
.reading-overline { display: block; font-size: 9px; color: var(--muted); margin: 20px 0 0; }
.reading-card h3 { font: 42px/1.8 var(--book-font); color: var(--accent); }
.reading-card p { color: var(--muted); font-size: 10px; line-height: 2; margin: 3px 0 16px; }
.reading-decoration { position: absolute; font: 150px/1 serif; bottom: 1px; left: -34px; color: #c5a55230; transform: rotate(15deg); pointer-events: none; }
.reading-card .text-link { position: relative; }
.saved-prompt { padding: 25px 10px 19px; text-align: center; }
.round-icon { display: inline-grid; place-items: center; background: var(--accent-soft); border-radius: 50%; width: 37px; height: 37px; color: var(--accent); margin-bottom: 12px; }
.round-icon .icon { width: 17px; }
.saved-prompt h3 { font-size: 13px; font-weight: 500; }
.saved-prompt p { font-size: 9px; color: var(--muted); margin: 8px 0 12px; }
.saved-prompt .text-link { font-size: 10px; }
.rail-note { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 9px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 15px; }
.rail-note .icon { width: 13px; }
.page-footer { margin: 13px 44px 0; padding: 22px 0; border-top: 1px solid var(--border); display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.footer-dot { color: var(--gold); padding: 0 5px; }
.page-heading { margin: 12px 0 30px; }
.page-heading h1 { font-size: 32px; }
.browse-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 20px; }
.browse-tools { display: flex; gap: 15px; align-items: center; }
.search-field { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0 14px; flex: 1; min-width: 0; color: var(--muted); }
.search-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.search-field input { border: 0; outline: 0; padding: 12px 0; min-width: 0; width: 100%; background: none; color: var(--ink); font-size: 14px; }
.search-field input::placeholder { color: var(--muted); }
.search-field .icon { width: 18px; }
.sort-field { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
select { color: var(--ink); background: var(--surface); border: 1px solid var(--border); padding: 9px 10px; border-radius: 7px; max-width: 160px; min-height: 44px; }
.view-switch { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 8px; }
.view-switch .icon-button { width: 36px; height: 36px; border-radius: 5px; }
.selected { background: var(--green-soft); color: var(--green); }
.alphabet { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 17px; margin-top: 17px; border-top: 1px solid var(--border); }
.alphabet button { min-width: 30px; min-height: 38px; border-radius: 5px; font-size: 14px; }
.alphabet button:first-child { padding-inline: 10px; font-size: 12px; }
.alphabet button:hover, .filter-tab:hover { background: var(--green-soft); color: var(--green); }
.filter-tabs { display: flex; gap: 6px; margin-top: 18px; }
.filter-tab { padding: 8px 14px; border-radius: 7px; font-size: 12px; min-height: 40px; }
.results-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 25px 0 17px; font-size: 13px; }
.muted { color: var(--muted); font-size: 10px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 30px; margin: 30px 0 5px; font-size: 13px; }
.list-layout { grid-template-columns: 1fr; gap: 10px; }
.list-layout .entry-link { display: flex; align-items: center; gap: 24px; padding: 15px 55px; text-align: right; }
.list-layout .entry-link h3 { margin: 0; font-size: 28px; min-width: 170px; }
.list-layout .entry-type { font-size: 10px; }
.list-layout .entry-number { top: 29px; }
.list-layout .save-button { top: 16px; left: 10px; }
.list-layout .entry-card-bottom { border: 0; margin: 0 auto 0 0; padding: 0; gap: 25px; font-size: 12px; }
.empty-state { text-align: center; padding: 75px 20px; color: var(--muted); }
.empty-icon { display: inline-grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; background: var(--green-soft); color: var(--green); margin-bottom: 22px; }
.empty-icon .icon { width: 29px; height: 29px; }
.empty-state h2 { color: var(--ink); font-size: 22px; margin-bottom: 12px; }
.empty-state p { margin-bottom: 24px; }
.detail-top { display: flex; align-items: center; justify-content: space-between; }
.detail-label { font-size: 10px; color: var(--muted); }
.detail-heading { text-align: center; padding: 30px 20px; border-bottom: 1px solid var(--border); margin-bottom: 30px; }
.detail-heading h1 { font: 64px/1.8 var(--book-font); color: var(--green); overflow-wrap: anywhere; }
.detail-heading p { font-size: 12px; color: var(--muted); }
.detail-heading-actions { display: inline-flex; align-items: center; gap: 5px; margin-top: 14px; font-size: 10px; color: var(--muted); }
.detail-heading-actions .save-button { position: static; background: var(--surface); border: 1px solid var(--border); }
.reader-layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 28px; }
.reader-sidebar { position: sticky; top: 107px; align-self: start; }
.reader-tabs { display: grid; gap: 6px; }
.reader-tab { display: flex; justify-content: space-between; gap: 8px; border-radius: 8px; padding: 13px 15px; font-size: 13px; text-align: right; min-height: 47px; }
.reader-tab:hover { background: var(--green-soft); }
.reader-tab span { color: var(--muted); font-size: 12px; }
.reader-tip { display: flex; align-items: center; justify-content: center; font-size: 9px; color: var(--muted); gap: 7px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); }
.reader-tip .icon { width: 16px; }
.reader-toolbar { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 15px; }
.font-controls { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.font-controls .icon-button { border: 1px solid var(--border); background: var(--surface); font: 23px sans-serif; width: 36px; height: 36px; }
.sub-filters { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 19px; }
.archive-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; text-align: start; vertical-align: middle; }
.archive-code { display: inline-block; flex-shrink: 0; white-space: nowrap; font: 600 14px/1.7 ui-monospace, monospace; font-variant-numeric: tabular-nums; color: var(--green); background: var(--green-soft); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; letter-spacing: .03em; }
.reader-tab .archive-label, .reader-tab .archive-label > span { color: inherit; font-size: inherit; }
.page-heading h1 .archive-label { gap: 14px; }
.page-heading h1 .archive-code { font-size: 21px; padding: 3px 10px; }
.category-description > .archive-label { margin-bottom: 8px; }
.source-card { background: var(--surface); padding: 25px 28px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 18px; min-width: 0; }
.source-card > header { display: flex; align-items: center; gap: 12px; padding-bottom: 19px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.source-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: var(--green-soft); color: var(--green); flex-shrink: 0; }
.source-avatar .icon { width: 18px; }
.source-card h3 { font-size: 14px; font-weight: 500; }
.source-card header div > span { font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.source-card .copy-button { margin-inline-start: auto; }
.source-card h4 { font-size: 16px; margin-bottom: 14px; }
.source-text { font: var(--reading-size, 25px)/2 var(--book-font); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.source-note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; color: var(--muted); border-right: 2px solid var(--gold); padding-right: 13px; margin-top: 20px; }
.category-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--green); background: var(--green-soft); padding: 6px 10px; border-radius: 5px; margin-top: 20px; font-size: 10px; }
.category-badge .icon { width: 13px; }
.category-description { padding: 15px 20px; background: var(--green-soft); color: var(--green); border-radius: 9px; font-size: 13px; margin-bottom: 20px; }
.category-description a { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 10px; text-decoration: underline; }
.category-description .icon { width: 16px; }
.load-more { display: flex; margin: 25px auto; }
.entry-pagination { display: flex; justify-content: space-between; border-top: 1px solid var(--border); margin-top: 25px; padding-top: 25px; gap: 20px; }
.entry-pagination a { display: flex; align-items: center; gap: 20px; font: 29px/1.5 var(--book-font); color: var(--green); }
.entry-pagination small { display: block; color: var(--muted); font: 10px/2 var(--ui-font); }
.category-results { max-width: 900px; margin: auto; }
.category-entry { margin: 18px 0 10px; font: 30px var(--book-font); }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 15px); padding: 13px 25px; border-radius: 10px; background: var(--toast-bg); color: var(--toast-ink); box-shadow: 0 8px 30px #0002; font-size: 13px; z-index: 90; opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; max-width: calc(100% - 30px); text-align: center; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); visibility: visible; }
.about-dialog { margin: auto; width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; padding: 35px; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 18px; text-align: center; }
.about-dialog::backdrop { background: #29221680; backdrop-filter: blur(5px); }
.dialog-close { position: absolute; left: 10px; top: 10px; }
.about-dialog .brand-emblem { margin-bottom: 20px; }
.about-dialog h2 { font-size: 25px; margin-bottom: 15px; }
.about-dialog p { font-size: 14px; line-height: 2.2; color: var(--muted); }
.about-stats { display: flex; justify-content: center; gap: 45px; margin: 25px 0; font-size: 12px; }
.about-stats b { display: block; font-size: 30px; color: var(--green); }
.about-dialog .about-disclaimer { text-align: right; background: var(--surface-alt); padding: 16px; border-radius: 9px; font-size: 12px; }
.about-dialog .about-local { font-size: 10px; margin-top: 18px; }
.about-local .icon { width: 14px; }
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1913;
  --surface: #262219;
  --surface-alt: #332d21;
  --ink: #f2ebd9;
  --muted: #bcb09a;
  --accent: #e8c864;
  --accent-soft: #3a311d;
  --accent-hover: #ffdf84;
  --gold: #d9b64e;
  --border: #443b29;
  --card-border: #62502b;
  --selection-bg: #6c5320;
  --selection-ink: #fff6d7;
  --shadow-rgb: 0, 0, 0;
  --hero-bg: linear-gradient(115deg, #51401c 0%, #332a1b 48%, #242017 100%);
  --toast-bg: #e8c864;
  --toast-ink: #2b2415;
}
@media (min-width: 1600px) {
  :root { --sidebar-width: 270px; }
  main { padding-top: 45px; }
  .hero { min-height: 355px; }
  .hero-content { padding-right: 48px; }
  .hero h1 { font-size: 49px; }
  .hero-art { margin-left: 65px; }
  .home-columns { grid-template-columns: minmax(0, 1fr) 280px; gap: 30px; }
  .entry-link { padding-top: 43px; }
  .entry-link h3 { font-size: 39px; }
  .entry-card-bottom { padding-block: 14px; }
}
@media (max-width: 1250px) {
  :root { --sidebar-width: 215px; }
  .sidebar { padding-inline: 15px; }
  .topbar { padding-inline: 28px; }
  main { padding-inline: 28px; }
  .page-footer { margin-inline: 28px; }
  .home-columns { grid-template-columns: minmax(0, 1fr) 220px; gap: 19px; }
  .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-art { transform: scale(.85); margin-left: -20px; width: 310px; }
  .hero-content { padding-right: 28px; }
  .hero h1 { font-size: 41px; }
  .collection-card { padding: 24px; }
  .collection-icon { width: 56px; height: 62px; }
  .entry-grid:not(.featured-grid):not(.list-layout) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) and (min-width: 761px) {
  :root { --sidebar-width: 88px; }
  .sidebar { padding: 25px 13px; align-items: center; }
  .brand { padding: 0; margin-bottom: 35px; }
  .brand.organisation-brand { width: 100%; }
  .sidebar-sponsor { width: 100%; font-size: 9px; }
  .brand > span:last-child, .sidebar .nav-caption, .sidebar .nav-link span, .sidebar-note, .sidebar-bottom, .sidebar .nav-link.active::after { display: none; }
  .desktop-nav { width: 100%; }
  .sidebar .nav-link { justify-content: center; padding: 14px; }
  .sidebar .nav-link > .icon { width: 23px; height: 23px; }
  .sidebar-divider { width: 35px; margin-block: 20px; flex-shrink: 0; }
  .welcome-mark { font-size: 21px; }
  .reader-layout { grid-template-columns: 170px minmax(0, 1fr); gap: 20px; }
  .list-layout .entry-link { gap: 12px; }
  .list-layout .entry-link h3 { min-width: 130px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 85px; }
  .sidebar { display: none; }
  .app-body { margin-right: 0; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .topbar { height: 92px; padding: 0 20px; }
  .breadcrumb { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 11px; }
  .mobile-branding { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
  .mobile-brand .organisation-logo { width: 90px; }
  .mobile-sponsor { gap: 0; border-right: 1px solid var(--border); padding-right: 13px; font-size: 9px; line-height: 1.4; }
  .mobile-sponsor .sponsor-logo { width: 60px; }
  .mobile-brand .brand-emblem { width: 32px; height: 38px; font-size: 30px; border-radius: 17px 17px 7px 7px; }
  .mobile-brand strong { font-size: 30px; }
  .topbar-actions { gap: 8px; }
  .mobile-about { display: inline-flex; }
  .quick-search { width: 42px; height: 42px; justify-content: center; }
  .quick-search .icon { width: 21px; }
  .quick-search span, .quick-search kbd, .topbar-separator { display: none; }
  .mobile-nav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); z-index: 40; box-shadow: 0 -3px 20px rgba(var(--shadow-rgb), .04); }
  .mobile-nav .nav-link { flex-direction: column; gap: 3px; justify-content: center; padding: 7px 3px; min-height: 58px; border-radius: 8px; font-size: 9px; position: relative; }
  .mobile-nav .nav-link .icon { width: 21px; height: 21px; }
  .mobile-nav .nav-link.active::after { display: none; }
  .mobile-nav .fav-count:not(:empty) { position: absolute; top: 2px; left: calc(50% - 25px); min-width: 18px; font-size: 9px; }
  main { padding: 25px 20px 18px; }
  .welcome { margin-bottom: 23px; }
  .welcome h1 { font-size: 25px; }
  .welcome p:not(.eyebrow) { font-size: 12px; }
  .welcome-mark { display: none; }
  .eyebrow { font-size: 10px; }
  .hero { min-height: 305px; border-radius: 14px; }
  .hero-content { padding: 28px; }
  .hero h1 { font-size: 40px; }
  .hero-art { transform: scale(.73); width: 240px; margin: 0 0 0 -30px; }
  .hero p { font-size: 12px; max-width: 290px; }
  .hero-kicker { font-size: 9px; }
  .collection-grid { gap: 14px; margin: 18px 0 30px; }
  .collection-card { min-height: 205px; padding: 20px; column-gap: 12px; }
  .collection-card h2 { font-size: 23px; }
  .collection-count strong { font-size: 35px; }
  .collection-count { font-size: 13px; }
  .collection-icon { width: 48px; height: 54px; border-radius: 12px; }
  .collection-icon .icon { width: 26px; height: 26px; }
  .home-columns { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .featured-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .section-heading h2 { font-size: 21px; }
  .entry-grid { gap: 12px; }
  .entry-link { padding-inline: 15px; }
  .entry-link h3 { font-size: 34px; }
  .entry-type { font-size: 9px; }
  .entry-card-bottom { font-size: 10px; }
  .discovery-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
  .reading-card { padding: 17px 20px; }
  .saved-prompt { align-self: center; }
  .rail-note { grid-column: 1 / -1; padding-top: 17px; }
  .page-footer { margin: 15px 20px 0; padding: 20px 0; gap: 10px; font-size: 8px; }
  .page-heading h1 { font-size: 28px; }
  .page-heading > p:last-child { font-size: 12px; }
  .browse-panel { padding: 15px; }
  .browse-tools { flex-wrap: wrap; gap: 12px; }
  .search-field { flex-basis: 100%; }
  .search-field input { font-size: 18px; }
  .sort-field { flex: 1; }
  .alphabet { gap: 3px; margin-top: 14px; }
  .alphabet button { min-width: 34px; min-height: 40px; }
  .filter-tab { min-height: 44px; }
  .reader-layout { display: block; }
  .reader-sidebar { position: static; margin-bottom: 20px; }
  .reader-sidebar .nav-caption, .reader-tip { display: none; }
  .reader-tabs { display: flex; overflow-x: auto; padding: 3px 3px 8px; scrollbar-width: thin; }
  .reader-tab { flex-shrink: 0; font-size: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--border); }
  .detail-heading { margin-bottom: 20px; padding: 25px 5px; }
  .detail-heading h1 { font-size: 57px; }
  .detail-heading p { font-size: 10px; }
  .source-card { padding: 20px; }
  .source-card > header { gap: 9px; }
  .source-card header div > span { font-size: 9px; }
  .source-card h3 { font-size: 13px; }
  .source-avatar { width: 33px; height: 36px; }
  .font-controls .icon-button { width: 44px; height: 44px; }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); width: max-content; }
  .about-dialog { padding: 28px 22px; }
}
@media (max-width: 540px) {
  .topbar { height: 84px; gap: 8px; }
  .mobile-branding { gap: 10px; }
  .mobile-brand .organisation-logo { width: 76px; }
  .mobile-sponsor { padding-right: 9px; }
  .mobile-sponsor .sponsor-logo { width: 48px; }
  .topbar-actions { gap: 2px; }
  .topbar-actions .icon-button, .topbar-actions .quick-search { width: 36px; }
  .hero { min-height: 323px; align-items: stretch; }
  .hero-content { padding: 25px; }
  .hero h1 { font-size: 38px; margin-block: 15px 12px; }
  .hero p { max-width: 230px; font-size: 12px; }
  .hero-art { position: absolute; left: -55px; top: 3px; width: 345px; transform: scale(.65); opacity: .22; }
  .hero-content { z-index: 2; }
  .hero .button { font-size: 12px; padding-inline: 17px; gap: 15px; }
  .desktop-break { display: none; }
  .collection-grid { gap: 12px; }
  .collection-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 238px; padding: 18px 15px; }
  .collection-icon { width: 42px; height: 44px; align-self: flex-start; margin-bottom: 12px; }
  .collection-icon .icon { width: 24px; height: 24px; }
  .collection-card h2 { align-self: flex-start; font-size: clamp(17px, 4.9vw, 23px); line-height: 1.8; }
  .collection-count { flex-direction: column; gap: 0; font-size: 12px; margin-top: 5px; }
  .collection-count strong { font-size: 34px; line-height: 1.6; }
  .collection-action { width: 100%; font-size: 12px; padding-top: 12px; margin-top: 14px; gap: 5px; }
  .collection-action .icon { width: 17px; height: 17px; }
  .featured-grid, .entry-grid:not(.featured-grid):not(.list-layout) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-link h3 { font-size: 35px; }
  .entry-card-bottom { font-size: 10px; }
  .entry-type { font-size: 9px; }
  .entry-link { padding-top: 37px; }
  .save-button { width: 44px; height: 44px; }
  .save-button .icon { width: 17px; height: 17px; }
  .section-heading .text-link { font-size: 10px; }
  .discovery-rail { grid-template-columns: 1fr; }
  .reading-card { padding: 20px 24px; }
  .reading-card h3 { font-size: 42px; }
  .reading-card p br, .saved-prompt p br { display: none; }
  .saved-prompt { padding-top: 14px; }
  .reading-decoration { font-size: 210px; left: 20px; bottom: -20px; }
  .page-footer { flex-direction: column; align-items: center; font-size: 9px; gap: 3px; }
  .list-layout .entry-link { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 14px 42px 14px 46px; }
  .list-layout .entry-link h3 { min-width: 0; font-size: 25px; }
  .list-layout .entry-type { grid-column: 1; font-size: 8px; }
  .list-layout .entry-card-bottom { grid-column: 2; grid-row: 1 / 3; font-size: 8px; gap: 0; }
  .list-layout .entry-card-bottom > .icon { display: none; }
  .list-layout .entry-number { right: 12px; top: 25px; font-size: 10px; }
  .list-layout .save-button { top: 12px; left: 0; }
  .pagination { gap: 13px; font-size: 10px; }
  .pagination .button { padding: 9px 12px; gap: 7px; font-size: 10px; }
  .results-heading { font-size: 12px; }
  .results-heading .muted { font-size: 9px; }
  .detail-label { font-size: 9px; }
  .source-card { padding: 17px; }
  .source-card .copy-button { width: 38px; }
  .source-text { line-height: 1.95; }
  .about-stats { gap: 25px; }
}
@media (max-width: 360px) {
  .hero { min-height: 280px; }
  .hero-content { padding: 18px; }
  .hero h1 { font-size: 30px; line-height: 1.45; margin: 12px 0 8px; }
  .hero p { margin-bottom: 16px; }
  .collection-card { min-height: 220px; padding: 14px 12px; }
  .collection-icon { width: 36px; height: 36px; margin-bottom: 8px; }
  .collection-icon .icon { width: 22px; height: 22px; }
  .collection-count { font-size: 10px; }
  .collection-count strong { font-size: 30px; line-height: 1.5; }
  .collection-action { padding-top: 9px; margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}