/* ============================================================
   Jubail Survey Program — demo-specific styles
   (extends portal.css tokens; both themes supported)
   ============================================================ */

section { scroll-margin-top: 72px; }
.section-gap { height: 34px; }

.section-head { margin: 6px 0 14px; }
.section-head h2 { font-size: 17px; font-weight: 700; }
.section-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; max-width: 860px; line-height: 1.7; }

/* ---------- partner strip ---------- */
.partners { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.partner {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 9px 14px; min-width: 0; flex: 1 1 220px;
}
.partner .pmark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff;
}
.partner b { display: block; font-size: 12.5px; }
.partner span { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }

/* ---------- map notes ---------- */
.map-note { font-size: 10.5px; color: var(--ink-3); padding: 9px 18px 12px; }

/* ---------- phase cards ---------- */
.phase-card { border-top: 3px solid var(--pc, var(--accent)); }
.phase-card .ph-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.phase-card .ph-head .pnum {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  color: #fff; background: var(--pc, var(--accent));
}
.phase-card .ph-head b { font-size: 15px; }
.phase-card .ph-sub { font-size: 11.5px; color: var(--ink-3); margin-bottom: 12px; }
.phase-card .ph-kpi { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 12px; }
.phase-card .ph-kpi .v { font-size: 34px; font-weight: 650; letter-spacing: -0.01em; line-height: 1; }
.phase-card .ph-kpi .u { font-size: 12.5px; color: var(--ink-3); }
.scope-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.scope-list li { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.scope-list li svg { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--pc, var(--accent)); }

/* ---------- timeline ---------- */
.timeline { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 6px 2px 2px; }
.tl-step { flex: 1; min-width: 130px; position: relative; padding-top: 18px; }
.tl-step::before {
  content: ''; position: absolute; top: 5px; inset-inline-start: 0; inset-inline-end: 0;
  height: 2px; background: var(--grid);
}
.tl-step.done::before { background: var(--tc, var(--accent)); }
.tl-step .tl-dot {
  position: absolute; top: 0; inset-inline-start: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--tc, var(--accent)); border: 2.5px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}
.tl-step.todo .tl-dot { background: var(--surface-2); }
.tl-step b { display: block; font-size: 12px; }
.tl-step .tl-sub { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; padding-inline-end: 14px; }
.tl-step .chip { margin-top: 6px; }

/* ---------- deliverables ---------- */
.dl-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.dl-card { display: flex; flex-direction: column; gap: 9px; }
.dl-card .dl-ic {
  width: 36px; height: 36px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--dc, var(--accent)) 14%, transparent);
  color: var(--dc, var(--accent));
}
.dl-card .dl-ic svg { width: 19px; height: 19px; }
.dl-card b { font-size: 13px; }
.dl-card p { font-size: 11.5px; color: var(--ink-3); line-height: 1.65; }

.layers-fig { display: grid; place-items: center; padding: 6px 0 2px; }
.layers-fig svg { width: 100%; max-width: 420px; height: auto; }
.layers-fig text { font-family: var(--font); }

.est-tag {
  display: inline-block; font-size: 9.5px; font-weight: 700;
  color: var(--ink-3); border: 1px dashed var(--baseline);
  border-radius: 5px; padding: 1px 6px; margin-inline-start: 6px; vertical-align: 1px;
}

