/* رصد — RASD | by BASEL
   ترتيب مستوحى من ناظم: لوحة داكنة، طابع رقمي، دقة في الأرقام */

:root {
  /* نظام ألوان مطابق لناظم */
  --bg: #0b1014;
  --surface: #131a20;
  --surface-2: #1a232b;
  --border: #26323c;
  --border-soft: rgba(255,255,255,0.06);

  --cyan: #2fb8c6;
  --cyan-dim: rgba(47,184,198,0.12);
  --cyan-glow: rgba(47,184,198,0.28);
  --violet: #7c83db;
  --mint: #2ED9A8;
  --amber: #e8a93a;
  --amber-dim: rgba(232,169,58,0.12);
  --coral: #d9594a;
  --coral-dim: rgba(217,89,74,0.12);

  --text: #e6edf0;
  --muted: #7c8894;
  --text-muted: #7c8894;
  --muted-2: #5a6670;

  --cta: #e8f4f6;
  --cta-text: #03181a;

  --font: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;
  --font-display: 'Noto Kufi Arabic', 'IBM Plex Sans Arabic', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius: 8px;
  --radius-sm: 6px;
  --max: 72rem; /* Nazim max-w-6xl */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; direction: rtl; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 2; /* Nazim leading-8 ≈ 2 for Arabic body */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
@media (max-width: 640px) { .container { padding: 0 1rem; } }
.mono { font-family: var(--mono); direction: ltr; unicode-bidi: plaintext; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
::selection { background: var(--cyan); color: var(--bg); }

/* ── Nav ── */
.navbar {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem 1.5rem;
  background: rgba(11,16,20,0.90);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(38,50,60,0.80);
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.35rem; letter-spacing: 0.02em;
  color: var(--cyan);
}
.brand-by {
  color: var(--muted); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--radius);
}
.nav-links { display: flex; gap: 0.35rem; list-style: none; flex-wrap: wrap; }
.nav-links a {
  color: var(--muted); font-size: 0.875rem; font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius); transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-cta {
  background: var(--cta); color: var(--cta-text);
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 700;
  transition: opacity 0.15s;
}
.nav-cta:hover { opacity: 0.9; }
@media (max-width: 980px) { .nav-links { display: none; } }

/* ── Hero ── */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  padding: 7.5rem 0 4.5rem;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 70% 20%, rgba(47,184,198,0.16), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(47,184,198,0.06), transparent 50%),
    linear-gradient(180deg, #0b1014 0%, #0e151b 50%, #0b1014 100%),
    linear-gradient(rgba(38,50,60,0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38,50,60,0.35) 1px, transparent 1px);
  background-size: auto, auto, auto, 48px 48px, 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}
.hero-inner { position: relative; z-index: 1; max-width: 48rem; text-align: start; }

.hero-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.35rem; }
.tag-soft, .tag-accent, .tag-by {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface);
}
.tag-soft { color: var(--muted); }
.tag-accent {
  color: var(--cyan); border-color: rgba(47,184,198,0.3);
  background: var(--cyan-dim);
}
.tag-by {
  color: var(--amber); border-color: rgba(232,169,58,0.35);
  background: var(--amber-dim); letter-spacing: 0.1em;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700; line-height: 1; margin: 0 0 0.45rem;
  color: var(--cyan); letter-spacing: 0;
}
.hero-name .mono {
  font-family: var(--mono);
  font-size: 0.28em; font-weight: 500; color: var(--muted);
  letter-spacing: 0.08em; vertical-align: middle; margin-inline-start: 0.35rem;
}
.hero-role {
  color: var(--muted); font-size: 1.05rem; font-weight: 500;
  margin: 0 0 1.1rem; max-width: 540px;
}

.hero h1 {
  font-size: clamp(1.25rem, 3vw, 1.875rem);
  font-weight: 600; line-height: 1.65; margin: 1.5rem 0 1.1rem;
  color: var(--text); max-width: 48rem;
}
.hero-desc {
  color: var(--muted); font-size: 1rem; max-width: 42rem;
  margin-bottom: 1.75rem; line-height: 2;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2.5rem; }

.btn-primary {
  display: inline-flex; align-items: center;
  background: var(--cta); color: var(--cta-text);
  padding: 12px 20px; border-radius: var(--radius);
  font-weight: 700; font-size: 0.875rem;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-ghost {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); color: var(--text);
  background: rgba(19,26,32,0.80);
  padding: 12px 20px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.875rem;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.hero-metrics, .map-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
}
@media (max-width: 800px) {
  .hero-metrics, .map-meta { grid-template-columns: repeat(2, 1fr); }
}
.metric {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.15rem;
}
.metric.compact { padding: 0.9rem 1rem; }
.metric-val {
  display: block; font-size: 1.45rem; font-weight: 600;
  color: #fff; margin-bottom: 0.2rem;
}
.metric-label { display: block; font-size: 0.78rem; color: var(--muted); }
.metric-sub { display: block; font-size: 0.7rem; color: var(--muted-2); margin-top: 0.35rem; }

