/* وطن — طبقة الصفحات الجديدة: القطع والحركة.
   تكمل ui.css بنفس الهوية: ورق بارد، حبر كحلي، أزرق ملكي، ذهب ومرجان. */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- البطل + بطاقة الدور ---------- */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(360px, .78fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 30px;
}
.hero-grid .hero { margin-bottom: 0; }
.hero-grid .hero h1 { font-size: clamp(36px, 4.1vw, 56px); }
.hero-grid .hero-num { font-size: clamp(48px, 5vw, 68px); }

.elig-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 48%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.elig-head h2 {
  margin-top: 7px;
  font-family: var(--display);
  font-size: clamp(26px, 2.3vw, 34px);
  font-weight: 600; line-height: 1.1; letter-spacing: -.035em;
  color: var(--ink);
}
.elig-head h2 em { font-style: normal; color: var(--brand); }
.elig-lede { margin-top: 8px; font-size: 13px; line-height: 1.7; color: var(--ink-2); }

.elig-form { display: flex; gap: 8px; }
.elig-form input {
  flex: 1 1 auto; min-width: 0; height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line); border-radius: 15px;
  background: var(--surface-2); color: var(--ink);
  font-family: var(--display); font-size: 16px; font-weight: 600;
  letter-spacing: .04em;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.elig-form input::placeholder { font-family: var(--font); font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--ink-4); }
.elig-form input:focus { outline: 0; border-color: var(--brand-mid); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 8%, transparent); }
.btn-solid {
  flex: none; height: 48px; padding: 0 20px;
  border: 0; border-radius: 15px;
  background: var(--grad-brand); box-shadow: var(--glow-brand); color: var(--on-brand);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.btn-solid:hover { filter: brightness(1.08); }
.btn-solid:active { transform: scale(.98); }
.btn-solid[disabled] { opacity: .6; cursor: default; }
.elig-hint { margin-top: -6px; font-size: 13px; line-height: 1.5; color: var(--ink-4); }

.elig-window {
  padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 15px;
  background: var(--surface-2);
  font-size: 13px; line-height: 1.6; color: var(--ink-2);
}
.window-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.window-line b { font-family: var(--display); font-size: 13px; color: var(--ink); direction: ltr; unicode-bidi: isolate; }
.window-progress { display: block; height: 5px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.window-progress i { display: block; height: 100%; min-width: 2px; border-radius: 999px; background: linear-gradient(90deg, var(--brand-mid), var(--brand)); transition: width .8s var(--ease); }
.window-sub { margin-top: 5px; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-3); }

.elig-result { display: grid; gap: 10px; }
.elig-result:empty { display: none; }
.result-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.result-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.result-sub { margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border-radius: 14px; background: var(--line-2); }
.result-cell { padding: 10px 11px; background: var(--surface-2); }
.result-cell span { display: block; font-size: 13px; color: var(--ink-3); }
.result-cell b { display: block; margin-top: 2px; font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.result-bar { display: block; height: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.result-bar i { display: block; height: 100%; min-width: 3px; border-radius: 999px; background: linear-gradient(90deg, var(--brand-mid), var(--brand)); transition: width .8s var(--ease); }
.result-line { font-size: 13px; line-height: 1.65; color: var(--ink-2); }
.result-line b { color: var(--ink); }
.result-line .gold { color: var(--gold); }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 23px; padding: 0 9px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.live { background: color-mix(in srgb, var(--live) 12%, transparent); color: var(--live); }
.pill.soon { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }
.pill.wait { background: color-mix(in srgb, var(--gold) 17%, transparent); color: var(--gold); }
.pill.done { background: var(--surface-3); color: var(--ink-3); }
.pill.hot { background: var(--copper-soft); color: var(--copper); }

.elig-more { border-top: 1px solid var(--line-2); padding-top: 10px; }
.elig-more summary {
  cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 500; color: var(--ink-3);
}
.elig-more summary::-webkit-details-marker { display: none; }
.elig-more summary::after { content: " +"; color: var(--brand); }
.elig-more[open] summary::after { content: " −"; }
.window-list { display: grid; gap: 0; margin: 9px 0 0; padding: 0; list-style: none; max-height: 176px; overflow: auto; }
.window-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; color: var(--ink-3); }
.window-row:last-child { border-bottom: 0; }
.window-row b { font-family: var(--display); font-size: 13px; color: var(--ink-2); direction: ltr; unicode-bidi: isolate; }
.window-row .is-now { color: var(--brand); font-weight: 600; }

.turn-note, .elig-card .turn-note {
  margin-top: auto; padding: 10px 12px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--copper) 6%, var(--surface));
  color: var(--ink-2); font-size: 13px; line-height: 1.65;
}
.turn-note strong { color: var(--copper); }

