/* توأم الميلاد: التصميم.
   الفكرة: كل شخص «تذكرة» مثقوبة، والقسيمة السفلية تحمل السنة، لأنها الشيء الوحيد الذي يختلف بين التوائم.
   الألوان كلها متغيرات في :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; }

/* ---------- حقائق اليوم، الأحداث، الفهرس، التنقل ---------- */
.facts-body {
  background: var(--card); border: 1px solid var(--line); border-inline-start: 5px solid var(--gold-2); border-radius: 22px;
  padding: 18px 20px; box-shadow: var(--shadow); display: grid; gap: 12px;
}
.facts-body p { margin: 0; font-size: 1.05rem; line-height: 1.85; max-width: 68ch; overflow-wrap: anywhere; }
.facts-body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; max-width: 68ch; }
.facts-body li { position: relative; padding-inline-start: 22px; color: var(--ink-2); line-height: 1.8; overflow-wrap: anywhere; }
.facts-body li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: 0.7em; width: 9px; height: 9px; border-radius: 3px; transform: rotate(45deg);
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
}

.ev-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ev {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
}
.ev-y {
  font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.2; text-align: center; padding: 8px 4px;
  border-radius: 12px; background: var(--soft); font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.ev-b { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.ev-b p { margin: 0; line-height: 1.75; overflow-wrap: anywhere; }
.ev-l { font-size: 0.85rem; color: var(--ink-2); text-underline-offset: 4px; }
.ev.me { border-color: var(--gold-2); background: color-mix(in srgb, var(--gold) 16%, var(--card)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 45%, transparent); }
.ev.me .ev-y { background: linear-gradient(var(--gold), var(--gold-2)); color: var(--on-gold); }
.ev-tag { font-size: 0.78rem; font-weight: 600; padding: 1px 10px; border-radius: 999px; background: var(--rose); color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ev-tag { background: #b83266; }
}
:root[data-theme="dark"] .ev-tag { background: #b83266; }

.idx-list { margin: 0; padding: 14px 18px; list-style: none; columns: 2 200px; column-gap: 24px; font-size: 0.92rem; line-height: 1.9; background: var(--card); border: 1px solid var(--line); border-radius: 22px; }
.idx-list li { break-inside: avoid; overflow-wrap: anywhere; }
.idx-list a { text-underline-offset: 4px; text-decoration-color: var(--line); }
.idx-list a:hover { text-decoration-color: currentColor; }
.idx-list span { color: var(--ink-2); font-size: 0.82rem; font-variant-numeric: tabular-nums; margin-inline-start: 4px; }

.daynav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.daynav a {
  display: grid; gap: 2px; padding: 12px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); text-decoration: none; min-height: 64px; align-content: center;
}
.daynav a:hover { border-color: var(--gold-2); }
.daynav a[rel="next"] { text-align: end; }
.daynav small { color: var(--ink-2); font-size: 0.78rem; }
.daynav span { font-family: var(--display); font-weight: 700; font-size: 1.1rem; }

/* ---------- الجنسية وحسابات التواصل على البطاقة ---------- */
.cc { display: inline-flex; align-items: center; font-size: 0.78rem; padding: 3px 10px; border-radius: 999px; color: var(--ink); background: color-mix(in srgb, var(--mint) 34%, var(--card)); font-weight: 500; }
.soc { display: inline-flex; gap: 4px; }
.soc a { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--ink-2); background: var(--soft); }
.soc a:hover { color: var(--ink); background: color-mix(in srgb, var(--gold) 40%, var(--card)); }
.soc svg { width: 15px; height: 15px; }

/* ---------- مشاهير عرب ---------- */
.arab-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.agroup { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; }
.agroup h3 { margin: 0 0 6px; font-family: var(--display); font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.agroup h3 a { text-underline-offset: 5px; text-decoration-color: var(--gold-2); }
.agroup h3 span, .mgroup h3 span { font-family: var(--body); font-size: 0.8rem; font-weight: 600; padding: 0 9px; border-radius: 999px; background: color-mix(in srgb, var(--mint) 34%, var(--card)); }
.agroup ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 0.92rem; line-height: 1.8; }
.agroup li span { color: var(--ink-2); font-size: 0.82rem; margin-inline-start: 4px; font-variant-numeric: tabular-nums; }
.agroup a, .idx-list span a { text-underline-offset: 4px; text-decoration-color: var(--line); }

/* تاريخ داخل خانة السنة (أحداث السنة) */
.ev-list.dated .ev { grid-template-columns: 104px minmax(0, 1fr); }
.ev-y.ev-d { font-size: 0.9rem; line-height: 1.3; text-decoration: none; color: inherit; }
a.ev-y.ev-d:hover { background: color-mix(in srgb, var(--gold) 40%, var(--card)); }
.yearbox .more .btn { display: inline-flex; align-items: center; height: 44px; text-decoration: none; }

/* ---------- صفحات التصفح (الأشهر والسنوات والدول) ---------- */
.phero {
  position: relative; overflow: hidden; border-radius: 30px; padding: 22px 26px 26px; color: var(--hero-ink);
  background: radial-gradient(560px 300px at 100% -12%, rgba(255, 200, 87, 0.3), transparent 62%), linear-gradient(135deg, var(--hero-1) 0%, var(--hero-2) 55%, var(--hero-3) 100%);
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.phero .brand { margin-bottom: 6px; }
.phero .lead { margin-bottom: 12px; }
.phero .btn { display: inline-flex; align-items: center; height: 46px; text-decoration: none; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 0.85rem; color: var(--hero-ink-2); }
.crumbs a { color: var(--hero-ink); text-underline-offset: 3px; }
.crumbs > * + *::before { content: "/"; margin-inline: 8px; opacity: 0.6; }
.list-main { display: flex; flex-direction: column; gap: 22px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.mday { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.mday h2 { margin: 0; font-family: var(--display); font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.mday h2 a { text-decoration: none; }
.mday h2 a:hover { text-decoration: underline; text-underline-offset: 5px; }
.mday ul { margin: 0; padding: 0; list-style: none; font-size: 0.92rem; line-height: 1.8; }
.mday li span, .mday .dl { color: var(--ink-2); font-size: 0.82rem; margin-inline-start: 4px; font-variant-numeric: tabular-nums; }
.mday li a { text-underline-offset: 4px; text-decoration-color: var(--line); }
.go { margin-top: auto; font-size: 0.85rem; font-weight: 600; color: var(--ink); text-underline-offset: 4px; text-decoration-color: var(--gold-2); }
.mgroup + .mgroup { margin-top: 14px; }
.mgroup h3 { margin: 0 0 8px; font-family: var(--display); font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.idx-list .dl { color: var(--ink-2); font-size: 0.82rem; margin-inline-start: 4px; text-underline-offset: 4px; text-decoration-color: var(--line); font-variant-numeric: tabular-nums; }
.ygroup h2 { margin: 0 0 10px; font-family: var(--display); font-size: 1.2rem; }
.ygroup + .ygroup { margin-top: 18px; }
.ylinks { display: flex; flex-wrap: wrap; gap: 8px; }
.ylinks a { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.ylinks a:hover { border-color: var(--gold-2); }
.ylinks span { font-size: 0.75rem; font-weight: 500; color: var(--ink-2); }

/* شريط التصفح في التذييل */
.browse { display: grid; gap: 8px; justify-items: center; }
.browse-months, .browse-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.browse a { color: var(--ink); font-size: 0.88rem; text-underline-offset: 4px; text-decoration-color: var(--line); }
.browse-more a { font-weight: 600; text-decoration-color: var(--gold-2); }

/* ---------- شريط «ماذا حدث يوم ولادتك؟» أعلى الصفحة ---------- */
.hist .sec-head { position: relative; }
.hs-nav { display: flex; gap: 6px; }
.hs-b { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: grid; place-items: center; }
.hs-b svg { width: 16px; height: 16px; }
.hs-b:disabled { opacity: 0.35; }
.hs {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 2px; padding: 4px 2px 12px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.hc {
  flex: 0 0 min(78%, 272px); scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px 16px 16px; box-shadow: var(--shadow); min-height: 200px;
}
.hc-tag { font-size: 0.75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--soft); color: var(--ink-2); }
.hc-when { font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.3; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
a.hc-when:hover { text-decoration: underline; text-underline-offset: 5px; }
.hc-t { margin: 0; line-height: 1.7; font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hc-l { margin-top: auto; font-size: 0.82rem; color: var(--ink-2); text-underline-offset: 4px; }
.hc.gold { border-color: var(--gold-2); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 30%, var(--card)), var(--card) 70%); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 45%, transparent), var(--shadow); }
.hc.gold .hc-tag { background: var(--rose); color: #fff; }
.hc.yr .hc-tag { background: color-mix(in srgb, var(--mint) 45%, var(--card)); color: var(--ink); }
.hc.end { justify-content: center; align-items: stretch; background: var(--soft); box-shadow: none; border-style: dashed; }
.hc.end .btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; height: auto; min-height: 44px; padding-block: 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hc.gold .hc-tag { background: #b83266; } }
:root[data-theme="dark"] .hc.gold .hc-tag { background: #b83266; }
@media (max-width: 460px) { .hs-nav { display: none; } }

/* ---------- بطاقة «سنة ميلادك في سطور» داخل شبكة البطاقات ---------- */
.yearcard {
  position: relative; min-width: 0; display: flex;
  flex-direction: column; gap: 12px; padding: 18px 18px 16px; border-radius: 22px; color: var(--hero-ink);
  background: radial-gradient(260px 160px at 100% 0%, rgba(255, 200, 87, 0.3), transparent 70%), linear-gradient(150deg, var(--hero-1), var(--hero-2) 60%, var(--hero-3));
  box-shadow: var(--shadow); filter: none;
}
.yc-head { display: grid; gap: 2px; }
.yc-k { font-size: 0.8rem; font-weight: 600; color: var(--gold); }
.yc-y { font-family: var(--display); font-size: 2.6rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.yc-n { font-size: 0.82rem; color: var(--hero-ink-2); }
.yc-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.yc-list li { display: grid; gap: 2px; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, 0.25); }
.yc-d { font-size: 0.78rem; font-weight: 700; color: var(--gold); text-decoration: none; justify-self: start; }
.yc-d:hover { text-decoration: underline; text-underline-offset: 3px; }
.yc-t { font-size: 0.88rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.yc-go { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 12px; font-weight: 700; font-size: 0.88rem; text-decoration: none; color: var(--on-gold); background: linear-gradient(135deg, var(--gold), var(--gold-2)); }

/* ---------- 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; }
  .facts-body { padding: 16px; }
  .ev { grid-template-columns: 62px minmax(0, 1fr); gap: 10px; padding: 10px 12px; }
  .ev-y { font-size: 0.95rem; }
  .ev-list.dated .ev { grid-template-columns: 88px minmax(0, 1fr); }
  .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; }
}

/* ---------- التقويم والبرج في صفحة اليوم ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.cal-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.cal-card h3 { margin: 0; font-family: var(--display); font-size: 1.15rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.cal-card h3 span { font-family: var(--body); font-size: 0.82rem; font-weight: 500; color: var(--ink-2); }
.cal-card p { margin: 0; line-height: 1.85; }
.cal-card dl { margin: 0; display: grid; gap: 6px; }
.cal-card dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.cal-card dt { color: var(--ink-2); font-size: 0.9rem; }
.cal-card dd { margin: 0; font-weight: 600; }
.cal-note { font-size: 0.82rem; color: var(--ink-2); }
.cal > p { margin: 0; }
.cal > p a, .cal-card p a { color: var(--c-science); text-underline-offset: 3px; }

/* ---------- مقدمة الصفحة الرئيسية ---------- */
.intro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; align-items: start; }
.intro-grid .prose { max-width: none; line-height: 1.85; }
.prose h3 { font-family: var(--display); font-size: 1.1rem; margin: 1.3em 0 0.3em; }
.prose h3:first-child { margin-top: 0; }
.prose ol { padding-inline-start: 1.3em; }

/* ---------- المقالات ---------- */
.article { line-height: 1.95; font-size: 1.04rem; }
.article .art-meta { color: var(--ink-2); font-size: 0.85rem; margin-top: 0; }
.article table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.95rem; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 10px; text-align: start; }
.article th { background: var(--soft); font-weight: 600; }
.article blockquote { margin: 1em 0; padding: 10px 16px; border-inline-start: 4px solid var(--gold); background: var(--soft); border-radius: 0 12px 12px 0; }
.art-cta { margin-top: 2em; padding: 16px 18px; border-radius: 18px; background: var(--soft); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.art-cta p { margin: 0; }
.art-cta .btn { display: inline-flex; align-items: center; height: 44px; text-decoration: none; }
.article .art-cta a.btn { color: var(--on-gold); }
.art-card p { margin: 0; color: var(--ink-2); font-size: 0.92rem; line-height: 1.8; }

/* ---------- «جرّب أيضاً» في الرئيسية ---------- */
.try-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.try-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform 0.15s ease, border-color 0.15s ease; }
.try-card:hover { transform: translateY(-2px); border-color: var(--gold-2); }
.try-card strong { font-family: var(--display); font-size: 1.12rem; }
.try-card span { color: var(--ink-2); font-size: 0.9rem; line-height: 1.7; }

/* ---------- لعبة «من الأكبر؟» ---------- */
.game-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); }
.game { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; min-height: 260px; justify-content: center; }
.g-start p { max-width: 52ch; line-height: 1.9; margin: 0 auto 14px; }
.g-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.g-pill { padding: 4px 12px; border-radius: 999px; background: var(--soft); font-size: 0.85rem; font-weight: 600; }
.g-pill.gold { background: var(--gold); color: var(--on-gold); }
.g-pill.hot { background: var(--rose); color: #fff; }
.g-q { margin: 0; font-family: var(--display); font-size: 1.5rem; }
.g-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; width: 100%; max-width: 640px; }
.g-vs { font-family: var(--display); color: var(--ink-2); }
.g-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border-radius: 20px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; cursor: pointer; transition: transform 0.15s ease, border-color 0.15s ease; min-height: 210px; }
.g-card:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--gold-2); }
.g-card:disabled { cursor: default; }
.g-ph { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: var(--soft); display: grid; place-items: center; font-family: var(--display); font-size: 2.2rem; color: var(--ink-2); }
.g-ph img { width: 100%; height: 100%; object-fit: cover; }
.g-name { font-size: 1.02rem; line-height: 1.5; }
.g-field { color: var(--ink-2); font-size: 0.82rem; }
.g-year { font-weight: 700; font-size: 0.9rem; min-height: 1.4em; }
.g-card.win { border-color: #1f9d6b; background: color-mix(in srgb, #1f9d6b 12%, var(--bg)); }
.g-card.lose { opacity: 0.75; }
.g-card.lose.picked { border-color: var(--danger); opacity: 1; }
.g-fb { padding: 10px 16px; border-radius: 14px; background: var(--soft); line-height: 1.8; }
.g-fb.ok strong { color: #1f9d6b; }
.g-fb.no strong { color: var(--danger); }
.g-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: 0.88rem; }
.g-links a { color: var(--c-science); text-underline-offset: 3px; }
.g-end { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.g-score { font-family: var(--display); font-size: 3.4rem; color: var(--ink); }
.g-msg { margin: 0; font-size: 1.1rem; font-weight: 600; }
.g-best { margin: 0; color: var(--ink-2); font-size: 0.9rem; }
.g-acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
.game .btn { display: inline-flex; align-items: center; justify-content: center; }
.game .btn.sm { height: 44px; }
@media (max-width: 480px) { .g-row { grid-template-columns: 1fr 1fr; } .g-vs { display: none; } .g-ph { width: 72px; height: 72px; } .g-card { min-height: 180px; } }

/* ---------- حاسبة العمر ---------- */
.calc { display: flex; flex-direction: column; gap: 16px; }
.calc-form { background: linear-gradient(135deg, #0a2f3a, #0c4a4e); padding: 18px; border-radius: 24px; }
.calc-form label { color: #fff; }
.calc-out { display: flex; flex-direction: column; gap: 16px; }
.c-hero { background: var(--card); border: 2px solid var(--gold); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 6px; text-align: center; box-shadow: var(--shadow); }
.c-big { font-family: var(--display); font-size: clamp(1.4rem, 5vw, 2rem); }
.c-party { font-weight: 700; color: var(--rose); }
.c-group h2 { font-family: var(--display); font-size: 1.2rem; margin: 0 0 10px; }
.c-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.c-stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.c-l { color: var(--ink-2); font-size: 0.85rem; }
.c-v { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.c-n { color: var(--ink-2); font-size: 0.8rem; }
.c-err { color: var(--danger); font-weight: 600; margin: 0; }
.c-more { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.c-more .btn { display: inline-flex; align-items: center; text-decoration: none; height: 48px; }

/* ---------- قائمة الصفحات أعلى الصفحة ---------- */
.topnav { position: relative; z-index: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 18px; padding-bottom: 2px; max-width: 100%; -webkit-mask-image: linear-gradient(to left, #000 88%, transparent); mask-image: linear-gradient(to left, #000 88%, transparent); }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { flex: none; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.18); color: var(--hero-ink); text-decoration: none; font-size: 0.88rem; font-weight: 600; white-space: nowrap; transition: background 0.15s ease; }
.topnav a:hover, .topnav a:focus-visible { background: rgba(255, 255, 255, 0.24); }
.topnav a[aria-current="page"] { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
@media (min-width: 900px) { .topnav { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; } }
.phero .topnav { margin-bottom: 8px; }

/* ==========================================================================
   رأس الموقع الثابت وتذييل الأعمدة (الإصدار الاحترافي)
   ========================================================================== */
.app { max-width: 1040px; }

.site-head {
  position: sticky; top: 10px; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 8px 10px 8px 16px; margin-bottom: -8px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.site-head .brand { margin: 0; color: var(--ink); font-size: 1.12rem; flex: none; }
.site-head .brand svg { width: 32px; height: 32px; }

/* القائمة: تلغي أسلوب الأزرار الشفافة القديم داخل الواجهة الملونة */
.site-head .topnav { margin: 0; padding: 0; overflow: visible; -webkit-mask-image: none; mask-image: none; flex-wrap: nowrap; }
.site-head .topnav.wide { margin-inline-start: auto; gap: 2px; }
.site-head .topnav a {
  background: none; border: 0; border-radius: 10px; padding: 8px 12px;
  color: var(--ink-2); font-size: 0.9rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.site-head .topnav a:hover { background: var(--soft); color: var(--ink); }
.site-head .topnav a[aria-current="page"] { background: var(--gold); color: var(--on-gold); }

.menu { display: none; margin-inline-start: auto; position: relative; }
.menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding-inline: 14px; border-radius: 12px; background: var(--soft); color: var(--ink); font-weight: 600;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary svg { width: 20px; height: 20px; }
.menu[open] summary { background: var(--ink); color: var(--card); }
.site-head .topnav.drop {
  position: absolute; inset-inline-end: 0; top: calc(100% + 10px); width: min(280px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 2px; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.site-head .topnav.drop a { padding: 11px 14px; font-size: 0.98rem; color: var(--ink); }

@media (max-width: 899px) {
  .site-head .topnav.wide { display: none; }
  .menu { display: block; }
}

/* الواجهة الملونة لم تعد تحمل الشعار */
.hero > .brand, .phero > .brand { display: none; }
.phero .crumbs { margin-top: 2px; }

/* ---------- التذييل ---------- */
.foot {
  display: block; justify-items: stretch; text-align: start; margin-top: 18px; padding: 28px;
  background: var(--card); border: 1px solid var(--line); border-radius: 28px; color: var(--ink-2); font-size: 0.92rem;
}
.foot::before { content: none; }
.foot-grid { width: 100%; display: grid; grid-template-columns: 1.5fr 1.7fr 1fr 1fr 1fr; gap: 28px; }
.fbrand .brand { color: var(--ink); margin-bottom: 10px; }
.fbrand p { margin: 0; line-height: 1.8; max-width: 34ch; }
.fcol h2 { margin: 0 0 10px; font-family: var(--display); font-size: 1rem; color: var(--ink); }
.fcol ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.foot .fcol a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.92rem; padding: 0; }
.foot .fcol a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.fcol.months { display: block; }
.fcol.months ul { grid-template-columns: repeat(3, auto); justify-content: start; column-gap: 22px; }
.foot-bar { width: 100%;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 0.82rem;
}
.foot-bar p { margin: 0; max-width: 70ch; line-height: 1.8; }
.foot-bar a { color: var(--ink); text-underline-offset: 3px; }
.foot-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.foot-tools button {
  background: var(--soft); border: 1px solid var(--line); color: var(--ink); border-radius: 10px;
  padding: 7px 12px; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.foot-tools button:hover { border-color: var(--gold-2); }
@media (max-width: 899px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .fbrand, .fcol.months { grid-column: 1 / -1; }
  .fcol.months ul { grid-template-columns: repeat(4, auto); }
}
@media (max-width: 479px) {
  .foot { padding: 22px 18px; }
  .fcol.months ul { grid-template-columns: repeat(3, auto); }
}
.site-head .topnav.drop { max-width: none; }
.site-head .topnav.drop a { white-space: normal; }
/* عناوين الصفحات الطويلة (المقالات) أصغر قليلاً على الجوال */
.phero h1 { font-size: clamp(1.7rem, 6.2vw, 2.7rem); line-height: 1.3; }
.phero .crumbs span[aria-current] { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