/* ── Sections ── */
.section { padding: 4rem 0; border-bottom: 1px solid var(--border); }
@media (min-width: 640px) { .section { padding: 5rem 0; } }
.section-alt { background: transparent; border-block: none; border-bottom: 1px solid var(--border); }
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1.5rem; margin-bottom: 2.5rem; flex-wrap: wrap;
}
.eyebrow {
  display: block; color: var(--cyan); font-size: 0.75rem; font-weight: 500;
  font-family: var(--mono); letter-spacing: 0.02em; margin-bottom: 0.5rem;
}
.section-head h2 {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem); font-weight: 700; line-height: 1.4;
  max-width: 48rem;
}
.section-desc { color: var(--muted); font-size: 0.95rem; max-width: 28rem; line-height: 2; }

/* ── Offer (ماذا أقدّم) — أسلوب بطاقات ناظم ── */
.offer-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
  margin-bottom: 2rem;
}
@media (max-width: 980px) { .offer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .offer-grid { grid-template-columns: 1fr; } }

.offer-card {
  background: transparent; border: none; border-radius: 0;
  padding: 0; transition: transform 0.2s ease;
}
.offer-card:hover { transform: translateY(-2px); border-color: transparent; }
.offer-num {
  display: block; color: var(--cyan); font-size: 0.75rem;
  font-family: var(--mono); letter-spacing: 0.08em; margin-bottom: 0.85rem;
}
.offer-card h3 {
  font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; line-height: 1.5;
  color: var(--text);
}
.offer-card p {
  color: var(--muted); font-size: 0.875rem; line-height: 1.85; margin: 0;
}

.offer-audience {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.85rem;
  padding: 1.25rem 1.35rem; border-radius: var(--radius);
  border: 1px solid rgba(47,184,198,0.28); background: var(--cyan-dim);
}
.offer-audience-head { display: flex; flex-direction: column; gap: 0.25rem; }
.offer-audience-label {
  font-weight: 700; font-size: 0.95rem; color: var(--cyan);
}
.offer-audience-sub {
  margin: 0; font-size: 0.86rem; color: var(--muted); font-weight: 500;
}
.offer-audience-chips {
  display: flex; flex-wrap: wrap; gap: 0.55rem;
  list-style: none; margin: 0; padding: 0;
}
.audience-tag {
  display: inline-flex; align-items: center;
  padding: 7px 14px; border-radius: 8px; font-size: 0.82rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  cursor: default; user-select: none; pointer-events: none;
  box-shadow: none;
}

/* ── Try path (جرّب المنصة) ── */
.try-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
@media (max-width: 980px) { .try-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .try-grid { grid-template-columns: 1fr; } }

.try-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.35rem 1.25rem;
  color: inherit; text-decoration: none;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  min-height: 100%;
}
.try-card:hover {
  border-color: var(--cyan);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}
.try-step {
  display: block; color: var(--amber); font-size: 0.72rem;
  letter-spacing: 0.08em; margin-bottom: 0.75rem; font-weight: 600;
}
.try-card h3 {
  font-size: 1.02rem; font-weight: 700; margin-bottom: 0.55rem; line-height: 1.4;
}
.try-card p {
  color: var(--muted); font-size: 0.86rem; line-height: 1.7;
  margin: 0 0 1rem; flex: 1;
}
.try-cta {
  font-size: 0.82rem; font-weight: 600; color: var(--cyan);
}