/* ---------- المدن ---------- */

.city-section { margin-bottom: 30px; }
.city-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.city-card {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 118px; padding: 15px 16px;
  text-align: start;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.city-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: color-mix(in srgb, var(--brand) 26%, var(--line)); }
.city-card.is-active { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent), var(--shadow-xs); }
.city-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.city-free { display: flex; align-items: baseline; gap: 5px; margin-top: auto; }
.city-free b { font-family: var(--display); font-size: 27px; font-weight: 600; line-height: 1; letter-spacing: -.03em; color: var(--ink); }
.city-free span { font-size: 13px; color: var(--ink-3); }
.city-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-3); }
.city-meter { display: block; height: 5px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.city-meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-mid), var(--brand)); }
.city-card.is-muted { opacity: .55; }
.city-card.is-muted .city-free b { color: var(--ink-3); }
.city-card.is-muted .city-meter i { background: var(--ink-4); }
.city-empty { grid-column: 1 / -1; padding: 24px; text-align: center; font-size: 13px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: 18px; }

/* ---------- المستكشف ---------- */

.explorer { margin-top: 34px; }
.explorer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 16px; align-items: start; }
.plots-card { overflow: hidden; }
.plots-table { min-width: 800px; }
.plots-table th:nth-child(3), .plots-table td:nth-child(3) { text-align: right; }
.plots-table .th-sort {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0; border: 0; background: none;
  font: inherit; letter-spacing: inherit; color: inherit;
  cursor: pointer;
}
.plots-table .th-sort:hover { color: var(--brand); }
.plots-table .th-sort[data-dir] { color: var(--brand); font-weight: 600; }
.plots-table .th-arrow { font-size: 13px; line-height: 1; color: var(--ink-4); }
.plots-table .th-sort[data-dir] .th-arrow { color: var(--brand); }
.plots-table .th-sort:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.plot-name { display: flex; align-items: center; gap: 7px; }
.plot-name b { font-family: var(--display); font-size: 14px; font-weight: 600; color: var(--ink); }
.flag { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 600; }
.flag--gold { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.flag--copper { background: var(--copper-soft); color: var(--copper); }
.zone-cell-line { display: block; max-width: 270px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-2); }
.city-cell-line { display: block; margin-top: 1px; font-size: 13px; color: var(--ink-4); }
.map-link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.map-link-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.map-link-btn svg { width: 12px; height: 12px; }

/* ---------- خريطة المنطقة ---------- */

