/* Miss & Mister Shayesteh Iran — design system
   Lapis #1D2C6B · Saffron #E3A52B · Pomegranate #B0173F · Firuzeh #1F9E98 · Porcelain #F5F6FA · Ink #161A33
   Layout uses logical properties so the same CSS serves LTR (English) and RTL (Persian). */

:root {
  --lapis: #1D2C6B;
  --lapis-deep: #121C48;
  --lapis-soft: #E8EBF6;
  --saffron: #E3A52B;
  --saffron-deep: #B9811A;
  --saffron-soft: #FBF1DC;
  --pomegranate: #B0173F;
  --pomegranate-soft: #FBE7EC;
  --firuzeh: #1F9E98;
  --firuzeh-soft: #E2F4F3;
  --porcelain: #F5F6FA;
  --surface: #FFFFFF;
  --ink: #161A33;
  --ink-2: #4A5070;
  --ink-3: #7C819C;
  --line: #DCDFEA;
  --focus: #3D5BD9;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 18px;
  --shadow: 0 1px 2px rgba(18, 28, 72, .06), 0 8px 24px rgba(18, 28, 72, .06);
  --font-display: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
  color-scheme: light;
}
[dir="rtl"] { --font-display: "Vazirmatn", Tahoma, sans-serif; --font-body: "Vazirmatn", Tahoma, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--porcelain); color: var(--ink); font: 400 16px/1.6 var(--font-body); min-height: 100vh; display: flex; flex-direction: column; }
[dir="rtl"] body { line-height: 1.85; }
img { max-width: 100%; display: block; }
a { color: var(--lapis); text-underline-offset: 3px; }
a:hover { color: var(--pomegranate); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; margin: 0 0 .5em; color: var(--lapis-deep); }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 720px; }
main { flex: 1; }
.stack > * + * { margin-block-start: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid-2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---- Header ------------------------------------------------------------ */
.site-header { background: var(--surface); border-block-end: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.site-header__in { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--lapis-deep); }
.brand img { width: 38px; height: 38px; }
.brand__name { font-family: "Marcellus", Georgia, serif; font-size: 1.3rem; line-height: 1; }
.brand__sub { display: block; font: 500 .7rem/1.2 var(--font-body); color: var(--pomegranate); letter-spacing: .04em; margin-block-start: 3px; }
.nav { margin-inline-start: auto; display: flex; align-items: center; gap: .25rem; }
.nav a { text-decoration: none; color: var(--ink-2); padding: .5rem .7rem; border-radius: var(--radius-s); font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--lapis); background: var(--lapis-soft); }
.nav__toggle { display: none; margin-inline-start: auto; background: none; border: 1px solid var(--line); border-radius: var(--radius-s); padding: .45rem .6rem; cursor: pointer; }
.nav__toggle span { display: block; width: 20px; height: 2px; background: var(--lapis); margin: 4px 0; }
.lang-switch { font-weight: 600 !important; color: var(--lapis) !important; border: 1px solid var(--line); }
@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav { display: none; position: absolute; inset-inline: 0; top: 64px; background: var(--surface); flex-direction: column; align-items: stretch; padding: .5rem var(--gutter) 1rem; border-block-end: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.is-open { display: flex; }
  .nav a { padding: .8rem .6rem; }
}

/* ---- Buttons ----------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .6rem 1.15rem; border-radius: var(--radius-m); border: 1px solid transparent; font: 600 .95rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; background: var(--surface); color: var(--lapis); border-color: var(--line); }
.btn:hover { border-color: var(--lapis); color: var(--lapis); }
.btn--primary { background: var(--lapis); color: #fff; border-color: var(--lapis); }
.btn--primary:hover { background: var(--lapis-deep); color: #fff; }
.btn--gold { background: var(--saffron); color: var(--lapis-deep); border-color: var(--saffron); }
.btn--gold:hover { background: #F0B643; color: var(--lapis-deep); border-color: #F0B643; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--danger { color: var(--pomegranate); border-color: #E9B5C2; }
.btn--danger:hover { background: var(--pomegranate); color: #fff; border-color: var(--pomegranate); }
.btn--ok { background: var(--firuzeh); color: #fff; border-color: var(--firuzeh); }
.btn--ok:hover { background: #17807B; color: #fff; }
.btn--sm { min-height: 34px; padding: .35rem .75rem; font-size: .85rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---- Forms ------------------------------------------------------------- */
.form label, label.field { display: block; font-weight: 600; font-size: .92rem; color: var(--ink-2); margin-block-end: 1rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], input[type=url], select, textarea {
  display: block; width: 100%; margin-block-start: .35rem; min-height: 46px; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-m);
  background: var(--surface); color: var(--ink); font: 400 1rem/1.4 var(--font-body);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(61, 91, 217, .15); }
