/* Ahali Muharraq — palette taken from the statement & certificate designs */
:root {
  --bg: #f3e9d3;
  --paper: #fbf6ea;
  --paper-2: #f6eedb;
  --card: #fffdf7;
  --gold: #b98a3e;
  --gold-2: #d8b66e;
  --gold-dark: #7f5c1d;
  --red: #b3121c;
  --red-dark: #8c0d15;
  --red-soft: #f6dcd6;
  --ink: #231b13;
  --ink-2: #4a3d2d;
  --muted: #7a6a52;
  --line: #e5d4b0;
  --line-2: #efe3c9;
  --ok: #2d7a4c;
  --ok-soft: #e1f0e4;
  --info-soft: #f4ead2;
  --danger: #b3261e;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(80, 55, 20, .06), 0 8px 24px rgba(80, 55, 20, .08);
  --font: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-deco: "Aref Ruqaa", "Tajawal", serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 255, 255, .7), transparent 60%),
    radial-gradient(900px 500px at 0% 20%, rgba(214, 170, 120, .18), transparent 60%),
    var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }
h1, h2, h3 { line-height: 1.35; margin: 0; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline { display: inline; margin: 0; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 16px; }
.narrow { max-width: 860px; }

/* ------------------------------------------------------------ buttons */
.btn {
  --b: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 8px 18px;
  font: 700 15px/1.2 var(--font);
  border-radius: 999px; border: 1.5px solid var(--b);
  background: var(--card); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .08s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible, .iconbtn:focus-visible, .pager__btn:focus-visible { outline: 3px solid rgba(185, 138, 62, .45); outline-offset: 2px; }
.btn--primary { background: linear-gradient(180deg, #c3202a, var(--red)); border-color: var(--red-dark); color: #fff; box-shadow: 0 6px 16px rgba(179, 18, 28, .22); }
.btn--primary:hover { background: var(--red-dark); }
.btn--gold { background: linear-gradient(180deg, #e4c47e, var(--gold)); border-color: var(--gold-dark); color: #2a1d08; }
.btn--gold:hover { background: var(--gold-2); }
.btn--ghost { background: transparent; border-color: var(--gold); color: var(--gold-dark); }
.btn--ghost:hover { background: rgba(185, 138, 62, .1); }
.btn--danger { background: var(--danger); border-color: #8f1d17; color: #fff; }
.btn--danger:hover { background: #8f1d17; }
.btn--lg { min-height: 50px; font-size: 16.5px; padding-inline: 22px; }
.btn--sm { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--gold-dark); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }

/* ------------------------------------------------------------ forms */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field__help { font-size: 13px; color: var(--muted); }
.field__error { font-size: 14px; color: var(--danger); font-weight: 700; min-height: 0; }
.field__error:empty { display: none; }
.input {
  width: 100%; min-height: 44px; padding: 9px 14px;
  font: 500 16px/1.4 var(--font); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select.input { padding-left: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237f5c1d' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; }
textarea.input { resize: vertical; line-height: 1.8; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(185, 138, 62, .16); outline: none; }
.input--lg { min-height: 54px; font-size: 19px; font-weight: 700; padding-inline: 16px; }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(179, 38, 30, .1); }
.input::placeholder { color: #b3a58c; font-weight: 500; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }

/* ------------------------------------------------------------ cards & alerts */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card__title { font-size: 21px; font-weight: 800; color: var(--ink); }
.card__title--sm { font-size: 17px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); margin-top: 6px; }
.card__hint { color: var(--muted); font-size: 15px; margin-top: 6px; }

.alert { margin-block: 14px 0; padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 700; font-size: 15px; border: 1px solid; }
.alert--success { background: var(--ok-soft); border-color: #b9dcc2; color: #1f5a37; }
.alert--error { background: #fbe5e2; border-color: #efbdb6; color: #8f1d17; }
.alert--info { background: var(--info-soft); border-color: var(--line); color: var(--gold-dark); }

.chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--red-soft); color: var(--red-dark); white-space: nowrap; }
.chip--muted { background: var(--line-2); color: var(--muted); font-size: 12px; margin-inline-start: 6px; }
.badge { display: inline-block; white-space: nowrap; min-width: 30px; text-align: center; padding: 1px 8px; border-radius: 8px; background: var(--line-2); color: var(--muted); font-weight: 700; font-size: 14px; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.eyebrow { color: var(--gold-dark); font-weight: 700; font-size: 14px; }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty svg { color: var(--gold); margin-bottom: 4px; }
.empty h3 { color: var(--ink); font-size: 19px; }
.empty .btn { margin-top: 8px; }

/* ------------------------------------------------------------ public: hero & statement */
.hero { position: relative; padding-top: 22px; padding-bottom: 36px; }
.layout { position: relative; display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr); align-items: start; }
  .side { position: sticky; top: 18px; }
}

.paper {
  position: relative; background: linear-gradient(180deg, var(--paper), var(--paper-2));
  border-radius: 6px; padding: 10px;
  border: 2px solid var(--gold);
  box-shadow: 0 18px 40px rgba(90, 60, 20, .14), inset 0 0 0 1px #fff7e3;
}
.paper__frame {
  border: 1px solid var(--gold-2); border-radius: 3px;
  padding: clamp(22px, 5vw, 48px) clamp(18px, 5vw, 52px);
  position: relative;
  background:
    radial-gradient(60% 50% at 50% 55%, rgba(222, 150, 130, .12), transparent 70%);
}
.paper__frame::before, .paper__frame::after {
  content: ""; position: absolute; width: 34px; height: 34px; border: 3px solid var(--gold); pointer-events: none;
}
.paper__frame::before { top: -6px; right: -6px; border-left: 0; border-bottom: 0; }
.paper__frame::after { bottom: -6px; left: -6px; border-right: 0; border-top: 0; }

.verse { text-align: center; color: var(--red); font-family: var(--font-deco); font-size: clamp(20px, 3.4vw, 27px); line-height: 1.6; }
.st-title { text-align: center; margin-top: 14px; display: grid; gap: 2px; }
.st-title__kicker { font-size: clamp(26px, 4.8vw, 36px); font-weight: 800; }
.st-title__main { font-size: clamp(22px, 4vw, 32px); font-weight: 800; }
.ornament { width: min(420px, 90%); margin: 12px auto 20px; }
.ornament--sm { width: 220px; margin: 0 auto 10px; }
.st-body { display: grid; gap: 16px; font-size: clamp(16.5px, 2.2vw, 19px); font-weight: 700; line-height: 2; color: #1b140e; text-align: justify; text-align-last: right; text-justify: inter-word; word-spacing: .02em; }
.st-body p { text-align: justify; text-align-last: right; }
.st-sign { text-align: center; margin-top: 28px; font-weight: 800; font-size: 19px; }
.st-date { text-align: center; margin-top: 10px; font-weight: 700; color: var(--ink-2); font-size: 16px; }

/* side */
.side { display: grid; gap: 18px; }
.card--form { border-top: 4px solid var(--red); padding: 24px; scroll-margin-top: 16px; }
.card--form .card__title { font-size: 22px; }
.card--form .form { margin-top: 18px; }
.counter { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; align-items: baseline; justify-content: center; gap: 8px; color: var(--muted); font-weight: 700; }
.counter strong { font-size: 28px; color: var(--red); font-weight: 800; font-variant-numeric: tabular-nums; }
.card--preview { padding: 10px; margin: 0; }
.card--preview img { border-radius: 8px; }
.card--preview figcaption { text-align: center; color: var(--muted); font-size: 14px; padding: 8px 4px 2px; }
.empty--closed svg { color: var(--red); }

/* mobile sticky CTA */
.cta-bar { position: fixed; inset: auto 0 0 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(251, 246, 234, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-top: 1px solid var(--line); transform: translateY(110%); transition: transform .25s; }
.cta-bar.is-shown { transform: none; }
@media (min-width: 980px) { .cta-bar { display: none; } }

/* footer */
.sitefoot { text-align: center; color: var(--muted); font-size: 14px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.skyline { height: clamp(60px, 9vw, 130px); background: url("../img/skyline.jpg") center bottom / cover no-repeat; -webkit-mask: linear-gradient(180deg, transparent, #000 45%); mask: linear-gradient(180deg, transparent, #000 45%); opacity: .8; margin-bottom: -8px; }
.is-public .sitefoot p { position: relative; }

/* ------------------------------------------------------------ certificate page */
.cert { padding-top: 22px; padding-bottom: 36px; display: grid; gap: 16px; }
.success { display: flex; gap: 12px; align-items: center; background: var(--ok-soft); border: 1px solid #b9dcc2; color: #1f5a37; border-radius: var(--radius); padding: 12px 16px; animation: pop .35s ease-out; }
.success strong { display: block; font-size: 17px; }
.success span { font-size: 15px; }
.success__icon { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.cert__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cert__name { font-size: clamp(22px, 4.5vw, 30px); font-weight: 800; color: var(--red-dark); }
.cert__img { margin-top: 16px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); aspect-ratio: 1200 / 848; }
.cert__img img { width: 100%; height: 100%; object-fit: cover; }
.cert__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.cert__actions .btn { flex: 1 1 180px; }
.cert__tip { margin-top: 12px; font-size: 14px; color: var(--muted); background: var(--info-soft); border-radius: var(--radius-sm); padding: 8px 12px; }
.cert__top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cert__top .btn { flex: 1 1 0; min-width: 0; }
@media (min-width: 640px) { .cert__top .btn { flex: 0 0 auto; } }
.cert__more { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }

/* ------------------------------------------------------------ modal */
.modal { border: 0; padding: 0; background: transparent; width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); color: var(--ink); }
.modal::backdrop { background: rgba(35, 25, 12, .5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal[open] { animation: pop .18s ease-out; }
.modal__box { background: var(--card); border-radius: var(--radius); border-top: 4px solid var(--gold); padding: 22px; display: grid; gap: 14px; margin: 0; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.modal__title { font-size: 19px; font-weight: 800; }
.modal__body { color: var(--ink-2); font-size: 16px; }
.modal__name { display: block; margin-top: 10px; padding: 12px; text-align: center; font-size: 22px; font-weight: 800; color: var(--red-dark); background: var(--paper-2); border: 1px dashed var(--gold); border-radius: var(--radius-sm); word-break: break-word; }
.modal__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal__actions .btn { flex: 1 1 120px; }
.modal--danger .modal__box { border-top-color: var(--danger); }
.modal--danger #confirmOk { background: var(--danger); border-color: #8f1d17; box-shadow: none; }

/* ------------------------------------------------------------ admin */
.is-admin { background: #f5eedf; }
.topbar { background: #fffdf7; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-block: 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; font-size: 17px; }
.brand__flag { width: 30px; height: 22px; border-radius: 4px; background: linear-gradient(90deg, #fff 0 34%, var(--red) 34%); position: relative; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.brand__flag::after { content: ""; position: absolute; inset: 0 auto 0 34%; width: 6px; background: #fff; clip-path: polygon(0 0, 100% 10%, 0 20%, 100% 30%, 0 40%, 100% 50%, 0 60%, 100% 70%, 0 80%, 100% 90%, 0 100%); }
.topnav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topnav a, .topnav .linkbtn { padding: 6px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 700; text-decoration: none; font-size: 15px; }
.topnav a:hover, .topnav .linkbtn:hover { background: var(--line-2); }
.topnav a.is-active { background: var(--red-soft); color: var(--red-dark); }
.wrap--admin { padding-top: 18px; padding-bottom: 40px; }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.pagehead__title { font-size: 24px; font-weight: 800; }
.pagehead__sub { color: var(--muted); font-size: 15px; }
.pagehead__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 2px; border-inline-start: 4px solid var(--gold); }
.stat:first-child { border-inline-start-color: var(--red); }
.stat__label { font-size: 13px; color: var(--muted); font-weight: 700; }
.stat__value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }

.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 14px 16px; }
.filters .field { flex: 1 1 140px; }
.filters .field--grow { flex: 3 1 240px; }
.filters .field--sm { flex: 0 1 100px; }
.filters .input { min-height: 40px; font-size: 15px; }
.filters__btns { display: flex; gap: 8px; }
.filters__more { display: contents; }
.filters__toggle { display: none; }
.filters__btns .btn { min-height: 40px; }
.search { position: relative; display: block; }
.search svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-right: 38px; }

.listbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; flex-wrap: wrap; }
.listbar__count { color: var(--muted); font-size: 14px; }
.listbar__bulk { display: flex; align-items: center; gap: 10px; font-weight: 700; background: #fbe5e2; padding: 4px 6px 4px 12px; border-radius: 999px; font-size: 14px; }

.table-card { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { background: var(--paper-2); color: var(--ink-2); font-size: 13px; font-weight: 800; text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fffaf0; }
.table tr:has(.rowcheck:checked) { background: #fdf1ee; }
.col-check { width: 44px; text-align: center !important; }
.col-id { width: 70px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-date { width: 170px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }
.col-num { width: 90px; text-align: center !important; }
.col-actions { width: 130px; }
.col-name a { color: var(--ink); font-weight: 700; text-decoration: none; }
.col-name a:hover { color: var(--red); text-decoration: underline; }
.rowactions { display: flex; gap: 4px; justify-content: flex-end; }
.iconbtn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; }
.iconbtn:hover { background: var(--line-2); border-color: var(--line); }
.iconbtn--danger { color: var(--danger); }
.iconbtn--danger:hover { background: #fbe5e2; border-color: #efbdb6; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--red); cursor: pointer; }

.pager { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.pager__btn { min-width: 40px; height: 40px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.pager__btn:hover { border-color: var(--gold); }
.pager__btn.is-current { background: var(--red); border-color: var(--red-dark); color: #fff; }
.pager__btn.is-disabled { pointer-events: none; opacity: .45; }
.pager__gap { align-self: center; color: var(--muted); padding: 0 2px; }

.auth { min-height: calc(100dvh - 140px); display: grid; place-items: center; padding: 24px 0; }
.auth__card { width: min(420px, 100%); text-align: start; }
.auth__card .card__title, .auth__card .card__hint { text-align: center; }
.auth__card .form { margin-top: 18px; }
.checks { list-style: none; padding: 0; margin: 16px 0 4px; display: grid; gap: 4px; font-size: 14px; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--danger); font-weight: 700; }

.settings { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .settings { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: start; } }
.settings__side { display: grid; gap: 16px; }
.form__foot { display: flex; justify-content: flex-start; padding-top: 6px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 8px 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__ui { flex: none; width: 48px; height: 28px; border-radius: 999px; background: #d9ccb3; position: relative; transition: background .2s; }
.switch__ui::after { content: ""; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .switch__ui { background: var(--ok); }
.switch input:checked + .switch__ui::after { transform: translateX(-20px); }
.switch input:focus-visible + .switch__ui { outline: 3px solid rgba(185, 138, 62, .45); outline-offset: 2px; }
.switch strong { display: block; font-size: 15px; }
.switch small { display: block; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: auto; }
  .table tr { display: grid; grid-template-columns: 30px auto auto 1fr auto; grid-template-areas: "check name name name actions" "check id date num actions"; column-gap: 10px; row-gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); align-items: center; }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { border: 0; padding: 0; }
  .table .col-check { grid-area: check; width: auto; }
  .table .col-name { grid-area: name; font-size: 16px; line-height: 1.5; }
  .table .col-actions { grid-area: actions; width: auto; }
  .table .col-id { grid-area: id; width: auto; font-size: 13px; }
  .table .col-date { grid-area: date; width: auto; font-size: 13px; }
  .table .col-num { grid-area: num; width: auto; justify-self: start; text-align: start !important; }
  .table .col-num .badge { font-size: 12px; }
  .table .col-num .badge::before { content: "تحميل "; font-weight: 500; }
  .rowactions { flex-direction: column; gap: 2px; }
  .rowactions .iconbtn { width: 38px; height: 34px; }
  .filters .field--grow { flex: 1 1 0; min-width: 0; }
  .filters__toggle { display: inline-flex; min-height: 40px; }
  .filters__more { display: none; flex: 1 1 100%; flex-wrap: wrap; gap: 10px 12px; }
  .filters__more.is-open { display: flex; }
  .filters__more .field { flex: 1 1 calc(50% - 6px); }
  .filters__btns { flex: 1 1 100%; }
  .stat { padding: 10px 14px; }
  .filters__btns .btn { flex: 1; }
  .pagehead__actions { width: 100%; }
  .pagehead__actions .btn { flex: 1; }
}
@media (max-width: 520px) {
  body { font-size: 15.5px; }
  .card { padding: 18px 16px; }
  .paper { padding: 6px; }
  .paper__frame { padding: 20px 14px; }
  .st-body { font-size: 16px; line-height: 1.95; }

  .hero { padding-top: 12px; }
  .is-public main { padding-bottom: 72px; }
  .stat__value { font-size: 22px; }
  .pager__btn { min-width: 36px; height: 36px; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