.plan-card {
  position: sticky; top: 96px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.plan-head .eyebrow { margin-bottom: 3px; }
.plan-head .card-title { font-size: 14px; }
.plan-zoom { display: flex; gap: 4px; }
.plan-zoom button {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2); color: var(--ink-2);
  font-family: var(--display); font-size: 14px; line-height: 1;
}
.plan-zoom button:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.plan-stage {
  position: relative;
  margin: 0 12px;
  overflow: hidden;
  border: 1px solid var(--line-2); border-radius: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 4%, var(--surface-2)), var(--surface-3));
  aspect-ratio: 1.35;
}
.plan-stage svg { display: block; width: 100%; height: 100%; }
.plan-loading {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 13px; color: var(--ink-3);
  background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--ink) 2%, transparent) 10px 20px);
}
.plan-poly { stroke: var(--surface); stroke-width: .8; vector-effect: non-scaling-stroke; transition: fill .15s var(--ease); }
.plan-poly.free { fill: color-mix(in srgb, var(--brand) 74%, var(--surface)); }
.plan-poly.booked { fill: color-mix(in srgb, var(--ink) 15%, var(--surface)); }
.plan-poly:hover { fill: var(--gold); cursor: pointer; }
.plan-poly.is-selected { fill: var(--copper); }
.plan-tip {
  position: absolute; z-index: 2; pointer-events: none;
  min-width: 126px; padding: 8px 10px;
  border-radius: 10px; background: var(--obsidian); color: #fff;
  font-size: 13px; line-height: 1.55;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, calc(-100% - 9px));
  opacity: 0; transition: opacity .12s var(--ease);
}
.plan-tip.is-on { opacity: 1; }
.plan-tip b { font-family: var(--display); font-size: 13px; }
.plan-tip span { display: block; color: rgba(255, 255, 255, .64); }
.plan-foot {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 9px 20px 0;
  font-size: 13px; color: var(--ink-3);
}
.plan-key { display: inline-flex; align-items: center; gap: 4px; }
.plan-key i { width: 8px; height: 8px; border-radius: 2px; }
.key-free { background: color-mix(in srgb, var(--brand) 74%, var(--surface)); }
.key-booked { background: color-mix(in srgb, var(--ink) 15%, var(--surface)); }
.key-selected { background: var(--copper); }
.plan-key--note { margin-inline-start: auto; color: var(--ink-4); }
.plan-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 14px 20px 0; overflow: hidden; border-radius: 14px; background: var(--line-2); }
.plan-stat { padding: 10px 12px; background: var(--surface-2); }
.plan-stat span { display: block; font-size: 13px; color: var(--ink-3); }
.plan-stat b { display: block; margin-top: 2px; font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.plan-stat b small { font-family: var(--font); font-size: 13px; font-weight: 400; color: var(--ink-3); }
.plan-empty { padding: 20px; text-align: center; font-size: 13px; color: var(--ink-3); }

.plot-detail { padding: 13px 20px 18px; }
.plot-detail:empty { display: none; }
.detail-card {
  padding: 12px 13px;
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(150deg, var(--brand-tint), var(--surface));
}
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.detail-top b { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--ink); }
.detail-top span { font-size: 13px; color: var(--ink-3); }
.detail-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.detail-facts span { display: block; font-size: 13px; color: var(--ink-3); }
.detail-facts b { display: block; font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--ink); }
.detail-note { margin-top: 8px; font-size: 13px; line-height: 1.55; color: var(--ink-3); }
.detail-note b { color: var(--copper); }

/* ---------- آخر الحجوزات ---------- */

.card-link { font-size: 13px; font-weight: 500; color: var(--brand); white-space: nowrap; }
.recent-feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.recent-feed .feed-item { padding: 10px 2px; }
.recent-price { font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--ink); }

.btn-quiet {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn-quiet:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }

/* ---------- الحركة ---------- */

.movement-head { padding-bottom: 22px; }
.movement-kpis { margin-bottom: 18px; }
.kpis--six.movement-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.trend-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 16px; }
.chart-panel { display: flex; flex-direction: column; }
.chart-panel .card-head { padding-bottom: 12px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding: 6px 22px 0; }
.bar-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; flex: 1 1 0; min-width: 0; height: 100%; }
.bar-col b { font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.bar-col i { display: block; width: 100%; max-width: 54px; height: 0; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 70%, var(--surface)), var(--brand-soft)); transition: height 1s var(--ease); }
.bar-col.peak i { background: linear-gradient(180deg, var(--brand), var(--brand-deep)); }
.bar-col.zero i { background: var(--line-2); }
/* يوم لم نرصده: خط متقطع رفيع فقط، بلا عمود يوحي بصفر حجوزات. */
.bar-col.gap i { height: 2% !important; background: repeating-linear-gradient(90deg, var(--line-2) 0 4px, transparent 4px 8px); }
.bar-col.gap b { color: var(--ink-4); }
.bar-col span { font-family: var(--display); font-size: 13px; color: var(--ink-4); white-space: nowrap; }
.balance-body { display: flex; align-items: center; gap: 18px; padding: 22px 22px 8px; }
.donut {
  position: relative; display: grid; place-items: center; flex: none;
  width: 132px; height: 132px; border-radius: 50%;
  background:
    radial-gradient(closest-side, var(--surface) 77%, transparent 78%),
    conic-gradient(var(--brand) calc(var(--pct) * 1%), var(--copper) 0);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.donut-center { position: relative; display: grid; justify-items: center; line-height: 1.1; }
.donut-center b { font-family: var(--display); font-size: 27px; font-weight: 600; color: var(--ink); letter-spacing: -.03em; }
.donut-center small { font-size: 13px; color: var(--ink-3); }
.balance-legend { display: grid; gap: 10px; min-width: 0; font-size: 13px; color: var(--ink-2); }
.balance-legend span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.balance-legend b { margin-inline-start: auto; font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--ink); }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.legend-dot--brand { background: var(--brand); }
.legend-dot--copper { background: var(--copper); }
.chart-note { padding: 0 22px 18px; margin-top: 4px; font-size: 13px; line-height: 1.6; color: var(--ink-3); }