.check { display: flex !important; gap: .6rem; align-items: flex-start; font-weight: 400 !important; color: var(--ink) !important; }
.check input { width: 20px; height: 20px; margin-block-start: .2rem; flex: none; accent-color: var(--lapis); }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
legend { font-family: var(--font-display); font-size: 1.15rem; color: var(--lapis-deep); padding: 0; margin-block-end: .75rem; }
small, .help { display: block; font-weight: 400; color: var(--ink-3); font-size: .82rem; margin-block-start: .3rem; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-block-start: .35rem; }
.choice label { margin: 0; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: flex; align-items: center; justify-content: center; min-height: 46px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); font-weight: 500; color: var(--ink); cursor: pointer; text-align: center; padding: .4rem; }
.choice input:checked + span { border-color: var(--lapis); background: var(--lapis-soft); color: var(--lapis-deep); box-shadow: inset 0 0 0 1px var(--lapis); }
.choice input:focus-visible + span { outline: 3px solid var(--focus); }

/* ---- Alerts / badges ------------------------------------------------------ */
.flashes { margin-block: 1rem; }
.alert { padding: .8rem 1rem; border-radius: var(--radius-m); margin-block-end: .6rem; border: 1px solid; font-size: .95rem; }
.alert--success { background: var(--firuzeh-soft); border-color: #A9DCD9; color: #0F5E5A; }
.alert--error { background: var(--pomegranate-soft); border-color: #F0BCC9; color: #8A1031; }
.alert--info { background: var(--lapis-soft); border-color: #C6CDE9; color: var(--lapis-deep); }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #EEF0F6; color: var(--ink-2); white-space: nowrap; }
.badge--draft { background: #EEF0F6; }
.badge--submitted, .badge--pending_review, .badge--pending { background: var(--saffron-soft); color: #7A5410; }
.badge--changes_requested { background: #FDEBD3; color: #8A4B0A; }
.badge--approved, .badge--verified, .badge--paid { background: var(--firuzeh-soft); color: #0F5E5A; }
.badge--finalist, .badge--winner { background: var(--lapis); color: #fff; }
.badge--winner { background: var(--saffron); color: var(--lapis-deep); }
.badge--rejected, .badge--failed { background: var(--pomegranate-soft); color: #8A1031; }
.badge--withdrawn { background: #EEF0F6; color: var(--ink-3); }
.badge--band-green { background: var(--firuzeh-soft); color: #0F5E5A; }
.badge--band-yellow { background: var(--saffron-soft); color: #7A5410; }
.badge--band-red { background: var(--pomegranate-soft); color: #8A1031; }

/* ---- Surfaces ------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1.25rem; }
@media (min-width: 640px) { .panel { padding: 1.6rem; } }
.panel + .panel { margin-block-start: 1rem; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-block-end: 1rem; }
.panel__head h2, .panel__head h3 { margin: 0; }
.page-head { padding-block: 1.75rem 1rem; }
.page-head p { color: var(--ink-2); max-width: 60ch; }
.prose { max-width: 70ch; }
.prose h3 { margin-block-start: 1.5em; }
.prose li { margin-block-end: .4em; }

/* ---- Hero (home) -------------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: var(--lapis-deep); color: #fff; }
.hero::before { content: ""; position: absolute; inset: 0; background: url("../img/pattern.svg") repeat; background-size: 72px; opacity: .22; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 75% 30%, rgba(227, 165, 43, .22), transparent 55%), linear-gradient(180deg, transparent 60%, rgba(18, 28, 72, .7)); }
.hero__in { position: relative; z-index: 1; display: grid; gap: 2rem; padding-block: 3.5rem 3rem; align-items: center; }
@media (min-width: 900px) { .hero__in { grid-template-columns: 1.15fr .85fr; padding-block: 5.5rem 5rem; } }
.hero__kicker { color: var(--saffron); font-weight: 600; margin-block-end: .75rem; }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 5.2vw, 3.7rem); line-height: 1.04; margin-block-end: 1rem; }
[dir="rtl"] .hero h1 { line-height: 1.35; }
.hero__lead { font-size: 1.12rem; color: #D5DAF0; max-width: 46ch; }
.hero__cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-block-start: 1.5rem; }
.hero__cta .btn:not(.btn--gold) { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.hero__cta .btn:not(.btn--gold):hover { border-color: #fff; }
.hero__word { font-family: "Vazirmatn", Tahoma, sans-serif; font-weight: 800; font-size: clamp(6rem, 22vw, 15rem); line-height: .9; color: transparent; -webkit-text-stroke: 1.5px rgba(227, 165, 43, .85); text-align: center; user-select: none; direction: rtl; }
.hero__word small { display: block; -webkit-text-stroke: 0; color: var(--saffron); font: 400 1.05rem/1.4 "Marcellus", Georgia, serif; letter-spacing: .12em; margin-block-start: .75rem; direction: ltr; }
.hero__meta { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-block-start: 2rem; color: #C3C9E6; font-size: .95rem; }
.hero__meta strong { display: block; color: #fff; font-size: 1.05rem; }
@media (prefers-reduced-motion: no-preference) {
  .hero__word { animation: rise 1.1s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(24px); letter-spacing: .08em; } to { opacity: 1; transform: none; } }
}

.section { padding-block: 3rem; }
.section--tight { padding-block: 2rem; }
.section__head { max-width: 640px; margin-block-end: 1.75rem; }
.section__head p { color: var(--ink-2); }
.cats { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
@media (min-width: 720px) { .cats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cats { grid-template-columns: repeat(4, 1fr); } }
.cat { background: var(--surface); padding: 1.5rem 1.25rem; }
.cat__name { font-family: var(--font-display); font-size: 1.25rem; color: var(--lapis-deep); margin-block-end: .35rem; }
.cat__meta { color: var(--ink-2); font-size: .92rem; }
.cat__age { display: block; font: 400 2rem/1 var(--font-display); color: var(--saffron-deep); margin-block-end: .75rem; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; counter-reset: s; }
@media (min-width: 900px) { .timeline { grid-template-columns: repeat(5, 1fr); } }
.timeline li { counter-increment: s; border-block-start: 3px solid var(--lapis); padding-block-start: .9rem; }
.timeline li::before { content: counter(s); display: block; font: 400 1.6rem/1 var(--font-display); color: var(--saffron-deep); margin-block-end: .5rem; }
[dir="rtl"] .timeline li::before { content: counter(s, persian); }
.timeline strong { display: block; color: var(--lapis-deep); margin-block-end: .25rem; }
.timeline span { color: var(--ink-2); font-size: .93rem; }
.standard { display: grid; gap: 1.5rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1.5rem; }
@media (min-width: 860px) { .standard { grid-template-columns: 1fr 1.2fr; padding: 2.25rem; } }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.shot { aspect-ratio: 3 / 4; border: 1px dashed #B8BFD8; border-radius: var(--radius-m); background: var(--porcelain); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: .6rem; font-size: .8rem; color: var(--ink-2); text-align: center; position: relative; }
.shot svg { position: absolute; inset: 10% 12% 22%; width: 76%; height: 68%; }
.cta-band { background: var(--saffron-soft); border-block: 1px solid #F1DDB0; }
.cta-band__in { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-block: 2rem; }
.cta-band h2 { margin: 0; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer { background: var(--lapis-deep); color: #C3C9E6; margin-block-start: 3rem; padding-block: 2.25rem 1.5rem; font-size: .92rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--saffron); }
.site-footer__in { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .site-footer__in { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.site-footer__base { border-block-start: 1px solid rgba(255,255,255,.12); margin-block-start: 1.5rem; padding-block-start: 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: #8F97C2; }
.install-btn[hidden] { display: none; }

/* ---- Auth ---------------------------------------------------------------- */
.auth { display: grid; place-items: start center; padding-block: 2rem 3rem; }
.auth .panel { width: 100%; max-width: 560px; }
.auth--wide .panel { max-width: 760px; }
.auth h1 { font-size: 1.8rem; }
.auth__alt { text-align: center; margin-block-start: 1rem; color: var(--ink-2); }

/* ---- Applicant area ------------------------------------------------------ */
.acc { display: grid; gap: 1.25rem; padding-block: 1.5rem 2rem; }
@media (min-width: 960px) { .acc { grid-template-columns: 250px 1fr; align-items: start; } }
.acc-nav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: .5rem; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.acc-nav::-webkit-scrollbar { display: none; }
@media (min-width: 960px) { .acc-nav { flex-direction: column; position: sticky; top: 80px; } }
.acc-nav a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem .8rem; border-radius: var(--radius-m); text-decoration: none; color: var(--ink-2); font-weight: 500; white-space: nowrap; font-size: .95rem; }
.acc-nav a:hover { background: var(--porcelain); color: var(--lapis); }
.acc-nav a[aria-current="page"] { background: var(--lapis); color: #fff; }
.count { min-width: 22px; height: 22px; border-radius: 11px; background: var(--pomegranate); color: #fff; font-size: .75rem; display: inline-grid; place-items: center; padding-inline: 6px; }
.status-hero { display: grid; gap: 1rem; }
@media (min-width: 720px) { .status-hero { grid-template-columns: 1fr auto; align-items: center; } }
.status-hero h1 { font-size: 1.7rem; margin: 0; }
.track { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; }
.track li { font-size: .78rem; color: var(--ink-3); text-align: center; }
.track li::before { content: ""; display: block; height: 6px; border-radius: 3px; background: #E3E6F0; margin-block-end: .45rem; }
.track li.is-done::before { background: var(--firuzeh); }
.track li.is-now::before { background: var(--saffron); }
.track li.is-now { color: var(--ink); font-weight: 600; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.step { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); text-decoration: none; color: var(--ink); }
a.step:hover { border-color: var(--lapis); color: var(--ink); }
.step__dot { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid #C4C9DC; display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--ink-3); }
.step.is-done .step__dot { background: var(--firuzeh); border-color: var(--firuzeh); color: #fff; }
.step.is-next { border-color: var(--saffron); box-shadow: inset 4px 0 0 var(--saffron); }
[dir="rtl"] .step.is-next { box-shadow: inset -4px 0 0 var(--saffron); }
.step__text { flex: 1; }
.step__text strong { display: block; font-weight: 600; }
.step__text span { font-size: .85rem; color: var(--ink-3); }
.step__go { color: var(--lapis); font-weight: 600; font-size: .9rem; }

/* ---- Photo upload ------------------------------------------------------- */
.slots { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .slots { grid-template-columns: repeat(3, 1fr); } }
.slot { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; display: flex; flex-direction: column; }
.slot__frame { position: relative; aspect-ratio: 3 / 4; background: var(--porcelain); display: grid; place-items: center; }
.slot__frame img { width: 100%; height: 100%; object-fit: cover; }
.slot__frame svg { width: 60%; height: 70%; }
.slot__body { padding: .9rem 1rem 1rem; display: grid; gap: .5rem; }
.slot__title { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-weight: 600; }
.slot__hint { font-size: .85rem; color: var(--ink-2); }
.slot input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.progress { height: 4px; background: #E3E6F0; border-radius: 2px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--lapis); transition: width .2s; }
.slot__msg { font-size: .85rem; }
.slot__msg.is-error { color: var(--pomegranate); }
.slot__msg.is-ok { color: #0F5E5A; }
.rules { display: grid; gap: .5rem; padding: 0; list-style: none; margin: 0; }
.rules li { padding-inline-start: 1.4rem; position: relative; font-size: .93rem; }
.rules li::before { content: ""; position: absolute; inset-inline-start: 0; top: .55em; width: 8px; height: 8px; background: var(--saffron); transform: rotate(45deg); }

/* ---- Selfie camera -------------------------------------------------------- */
.cam { position: relative; max-width: 420px; margin-inline: auto; aspect-ratio: 3 / 4; border-radius: var(--radius-l); overflow: hidden; background: #0E1430; }
.cam video, .cam img, .cam canvas { width: 100%; height: 100%; object-fit: cover; }
.cam video { transform: scaleX(-1); }
.cam__oval { position: absolute; inset: 9% 17% 22%; border: 3px dashed rgba(227, 165, 43, .9); border-radius: 50% / 45%; pointer-events: none; }
.cam__count { position: absolute; inset: 0; display: grid; place-items: center; font: 400 5rem/1 var(--font-display); color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.challenge { background: var(--saffron-soft); border: 1px solid #F1DDB0; border-radius: var(--radius-m); padding: .9rem 1rem; text-align: center; font-weight: 600; color: #6B4A0E; }
.challenge span { display: block; font-size: 1.7rem; margin-block-end: .25rem; }

/* ---- Messages ------------------------------------------------------------- */
.thread { display: grid; gap: .75rem; }
.msg { max-width: 85%; padding: .75rem 1rem; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; }
.msg--me { margin-inline-start: auto; background: var(--lapis-soft); border-color: #CBD2EE; }
.msg--staff { border-inline-start: 3px solid var(--saffron); }
.msg__meta { display: block; font-size: .78rem; color: var(--ink-3); margin-block-start: .35rem; }

/* ---- Tables --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: start; font-weight: 600; color: var(--ink-2); background: #FAFBFD; border-block-end: 1px solid var(--line); padding: .7rem .85rem; white-space: nowrap; }
.table td { padding: .7rem .85rem; border-block-end: 1px solid #ECEEF4; vertical-align: middle; }
.table tr:last-child td { border-block-end: 0; }
.table tbody tr:hover { background: #FBFBFE; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.thumb { width: 44px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--porcelain); }
.pager { display: flex; gap: .35rem; justify-content: center; margin-block: 1.25rem; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; background: var(--surface); padding-inline: .5rem; }
.pager span { background: var(--lapis); color: #fff; border-color: var(--lapis); }

/* ---- Contestants gallery ---------------------------------------------- */
.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.person { text-decoration: none; color: var(--ink); }
.person img, .person .ph { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; border-radius: var(--radius-l); background: var(--lapis-soft); }
.person strong { display: block; margin-block-start: .5rem; }
.person span { font-size: .85rem; color: var(--ink-3); }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-block-end: 1.25rem; }
.filters a { text-decoration: none; padding: .45rem .85rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); background: var(--surface); font-size: .9rem; }
.filters a[aria-current="true"] { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.profile { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .profile { grid-template-columns: 1.1fr .9fr; } }
.profile__photos { display: grid; gap: .75rem; grid-template-columns: 2fr 1fr; }
.profile__photos img { border-radius: var(--radius-l); width: 100%; height: 100%; object-fit: cover; }
.profile__photos img:first-child { grid-row: span 2; }

/* ---- Install page -------------------------------------------------------- */
.install { padding: 1.5rem var(--gutter); }
.install__card { max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1.5rem; }
.install__head { display: flex; align-items: center; gap: 1rem; margin-block-end: 1.5rem; }
.install__head h1 { font-size: 1.6rem; margin: 0; }
.install__head p { margin: 0; }
.install__lang { margin-inline-start: auto; }
.checks { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .35rem; margin: 0 0 1.5rem; }
.checks li.ok { color: #0F5E5A; } .checks li.bad { color: var(--pomegranate); font-weight: 600; } .checks li.warn { color: var(--ink-3); }
.install__steps pre { background: var(--porcelain); padding: .75rem; border-radius: var(--radius-m); overflow-x: auto; font-size: .85rem; }

/* ---- Lightbox / modal ------------------------------------------------ */
.lightbox { position: fixed; inset: 0; background: rgba(8, 12, 32, .92); z-index: 100; display: none; place-items: center; padding: 1rem; }
.lightbox.is-open { display: grid; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: var(--radius-m); }
.lightbox button { position: absolute; top: 1rem; inset-inline-end: 1rem; }

/* ---- Misc -------------------------------------------------------------- */
dl.facts { display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: .4rem 1rem; margin: 0; font-size: .95rem; }
dl.facts dt { color: var(--ink-3); overflow-wrap: anywhere; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-2); }
.empty h3 { margin-block-end: .4rem; }
.qr { width: 184px; height: 184px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); }
.code-input { font: 600 1.5rem/1 ui-monospace, monospace !important; letter-spacing: .4em; text-align: center; max-width: 240px; }
.divider { height: 1px; background: var(--line); margin-block: 1.25rem; border: 0; }
@media print { .site-header, .site-footer, .acc-nav, .sidebar { display: none !important; } }
@media (max-width: 639px) {
  .slot { flex-direction: row; }
  .slot__frame { width: 38%; flex: none; aspect-ratio: 3 / 4; }
  .slot__body { flex: 1; min-width: 0; }
}

/* ---- 1.2: invoices, voter -------------------------------------------- */
.doc-page { background: #E9ECF4; }
.doc-bar { background: var(--surface); border-block-end: 1px solid var(--line); padding-block: .6rem; }
.container--doc { max-width: 820px; padding-block: 1.25rem 3rem; }
.invoice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1.5rem; box-shadow: var(--shadow); }
@media (min-width: 700px) { .invoice { padding: 2.5rem; } }
.invoice h1 { margin: 0; font-size: 1.9rem; }
.invoice h2 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; color: var(--ink-3); margin-block-end: .4rem; }
.invoice__head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding-block-end: 1.25rem; border-block-end: 3px solid var(--lapis); }
.invoice__brand { display: flex; gap: .8rem; align-items: flex-start; }
.invoice__brand strong { display: block; font-family: "Marcellus", Georgia, serif; font-size: 1.15rem; color: var(--lapis-deep); font-weight: 400; }
[dir="rtl"] .invoice__brand strong { font-family: var(--font-display); font-weight: 700; }
.invoice__brand span { display: block; font-size: .85rem; color: var(--ink-2); }
.invoice__title { text-align: end; display: grid; gap: .3rem; justify-items: end; }
.invoice__no { font-size: .9rem; color: var(--ink-2); }
.invoice__meta { display: grid; gap: 1rem; padding-block: 1.25rem; }
@media (min-width: 640px) { .invoice__meta { grid-template-columns: 1fr 1fr; } }
.invoice__items { width: 100%; border-collapse: collapse; margin-block: .5rem 1.5rem; }
.invoice__items th, .invoice__items td { padding: .8rem .4rem; text-align: start; border-block-end: 1px solid var(--line); }
.invoice__items thead th { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.invoice__items tfoot th { border: 0; font-size: 1.15rem; color: var(--lapis-deep); }
.invoice__items .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.invoice__pay { background: var(--porcelain); border-radius: var(--radius-m); padding: 1.1rem; }
.invoice__pay h2 { color: var(--lapis-deep); font-size: 1.1rem; }
.invoice__manual { margin-block-start: 1rem; padding-block-start: 1rem; border-block-start: 1px dashed var(--line); }
.invoice__manual h3 { font-size: 1rem; }
.invoice__foot { margin-block-start: 1.5rem; font-size: .8rem; color: var(--ink-3); text-align: center; }
.stamp { display: inline-block; padding: .2rem .7rem; border: 2px solid currentColor; border-radius: 6px; font-weight: 700; font-size: .85rem; letter-spacing: .02em; }
.stamp--sm { padding: .05rem .45rem; font-size: .72rem; border-width: 1.5px; }
.stamp--unpaid { color: #9A6512; }
.stamp--overdue { color: var(--pomegranate); }
.stamp--paid { color: #0F7A74; }
.stamp--cancelled { color: var(--ink-3); text-decoration: line-through; }
.invoice-alert { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--saffron-soft); border: 1px solid #EBCF8F; border-radius: var(--radius-l); padding: 1rem 1.25rem; margin-block-end: 1rem; }
.invoice-alert.is-overdue { background: var(--pomegranate-soft); border-color: #F0BCC9; }
.invoice-alert strong { display: block; color: var(--lapis-deep); }
.invoice-alert span { font-size: .9rem; color: var(--ink-2); }
.inv-actions { gap: .35rem; margin-block: .4rem; }
.inv-actions select, .inv-actions input { margin: 0; min-height: 34px; font-size: .85rem; width: auto; flex: 1 1 120px; padding: .3rem .5rem; }
.inv-line { padding-block: .5rem; border-block-start: 1px solid #ECEEF4; }
.set-group { margin: 1.5rem 0 .25rem; padding-block-start: 1rem; border-block-start: 2px solid var(--lapis-soft); font-size: 1.1rem; }
.set-group:first-of-type { margin-top: 0; border: 0; padding-top: 0; }
@media print {
  .no-print, .doc-bar, .flashes { display: none !important; }
  .doc-page { background: #fff; }
  .invoice { border: 0; box-shadow: none; padding: 0; }
  .container--doc { padding: 0; max-width: none; }
}

/* ---- 1.3: shared widgets (both themes) --------------------------------- */
.glyph { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; }
.btn .glyph { width: 1.15em; height: 1.15em; }
.announce { font-size: .92rem; font-weight: 600; }
.announce.tone-saffron { background: #F6C453; color: #3A2700; }
.announce.tone-turquoise { background: #1F9E98; color: #fff; }
.announce.tone-rose { background: #B0173F; color: #fff; }
.announce.tone-lapis { background: #1D2C6B; color: #fff; }
.announce__in { display: flex; align-items: center; gap: .6rem; min-height: 40px; }
.announce a, .announce span { color: inherit; flex: 1; text-decoration: none; }
.announce a:hover { text-decoration: underline; color: inherit; }
.announce__close { background: none; border: 0; color: inherit; cursor: pointer; padding: .3rem; opacity: .8; }
.announce.is-hidden { display: none; }

/* WhatsApp support */
.wa { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: .75rem; }
.wa--end { inset-inline-end: 16px; }
.wa--start { inset-inline-start: 16px; align-items: flex-start; }
.wa__fab { display: inline-flex; align-items: center; gap: .55rem; min-height: 54px; padding: 0 1.15rem 0 1rem; border: 0; border-radius: 999px; background: #1FAF5A; color: #fff; font: 700 .95rem/1 var(--font-body); box-shadow: 0 10px 28px rgba(16, 120, 60, .35); cursor: pointer; }
.wa__fab .glyph { width: 26px; height: 26px; }
.wa__fab:hover { background: #179A4D; }
@media (max-width: 640px) { .wa__label { display: none; } .wa__fab { width: 56px; padding: 0; justify-content: center; } }
@media (prefers-reduced-motion: no-preference) { .wa__fab { animation: wa-pulse 2.6s ease-out 1.5s 2; } @keyframes wa-pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 175, 90, .55); } 100% { box-shadow: 0 0 0 18px rgba(31, 175, 90, 0); } } }
.wa__panel { width: min(340px, calc(100vw - 32px)); background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 20px 50px rgba(10, 20, 50, .28); border: 1px solid #E3E7F0; }
.wa__head { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; background: linear-gradient(135deg, #128C4A, #1FAF5A); color: #fff; }
.wa__head strong { display: block; font-size: 1rem; }
.wa__head span { font-size: .8rem; opacity: .9; }
.wa__avatar { width: 42px; height: 42px; border-radius: 50%; background: #0F1B4C; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.wa__close { margin-inline-start: auto; background: rgba(255,255,255,.15); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.wa__body { padding: 1rem; background: #ECE5DD url("../img/pattern.svg"); background-size: 64px; }
.wa__bubble { margin: 0; background: #fff; padding: .7rem .9rem; border-radius: 4px 14px 14px 14px; box-shadow: 0 1px 1px rgba(0,0,0,.08); font-size: .93rem; color: #1B1F2E; max-width: 92%; }
[dir="rtl"] .wa__bubble { border-radius: 14px 4px 14px 14px; }
.wa__start { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: .9rem 1rem .4rem; min-height: 46px; border-radius: 999px; background: #1FAF5A; color: #fff; font-weight: 700; text-decoration: none; }
.wa__start:hover { background: #179A4D; color: #fff; }
.wa__note { margin: 0 1rem .9rem; font-size: .75rem; color: #7C819C; text-align: center; }

/* Share */
.share { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1rem 1.1rem; }
.share__title { display: flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--ink-2); margin-block-end: .6rem; }
.share__row { display: flex; flex-wrap: wrap; gap: .4rem; }
.share__btn { display: inline-flex; align-items: center; gap: .35rem; min-height: 38px; padding: 0 .85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .85rem/1 var(--font-body); text-decoration: none; cursor: pointer; }
.share__btn:hover { border-color: var(--lapis); color: var(--lapis); }
.share--wa { color: #128C4A; } .share--tg { color: #1E88C7; } .share--fb { color: #1A5DC2; } .share--x { color: #111; }

/* FAQ accordion & legal pages */
.prose details, .g-qa { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); margin-block-end: .6rem; }
.prose details summary, .g-qa summary { cursor: pointer; padding: .9rem 1rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; color: var(--lapis-deep); }
.prose details summary::-webkit-details-marker, .g-qa summary::-webkit-details-marker { display: none; }
.prose details summary::after, .g-qa summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--saffron-deep); flex: none; }
.prose details[open] summary::after, .g-qa[open] summary::after { content: "–"; }
.prose details > *:not(summary), .g-qa > p { padding: 0 1rem 1rem; margin: 0; }
.prose details > ul, .prose details > ol { padding-inline-start: 2.2rem; }
.prose h2 { font-size: 1.35rem; margin-block: 1.6em .5em; }
.prose .legal-meta { color: var(--ink-3); font-size: .88rem; }
.prose .toc { background: var(--porcelain); border-radius: var(--radius-m); padding: .8rem 1.1rem; }
.prose .toc ol { margin: .3rem 0 0; }
.prose .note { background: var(--saffron-soft); border-inline-start: 4px solid var(--saffron); padding: .8rem 1rem; border-radius: 6px; }
.faq-group { margin-block-start: 1.75rem; }
.faq-group > h2 { margin-block-start: 0; }

/* Maintenance */
.maint { min-height: 100vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: .5rem; padding: 2rem; max-width: 560px; margin: 0 auto; }
.maint p { color: var(--ink-2); }
.maint__links { font-size: .9rem; }
.footer-pages { columns: 2; column-gap: 1.5rem; }
.footer-pages li { break-inside: avoid; }
.site-footer ul.footer-pages { display: block; columns: 2; column-gap: 1.5rem; }
.site-footer ul.footer-pages li { margin-block-end: .55rem; }

/* ---- 2.8 · SHS.confirm(): in-page confirm dialog (replaces native confirm()) ---- */
.shs-confirm { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1rem; }
.shs-confirm[hidden] { display: none; }
.shs-confirm__scrim { position: absolute; inset: 0; background: rgba(10, 12, 20, .45); opacity: 0; transition: opacity .16s ease-out; }
.shs-confirm__box { position: relative; width: min(100%, 420px); background: var(--surface, #fff); color: var(--text, #15171C); border: 1px solid var(--line, rgba(0,0,0,.08)); border-radius: 14px; padding: 1.1rem 1.2rem 1rem; box-shadow: 0 24px 60px rgba(0,0,0,.25); opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .16s ease-out, transform .2s ease-out; }
.shs-confirm.is-open .shs-confirm__scrim, .shs-confirm.is-open .shs-confirm__box { opacity: 1; transform: none; }
.shs-confirm__title { margin: 0 0 .35rem; font-size: 1.05rem; font-weight: 800; }
.shs-confirm__msg { margin: 0 0 1rem; line-height: 1.6; white-space: pre-line; }
.shs-confirm__acts { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.shs-confirm__acts .btn { min-width: 96px; }
.shs-confirm__acts .btn[hidden] { display: none; }
.shs-confirm-lock { overflow: hidden; }
[data-mode="dark"] .shs-confirm__box { background: var(--surface, #15171C); color: var(--text, #F3F4F6); border-color: rgba(255,255,255,.1); }
@media (prefers-reduced-motion: reduce) { .shs-confirm__scrim, .shs-confirm__box { transition: none; } }

/* ---- 2.8 · member menu in the public header (layout only; themes colour it) ---- */
.umenu__n { margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--pomegranate, #B0173F); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.umenu__btn .umenu__n { margin-inline-start: 0; }
.umenu__panel a .umenu__n { margin-inline-start: auto; }
.umenu__out.umenu__danger { color: var(--pomegranate, #B0173F); }