/* ---------- AI detection ---------- */
.scanline {
  position: absolute; top: 0; bottom: 0; width: 3px; z-index: 6;
  background: linear-gradient(to bottom, transparent, var(--s7) 18%, var(--s7) 82%, transparent);
  box-shadow: 0 0 14px 3px color-mix(in srgb, var(--s7) 55%, transparent);
  left: 0; pointer-events: none;
  transition: left 2.4s cubic-bezier(.45,.05,.55,.95);
}
.det-stats { display: flex; flex-direction: column; gap: 8px; }
.det-stat {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 10px 13px;
}
.det-stat .sw { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.det-stat .sw.line { height: 4px; border-radius: 2px; }
.det-stat .lb { font-size: 12px; color: var(--ink-2); }
.det-stat .ct { margin-inline-start: auto; font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.det-stat .ct small { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-inline-start: 3px; }
.det-stat.off { opacity: .45; }
.det-toggles { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.det-steps { margin-top: 14px; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.det-steps .micro { margin-bottom: 9px; }
.det-step { display: flex; align-items: flex-start; gap: 9px; font-size: 11.5px; color: var(--ink-2); padding: 4px 0; line-height: 1.6; }
.det-step .n {
  width: 19px; height: 19px; border-radius: 6px; flex: none; margin-top: 1px;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700;
  background: color-mix(in srgb, var(--s7) 14%, transparent); color: var(--s7);
}
.det-note { margin-top: 12px; font-size: 11px; color: var(--ink-3); line-height: 1.7; border-inline-start: 3px solid var(--s1); padding: 7px 11px; background: color-mix(in srgb, var(--s1) 6%, transparent); border-radius: 7px; }
.det-hint { padding: 22px 8px; text-align: center; font-size: 12px; color: var(--ink-3); line-height: 1.8; }

.maplibregl-popup-content {
  font-family: var(--font) !important;
  background: var(--surface-2) !important; color: var(--ink-1) !important;
  border: 1px solid var(--border); border-radius: 9px !important;
  padding: 10px 13px !important; font-size: 12px; box-shadow: var(--shadow) !important;
}
.maplibregl-popup-tip { border-top-color: var(--surface-2) !important; border-bottom-color: var(--surface-2) !important; }
.maplibregl-popup-close-button { color: var(--ink-3) !important; font-size: 15px; padding: 2px 7px !important; }
.det-pop b { display: block; font-size: 12.5px; margin-bottom: 3px; }
.det-pop span { display: block; color: var(--ink-3); font-size: 11px; line-height: 1.6; }

/* ---------- satellite swipe compare ---------- */
.swipe-wrap {
  position: relative; height: 520px; overflow: hidden;
  background: #0d0d10; direction: ltr;
  border-radius: 0; touch-action: pan-y;
}
@media (max-width: 1080px) { .swipe-wrap { height: 400px; } }
.swipe-wrap .swipe-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.swipe-wrap .swipe-top { z-index: 2; }
.swipe-handle {
  position: absolute; top: 0; bottom: 0; z-index: 5;
  width: 36px; margin-left: -18px; cursor: ew-resize;
  display: grid; place-items: center;
}
.sh-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.6); }
.sh-grip {
  position: relative; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; color: #222;
  display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.swipe-tag {
  position: absolute; top: 12px; z-index: 4; pointer-events: none;
  background: rgba(10,10,11,.78); color: #f0f0ee;
  border: 1px solid rgba(255,255,255,.2); border-radius: 7px;
  padding: 4px 11px; font-size: 11px; font-weight: 700; letter-spacing: .03em;
}
.tag-left { left: 12px; }
.tag-right { right: 12px; }
.swipe-wrap .maplibregl-ctrl-attrib { background: rgba(10,10,11,.7) !important; font-size: 9px; }
.swipe-wrap .maplibregl-ctrl-attrib a { color: #9a9aa2 !important; }

/* ---------- pixel resolution panels ---------- */
.pixel-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.pixel-cell { min-width: 0; }
.pixel-cell svg { display: block; width: 100%; height: auto; border-radius: 9px; border: 1px solid var(--border-soft); }
.pixel-cell b { display: block; font-size: 11.5px; margin-top: 7px; }
.pixel-cell span { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 1px; line-height: 1.5; }

/* ---------- AI report ---------- */
.ai-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700;
  color: var(--s7); background: color-mix(in srgb, var(--s7) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--s7) 30%, transparent);
  border-radius: 99px; padding: 4px 11px; white-space: nowrap;
}
.ai-badge svg { flex: none; }

.report-empty { padding: 26px 8px; text-align: center; }
.report-empty p { font-size: 12px; color: var(--ink-3); line-height: 1.7; max-width: 340px; margin: 0 auto 14px; }
.btn-primary {
  font-family: var(--font); font-size: 12.5px; font-weight: 700;
  color: #fff; background: var(--s7); border: none; border-radius: 9px;
  padding: 9px 20px; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.1); }

.gen-steps { display: flex; flex-direction: column; gap: 10px; padding: 18px 6px; }
.gen-step { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-3); }
.gen-step.on { color: var(--ink-1); }
.gen-step.done { color: var(--ink-2); }
.gen-step .gs-ic { width: 17px; height: 17px; flex: none; display: grid; place-items: center; }
.gen-spin {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--baseline); border-top-color: var(--s7);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gen-spin { animation: none; } }

