:root {
    --bg: #f6f3ea;
    --surface: #ffffff;
    --surface-2: #efeadc;
    --ink: #1b2a24;
    --muted: #5d6c64;
    --line: #e2dccb;
    --primary: #0f5c45;
    --primary-ink: #ffffff;
    --primary-soft: #e3f0ea;
    --gold: #a97f35;
    --gold-soft: #e6c98a;
    --danger: #a3312b;
    --danger-soft: #fbe9e7;
    --ok-soft: #e3f0ea;
    --shadow: 0 1px 2px rgba(27, 42, 36, .06), 0 8px 24px rgba(27, 42, 36, .08);
    --radius: 14px;
    --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1613;
        --surface: #15211c;
        --surface-2: #1c2b25;
        --ink: #e9f0eb;
        --muted: #9db0a6;
        --line: #283a32;
        --primary: #2f9c79;
        --primary-ink: #06130e;
        --primary-soft: #183229;
        --gold: #d6b272;
        --danger: #f0958d;
        --danger-soft: #3a1c1a;
        --ok-soft: #183229;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); }
h1, h2, h3, p { margin: 0; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}
@media (prefers-color-scheme: dark) { .site-header { background: #0f3b2e; } }

.header-row { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand-mark rect { fill: rgba(255, 255, 255, .12); }
.brand-mark path { fill: none; stroke: var(--gold-soft); stroke-width: 3.5; stroke-linejoin: round; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: "Amiri", "Tajawal", serif; font-weight: 700; font-size: 1.25rem; }
.brand-tag { font-size: .78rem; color: rgba(255, 255, 255, .78); }

.site-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.site-nav a {
    color: rgba(255, 255, 255, .88); text-decoration: none; white-space: nowrap;
    padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: .98rem;
}
.site-nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.site-nav a.is-active { background: #fff; color: #0f5c45; }

@media (max-width: 860px) {
    .header-row { flex-direction: column; align-items: stretch; gap: 0; padding-top: 8px; }
    .brand-name { font-size: 1.12rem; }
    .site-nav {
        margin: 6px -16px 0; padding: 0 12px 8px; overflow-x: auto;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .site-nav::-webkit-scrollbar { display: none; }
    .site-nav a { padding: 6px 12px; font-size: .93rem; }
}

/* ---------- Common blocks ---------- */
.section { padding: 40px 0; }
.section-head { margin-bottom: 20px; }
.section-head h1, .section-head h2 { font-family: "Amiri", "Tajawal", serif; font-size: 1.8rem; line-height: 1.4; }
.section-head p { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 8px 18px; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-weight: 700; font-size: .98rem; text-decoration: none; cursor: pointer;
    background: var(--primary); color: var(--primary-ink);
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--line); }
.btn-ghost:hover { background: var(--primary-soft); filter: none; }
.btn-light { background: #fff; color: #0f5c45; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .12); filter: none; }
.btn small { font-weight: 500; opacity: .8; }
.btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }

.tag { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .82rem; font-weight: 700; }

.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badges img { display: block; height: 44px; width: auto; }

.notice { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.notice-ok { background: var(--ok-soft); color: var(--primary); }
.notice-error { background: var(--danger-soft); color: var(--danger); }

/* ---------- Home ---------- */
.hero {
    background:
        radial-gradient(circle at 15% 20%, rgba(230, 201, 138, .22), transparent 45%),
        linear-gradient(160deg, #0f5c45 0%, #0a3f30 100%);
    color: #fff; padding: 56px 0 64px;
}
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; }
.hero h1 { font-family: "Amiri", "Tajawal", serif; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.35; }
.hero p { color: rgba(255, 255, 255, .86); font-size: 1.1rem; margin-top: 10px; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-books { display: flex; justify-content: center; align-items: flex-end; gap: 0; }
.hero-books img {
    width: 150px; height: auto; aspect-ratio: 110 / 157; object-fit: cover; border-radius: 6px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .15);
}
.hero-books img:nth-child(1) { transform: rotate(7deg) translateX(-18px); }
.hero-books img:nth-child(2) { transform: translateY(-14px) scale(1.08); z-index: 1; }
.hero-books img:nth-child(3) { transform: rotate(-7deg) translateX(18px); }

@media (max-width: 760px) {
    .hero { padding: 36px 0 44px; text-align: center; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero p { margin-inline: auto; }
    .hero-actions { justify-content: center; }
    .hero-books img { width: 96px; }
}

.mushaf-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
@media (max-width: 900px) { .mushaf-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px) { .mushaf-grid { grid-template-columns: repeat(2, 1fr); } }
.mushaf-card { display: block; padding: 12px; text-align: center; text-decoration: none; color: var(--ink); transition: transform .15s, border-color .15s; }
.mushaf-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.mushaf-card img { width: 100%; aspect-ratio: 110 / 157; object-fit: cover; border-radius: 6px; display: block; }
.mushaf-card strong { display: block; margin-top: 10px; font-size: 1rem; }
.mushaf-card span { display: block; color: var(--muted); font-size: .85rem; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .feature-grid { grid-template-columns: 1fr; } }
.feature { padding: 22px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.feature h3 { font-size: 1.2rem; }
.feature p { color: var(--muted); flex: 1; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.feature-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.resume { display: none; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 24px; }
.resume.is-on { display: flex; }

/* ---------- Reader ---------- */
.reader { padding: 16px 0 96px; }
.reader .resume { margin-bottom: 12px; padding: 10px 14px; font-size: .95rem; }
.reader-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px; margin-bottom: 16px; }
.reader-bar.has-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.field label { font-size: .78rem; color: var(--muted); font-weight: 700; padding-inline-start: 4px; }
.field select, .field input, .field textarea {
    width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.7; }
@media (max-width: 640px) {
    .reader-bar, .reader-bar.has-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.reader-stage { display: flex; align-items: center; justify-content: center; gap: 12px; }
.side-btn {
    width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--line); color: var(--primary); text-decoration: none; box-shadow: var(--shadow);
}
.side-btn:hover { background: var(--primary-soft); }
.side-btn svg, .pager svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.side-btn[aria-disabled="true"] { opacity: .3; pointer-events: none; }
@media (max-width: 760px) { .side-btn { display: none; } }

/* On larger screens keep the whole page visible without scrolling. */
@media (min-width: 761px) {
    .reader-stage .page-frame { width: min(100%, 600px, max(420px, calc((100vh - 260px) * 600 / 860))); }
}

.page-frame {
    position: relative; width: 100%; max-width: 600px; aspect-ratio: 600 / 860;
    background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden;
    touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.page-sheet { position: absolute; inset: 0; }
/* The current page with the next one waiting on its left and the previous on its right. */
.slot { position: absolute; inset: 0; overflow: hidden; }
.slot-next { transform: translateX(calc(-100% - 16px)); }
.slot-prev { transform: translateX(calc(100% + 16px)); }
.page-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; transition: opacity .2s; -webkit-user-drag: none; }
.page-frame.is-loading .slot-cur img, .page-frame.is-loading .page-sheet > img { opacity: .25; }
/* Tapping the page opens full-screen reading; page turns are by swipe or the buttons. */
.page-frame { cursor: pointer; -webkit-tap-highlight-color: transparent; }
body.is-reading .page-frame { cursor: default; }
.spinner {
    position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; z-index: 1;
    border: 4px solid var(--line); border-top-color: var(--primary); border-radius: 50%;
    animation: spin .8s linear infinite; display: none;
}
.page-frame.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Shown instead of the spinner once a page has been loading for more than a second. */
.load-box {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; display: none;
    width: min(260px, 78%); padding: 14px 16px; border-radius: 12px; text-align: center;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .95rem;
}
.page-frame.is-slow .load-box { display: block; }
.page-frame.is-slow .spinner { display: none; }
.load-box small { display: block; color: var(--muted); font-size: .85rem; min-height: 1.4em; }
.load-track { height: 8px; margin-top: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; direction: ltr; }
.load-fill { height: 100%; width: 0; border-radius: 999px; background: var(--primary); transition: width .15s linear; }
.load-box.is-indeterminate .load-fill { width: 35%; transition: none; animation: load-slide 1.1s ease-in-out infinite; }
@keyframes load-slide { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.page-error {
    position: absolute; inset: 0; z-index: 3; display: none; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; padding: 24px; text-align: center; background: var(--surface);
}
.page-frame.is-error .page-error { display: flex; }
.page-frame.is-error .spinner { display: none; }

.pager {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.pager-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 640px; }
.pager .btn { min-width: 104px; }
.pager-info { text-align: center; line-height: 1.3; min-width: 0; }
.pager-info strong { display: block; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager-info span { color: var(--muted); font-size: .85rem; }
.reader-hint { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 14px; }
@media (max-width: 420px) { .pager .btn { min-width: 0; padding-inline: 12px; } }

/* Full-screen reading mode: the page fills the screen and the controls stay out of the way. */
.bar-tools { grid-column: 1 / -1; display: flex; gap: 8px; }
.bar-tools .bar-full { flex: 1; }
.bar-tools .btn { padding-inline: 12px; }
.bar-tools .btn:disabled, .round-btn:disabled { opacity: .35; cursor: default; }
.zoom-btns { position: absolute; z-index: 4; display: none; gap: 8px; }
.round-btn {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 0; padding: 0; cursor: pointer;
    background: rgba(15, 30, 24, .55); color: #fff;
}
.bar-tools svg, .round-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.page-frame img { transform-origin: 0 0; }
/* Phones and tablets zoom with two fingers; the zoom buttons are for mouse users. */
.hint-touch { display: none; }
@media (hover: none), (pointer: coarse) {
    #zoom-in-bar, #zoom-out-bar, .zoom-btns { display: none !important; }
    .hint-touch { display: block; }
    .hint-mouse { display: none; }
}
/* While zoomed, a finger moves the page instead of scrolling or turning it. */
.page-frame.is-zoomed { touch-action: none; cursor: grab; }
.page-frame.is-zoomed:active { cursor: grabbing; }
body.is-reading .zoom-btns { top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); opacity: 0; pointer-events: none; display: flex; transition: opacity .2s; }
body.is-reading.show-ui .zoom-btns { opacity: 1; pointer-events: auto; }
.bar-full svg, .full-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.full-btn {
    position: absolute; top: 8px; left: 8px; z-index: 4; width: 40px; height: 40px; border-radius: 50%;
    display: none; place-items: center; border: 0; cursor: pointer; padding: 0;
    background: rgba(15, 30, 24, .55); color: #fff; transition: opacity .2s;
}
.full-btn .icon-close { display: none; }
.read-toast {
    position: absolute; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 4; display: none;
    padding: 8px 16px; border-radius: 999px; background: rgba(15, 30, 24, .82); color: #fff; font-size: .9rem; max-width: calc(100% - 24px); text-align: center;
}

body.is-reading { overflow: hidden; background: #0b0f0d; }
body.is-reading .site-header, body.is-reading .reader-bar, body.is-reading .reader-hint,
body.is-reading .site-footer, body.is-reading .side-btn, body.is-reading .skip { display: none; }
body.is-reading .reader { padding: 0; }
body.is-reading .reader-stage { position: fixed; inset: 0; z-index: 60; background: #0b0f0d; }
body.is-reading .reader-stage .page-frame {
    width: 100vw; max-width: none; height: 100vh; height: 100dvh; aspect-ratio: auto !important;
    border: 0; border-radius: 0; box-shadow: none; background: #0b0f0d;
}
body.is-reading .page-frame img { background: transparent; }
/* Phone held sideways: fit the page to the width and scroll down through it. */
@media (orientation: landscape) and (max-height: 540px) {
    body.is-reading .reader-stage .page-frame { overflow-y: auto; -webkit-overflow-scrolling: touch; }
    body.is-reading .page-sheet { position: relative; inset: auto; }
    body.is-reading .slot-cur { position: static; overflow: visible; }
    body.is-reading .slot-next, body.is-reading .slot-prev { display: none; }
    body.is-reading .page-frame img { position: static; height: auto; }
}
body.is-reading .full-btn { display: grid; top: calc(10px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); opacity: 0; pointer-events: none; }
body.is-reading .full-btn .icon-open { display: none; }
body.is-reading .full-btn .icon-close { display: block; }
body.is-reading .pager { z-index: 70; transform: translateY(110%); transition: transform .25s; }
body.is-reading.show-ui .pager { transform: none; }
body.is-reading.show-ui .full-btn { opacity: 1; pointer-events: auto; }
body.is-reading.show-toast .read-toast { display: block; }
.page-toast {
    position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 4; display: none;
    padding: 4px 16px; border-radius: 999px; background: rgba(15, 30, 24, .82); color: #fff; font-size: .95rem; white-space: nowrap; pointer-events: none;
}
body.is-reading .page-toast.is-on { display: block; }
body.is-reading.show-ui .page-toast { display: none; }

/* ---------- Downloads ---------- */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dl-card { padding: 16px; display: flex; gap: 14px; }
.dl-covers { display: flex; flex-shrink: 0; width: 104px; position: relative; height: 134px; }
.dl-covers img { position: absolute; width: 84px; height: 120px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: #fff; }
.dl-covers img:first-child { inset-inline-start: 0; top: 0; z-index: 1; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.dl-covers img:last-child { inset-inline-end: 0; bottom: 0; }
.dl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.dl-body h3 { font-size: 1.08rem; line-height: 1.4; }
.dl-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.dl-files .btn { min-height: 40px; padding: 6px 12px; font-size: .9rem; }
.dl-more { display: flex; flex-wrap: wrap; gap: 12px; font-size: .88rem; }

.win-card { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
.win-card p { color: var(--muted); margin: 8px 0 16px; }
.win-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.win-shots img { width: 100%; border-radius: 6px; border: 1px solid var(--line); display: block; }
@media (max-width: 760px) { .win-card { grid-template-columns: 1fr; } }

/* ---------- Apps ---------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.app-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.app-top { display: flex; gap: 12px; align-items: center; }
.app-icons { display: flex; gap: 6px; flex-shrink: 0; }
.app-icons img { width: 64px; height: 64px; border-radius: 14px; display: block; }
.app-top h3 { font-size: 1.08rem; line-height: 1.4; }
.app-top p { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.app-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; }
.app-shots { display: flex; gap: 8px; }
.app-shots a { flex: 1; max-width: 33%; }
.app-shots img { width: 100%; aspect-ratio: 557 / 800; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.app-card .store { margin-top: auto; display: block; }
.app-card .store img { height: 48px; width: auto; display: block; }
.platform-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 32px 0 14px; }
.platform-head h2 { font-size: 1.35rem; }
.platform-head span { color: var(--muted); font-size: .9rem; }

/* ---------- Comments ---------- */
.notes-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .notes-grid { grid-template-columns: 1fr; } }
.note-form { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 861px) { .note-form { position: sticky; top: calc(var(--header-h) + 16px); } }
.note-form h2 { font-size: 1.2rem; }
.note-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field small { color: var(--muted); font-size: .8rem; padding-inline-start: 4px; }
.note-list { display: flex; flex-direction: column; gap: 12px; }
.note { padding: 14px 18px; }
.note-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-bottom: 4px; }
.note-head strong { color: var(--primary); }
.note-head time { color: var(--muted); font-size: .82rem; }
.note p { white-space: pre-wrap; overflow-wrap: anywhere; }

.optional { font-weight: 400; }
.counter { text-align: end; }
.note-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.note-reply { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--primary-soft); border-inline-start: 3px solid var(--primary); }
.note-reply strong { color: var(--primary); font-size: .88rem; }
.notes-empty { color: var(--muted); padding: 16px 0; }
.note-pages { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--muted); font-size: .92rem; }
.note-pages .btn { min-height: 40px; }

/* Owner tools on the comments page */
.admin-login { max-width: 380px; margin-bottom: 24px; position: static; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 20px; border-color: var(--gold); }
.note-pending { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.note-hidden { opacity: .6; }
.note-admin { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .9rem; }
.note-actions { display: flex; gap: 6px; margin-inline-start: auto; }
.note-actions .btn, .note-admin details .btn { min-height: 36px; padding: 4px 12px; font-size: .88rem; }
.note-admin details { flex-basis: 100%; }
.note-admin summary { cursor: pointer; color: var(--primary); }
.note-admin details textarea { min-height: 80px; margin: 8px 0; }
.tag-pending { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: var(--ink); }
.tag-hidden { background: var(--surface-2); color: var(--muted); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--line); margin-top: 24px; font-size: .95rem; color: var(--muted); }
.page-read .site-footer { padding-bottom: 72px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; padding-top: 32px; padding-bottom: 24px; }
.footer-title { color: var(--ink); font-weight: 700; margin-bottom: 8px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--primary); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 14px; padding-bottom: 18px; text-align: center; font-size: .88rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 20px; } }

@media (prefers-reduced-motion: reduce) {
    /* The page sheet keeps its short fade: it is the only sign that the page turned. */
    *:not(.page-sheet) { transition: none !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