.move-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; margin-top: 16px; align-items: start; }
.city-bars { display: grid; gap: 12px; padding: 16px 22px 20px; }
.city-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
.city-bar-label { overflow: hidden; font-size: 13px; font-weight: 500; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.city-bar-value { font-family: var(--display); font-size: 13px; color: var(--ink-3); direction: ltr; unicode-bidi: isolate; }
.city-bar-value b { color: var(--ink); font-weight: 600; }
.city-bar-track { grid-column: 1 / -1; display: block; height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.city-bar-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-mid), var(--brand)); transition: width .8s var(--ease); }
.city-bar:nth-child(2n) .city-bar-track i { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 55%, var(--surface)), var(--gold)); }

.hot-table { min-width: 640px; }
.hot-zone a { font-size: 13px; font-weight: 500; color: var(--ink); }
.hot-zone a:hover { color: var(--brand); }
.hot-zone span { display: block; margin-top: 1px; font-size: 13px; color: var(--ink-4); }
.heat-cell { display: flex; align-items: center; gap: 7px; }
.heat-track { display: block; width: 54px; height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.heat-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-mid), var(--copper)); }
.heat-cell b { font-family: var(--display); font-size: 13px; color: var(--ink); }

.records-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.records-table { min-width: 760px; }
.records-table th:nth-child(4), .records-table td:nth-child(4) { text-align: right; }
.booked-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 0 8px; border-radius: 999px; background: var(--copper-soft); color: var(--copper); font-size: 13px; font-weight: 600; white-space: nowrap; }
.booked-badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.mono-time { font-family: var(--display); font-size: 13px; color: var(--ink-3); direction: ltr; unicode-bidi: isolate; white-space: nowrap; }

.schedule-card { margin-top: 16px; }
.schedule-table { min-width: 620px; }
.schedule-table td, .schedule-table th { font-size: 13px; }
.schedule-table .num { font-size: 13px; }
.schedule-note { padding: 0 22px 18px; font-size: 13px; line-height: 1.6; color: var(--ink-3); }

/* ---------- الاستجابة ---------- */

@media (max-width: 1320px) {
  .city-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis--six.movement-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .elig-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; gap: 16px 24px; }
  .elig-head { grid-column: 1; }
  .elig-form, .elig-hint { grid-column: 2; }
  .elig-hint { margin-top: -10px; }
  .elig-window, .elig-result, .elig-more, .turn-note { grid-column: 1 / -1; }
  .explorer-grid { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 960px) {
  .elig-card { display: flex; }
  .explorer-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-card { position: static; }
  .plan-stage { aspect-ratio: 1.55; }
  .trend-grid { grid-template-columns: minmax(0, 1fr); }
  .move-grid { grid-template-columns: minmax(0, 1fr); }
  .city-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .recent-feed { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .hero-grid { margin-bottom: 22px; }
  .elig-card { padding: 18px; border-radius: 24px; }
  .city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .city-card { min-height: 108px; padding: 13px; }
  .city-free b { font-size: 23px; }
  .plots-table { display: none; }
  .plots-card .plot-cards { display: grid; }
  .plots-card .table-foot { border-top: 0; }
  .plan-head { padding: 15px 16px 10px; }
  .plan-stats { margin: 12px 16px 0; }
  .plan-foot { padding-inline: 16px; }
  .plan-detail { padding-inline: 16px; }
  .plan-stage { margin-inline: 10px; aspect-ratio: 1.25; }
  .bars { height: 150px; gap: 4px; padding-inline: 16px; }
  .bar-col b { font-size: 13px; }
  .bar-col span { font-size: 13px; }
  .kpis--six.movement-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .balance-body { padding-inline: 16px; }
  .chart-note { padding-inline: 16px; }
  .city-bars { padding-inline: 16px; }
  .elig-result .result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-zoom button { width: 34px; height: 34px; }
  .section-head { gap: 8px; }
  .recent-feed { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 460px) {
  .hero-grid .hero h1 { font-size: 32px; }
  .hero-grid .hero-num { font-size: 44px; }
  .elig-card { padding: 15px; }
  .elig-form { flex-direction: column; }
  .btn-solid { width: 100%; }
  .city-grid { grid-template-columns: minmax(0, 1fr); }
  .city-card { min-height: 92px; }
  .city-free b { font-size: 25px; }
  .result-cell b { font-size: 15px; }
  .plan-foot .plan-key--note { margin-inline-start: 0; }
  .detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-col span { writing-mode: vertical-rl; }
}

/* ---------- عناصر مكمّلة ---------- */

.plan-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.recent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.recent-card {
  display: flex; flex-direction: column; gap: 0;
  padding: 15px 16px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); color: inherit;
  box-shadow: var(--shadow-xs);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.recent-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: color-mix(in srgb, var(--copper) 30%, var(--line)); color: inherit; }
.recent-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recent-city { font-size: 13px; color: var(--ink-3); }
.recent-time { font-size: 13px; color: var(--ink-4); }
.recent-plot { margin-top: 8px; font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--ink); }
.recent-zone { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-3); }
.recent-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-3); }
.recent-foot b { font-family: var(--display); font-size: 13px; color: var(--ink); }