.report { display: flex; flex-direction: column; gap: 12px; }
.report-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-head b { font-size: 13.5px; }
.report-kv { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.report-kv b { color: var(--ink-2); font-weight: 600; }
.report-sum { font-size: 12.5px; color: var(--ink-2); line-height: 1.75; }
.report-findings { display: flex; flex-direction: column; gap: 8px; }
.rf-row {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 9px; padding: 9px 12px;
}
.rf-row .chip { flex: none; margin-top: 1px; }
.rf-row .rf-tx { min-width: 0; }
.rf-row .rf-tx b { display: block; font-size: 12px; line-height: 1.5; }
.rf-row .rf-tx span { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.55; }
.report-rec {
  font-size: 12px; color: var(--ink-2); line-height: 1.7;
  border-inline-start: 3px solid var(--s7);
  background: color-mix(in srgb, var(--s7) 7%, transparent);
  border-radius: 8px; padding: 9px 12px;
}
.report-meta { font-size: 10px; color: var(--ink-3); line-height: 1.6; border-top: 1px dashed var(--baseline); padding-top: 9px; }
.report-actions { display: flex; gap: 8px; }

.alert-live {
  display: flex; align-items: center; gap: 10px;
  background: rgba(208,59,59,.10); border: 1px solid rgba(208,59,59,.4);
  border-radius: 9px; padding: 8px 12px; margin-bottom: 12px;
  font-size: 12px; color: var(--ink-1);
}

/* ---------- benefits / integration ---------- */
.benefits { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.benefit { display: flex; flex-direction: column; gap: 9px; }
.benefit .b-ic {
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--bc, var(--s7)) 14%, transparent); color: var(--bc, var(--s7));
}
.benefit .b-ic svg { width: 19px; height: 19px; }
.benefit b { font-size: 13px; }
.benefit p { font-size: 11.5px; color: var(--ink-3); line-height: 1.65; }

.closing {
  border: 1px solid var(--border-soft); border-inline-start: 3px solid var(--s7);
  border-radius: 12px; background: var(--surface);
  padding: 15px 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.8; max-width: 980px;
}
.closing b { color: var(--ink-1); }

/* ---------- patrol map markers ---------- */
.patrol-drone { position: relative; width: 30px; height: 30px; }
.patrol-drone .ping {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--mc, #9085e9); opacity: .5;
  animation: ping 2.6s ease-out infinite;
}
@media (prefers-reduced-motion: reduce) { .patrol-drone .ping { animation: none; opacity: 0; } }
.patrol-drone svg { position: absolute; inset: 6px; width: 18px; height: 18px; }

.alert-ping { position: relative; width: 18px; height: 18px; }
.alert-ping i {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--status-critical); opacity: .55;
  animation: ping 1.4s ease-out infinite;
}
.alert-ping::after {
  content: ''; position: absolute; inset: 5px; border-radius: 50%;
  background: var(--status-critical); border: 2px solid #fff;
}

@media (max-width: 820px) {
  .phase-card .ph-kpi .v { font-size: 28px; }
  .pixel-grid { grid-template-columns: repeat(2, 1fr); }
}