/* ── Method ── */
.method-grid {
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 1rem; align-items: start;
}
@media (max-width: 860px) { .method-grid { grid-template-columns: 1fr; } }
.method-list { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.method-item {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  width: 100%; text-align: right;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem 1.15rem;
  transition: 0.15s;
}
.method-item:hover { border-color: #344552; }
.method-item.active {
  background: var(--cyan-dim); border-color: rgba(47,184,198,0.4);
  box-shadow: 0 0 0 1px rgba(47,184,198,0.15);
}
.method-item .t { font-weight: 600; font-size: 0.92rem; }
.method-item.active .t { color: var(--cyan); }
.method-item .chev { color: var(--muted-2); }
.method-item.active .chev { color: var(--cyan); transform: scaleX(-1); }

.method-detail {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem; min-height: 280px;
}
.method-detail-num {
  font-family: var(--mono); color: var(--cyan); font-size: 0.8rem;
  margin-bottom: 1rem; letter-spacing: 0.06em;
}
.method-detail h3 { font-size: 1.15rem; margin-bottom: 0.65rem; }
.method-detail p { color: var(--muted); font-size: 0.92rem; max-width: 460px; }
.method-stat {
  display: inline-flex; margin-top: 1.25rem;
  padding: 5px 12px; border-radius: 999px;
  background: var(--cyan-dim); color: var(--cyan);
  font-size: 0.78rem; font-weight: 600; font-family: var(--mono);
}

/* ── KPIs ── */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem;
}
@media (max-width: 980px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.15rem;
  transition: border-color 0.15s, transform 0.2s ease;
}
.kpi-card:hover { transform: translateY(-2px); border-color: rgba(47,184,198,0.35); }
.kpi-card.warn { border-color: rgba(217,89,74,0.35); background: linear-gradient(180deg, var(--coral-dim), var(--surface) 55%); }
.kpi-card.gold { border-color: rgba(232,169,58,0.35); background: linear-gradient(180deg, var(--amber-dim), var(--surface) 55%); }
.kpi-code {
  font-family: var(--mono); font-size: 0.72rem; color: var(--cyan);
  letter-spacing: 0.08em; margin-bottom: 0.85rem;
}
.kpi-value {
  font-family: var(--mono); font-size: 1.6rem; font-weight: 600;
  color: var(--cyan); direction: ltr; text-align: right; margin-bottom: 0.25rem;
}
.kpi-card.warn .kpi-value { color: var(--coral); }
.kpi-card.gold .kpi-value { color: var(--amber); }
.kpi-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.2rem; }
.kpi-hint { font-size: 0.75rem; color: var(--muted); line-height: 1.6; }

.risk-strip {
  margin-top: 1rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.65rem;
  background: var(--surface); border: 1px solid rgba(217,89,74,0.25);
  border-radius: var(--radius); padding: 1rem 1.15rem;
}
.risk-strip-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem; width: 100%;
}
.risk-strip-label { color: var(--coral); font-size: 0.82rem; font-weight: 700; }
.risk-strip-note {
  margin: 0; font-size: 0.78rem; color: var(--muted); line-height: 1.7; max-width: 52rem;
}
.risk-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.risk-chip {
  background: var(--coral-dim); color: var(--coral);
  border: 1px solid rgba(217,89,74,0.25);
  padding: 4px 11px; border-radius: var(--radius); font-size: 0.78rem; font-weight: 600;
}

/* ── Charts / Panels ── */
.charts-grid, .insights-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem;
}
@media (max-width: 800px) {
  .charts-grid, .insights-grid { grid-template-columns: 1fr; }
}
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.panel-full { grid-column: 1 / -1; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.75rem; margin-bottom: 1.1rem;
}
.panel-head h3 { font-size: 0.92rem; font-weight: 600; }
.panel-tag {
  color: var(--muted); font-size: 0.7rem;
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px;
}
.panel canvas { max-height: 280px; }

/* ── Factors & metrics ── */
.factor-list { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.factor-row {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 0.75rem; align-items: center;
}
.factor-rank {
  font-family: var(--mono); font-size: 0.72rem; color: var(--cyan);
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid rgba(47,184,198,0.35); display: grid; place-items: center;
}
.factor-name { font-size: 0.88rem; font-weight: 500; }
.factor-bar-wrap { grid-column: 2 / -1; height: 5px; background: var(--border); border-radius: 4px; overflow: hidden; }
.factor-bar { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--amber)); border-radius: 4px; }
.factor-val { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

.metrics-table { display: grid; gap: 0.55rem; }
.metric-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.7rem 0.85rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.metric-row span:first-child { color: var(--muted); font-size: 0.85rem; }
.metric-row span:last-child { font-family: var(--mono); font-weight: 600; color: #fff; }

/* ── Table ── */
.table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: auto;
}
.data-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.data-table th {
  text-align: right; font-size: 0.72rem; color: var(--muted); font-weight: 600;
  padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.data-table td {
  padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border-soft);
  font-size: 0.86rem;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table td.mono { color: var(--muted); }
.rank-pill {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid rgba(217,89,74,0.4); color: var(--coral);
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
}
.fail-cell { display: flex; align-items: center; gap: 10px; }
.fail-track { width: 72px; height: 5px; background: var(--border); border-radius: 4px; position: relative; flex-shrink: 0; }
.fail-fill { position: absolute; inset: 0; background: linear-gradient(90deg, var(--amber), var(--coral)); border-radius: 4px; }

/* ── Map ── */
.map-meta { margin-bottom: 1rem; }
.map-frame {
  width: 100%; height: 500px; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
}
.map-frame iframe { width: 100%; height: 100%; border: none; }

/* ── Report ── */
.report-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; text-align: right;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.4rem;
}
.report-toggle:hover { border-color: #344552; }
.report-toggle b { display: block; margin-bottom: 3px; }
.report-toggle span { color: var(--muted); font-size: 0.82rem; }
.report-toggle-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--cyan-dim); color: var(--cyan); font-size: 1.2rem;
  transition: transform 0.25s;
}
.report-toggle.open .report-toggle-icon { transform: rotate(45deg); }
.report-panel { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.report-panel.open { max-height: 5000px; }
.report-box {
  background: var(--surface-2); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius); padding: 1.75rem; margin-top: -1px;
}
.report-box h1 { font-size: 1.25rem; margin-bottom: 0.85rem; }
.report-box h2 { font-size: 1rem; color: var(--cyan); margin: 1.5rem 0 0.65rem; }
.report-box p, .report-box li { color: var(--muted); margin-bottom: 0.45rem; }
.report-box strong { color: var(--text); }