.records-cards { display: none; }

@media (max-width: 1320px) {
  .recent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .recent-grid { grid-template-columns: minmax(0, 1fr); }
  .records-layout .records-table { display: none; }
  .records-cards { display: grid; grid-template-columns: minmax(0, 1fr); }
  .records-layout .table-foot { border-top: 0; }
}
@media (max-width: 460px) {
  .plan-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.head-kpis { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.head-kpi {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 96px; padding: 8px 13px;
  border: 1px solid var(--line); border-radius: 15px;
  background: var(--surface);
}
.head-kpi span { font-size: 13px; color: var(--ink-3); }
.head-kpi b { font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--ink); direction: ltr; unicode-bidi: isolate; }
.date-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  min-height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-3);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--grad-brand); border-color: transparent; box-shadow: var(--glow-brand); color: var(--on-brand); }

@media (max-width: 760px) {
  .head-kpis { justify-content: flex-start; }
  .records-cards { display: grid; }
  .records-layout .table-wrap { display: none; }
  .records-layout .table-foot { border-top: 0; }
}

.plan-note {
  margin: 8px 20px 16px;
  font-size: 13px; line-height: 1.55; color: var(--ink-4);
}
.plot-detail-in {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px; align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-2);
}
.plot-detail-no {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 11px; background: var(--brand); color: #fff;
  font-family: var(--display); font-size: 15px; font-weight: 600;
}
.plot-detail-in h4 { font-size: 13px; font-weight: 600; color: var(--ink); }
.plot-detail-in p { margin-top: 2px; font-size: 13px; line-height: 1.55; color: var(--ink-3); }
.plot-detail-in p b { color: var(--ink-2); }
.plot-detail-close { border: 0; background: transparent; color: var(--ink-4); font-size: 16px; line-height: 1; padding: 4px; }
.result-error { color: var(--copper); }
.recent-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.recent-down { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-4); }
.recent-foot b { color: var(--ink); }
.booked-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 0 8px; border-radius: 999px; background: var(--copper-soft); color: var(--copper); font-size: 13px; font-weight: 600; }
.booked-badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.records-cards { display: none; }
@media (max-width: 760px) {
  .records-cards { display: grid; }
  .records-layout .table-wrap { display: none; }
  .records-layout .table-foot { border-top: 0; }
  .plan-note { margin-inline: 16px; }
}

/* ---------- تفاصيل الخريطة والملاحظات ---------- */

.plan-note { padding: 10px 20px 16px; font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.plot-detail-in {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface-2);
}
.plot-detail-no {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 12px; background: var(--brand-soft); color: var(--brand);
  font-family: var(--display); font-size: 14px; font-weight: 600;
}
.plot-detail-in h4 { font-size: 13px; font-weight: 600; color: var(--ink); }
.plot-detail-in p { margin-top: 1px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.plot-detail-in p b { color: var(--ink-2); }
.plot-detail-close { border: 0; background: transparent; color: var(--ink-4); font-size: 16px; line-height: 1; padding: 4px; }
.plot-detail-close:hover { color: var(--copper); }
.result-error { padding: 9px 11px; border-radius: 11px; background: var(--copper-soft); color: var(--copper); font-size: 13px; line-height: 1.55; }
.recent-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: 13px; color: var(--ink-3); }
.recent-price { font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--ink); }
.recent-down { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-4); }

@media (max-width: 760px) {
  .plan-note { padding-inline: 16px; }
  .head-kpi { min-width: 82px; }
}

