/* رباط أزرق — هوية البروفه الرسمي (أوف وايت، أخضر داكن، بدون هالات ملونة) */
:root {
  --bg: #FBFAF7;
  --card: #FFFFFF;
  --ink: #111827;
  --ink-strong: #0B1220;
  --green: #0F3D2E;
  --muted: #6B7280;
  --muted2: #8A8478;
  --line: #E7E2D8;
  --line2: #EEEAE2;
  --soft: #F1EEE7;
  --chip: #F8F6F2;
  --gold: #A8843A;
  --beige-text: #8A7350;
  --shadow: 0 1px 2px rgba(17,24,39,0.03);
  --nav-shadow: 0 8px 28px rgba(17,24,39,0.12);
  --radius: 20px;
  --phone-w: 430px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
#dev.pubmode, .pub {
  width: 100%; max-width: var(--phone-w); /* rootfix: لا يتجاوز عرض الجوال (كان 430px ثابت فيصغّر الصفحة على الجوالات الأضيق) */
  min-height: 920px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(17,24,39,0.15);
}
.status {
  height: 54px; padding: 14px 24px 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; font-weight: 600;
}
.status-icons { display: flex; gap: 6px; align-items: center; }
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px 12px; gap: 10px;
}
.header .title { font-size: 18px; font-weight: 700; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); text-decoration: none; color: inherit; flex-shrink: 0;
}
.content { padding: 0 20px 110px; }
.brand-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.brand {
  font-size: 22px; font-weight: 800; color: var(--green); letter-spacing: 0.2px;
}
.brand span { color: var(--ink-strong); font-weight: 700; font-size: 13px; display: block; margin-top: 2px; }
.search-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line2); border-radius: 999px;
  padding: 12px 16px; box-shadow: var(--shadow); margin-bottom: 16px;
  text-decoration: none; color: var(--muted);
  font-size: 14px; font-weight: 600;
}
.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line2); box-shadow: var(--shadow); padding: 16px;
}
.card + .card { margin-top: 12px; }
.section { margin-bottom: 18px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.section-title { font-size: 17px; font-weight: 800; color: var(--ink-strong); }
.link-more { font-size: 13px; font-weight: 700; color: var(--green); text-decoration: none; }
.hero {
  background: linear-gradient(145deg, #0F3D2E 0%, #1A5C45 100%);
  color: #fff; border-radius: 24px; padding: 18px; margin-bottom: 16px;
}
.hero .kicker { font-size: 12px; font-weight: 700; opacity: 0.85; margin-bottom: 8px; }
.hero .h-title { font-size: 20px; font-weight: 800; line-height: 1.35; margin-bottom: 10px; }
.hero .meta { font-size: 13px; opacity: 0.9; line-height: 1.7; }
.hero .actions { display: flex; gap: 8px; margin-top: 14px; }
.btn {
  border: 0; border-radius: 999px; padding: 10px 14px; font-size: 13px; font-weight: 700;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-light { background: #fff; color: var(--green); }
.btn-ghost { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.25); }
.btn-green { background: var(--green); color: #fff; }
.btn-outline {
  background: transparent; color: var(--green);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px;
  font-size: 13px; font-weight: 700; text-decoration: none; display: inline-flex;
}
.empty {
  background: var(--soft); border-radius: 18px; padding: 16px; text-align: center;
  color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.7;
}
.empty strong { color: var(--green); display: block; margin-bottom: 4px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  background: var(--card); border: 1px solid var(--line2); border-radius: 18px;
  padding: 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.tile .t-label { font-size: 12px; color: var(--muted2); font-weight: 700; margin-bottom: 6px; }
.tile .t-title { font-size: 15px; font-weight: 800; color: var(--ink-strong); line-height: 1.35; }
.tile .t-meta { font-size: 12px; color: var(--muted); margin-top: 8px; font-weight: 600; }
.row-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--soft); text-decoration: none; color: inherit;
}
.row-item:first-child { border-top: 0; padding-top: 0; }
.row-item .r-title { font-size: 14px; font-weight: 800; color: var(--ink-strong); }
.row-item .r-meta { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 600; line-height: 1.5; }
.pos {
  min-width: 28px; text-align: center; font-size: 18px; font-weight: 800; color: var(--green);
}
.filters {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px;
}
.filter {
  flex-shrink: 0; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  color: var(--muted); background: transparent; border: 1px solid var(--line); cursor: pointer;
}
.filter.active { color: var(--green); border-color: var(--green); background: #E8F0EC; }
.search-box {
  width: 100%; border: 1px solid var(--line2); border-radius: 16px; padding: 14px 16px;
  font-size: 15px; font-weight: 600; background: var(--card); margin-bottom: 12px;
  outline: none; font-family: inherit;
}
.mode {
  display: flex; border-bottom: 1px solid var(--line); margin-bottom: 16px;
}
.mode-btn {
  flex: 1; text-align: center; padding: 10px 0; font-size: 14px; font-weight: 600; color: var(--muted);
  cursor: pointer; background: transparent; border: 0; font-family: inherit;
}
.mode-btn.active { color: var(--green); border-bottom: 2px solid var(--green); font-weight: 800; }
.badge-text { font-size: 12px; font-weight: 700; color: var(--beige-text); margin-bottom: 6px; }
.horse-name { font-size: 34px; font-weight: 800; color: var(--ink-strong); line-height: 1.15; margin-bottom: 14px; }
.parents { display: flex; gap: 10px; margin-bottom: 18px; }
.parent-card {
  flex: 1; background: var(--card); border-radius: 18px; padding: 14px;
  border: 1px solid var(--line2); box-shadow: var(--shadow);
}
.parent-label { font-size: 12px; color: var(--muted2); margin-bottom: 6px; font-weight: 600; }
.parent-name { font-size: 15px; font-weight: 800; color: var(--green); }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 10px 2px 12px; font-size: 14px; font-weight: 600; color: #9CA3AF;
  white-space: nowrap; position: relative; cursor: pointer; background: none; border: 0; font-family: inherit;
}
.tab.active { color: var(--green); font-weight: 800; }
.tab.active::after {
  content: ""; position: absolute; right: 0; left: 0; bottom: 0; height: 3px;
  background: var(--green); border-radius: 3px 3px 0 0;
}
.season { background: var(--soft); border-radius: 22px; padding: 14px; margin-bottom: 16px; }
.season-title { color: var(--gold); font-size: 13px; font-weight: 800; margin-bottom: 10px; }
.stats { background: var(--card); border-radius: 18px; display: flex; overflow: hidden; }
.stat { flex: 1; padding: 14px 6px; text-align: center; border-left: 1px solid #F0EBE3; }
.stat:first-child { border-left: none; }
.stat-num { font-size: 22px; font-weight: 800; color: var(--ink-strong); margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--muted2); font-weight: 600; }
.family-summary { font-size: 14px; line-height: 1.75; color: #374151; margin-bottom: 14px; }
.family-summary strong { color: var(--green); font-weight: 800; }
.meta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.meta-row span { font-size: 12px; font-weight: 700; color: var(--muted); }
.sib-table { width: 100%; border-collapse: collapse; }
.sib-table th {
  font-size: 11px; color: #9A9184; font-weight: 700; padding: 0 4px 10px; text-align: center;
}
.sib-table th.name { text-align: right; }
.sib-table td {
  padding: 12px 4px; border-top: 1px solid var(--soft); font-size: 13px;
  text-align: center; color: var(--ink); font-weight: 700;
}
.sib-table td.name { text-align: right; font-weight: 800; color: var(--green); }
.result {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--line2);
  padding: 14px 16px; margin-bottom: 10px;
}
.result-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.result-pos-label { font-size: 12px; color: var(--muted2); font-weight: 700; }
.result-pos-num { font-size: 28px; font-weight: 800; color: var(--green); line-height: 1; }
.result-date { font-size: 13px; font-weight: 700; color: var(--ink); text-align: left; }
.result-meta { font-size: 13px; color: var(--muted); line-height: 1.75; }
.result-meta b { color: #374151; font-weight: 700; }
.result-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--soft);
}
.result-grid .g { text-align: center; }
.result-grid .g .k { font-size: 11px; color: var(--muted2); font-weight: 700; margin-bottom: 4px; }
.result-grid .g .v { font-size: 13px; font-weight: 800; color: var(--ink-strong); }
.team-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px; border-top: 1px solid var(--soft);
}
.team-item:first-child { border-top: none; padding-top: 4px; }
.team-role { font-size: 12px; color: var(--muted2); font-weight: 600; margin-bottom: 2px; }
.team-name { font-size: 15px; font-weight: 800; }
.source {
  text-align: center; font-size: 12px; color: #9A9184; font-weight: 600;
  padding: 8px 8px 20px; line-height: 1.6;
}
.chart-wrap { padding: 8px 0 4px; }
.chart-note { font-size: 12px; color: var(--muted); line-height: 1.7; margin-bottom: 12px; font-weight: 600; }
.chart-svg { width: 100%; height: 220px; background: var(--card); border-radius: 18px; border: 1px solid var(--line2); }
.video-box {
  background: #0B1220; border-radius: 18px; aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center; color: #fff;
  text-decoration: none; margin-bottom: 14px; position: relative; overflow: hidden;
}
.video-box .play {
  width: 56px; height: 56px; border-radius: 999px; background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
}
.video-box .v-label {
  position: absolute; right: 12px; bottom: 12px; font-size: 12px; font-weight: 700;
  background: rgba(0,0,0,0.45); padding: 6px 10px; border-radius: 999px;
}
.scan-zone {
  border: 1.5px dashed #C9C2B4; border-radius: 22px; padding: 36px 16px;
  text-align: center; background: var(--soft); margin: 12px 0 16px;
}
.scan-zone h3 { font-size: 16px; margin-bottom: 8px; color: var(--ink-strong); }
.scan-zone p { font-size: 13px; color: var(--muted); line-height: 1.7; font-weight: 600; }
.pub .nav, #dev.pubmode .nav {
  position: fixed; left: 50%; transform: translateX(-50%); width: calc(100% - 36px); max-width: 394px;
  bottom: 14px; height: 64px;
  background: var(--card); border-radius: 999px; box-shadow: var(--nav-shadow);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 8px; border: 1px solid #F0EBE3; z-index: 20;
}
#dev.pubmode { background: var(--bg); padding-bottom: 96px; }
#dev.pubmode .status { display:none; }
.nav a {
  width: 46px; height: 46px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.nav a.active { background: #E8F0EC; }
.ops-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px;
  text-decoration: none; margin-bottom: 12px;
}
.full-only.hidden, .brief-hide.hidden { display: none !important; }

.pub .status { display:none; }
.pub .content { padding-bottom: 24px; }
.pub button.tile, .pub button.row-item, .pub button.ops-chip, .pub button.search-pill {
  font: inherit; cursor: pointer; text-align: inherit; width: 100%;
}
.pub .chart-svg text { font-family: Cairo, Tahoma, sans-serif; }


/* خدمات + أخبار + سباقات قريبة (معاينة خاصة) */
.svc-list { display: flex; flex-direction: column; gap: 12px; }
.svc-card { margin: 0 !important; }
.news-slider {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.news-card {
  flex: 0 0 78%; max-width: 300px; scroll-snap-align: start;
  background: var(--card); border: 1px solid var(--line2); border-radius: 18px;
  padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  display: block;
}
.news-card .n-kicker { font-size: 12px; font-weight: 700; color: var(--beige-text); margin-bottom: 6px; }
.news-card .n-title { font-size: 15px; font-weight: 800; color: var(--ink-strong); line-height: 1.45; margin-bottom: 8px; }
.news-card .n-sum { font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.7; margin-bottom: 10px; }
.news-card .n-meta { font-size: 12px; font-weight: 700; color: var(--muted2); margin-bottom: 8px; }
.news-card .n-src { font-size: 12px; font-weight: 800; color: var(--green); }
.up-list { display: flex; flex-direction: column; gap: 12px; }
.up-card {
  background: var(--card); border: 1px solid var(--line2); border-radius: 18px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.up-head { margin-bottom: 10px; }
.up-item { padding: 12px 0; border-top: 1px solid var(--soft); }
.up-item:first-of-type { border-top: 0; padding-top: 0; }
.up-date { font-size: 12px; font-weight: 800; color: var(--gold); margin-bottom: 4px; }
.up-title { font-size: 15px; font-weight: 800; color: var(--ink-strong); margin-bottom: 6px; line-height: 1.4; }
.up-sum { font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.7; margin-bottom: 6px; }
.up-src { font-size: 12px; font-weight: 700; color: var(--muted2); margin-bottom: 8px; }
.up-links { display: flex; flex-wrap: wrap; gap: 8px; }
.up-link {
  font-size: 12px; font-weight: 800; color: var(--green); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: var(--chip);
}
.pub .mode { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.pub .mode-btn {
  flex: 1; text-align: center; padding: 10px 0; font-size: 14px; font-weight: 600; color: var(--muted);
  cursor: pointer; background: transparent; border: 0; font-family: inherit;
}
.pub .mode-btn.active { color: var(--green); border-bottom: 2px solid var(--green); font-weight: 800; }
