/* AisBpums design tokens: formal / academic. Colors live in the 12 theme blocks below (4 palettes x light, dark, system-dark);
   every block defines the same variable set (checked by ThemeCssTests, WCAG 2.1 AA). --accent is decorative only:
   never use it for text, focus rings or borders that carry meaning. */
@font-face { font-family: Vazirmatn; font-weight: 400; src: url("../fonts/Vazirmatn-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: Vazirmatn; font-weight: 700; src: url("../fonts/Vazirmatn-Bold.ttf") format("truetype"); font-display: swap; }

:root {
  --radius: .375rem;
  --shadow: 0 1px 2px rgb(0 0 0 / .08), 0 4px 12px rgb(0 0 0 / .06);
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.5rem; --space-6: 2.5rem;
}

/* navy-gold */
:root[data-theme="navy-gold"][data-mode="light"], :root[data-theme="navy-gold"]:not([data-mode]) { color-scheme: light; --bg: #f7f5ef; --surface: #ffffff; --surface-alt: #efece3; --text: #1b2230; --text-muted: #566074; --border: #d9d4c7; --border-strong: #7a7466; --primary: #14284b; --on-primary: #ffffff; --accent: #b8924a; --on-accent: #14284b; --link: #14284b; --focus-ring: #14284b; --success: #1b6b34; --on-success: #ffffff; --warning: #7a4f00; --on-warning: #ffffff; --danger: #b3261e; --on-danger: #ffffff; }
:root[data-theme="navy-gold"][data-mode="dark"] { color-scheme: dark; --bg: #0e1420; --surface: #172033; --surface-alt: #1f2a42; --text: #e8ebf2; --text-muted: #a3adc2; --border: #2c3850; --border-strong: #8190ad; --primary: #8fb0ee; --on-primary: #0e1420; --accent: #d4ad63; --on-accent: #0e1420; --link: #8fb0ee; --focus-ring: #8fb0ee; --success: #7fd49a; --on-success: #0e1420; --warning: #f0c060; --on-warning: #0e1420; --danger: #f2b8b5; --on-danger: #0e1420; }
/* emerald-copper */
:root[data-theme="emerald-copper"][data-mode="light"], :root[data-theme="emerald-copper"]:not([data-mode]) { color-scheme: light; --bg: #f7f5ef; --surface: #ffffff; --surface-alt: #efece3; --text: #1b2230; --text-muted: #566074; --border: #d9d4c7; --border-strong: #7a7466; --primary: #0b4f45; --on-primary: #ffffff; --accent: #c27a3d; --on-accent: #1b2230; --link: #0b4f45; --focus-ring: #0b4f45; --success: #1b6b34; --on-success: #ffffff; --warning: #7a4f00; --on-warning: #ffffff; --danger: #b3261e; --on-danger: #ffffff; }
:root[data-theme="emerald-copper"][data-mode="dark"] { color-scheme: dark; --bg: #0e1420; --surface: #172033; --surface-alt: #1f2a42; --text: #e8ebf2; --text-muted: #a3adc2; --border: #2c3850; --border-strong: #8190ad; --primary: #5fc9b4; --on-primary: #0e1420; --accent: #dd9459; --on-accent: #0e1420; --link: #5fc9b4; --focus-ring: #5fc9b4; --success: #7fd49a; --on-success: #0e1420; --warning: #f0c060; --on-warning: #0e1420; --danger: #f2b8b5; --on-danger: #0e1420; }
/* burgundy-silver */
:root[data-theme="burgundy-silver"][data-mode="light"], :root[data-theme="burgundy-silver"]:not([data-mode]) { color-scheme: light; --bg: #f7f5ef; --surface: #ffffff; --surface-alt: #efece3; --text: #1b2230; --text-muted: #566074; --border: #d9d4c7; --border-strong: #7a7466; --primary: #6b1d33; --on-primary: #ffffff; --accent: #a8aab0; --on-accent: #1b2230; --link: #6b1d33; --focus-ring: #6b1d33; --success: #1b6b34; --on-success: #ffffff; --warning: #7a4f00; --on-warning: #ffffff; --danger: #b3261e; --on-danger: #ffffff; }
:root[data-theme="burgundy-silver"][data-mode="dark"] { color-scheme: dark; --bg: #0e1420; --surface: #172033; --surface-alt: #1f2a42; --text: #e8ebf2; --text-muted: #a3adc2; --border: #2c3850; --border-strong: #8190ad; --primary: #e58fa8; --on-primary: #0e1420; --accent: #c4c6cb; --on-accent: #0e1420; --link: #e58fa8; --focus-ring: #e58fa8; --success: #7fd49a; --on-success: #0e1420; --warning: #f0c060; --on-warning: #0e1420; --danger: #f2b8b5; --on-danger: #0e1420; }
/* blue-amber */
:root[data-theme="blue-amber"][data-mode="light"], :root[data-theme="blue-amber"]:not([data-mode]) { color-scheme: light; --bg: #f7f5ef; --surface: #ffffff; --surface-alt: #efece3; --text: #1b2230; --text-muted: #566074; --border: #d9d4c7; --border-strong: #7a7466; --primary: #0f4c81; --on-primary: #ffffff; --accent: #e0a526; --on-accent: #1b2230; --link: #0f4c81; --focus-ring: #0f4c81; --success: #1b6b34; --on-success: #ffffff; --warning: #7a4f00; --on-warning: #ffffff; --danger: #b3261e; --on-danger: #ffffff; }
:root[data-theme="blue-amber"][data-mode="dark"] { color-scheme: dark; --bg: #0e1420; --surface: #172033; --surface-alt: #1f2a42; --text: #e8ebf2; --text-muted: #a3adc2; --border: #2c3850; --border-strong: #8190ad; --primary: #7fb8ee; --on-primary: #0e1420; --accent: #eab84a; --on-accent: #0e1420; --link: #7fb8ee; --focus-ring: #7fb8ee; --success: #7fd49a; --on-success: #0e1420; --warning: #f0c060; --on-warning: #0e1420; --danger: #f2b8b5; --on-danger: #0e1420; }

/* Device preference when the user has not chosen a mode (must stay identical to the explicit dark blocks). */
@media (prefers-color-scheme: dark) {
  :root[data-theme="navy-gold"]:not([data-mode]) { color-scheme: dark; --bg: #0e1420; --surface: #172033; --surface-alt: #1f2a42; --text: #e8ebf2; --text-muted: #a3adc2; --border: #2c3850; --border-strong: #8190ad; --primary: #8fb0ee; --on-primary: #0e1420; --accent: #d4ad63; --on-accent: #0e1420; --link: #8fb0ee; --focus-ring: #8fb0ee; --success: #7fd49a; --on-success: #0e1420; --warning: #f0c060; --on-warning: #0e1420; --danger: #f2b8b5; --on-danger: #0e1420; }
  :root[data-theme="emerald-copper"]:not([data-mode]) { color-scheme: dark; --bg: #0e1420; --surface: #172033; --surface-alt: #1f2a42; --text: #e8ebf2; --text-muted: #a3adc2; --border: #2c3850; --border-strong: #8190ad; --primary: #5fc9b4; --on-primary: #0e1420; --accent: #dd9459; --on-accent: #0e1420; --link: #5fc9b4; --focus-ring: #5fc9b4; --success: #7fd49a; --on-success: #0e1420; --warning: #f0c060; --on-warning: #0e1420; --danger: #f2b8b5; --on-danger: #0e1420; }
  :root[data-theme="burgundy-silver"]:not([data-mode]) { color-scheme: dark; --bg: #0e1420; --surface: #172033; --surface-alt: #1f2a42; --text: #e8ebf2; --text-muted: #a3adc2; --border: #2c3850; --border-strong: #8190ad; --primary: #e58fa8; --on-primary: #0e1420; --accent: #c4c6cb; --on-accent: #0e1420; --link: #e58fa8; --focus-ring: #e58fa8; --success: #7fd49a; --on-success: #0e1420; --warning: #f0c060; --on-warning: #0e1420; --danger: #f2b8b5; --on-danger: #0e1420; }
  :root[data-theme="blue-amber"]:not([data-mode]) { color-scheme: dark; --bg: #0e1420; --surface: #172033; --surface-alt: #1f2a42; --text: #e8ebf2; --text-muted: #a3adc2; --border: #2c3850; --border-strong: #8190ad; --primary: #7fb8ee; --on-primary: #0e1420; --accent: #eab84a; --on-accent: #0e1420; --link: #7fb8ee; --focus-ring: #7fb8ee; --success: #7fd49a; --on-success: #0e1420; --warning: #f0c060; --on-warning: #0e1420; --danger: #f2b8b5; --on-danger: #0e1420; }
}

/* ---- Base ---- */
* { box-sizing: border-box; }
body { margin: 0; font-family: Vazirmatn, Tahoma, sans-serif; background: var(--bg); color: var(--text); line-height: 1.9; min-height: 100vh; display: flex; flex-direction: column; }
main { width: 100%; max-width: 64rem; margin-inline: auto; padding: var(--space-5) var(--space-4); flex: 1; }
main:focus { outline: none; }
h1, h2, h3 { line-height: 1.5; color: var(--text); }
h1 { font-size: 1.6rem; margin-block: 0 var(--space-4); padding-block-end: var(--space-2); border-block-end: 3px double var(--border-strong); }
h2 { font-size: 1.25rem; margin-block: var(--space-5) var(--space-3); }
a { color: var(--link); text-decoration: none; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
small { color: var(--text-muted); }
img { max-width: 100%; }

/* ---- Focus, skip link, motion ---- */
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
/* Header bar controls sit on --primary: ring uses --on-primary. The dropdown panel sits on --surface: keep --focus-ring. */
.site-header > .brand:focus-visible, .site-nav > a:focus-visible, .site-nav > form .link-btn:focus-visible, .theme-menu > summary:focus-visible { outline-color: var(--on-primary); }
.theme-menu .theme-form :focus-visible { outline-color: var(--focus-ring); }
.skip-link { position: absolute; inset-inline-start: var(--space-3); inset-block-start: -4rem; z-index: 100; background: var(--surface); color: var(--link); border: 2px solid var(--focus-ring); border-radius: var(--radius); padding: var(--space-2) var(--space-4); }
.skip-link:focus { inset-block-start: var(--space-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---- Header, nav, footer ---- */
.site-header { background: var(--primary); color: var(--on-primary); border-block-end: 4px double var(--accent); padding: var(--space-3) var(--space-4); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); }
.brand { color: inherit; font-weight: 700; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.site-nav a, .site-header summary { color: var(--on-primary); }
.site-nav form { margin: 0; }
.site-footer { text-align: center; color: var(--text-muted); background: var(--surface-alt); border-block-start: 1px solid var(--border); padding: var(--space-4); display: grid; gap: var(--space-2); justify-items: center; }
/* Form controls do not inherit the page font by default (browsers use the system UI font): every button uses Vazirmatn. */
button, input, select, textarea { font: inherit; }
/* Buttons without a class (row actions, small forms) get a quiet outlined look instead of the browser's grey box. */
main button:not([class]) { background: var(--surface); color: var(--link); border: 1px solid var(--primary); border-radius: var(--radius); padding: var(--space-1) var(--space-3); line-height: 1.6; cursor: pointer; white-space: nowrap; }
main button:not([class]):hover { background: var(--surface-alt); }
.link-btn { background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none; padding: 0; color: var(--link); }
.site-nav .link-btn { color: var(--on-primary); }
/* Locked actions (unconfirmed email, certificate not issued yet) must not look like the live link next to them. */
.link-btn[disabled] { color: var(--text-muted); text-decoration: none; cursor: not-allowed; }
.site-nav .link-btn[disabled] { color: var(--on-primary); opacity: .75; } /* on the --primary bar --text-muted would fail contrast */
/* Email addresses inside RTL text: one LTR run, never broken at the hyphen of no-reply. */
bdi[dir="ltr"] { white-space: nowrap; }

/* ---- Theme switcher ---- */
.theme-menu { position: relative; }
.theme-menu summary { cursor: pointer; list-style: none; padding: var(--space-1) var(--space-2); border: 1px solid currentColor; border-radius: var(--radius); }
.theme-menu summary::-webkit-details-marker { display: none; }
.theme-menu .theme-form { position: absolute; inset-inline-end: 0; z-index: 50; min-width: 15rem; margin-block-start: var(--space-2); background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-3); }
/* Phones: the popover spans the viewport instead of hanging off the start edge (admin nav wraps the toggle mid-row). */
@media (max-width: 40rem) { .theme-menu .theme-form { position: fixed; inset-inline: var(--space-4); min-width: 0; } }
.theme-form { display: grid; gap: var(--space-2); }
.theme-form[hidden] { display: none; }
.theme-form label { display: grid; gap: var(--space-1); font-size: .9rem; }
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--space-3); border: 0; padding: 0; margin: 0; }
.swatch-card { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: var(--space-3); cursor: pointer; }
.swatch-card:has(input:checked) { border-width: 3px; padding: calc(var(--space-3) - 2px); border-color: var(--primary); }
.swatch-card input { margin: 0; }
.swatch-chips { display: inline-flex; gap: 2px; margin-inline-start: auto; }
.swatch-chips i { width: 1.5rem; height: 1.5rem; border: 1px solid var(--border-strong); display: inline-block; }
.swatch-chips i:first-child { border-start-start-radius: var(--radius); border-end-start-radius: var(--radius); }
.swatch-chips i:last-child { border-start-end-radius: var(--radius); border-end-end-radius: var(--radius); }
/* Decorative swatch colors: literal palette values, independent of the active theme. */
[data-palette="navy-gold"] i:first-child { background: #14284b; } [data-palette="navy-gold"] i:last-child { background: #b8924a; }
[data-palette="emerald-copper"] i:first-child { background: #0b4f45; } [data-palette="emerald-copper"] i:last-child { background: #c27a3d; }
[data-palette="burgundy-silver"] i:first-child { background: #6b1d33; } [data-palette="burgundy-silver"] i:last-child { background: #a8aab0; }
[data-palette="blue-amber"] i:first-child { background: #0f4c81; } [data-palette="blue-amber"] i:last-child { background: #e0a526; }
.mode-options { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }

/* ---- Buttons ---- */
.btn { font: inherit; background: var(--primary); color: var(--on-primary); border: 2px solid var(--primary); border-radius: var(--radius); padding: var(--space-2) var(--space-4); cursor: pointer; justify-self: start; text-decoration: none; display: inline-block; line-height: 1.6; }
.btn:hover { box-shadow: var(--shadow); }
.btn-secondary { background: var(--surface); color: var(--link); border-color: var(--primary); }
.btn-danger { background: var(--danger); color: var(--on-danger); border-color: var(--danger); }
.btn-ghost { background: transparent; color: var(--link); border-color: transparent; }
.btn-sm { padding: var(--space-1) var(--space-3); font-size: .9rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }

/* ---- Forms ---- */
.form { max-width: 30rem; display: grid; gap: var(--space-3); }
.form label { display: grid; gap: var(--space-1); font-weight: 700; }
/* Grid items and fieldsets default to min-content width: a file input or long select pushed forms past a 375 px screen. */
.form > *, .form fieldset { min-inline-size: 0; }
.form input, .form textarea, .form select, .theme-form select { font: inherit; font-weight: 400; padding: var(--space-2) var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.form input:focus-visible, .form textarea:focus-visible, .form select:focus-visible, .theme-form select:focus-visible { border-color: var(--focus-ring); }
.form input, .form select, .form textarea { max-inline-size: 100%; }
[hidden] { display: none !important; }
/* Inputs outside .form (inline forms, filters, admin pages) get the same look and Vazirmatn. */
main input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="color"], [type="file"], [type="submit"]), main select, main textarea { font: inherit; font-weight: 400; padding: var(--space-2) var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); max-inline-size: 100%; }
main input:focus-visible, main select:focus-visible, main textarea:focus-visible { border-color: var(--focus-ring); }
.form input[type="radio"], .form input[type="checkbox"] { padding: 0; accent-color: var(--primary); }
.form input[type="color"] { padding: 2px; inline-size: 4rem; block-size: 2.5rem; cursor: pointer; } /* the shared padding left a 1 px swatch */
.form fieldset { border: 1px solid var(--border-strong); border-radius: var(--radius); display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); }
.form legend { font-weight: 700; padding-inline: var(--space-2); }
.form label.check, label.check { display: flex; gap: var(--space-2); align-items: center; font-weight: 400; }
.help, .form .help { color: var(--text-muted); font-size: .9rem; font-weight: 400; }
.form input[aria-invalid="true"], .input-validation-error { border-color: var(--danger); border-width: 2px; }
::placeholder { color: var(--text-muted); opacity: 1; }
.error { color: var(--danger); font-weight: 700; }
.error:empty, .validation-summary-valid { display: none; }
.field-validation-error { color: var(--danger); }
.field-validation-error::before { content: "\26A0\FE0E "; }
.inline-form { display: inline-flex; gap: var(--space-2); align-items: end; margin-block: var(--space-1); }
.inline-form + .inline-form { margin-inline-start: var(--space-3); }
.secret { word-break: break-all; }
.codes { columns: 2; font-family: monospace; }
.links { padding-inline-start: var(--space-5); }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-block: var(--space-3); }
.filters strong { border-block-end: 3px solid var(--primary); }

/* ---- Alerts (notice / error paragraphs) ---- */
.notice, .alert { background: var(--surface); border: 1px solid var(--border-strong); border-inline-start: 6px solid var(--primary); border-radius: var(--radius); padding: var(--space-3) var(--space-4); }
.alert-success { border-inline-start-color: var(--success); color: var(--success); }
.alert-warning { border-inline-start-color: var(--warning); color: var(--warning); }
.alert-danger, p.error { border-inline-start-color: var(--danger); }
p.error, div.error[role="alert"] { background: var(--surface); border: 1px solid var(--danger); border-radius: var(--radius); padding: var(--space-3) var(--space-4); }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3) var(--space-4); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 4px var(--border); }
.card h3, .card h2 { margin-block-start: 0; }
.card-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); margin-block-end: var(--space-2); }
.cards { list-style: none; padding: 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }

/* ---- Tables: wrap in .table-scroll to scroll sideways on phones ---- */
/* One look for every data table: a bordered card (the scroll region), a tinted header with a primary rule, zebra rows. */
.table-scroll { overflow-x: auto; max-width: 100%; margin-block: var(--space-3) var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); font-size: .95rem; }
.table caption { text-align: start; padding: var(--space-2) var(--space-3); font-weight: 700; }
.table th, .table td { text-align: start; padding: var(--space-2) var(--space-3); border-block-end: 1px solid var(--border); vertical-align: middle; }
.table thead th { background: var(--surface-alt); color: var(--text); font-weight: 700; white-space: nowrap; border-block-end: 2px solid var(--primary); }
.table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-alt) 45%, var(--surface)); }
.table tbody tr:hover { background: var(--surface-alt); }
.table tbody tr:last-child > * { border-block-end: 0; }
.table tbody th[scope="row"] { font-weight: 700; }
.table td.acts { white-space: nowrap; }
.table input[type="checkbox"] { inline-size: 1.1rem; block-size: 1.1rem; vertical-align: middle; }
.table .inline-form { flex-wrap: wrap; } /* row actions stack in a narrow cell; each label stays whole */
.table .link-btn { white-space: nowrap; }
/* Action cells: a coloured "|" (decorative --accent) between separate links/buttons. */
.acts .sep, .acts > :not(.sep) + :not(.sep)::before, .acts .inline-form > button + button::before { color: var(--accent); margin-inline: var(--space-2); text-decoration: none; }
.acts > :not(.sep) + :not(.sep)::before, .acts .inline-form > button + button::before { content: "|"; display: inline-block; }
.table-dense th, .table-dense td { padding-inline: var(--space-2); } /* many-column tables (email queue) fit 1280 px without scrolling */
.table td[dir="ltr"], .table td [dir="ltr"] { white-space: nowrap; } /* certificate numbers never break at their hyphens */

/* ---- Certificate template: background thumbnail; layout tables scroll inside .table-scroll on phones ---- */
.bg-thumb { display: block; width: 100%; max-width: 30rem; height: auto; border: 1px solid var(--border); border-radius: var(--radius); }
/* event page images: fluid, galleries wrap into as many columns as fit (2 at 375 px) */
.event-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); margin-block-end: 1rem; }
.gallery, .event-thumbs { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.gallery { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.event-thumbs { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
.gallery-img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.event-thumb { display: block; width: 100%; max-width: 16rem; height: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.layout-table input:not([type="checkbox"]) { inline-size: 4.5rem; }
.layout-table input.extra-text { inline-size: 12rem; }
.layout-table input[maxlength="1"] { inline-size: 3rem; }
.form-wide { max-width: none; } /* the template form: fields stay 30rem, the layout tables get the page width at 1280 px */
.form-wide > :not(.wide) { max-width: 30rem; }
.layout-table input[type="color"] { inline-size: 3rem; }
.layout-table th[scope="row"] { white-space: nowrap; }

/* ---- Badges (registration statuses) ---- */
.badge { display: inline-block; padding: 0 var(--space-2); border: 1px solid currentColor; border-radius: 999px; font-size: .85rem; line-height: 1.7; background: var(--surface); color: var(--text); white-space: nowrap; }
.badge-success { color: var(--success); }
.badge-warning { color: var(--warning); }
.badge-danger { color: var(--danger); }

/* ---- Pagination ---- */
.pager { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-block: var(--space-4); }
.pager a { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: var(--space-1) var(--space-3); background: var(--surface); }

/* ---- Facts, messaging, verification, landing ---- */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-4); }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; }
.pre-line { white-space: pre-line; }
.event-link { overflow-wrap: anywhere; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.verify-card { background: var(--surface); border: 2px solid var(--text-muted); border-radius: var(--radius); padding: var(--space-4); margin-block: var(--space-4); }
.verify-card.valid { border-color: var(--success); }
.verify-card.revoked { border-color: var(--danger); }
.verify-card .verify-status { font-size: 1.25rem; margin: 0 0 var(--space-2); }
.verify-card.valid .verify-status { color: var(--success); }
.verify-card.revoked .verify-status { color: var(--danger); }
.thread { list-style: none; padding: 0; display: grid; gap: var(--space-2); max-width: 40rem; }
.msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-2) var(--space-3); }
.msg-admin { border-inline-start: 6px solid var(--primary); }
.msg-meta { color: var(--text-muted); font-size: .85rem; }
.hero { text-align: center; padding-block: var(--space-5); border-block-end: 3px double var(--border-strong); margin-block-end: var(--space-5); }
.hero-logo, .logo-preview { max-width: 96px; height: auto; }
.hero .actions { justify-content: center; align-items: center; }

/* ---- Landing: Persian list numerals, contact band ---- */
#mission ol { list-style-type: persian; }
.contact-band { background: var(--primary); color: var(--on-primary); border-radius: var(--radius); border-block-end: 4px double var(--accent); padding: var(--space-4); margin-block-start: var(--space-5); }
.contact-band h2 { margin-block-start: 0; color: var(--on-primary); }
.contact-band a { color: var(--on-primary); font-weight: 700; }
.contact-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.contact-grid p { margin: 0 0 var(--space-3); }
/* Hover: the whole picture fades in and eases out to its full size over the cropped cover (object-fit itself cannot animate). */
.event-cover-box { position: relative; overflow: hidden; border-radius: var(--radius); margin-block-end: 1rem; }
.event-cover-box .event-cover { margin-block-end: 0; }
.event-cover-full { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface-alt); border-radius: var(--radius); opacity: 0; transform: scale(1.12); transition: opacity .9s ease-in-out, transform 1.1s cubic-bezier(.22, .61, .36, 1); pointer-events: none; }
.event-cover-box:hover .event-cover-full { opacity: 1; transform: scale(1); }
@media (prefers-reduced-motion: reduce) { .event-cover-full { transition-duration: .01ms; } }
.event-qr { margin: var(--space-4) 0 0; text-align: center; }
.event-qr img { background: #fff; padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius); image-rendering: pixelated; }
.event-qr figcaption { color: var(--text-muted); font-size: .9rem; }

/* Email-text editor (event form): toolbar + contenteditable area; the textarea is shown only without JS. */
.rte { display: grid; gap: var(--space-1); }
.rte-label { font-weight: 600; }
.rte-bar { display: none; flex-wrap: wrap; gap: var(--space-1); }
.rte-on .rte-bar { display: flex; }
.rte-bar button { min-inline-size: 2.25rem; padding: 0.25rem 0.5rem; line-height: 1.2; }
.rte-area { display: none; min-block-size: 8rem; padding: var(--space-2) var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); line-height: 2; overflow-wrap: anywhere; }
.rte-on .rte-area { display: block; }
.rte-area:focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.rte-source { min-block-size: 8rem; font-family: monospace; direction: ltr; }
.rte-b { font-weight: 700; } .rte-i { font-style: italic; } .rte-u { text-decoration: underline; }