/* تدقيق الحالات الخاصة */
.plan-note { padding: 10px 20px 16px; font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.plot-detail-in {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface-2);
}
.plot-detail-no {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 12px; background: var(--brand-soft); color: var(--brand);
  font-family: var(--display); font-size: 14px; font-weight: 600;
}
.plot-detail-in h4 { font-size: 13px; font-weight: 600; color: var(--ink); }
.plot-detail-in p { margin-top: 1px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.plot-detail-in p b { color: var(--ink-2); }
.plot-detail-close { border: 0; background: transparent; color: var(--ink-4); font-size: 16px; line-height: 1; padding: 4px; }
.plot-detail-close:hover { color: var(--copper); }
.result-error { padding: 9px 11px; border-radius: 11px; background: var(--copper-soft); color: var(--copper); font-size: 13px; line-height: 1.55; }
.recent-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: 13px; color: var(--ink-3); }
.recent-price { font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--ink); }
.recent-down { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-4); }

@media (max-width: 760px) {
  .plan-note { padding-inline: 16px; }
  .head-kpi { min-width: 82px; }
}

/* إصلاحات الهيرو */
.hero-copy { min-width: 0; }
.hero-figure { min-width: 0; }
.hero-grid .hero h1 { font-size: clamp(34px, 3.8vw, 52px); overflow-wrap: break-word; }
.plan-stage .plan-empty { max-width: 300px; }

/* إصلاحات بعد المعاينة */
.hero-copy { min-width: 0; }
.hero-figure { min-width: 0; }
.hero-grid .hero h1 { font-size: clamp(34px, 3.6vw, 50px); }

/* إصلاحات التنسيق */
.hero-copy { min-width: 0; }
.hero-grid .hero h1 {
  font-size: clamp(32px, 3.2vw, 44px);
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.plan-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1180px) {
  .hero-grid { grid-template-columns: minmax(0, 1.5fr) minmax(360px, .8fr); }
}

@media (max-width: 900px) {
  .records-layout .records-table { display: none; }
  .records-cards { display: grid; grid-template-columns: minmax(0, 1fr); }
  .records-layout .table-wrap { display: none; }
  .records-layout .table-foot { border-top: 0; }
}

@media (min-width: 1180px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 390px; }
  .hero { grid-template-columns: minmax(0, 1.12fr) minmax(280px, .88fr); }
}

/* تنبيه الحجز الحيّ (live-watch.js): يظهر فقط حين تختفي قطعة من المتاح. */
.live-watch {
  position: fixed; bottom: 26px; inset-inline-end: 24px; z-index: 95;
  max-width: min(330px, calc(100vw - 32px));
  padding: 12px 16px 13px; border-radius: 16px;
  background: var(--obsidian); color: #f3f0e8;
  border-inline-start: 3px solid var(--gold);
  box-shadow: var(--shadow-md);
  font-family: var(--font); font-size: 13px; line-height: 1.6;
}
.live-watch strong { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.live-watch ul { margin: 5px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.live-watch li { font-size: 13px; color: #d5d9e6; }
.live-watch li.more { color: var(--mint); }
@media (prefers-reduced-motion: no-preference) {
  .live-watch { animation: live-watch-in .34s cubic-bezier(.22, 1, .36, 1); }
}
@keyframes live-watch-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* سوق ما بعد الحجز: مدخل ظاهر من الصفحة الرئيسية. */
.market-promo {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  margin: 22px 0 30px; padding: 22px 26px;
  border: 1px solid var(--line); border-radius: var(--radius-xl);
  background:
    radial-gradient(80% 120% at 100% 0%, color-mix(in srgb, var(--copper) 9%, transparent), transparent 58%),
    linear-gradient(165deg, var(--brand-tint), var(--surface) 64%);
}
.market-promo-copy { max-width: 62ch; }
.market-promo-copy h2 {
  margin-top: 4px;
  font-family: var(--display); font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 600; line-height: 1.1; letter-spacing: -.035em; color: var(--ink);
}
.market-promo-copy h2 em { font-style: normal; color: var(--copper); }
.market-promo-copy p:last-child { margin-top: 6px; font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.market-promo-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.market-promo-actions .btn-solid,
.market-promo-actions .btn-quiet { height: 42px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
@media (max-width: 700px) {
  .market-promo { padding: 18px; }
  .market-promo-actions { width: 100%; }
  .market-promo-actions a { flex: 1 1 auto; }
}
