/* توأم الميلاد: التصميم.
   الفكرة: كل شخص «تذكرة» مثقوبة، والقسيمة السفلية تحمل السنة، لأنها الشيء الوحيد الذي يختلف بين التوائم.
   الألوان كلها متغيرات في :root، والوضع الداكن يعيد تعريفها فقط. */
:root {
  --bg: #edf4f2;
  --card: #ffffff;
  --soft: #e1edea;
  --line: #cfe0dc;
  --ink: #0b2229;
  --ink-2: #4d646b;
  --edge: #cfe0dc;
  --lift: rgba(6, 52, 58, 0.14);
  --shadow: 0 1px 2px rgba(6, 52, 58, 0.08), 0 14px 28px -16px rgba(6, 52, 58, 0.28);
  --gold: #ffc857;
  --gold-2: #ffab3d;
  --on-gold: #2b1d00;
  --rose: #ff5f8f;
  --mint: #8be8d4;
  --hero-1: #042a33;
  --hero-2: #09474f;
  --hero-3: #11705f;
  --hero-ink: #ffffff;
  --hero-ink-2: rgba(255, 255, 255, 0.84);
  --hero-err: #ffb4ab;
  --danger: #b3261e;
  --focus: #3f4cc4;
  --tint-mix: 0%;
  --c-actors: #d63a64;
  --c-singers: #4a57d0;
  --c-creators: #4f7f00;
  --c-arts: #0a7fa6;
  --c-science: #087a5c;
  --c-politics: #9c6200;
  --c-sports: #c2481a;
  --c-letters: #7b4fcb;
  --c-other: #5e6b7b;
  --display: 'Reem Kufi', 'IBM Plex Sans Arabic', 'Noto Kufi Arabic', Tahoma, system-ui, sans-serif;
  --body: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #061317; --card: #0e1f26; --soft: #14303a; --line: #1f3a45; --ink: #e6f2f1; --ink-2: #9db6ba;
    --edge: #21404b; --lift: rgba(0, 0, 0, 0.5);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 16px 30px -16px rgba(0, 0, 0, 0.75);
    --danger: #ff8a80; --focus: #aab3ff; --tint-mix: 42%; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #061317; --card: #0e1f26; --soft: #14303a; --line: #1f3a45; --ink: #e6f2f1; --ink-2: #9db6ba;
  --edge: #21404b; --lift: rgba(0, 0, 0, 0.5);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 16px 30px -16px rgba(0, 0, 0, 0.75);
  --danger: #ff8a80; --focus: #aab3ff; --tint-mix: 42%; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.65;
  padding-inline: 16px; padding-block: 16px 40px;
}
a { color: inherit; }
img { max-width: 100%; }
.app { max-width: 940px; margin-inline: auto; display: flex; flex-direction: column; gap: 26px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.hero :focus-visible { outline-color: var(--gold); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* لون الفئة: --cat للتعبئة، و--cat-ink للنص والأيقونات (يُفتَّح في الوضع الداكن للحفاظ على التباين) */
.f-actors { --cat: var(--c-actors); --cat-ink: color-mix(in srgb, var(--c-actors), #ffffff var(--tint-mix)); }
.f-singers { --cat: var(--c-singers); --cat-ink: color-mix(in srgb, var(--c-singers), #ffffff var(--tint-mix)); }
.f-creators { --cat: var(--c-creators); --cat-ink: color-mix(in srgb, var(--c-creators), #ffffff var(--tint-mix)); }
.f-arts { --cat: var(--c-arts); --cat-ink: color-mix(in srgb, var(--c-arts), #ffffff var(--tint-mix)); }
.f-science { --cat: var(--c-science); --cat-ink: color-mix(in srgb, var(--c-science), #ffffff var(--tint-mix)); }
.f-politics { --cat: var(--c-politics); --cat-ink: color-mix(in srgb, var(--c-politics), #ffffff var(--tint-mix)); }
.f-sports { --cat: var(--c-sports); --cat-ink: color-mix(in srgb, var(--c-sports), #ffffff var(--tint-mix)); }
.f-letters { --cat: var(--c-letters); --cat-ink: color-mix(in srgb, var(--c-letters), #ffffff var(--tint-mix)); }
.f-other { --cat: var(--c-other); --cat-ink: color-mix(in srgb, var(--c-other), #ffffff var(--tint-mix)); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 34px; padding: 22px 26px 26px; color: var(--hero-ink);
  background:
    radial-gradient(640px 340px at 100% -12%, rgba(255, 200, 87, 0.34), transparent 62%),
    radial-gradient(560px 320px at 0% 118%, rgba(255, 95, 143, 0.26), transparent 62%),
    linear-gradient(135deg, var(--hero-1) 0%, var(--hero-2) 55%, var(--hero-3) 100%);
  box-shadow: 0 34px 60px -36px rgba(4, 42, 51, 0.95);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.4px, transparent 2px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%); mask-image: linear-gradient(180deg, #000, transparent 70%);
}
.hero > * { position: relative; }
.hero > .hero-art { position: absolute; inset: 0; pointer-events: none; }
.sp { position: absolute; background-position: center; background-size: contain; background-repeat: no-repeat; }
.sp.a { top: 20px; right: 44%; width: 20px; height: 20px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 7 17 11 24 12 17 13 13 17 12 24 11 17 7 13 0 12 7 11 11 7 12 0Z' fill='%23ffc857'/%3E%3C/svg%3E"); filter: drop-shadow(0 0 6px rgba(255, 200, 87, 0.9)); }
.sp.b { top: 36%; left: 33%; width: 12px; height: 12px; opacity: 0.8; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 7 17 11 24 12 17 13 13 17 12 24 11 17 7 13 0 12 7 11 11 7 12 0Z' fill='%23ffffff'/%3E%3C/svg%3E"); }
.sp.c { bottom: 36%; right: 6%; width: 15px; height: 15px; opacity: 0.95; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 7 17 11 24 12 17 13 13 17 12 24 11 17 7 13 0 12 7 11 11 7 12 0Z' fill='%23ff7aa2'/%3E%3C/svg%3E"); }
.cf { position: absolute; border-radius: 2px; opacity: 0.9; }
.cf.c1 { top: 22px; left: 96px; width: 11px; height: 5px; background: var(--gold); transform: rotate(32deg); }
.cf.c2 { top: 78px; left: 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--rose); }
.cf.c3 { top: 150px; left: 74px; width: 12px; height: 5px; background: var(--mint); transform: rotate(-24deg); }
.cf.c4 { top: 14px; left: 40%; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); opacity: 0.7; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin-bottom: 16px; }
.brand svg { width: 30px; height: 30px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.hero-copy { min-width: 0; }
h1 { margin: 0 0 8px; font-family: var(--display); font-weight: 700; font-size: clamp(1.95rem, 7vw, 3.2rem); line-height: 1.2; text-wrap: balance; }
.lead { margin: 0; color: var(--hero-ink-2); max-width: 38ch; }

/* ورقة التقويم: ورقتان خلفها كأنها رزمة، وثقبان للتعليق */
.leaf {
  position: relative; width: 118px; flex: none; border-radius: 24px; overflow: hidden; text-align: center; transform-origin: 50% 0;
  background: rgba(255, 255, 255, 0.13); border: 1px solid rgba(255, 255, 255, 0.32);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 7px 0 -3px rgba(255, 255, 255, 0.16), 0 14px 0 -6px rgba(255, 255, 255, 0.09), 0 28px 34px -18px rgba(0, 0, 0, 0.75);
}
.leaf-head { position: relative; background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: var(--on-gold); font-family: var(--display); font-weight: 700; padding: 11px 0 4px; }
.leaf-head::before, .leaf-head::after { content: ""; position: absolute; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: rgba(4, 42, 51, 0.55); }
.leaf-head::before { inset-inline-start: 22%; }
.leaf-head::after { inset-inline-end: 22%; }
.leaf-day { font-weight: 600; font-size: 3.6rem; line-height: 1; padding: 8px 0 14px; font-variant-numeric: tabular-nums; }

.form {
  margin-top: 22px; padding: 14px; border-radius: 24px; display: grid; gap: 12px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.fields { display: grid; grid-template-columns: 0.9fr 1.4fr 1.1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 0.8rem; color: var(--hero-ink-2); font-weight: 500; }
.field select, .field input {
  width: 100%; height: 50px; font: inherit; font-weight: 500; color: #0b2229; background: #ffffff;
  border: 0; border-radius: 14px; padding-inline: 12px; font-variant-numeric: tabular-nums; color-scheme: light;
}
button { font: inherit; cursor: pointer; }
.btn {
  height: 52px; border: 0; border-radius: 16px; font-weight: 700; font-size: 1.02rem; padding-inline: 22px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: var(--on-gold);
  box-shadow: 0 12px 24px -12px rgba(255, 171, 61, 0.95); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 16px 28px -12px rgba(255, 171, 61, 1); }
.btn:active { transform: translateY(1px); }
.btn.sm { height: 42px; font-size: 0.92rem; padding-inline: 16px; border-radius: 12px; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); }
.status:empty { display: none; }
.status { margin: 0; font-size: 0.9rem; color: var(--hero-ink-2); }
.status.err { color: var(--hero-err); font-weight: 500; }

/* شريط معلومات اليوم: خلية لكل معلومة تفصلها خطوط منقطة كحافة التذكرة */
.tiles {
  margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); overflow: hidden; border-radius: 22px;
  background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tile { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 13px 16px; }
.tile + .tile::before { content: ""; position: absolute; inset-block: 12px; inset-inline-start: 0; border-inline-start: 2px dotted rgba(255, 255, 255, 0.32); }
.t-l { font-size: 0.78rem; color: var(--hero-ink-2); }
.t-v { font-family: var(--display); font-weight: 700; font-size: 1.2rem; line-height: 1.35; overflow-wrap: anywhere; }
.t-s { font-size: 0.74rem; color: var(--hero-ink-2); }

/* الخط الزمني داخل الواجهة العلوية */
.timeline { margin-top: 14px; padding: 4px 2px 0; }
.tl-line { position: relative; height: 26px; margin-inline: 6px; }
.tl-line::before { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: rgba(255, 255, 255, 0.26); }
.tl-dot {
  position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 0; margin-inline-start: -5px; border-radius: 50%;
  background: color-mix(in srgb, var(--cat), #ffffff 38%); box-shadow: 0 0 0 2px var(--hero-2);
}
.tl-me { position: absolute; top: 1px; bottom: 1px; width: 4px; margin-inline-start: -2px; border-radius: 2px; background: linear-gradient(var(--gold), var(--gold-2)); box-shadow: 0 0 0 2px var(--hero-2), 0 0 10px rgba(255, 200, 87, 0.8); }
.tl-ends { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; font-size: 0.8rem; color: var(--hero-ink-2); font-variant-numeric: tabular-nums; }
.tl-key { display: inline-flex; align-items: center; gap: 6px; color: var(--hero-ink); }
.tl-key b { width: 4px; height: 14px; border-radius: 2px; background: linear-gradient(var(--gold), var(--gold-2)); }

/* ---------- sections ---------- */
.block { display: flex; flex-direction: column; gap: 14px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.sec-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1.35; }
.star-t::before {
  content: ""; display: inline-block; width: 0.8em; height: 0.8em; margin-inline-end: 0.45em; vertical-align: -0.02em; background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 7 17 11 24 12 17 13 13 17 12 24 11 17 7 13 0 12 7 11 11 7 12 0Z' fill='%23ffab3d'/%3E%3C/svg%3E");
}
.count { font-weight: 600; font-size: 0.85rem; background: color-mix(in srgb, var(--gold) 34%, var(--card)); color: var(--ink); border-radius: 999px; padding: 1px 11px; font-variant-numeric: tabular-nums; }
.rule { flex: 1; min-width: 18px; border-top: 2px dotted var(--line); }
.tool {
  position: relative; display: inline-flex; gap: 8px; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 0.88rem; font-weight: 500;
}
.tool svg { width: 16px; height: 16px; }
.tool[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tool .pip { width: 8px; height: 8px; border-radius: 50%; background: var(--rose); }
.sec-sub { margin: 0; flex-basis: 100%; color: var(--ink-2); font-size: 0.9rem; }

.filters { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 22px; background: var(--soft); border: 1px dashed var(--line); }
.arbar { display: flex; }
.switch {
  display: inline-flex; gap: 10px; align-items: center; min-height: 38px; padding: 0 14px 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 0.88rem; font-weight: 500;
}
.switch .trk { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line); transition: background 0.15s; }
.switch .trk::after {
  content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: inset-inline-start 0.15s;
}
.switch[aria-checked="true"] .trk { background: var(--c-science); }
.switch[aria-checked="true"] .trk::after { inset-inline-start: 16px; }
.switch .n { opacity: 0.7; font-size: 0.82rem; }
.switch .n:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; gap: 8px; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 0.9rem; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:not(.all)[aria-pressed="true"] { background: var(--cat); color: #ffffff; border-color: var(--cat); }
.ic { display: inline-flex; flex: none; width: 16px; height: 16px; color: var(--cat-ink); }
.ic svg { width: 100%; height: 100%; }
.chip:not(.all)[aria-pressed="true"] .ic { color: #ffffff; }
.chip .n { opacity: 0.7; font-variant-numeric: tabular-nums; }

/* ---------- ticket cards ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.grid.feat { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.card {
  position: relative; min-width: 0; display: flex; transition: transform 0.18s ease, filter 0.18s ease;
  filter: drop-shadow(0 1px 0 var(--edge)) drop-shadow(0 -1px 0 var(--edge)) drop-shadow(1px 0 0 var(--edge)) drop-shadow(-1px 0 0 var(--edge)) drop-shadow(0 14px 14px var(--lift));
}
.card:hover {
  transform: translateY(-3px);
  filter: drop-shadow(0 1px 0 var(--edge)) drop-shadow(0 -1px 0 var(--edge)) drop-shadow(1px 0 0 var(--edge)) drop-shadow(-1px 0 0 var(--edge)) drop-shadow(0 20px 18px color-mix(in srgb, var(--cat) 24%, transparent));
}
.tkt {
  --cut: 64px; position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: var(--card);
  -webkit-mask: radial-gradient(circle 10px at 0 calc(100% - var(--cut)), #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 10px at 100% calc(100% - var(--cut)), #0000 97%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 10px at 0 calc(100% - var(--cut)), #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 10px at 100% calc(100% - var(--cut)), #0000 97%, #000) right / 51% 100% no-repeat;
}
.tkt::before {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 74px; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--cat) 20%, transparent) 1.3px, transparent 1.9px); background-size: 12px 12px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent); mask-image: linear-gradient(180deg, #000, transparent);
}
.tkt > * { position: relative; }
.body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 16px; }
.who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ava {
  position: relative; width: 60px; height: 60px; flex: none; border-radius: 20px; overflow: hidden; display: grid; place-items: center;
  color: #ffffff; font-family: var(--display); font-weight: 700; font-size: 1.55rem; line-height: 1;
  background: linear-gradient(135deg, var(--cat), color-mix(in srgb, var(--cat) 60%, #000));
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5px color-mix(in srgb, var(--cat) 38%, transparent), 0 12px 18px -10px var(--cat);
}
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.tx { min-width: 0; }
.name { margin: 0; font-size: 1.12rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.name a { text-decoration: none; }
.name a:hover { text-decoration: underline; text-underline-offset: 4px; }
.desc { margin: 0; color: var(--ink-2); font-size: 0.92rem; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: auto; }
.cat-chip {
  display: inline-flex; gap: 6px; align-items: center; font-size: 0.8rem; padding: 3px 11px 3px 10px; border-radius: 999px; color: var(--ink);
  background: color-mix(in srgb, var(--cat) 11%, var(--card)); border: 1px solid color-mix(in srgb, var(--cat) 30%, var(--line));
}
.cat-chip .ic { width: 14px; height: 14px; }
.rel, .wd { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; padding: 3px 10px; border-radius: 999px; color: var(--ink-2); background: var(--soft); }
.wd { color: var(--ink); background: color-mix(in srgb, var(--gold) 38%, var(--card)); font-weight: 500; }
.wd svg { width: 13px; height: 13px; }

/* القسيمة: السنة بحجم كبير، وبينها وبين البطاقة خط ثقب منقط */
.stub {
  position: relative; height: var(--cut); flex: none; display: flex; align-items: center; gap: 14px; padding-inline: 22px;
  background: color-mix(in srgb, var(--cat) 9%, var(--card));
}
.stub::before { content: ""; position: absolute; top: -1px; inset-inline: 16px; border-top: 2px dashed color-mix(in srgb, var(--cat) 34%, var(--line)); }
.date { display: inline-flex; align-items: baseline; gap: 10px; min-width: 0; }
.date b { font-weight: 700; font-size: 2.1rem; line-height: 1; letter-spacing: 0.01em; color: var(--cat-ink); font-variant-numeric: tabular-nums; }
.dm { font-size: 0.9rem; color: var(--ink-2); white-space: nowrap; }
.stub .lbl { margin-inline-start: auto; text-align: end; font-size: 0.78rem; font-weight: 600; line-height: 1.35; max-width: 11em; }

/* التطابق التام: تذكرة ذهبية */
.card.exact {
  --edge: #f2a634; --lift: rgba(255, 150, 40, 0.34);
  filter: drop-shadow(0 2px 0 var(--edge)) drop-shadow(0 -2px 0 var(--edge)) drop-shadow(2px 0 0 var(--edge)) drop-shadow(-2px 0 0 var(--edge)) drop-shadow(0 18px 16px var(--lift));
}
.card.exact:hover { filter: drop-shadow(0 2px 0 var(--edge)) drop-shadow(0 -2px 0 var(--edge)) drop-shadow(2px 0 0 var(--edge)) drop-shadow(-2px 0 0 var(--edge)) drop-shadow(0 24px 20px var(--lift)); }
.exact .tkt::before { display: none; }
.strip {
  display: flex; align-items: center; gap: 8px; padding: 8px 18px; font-weight: 700; font-size: 0.88rem;
  background: linear-gradient(90deg, var(--gold), var(--gold-2)); color: var(--on-gold);
}
.strip svg { width: 16px; height: 16px; }
.exact .body { padding-top: 16px; }
.exact .ava { width: 66px; height: 66px; border-radius: 22px; font-size: 1.8rem; }
.exact .stub { background: linear-gradient(135deg, #ffe49a, var(--gold) 55%, var(--gold-2)); color: var(--on-gold); }
.exact .stub::before { border-top-color: rgba(43, 29, 0, 0.38); }
.exact .date b { color: var(--on-gold); }
.exact .dm { color: rgba(43, 29, 0, 0.78); }
.exact .stub .lbl { color: var(--on-gold); }

/* تطابق وحيد يملأ العرض: تذكرة أفقية، والقسيمة الذهبية على الجانب */
.card.exact { container-type: inline-size; }
@container (min-width: 620px) {
  .exact .tkt {
    --sw: 260px; display: grid; grid-template-columns: 1fr var(--sw); grid-template-rows: auto 1fr; grid-template-areas: "strip stub" "body stub";
    -webkit-mask: radial-gradient(circle 11px at var(--sw) 0, #0000 97%, #000) top / 100% 51% no-repeat, radial-gradient(circle 11px at var(--sw) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
    mask: radial-gradient(circle 11px at var(--sw) 0, #0000 97%, #000) top / 100% 51% no-repeat, radial-gradient(circle 11px at var(--sw) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
  }
  .exact .strip { grid-area: strip; }
  .exact .body { grid-area: body; justify-content: center; gap: 16px; padding: 24px 30px; }
  .exact .ava { width: 88px; height: 88px; border-radius: 28px; font-size: 2.3rem; }
  .exact .who { gap: 20px; }
  .exact .name { font-size: 1.55rem; font-family: var(--display); font-weight: 700; }
  .exact .desc { font-size: 1rem; }
  .exact .stub { grid-area: stub; height: auto; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 20px 18px; text-align: center; }
  .exact .stub::before { inset: 18px -1px 18px auto; border-top: 0; border-right: 2px dashed rgba(43, 29, 0, 0.38); }
  .exact .date { flex-direction: column; align-items: center; gap: 4px; }
  .exact .date b { font-size: 3.2rem; }
  .exact .stub .lbl { margin: 0; max-width: none; text-align: center; font-size: 0.85rem; }
}

/* الشخصية المميزة: أول عنصر في الشبكة، بعرض عمودين */
.spot {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 16px; border-radius: 26px;
  background: var(--card); border: 1px solid var(--edge); box-shadow: var(--shadow); grid-column: 1 / -1;
}
.spot::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(460px 220px at 100% 0%, color-mix(in srgb, var(--cat) 20%, transparent), transparent 70%);
}
.spot-wm svg { width: 100%; height: 100%; }
.spot > * { position: relative; }
.spot > .spot-wm { position: absolute; inset-block-end: -20px; inset-inline-end: 24px; width: 190px; height: 190px; color: var(--cat); opacity: 0.09; pointer-events: none; }
.spot-photo {
  position: relative; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; display: grid; place-items: center; color: #ffffff;
  font-family: var(--display); font-weight: 700; font-size: 3rem; line-height: 1;
  background: linear-gradient(135deg, var(--cat), color-mix(in srgb, var(--cat) 60%, #000)); box-shadow: 0 18px 30px -18px var(--cat);
}
.spot-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.spot-body { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; }
.spot-kicker { align-self: flex-start; font-size: 0.78rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; color: var(--on-gold); background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.spot-name { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 4.5vw, 1.9rem); line-height: 1.3; overflow-wrap: anywhere; }
.spot-name a { text-decoration: none; }
.spot-name a:hover { text-decoration: underline; text-underline-offset: 5px; }
.spot-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 4px; }
.spot-meta .date b { font-size: 1.6rem; }

.sk {
  position: relative; overflow: hidden; height: 168px; border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 18px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.sk i { display: block; border-radius: 10px; background: var(--soft); }
.sk-top { display: flex; align-items: center; gap: 14px; }
.sk-ava { width: 60px; height: 60px; flex: none; border-radius: 20px; }
.sk-lines { flex: 1; display: grid; gap: 10px; }
.sk-lines i { height: 12px; }
.sk-lines i + i { width: 62%; }
.sk-foot { height: 26px; width: 55%; margin-top: auto; }
.empty { grid-column: 1 / -1; padding: 28px 16px; border: 2px dotted var(--line); border-radius: 22px; color: var(--ink-2); text-align: center; background: var(--card); display: grid; gap: 12px; justify-items: center; }
.more { display: flex; justify-content: center; }

/* ---------- ads ---------- */
.ad { min-height: 120px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.ad[hidden] { display: none; }
.ad-label { font-size: 0.72rem; color: var(--ink-2); letter-spacing: 0.04em; }
.ad-body { min-width: 0; flex: 1; display: flex; justify-content: center; align-items: center; }
.consent {
  position: fixed; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 50; max-width: 620px; margin-inline: auto;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
  display: grid; gap: 10px;
}
.consent[hidden] { display: none; }
.consent p { margin: 0; font-size: 0.9rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.toast {
  position: fixed; inset-inline: 16px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); margin-inline: auto; width: fit-content; max-width: 90vw; z-index: 60;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 0.9rem; font-weight: 500; box-shadow: 0 16px 30px -14px rgba(0, 0, 0, 0.6);
}
.toast[hidden] { display: none; }

/* ---------- footer and static pages ---------- */
.foot { display: grid; gap: 10px; justify-items: center; text-align: center; color: var(--ink-2); font-size: 0.85rem; padding-top: 6px; }
.foot::before {
  content: ""; width: min(240px, 70%); height: 16px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C13 7 17 11 24 12 17 13 13 17 12 24 11 17 7 13 0 12 7 11 11 7 12 0Z' fill='%23ffab3d'/%3E%3C/svg%3E") center / 16px 16px no-repeat,
    linear-gradient(90deg, var(--line) 0 40%, transparent 40% 60%, var(--line) 60% 100%) center / 100% 2px no-repeat;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; }
.foot nav a, .foot nav button { color: var(--ink); background: none; border: 0; padding: 4px 2px; font-size: 0.9rem; font-weight: 500; text-underline-offset: 4px; }
.foot nav button[hidden] { display: none; }
.foot p { margin: 0; max-width: 60ch; }
.prose { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: var(--shadow); max-width: 74ch; width: 100%; margin-inline: auto; }
.prose h2 { font-family: var(--display); font-size: 1.25rem; margin: 1.6em 0 0.4em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-inline-start: 1.2em; }
.prose a { color: var(--c-science); text-underline-offset: 3px; }

.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -16px; width: 8px; height: 14px; border-radius: 2px; opacity: 0; animation: fall 2.4s ease-in forwards; }
@keyframes fall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--dx, 0), 105vh, 0) rotate(var(--rot, 360deg)); }
}
@keyframes shimmer { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
@keyframes tear { from { transform: perspective(520px) rotateX(-78deg); opacity: 0.2; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .sk::after {
    content: ""; position: absolute; inset: 0; transform: translateX(100%);
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 7%, transparent), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
  }
  .leaf.tear { animation: tear 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
  .confetti { display: none; }
  .btn { transition: none; }
  .switch .trk, .switch .trk::after { transition: none; }
}
@media (min-width: 600px) {
  .spot { grid-column: span 2; }
}
@media (max-width: 460px) {
  .hero { padding: 18px 16px 18px; border-radius: 28px; }
  .leaf { width: 92px; border-radius: 20px; }
  .leaf-day { font-size: 2.8rem; padding: 6px 0 10px; }
  .form { padding: 12px; margin-top: 18px; }
  .fields { gap: 8px; }
  .sec-title { font-size: 1.3rem; }
  #restBox .sec-head .rule { flex: 0 0 100%; min-width: 100%; height: 0; border: 0; }
  #restBox .sec-head .tool { flex: 1 1 calc(50% - 6px); max-width: calc(50% - 6px); justify-content: center; }
  .prose { padding: 18px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile::before { display: none; }
  .t-wd { order: 1; }
  .t-age { order: 2; }
  .t-age::before { display: block; }
  .t-hj { order: 3; grid-column: 1 / -1; }
  .t-next { order: 4; grid-column: 1 / -1; }
  .t-hj, .t-next { border-top: 2px dotted rgba(255, 255, 255, 0.28); }
  .spot { grid-template-columns: 104px 1fr; gap: 14px; padding: 14px; border-radius: 22px; }
  .spot-photo { font-size: 2.2rem; border-radius: 18px; }
  .spot > .spot-wm { width: 120px; height: 120px; inset-inline-end: 12px; }
  .sp.b, .cf.c3 { display: none; }
}