/* ── Footer ── */
.footer { border-top: 1px solid var(--border); background: #090d11; }
.footer-top {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1.25rem; padding: 2rem 0;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-links a { color: var(--muted); font-size: 0.82rem; }
.footer-links a:hover { color: var(--cyan); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem;
  padding: 1.15rem 0; border-top: 1px solid var(--border);
  font-size: 0.74rem; color: var(--muted-2);
}

.fade-in { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── Workflow Ops Room ── */
.wf-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem;
}
.wf-toolbar-right { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.wf-legend {
  display: flex; flex-wrap: wrap; gap: 0.85rem;
  font-size: 0.75rem; color: var(--muted);
}
.wf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.lg-input { background: #7c8894; }
.lg-process { background: var(--cyan); }
.lg-model { background: #7c83db; }
.lg-output { background: var(--mint); }
.lg-decision { background: var(--amber); }

.wf-layout {
  display: grid; grid-template-columns: 1.55fr 0.9fr; gap: 1rem; align-items: start;
}
@media (max-width: 980px) { .wf-layout { grid-template-columns: 1fr; } }

.wf-canvas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.1rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.wf-canvas::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background:
    linear-gradient(rgba(38,50,60,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38,50,60,0.5) 1px, transparent 1px);
  background-size: 28px 28px;
}

.wf-row {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 0.55rem; margin-bottom: 0.35rem;
}
.wf-row-center { justify-content: center; }

.wf-node {
  position: relative; z-index: 1;
  min-width: 148px; max-width: 180px; flex: 1 1 148px;
  text-align: right;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s, background 0.15s;
}
.wf-node:hover { border-color: #3d4d5a; transform: translateY(-1px); }
.wf-node.active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(47,184,198,0.35), 0 10px 30px rgba(47,184,198,0.12);
  background: rgba(47,184,198,0.08);
}
.wf-node.done { border-color: rgba(46,217,168,0.45); }
.wf-node.pulse {
  animation: wf-pulse 0.7s ease;
}
@keyframes wf-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.wf-node.type-input { border-top: 2px solid #7c8894; }
.wf-node.type-process { border-top: 2px solid var(--cyan); }
.wf-node.type-model { border-top: 2px solid #7c83db; }
.wf-node.type-output { border-top: 2px solid var(--mint); }
.wf-node.type-decision {
  border-top: 2px solid var(--amber);
  max-width: 220px; min-width: 200px;
  background: linear-gradient(180deg, var(--amber-dim), var(--surface-2) 60%);
}

.wf-code {
  display: block; color: var(--muted-2); font-size: 0.68rem;
  letter-spacing: 0.08em; margin-bottom: 0.35rem;
}
.wf-title { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 0.15rem; }
.wf-sub { display: block; color: var(--muted); font-size: 0.72rem; }

.wf-arrow {
  color: var(--muted-2); font-size: 0.95rem; font-family: var(--mono);
  flex: 0 0 auto; opacity: 0.7;
}

.wf-join {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 0.35rem; margin: 0.55rem 0 0.75rem;
}
.wf-join-line {
  width: 2px; height: 18px;
  background: linear-gradient(to bottom, transparent, var(--cyan), transparent);
}
.wf-join-label {
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.1rem;
  font-size: 0.78rem; font-weight: 700; color: var(--text);
  padding: 5px 12px; border-radius: 10px;
  border: 1px solid rgba(47,184,198,0.3); background: var(--cyan-dim);
  letter-spacing: 0;
}
.wf-join-en {
  font-size: 0.62rem; font-weight: 500; color: var(--cyan);
  letter-spacing: 0.08em;
}
.wf-legend small {
  margin-inline-start: 0.25rem; font-size: 0.62rem; color: var(--muted); letter-spacing: 0.06em;
}

.wf-branch {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem;
  margin: 0.75rem 0 0.35rem;
}
@media (max-width: 640px) { .wf-branch { grid-template-columns: 1fr; } }
.wf-branch-arm {
  display: flex; flex-direction: column; align-items: center; gap: 0.45rem;
}
.wf-branch-tag {
  font-size: 0.65rem; letter-spacing: 0.1em;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border);
}
.wf-branch-tag.warn { color: var(--coral); border-color: rgba(217,89,74,0.35); background: var(--coral-dim); }
.wf-branch-tag.ok { color: var(--mint); border-color: rgba(46,217,168,0.35); background: rgba(46,217,168,0.1); }
.wf-branch-arm .wf-node { width: 100%; max-width: 240px; }

.wf-detail {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.35rem; min-height: 360px;
  position: sticky; top: 76px;
}
.wf-detail-empty span {
  display: block; color: var(--cyan); font-size: 0.72rem;
  letter-spacing: 0.1em; margin-bottom: 0.75rem;
}
.wf-detail-empty p { color: var(--muted); font-size: 0.9rem; line-height: 1.8; }
.wf-detail-kicker {
  font-family: var(--mono); color: var(--cyan); font-size: 0.72rem;
  letter-spacing: 0.1em; margin-bottom: 0.55rem;
}
.wf-detail-body h3 { font-size: 1.1rem; margin-bottom: 0.55rem; }
.wf-detail-body p { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.8; }
.wf-detail-meta {
  display: grid; gap: 0.45rem; margin-bottom: 1rem;
}
.wf-meta-row {
  display: flex; justify-content: space-between; gap: 0.75rem;
  padding: 0.55rem 0.7rem; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.8rem;
}
.wf-meta-row span:first-child { color: var(--muted); }
.wf-meta-row span:last-child { font-family: var(--mono); color: #fff; font-weight: 600; }
.wf-detail-next {
  display: inline-flex; margin-top: 0.25rem;
  padding: 5px 11px; border-radius: 999px;
  background: var(--cyan-dim); color: var(--cyan);
  font-size: 0.75rem; font-weight: 600;
}

.wf-log {
  margin-top: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.wf-log-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--border);
  font-size: 0.82rem; font-weight: 600;
}
.wf-log-head .wf-log-status {
  color: var(--cyan); font-size: 0.8rem; font-weight: 600;
}
.wf-log-list {
  list-style: none; max-height: 180px; overflow: auto;
  padding: 0.5rem 0;
}
.wf-log-list li {
  display: grid; grid-template-columns: 64px 1fr; gap: 0.75rem;
  padding: 0.45rem 1.1rem; font-size: 0.82rem; color: var(--muted);
  border-bottom: 1px solid var(--border-soft);
}
.wf-log-list li:last-child { border-bottom: none; }
.wf-log-list .t { font-family: var(--mono); color: var(--cyan); font-size: 0.72rem; }
.data-provenance {
  margin-top: 1.35rem;
  font-size: 0.72rem;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}
.skeleton-line { margin-bottom: 0.85rem; }
.skeleton-block {
  height: 14px; border-radius: 6px; margin-bottom: 0.65rem;
  background: linear-gradient(90deg, var(--surface-2), rgba(47,184,198,0.12), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-block.short { width: 62%; }
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.wf-log-list .live { color: var(--text); }

.data-loading {
  color: var(--muted); font-size: 0.88rem; padding: 0.75rem 0;
  grid-column: 1 / -1;
}
.data-error {
  color: var(--coral); font-size: 0.88rem; padding: 0.75rem 0;
  grid-column: 1 / -1;
}
.metric-val.is-loading {
  color: var(--muted-2);
  animation: pulse-load 1.2s ease-in-out infinite;
}
@keyframes pulse-load {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.report-fallback {
  white-space: pre-wrap; font-family: var(--font); color: var(--muted);
  font-size: 0.9rem; line-height: 1.8;
}

@media (max-width: 640px) {
  .hero { padding: 6.5rem 0 3rem; }
  .section { padding: 3.75rem 0; }
  .container { padding: 0 1.1rem; }
  .wf-arrow { display: none; }
  .wf-node { max-width: none; }
}

