:root {
  --mf-bg: #07090d;
  --mf-panel: rgba(255,255,255,.055);
  --mf-panel-2: rgba(255,255,255,.085);
  --mf-line: rgba(255,255,255,.12);
  --mf-text: #f5f1e8;
  --mf-muted: rgba(245,241,232,.68);
  --mf-gold: #d8b45d;
  --mf-soft: rgba(216,180,93,.16);
  --mf-danger: #ef8b70;
  --mf-good: #8fe0b1;
}

.mf-shell, .mf-shell * { box-sizing: border-box; }
.mf-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto;
  padding: 28px;
  border: 1px solid var(--mf-line);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(216,180,93,.18), transparent 35%),
    linear-gradient(135deg, #07090d, #101520 58%, #07090d);
  color: var(--mf-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 28px 90px rgba(0,0,0,.38);
}
.mf-hero { display: grid; grid-template-columns: 1fr 280px; gap: 22px; align-items: stretch; margin-bottom: 22px; }
.mf-kicker { margin: 0 0 10px; color: var(--mf-gold); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; }
.mf-hero h1 { margin: 0; font-size: clamp(34px, 5vw, 68px); line-height: .96; letter-spacing: -.06em; max-width: 880px; }
.mf-subtitle { color: var(--mf-muted); max-width: 720px; font-size: 17px; line-height: 1.55; margin: 18px 0 0; }
.mf-status-card, .mf-card {
  border: 1px solid var(--mf-line);
  background: var(--mf-panel);
  border-radius: 22px;
  padding: 22px;
  backdrop-filter: blur(18px);
}
.mf-status-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 190px; }
.mf-status-card span, .mf-status-card small, .mf-card small { color: var(--mf-muted); }
.mf-status-card strong { font-size: 28px; line-height: 1.1; }
.mf-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px; border: 1px solid var(--mf-line); border-radius: 18px; margin-bottom: 18px; background: rgba(255,255,255,.035); }
.mf-tabs button, .mf-flow-node, .mf-ask-box button {
  border: 1px solid var(--mf-line);
  background: rgba(255,255,255,.06);
  color: var(--mf-text);
  border-radius: 999px;
  padding: 11px 15px;
  cursor: pointer;
  white-space: nowrap;
}
.mf-tabs button.is-active, .mf-ask-box button { background: var(--mf-soft); border-color: rgba(216,180,93,.45); color: #ffe4a2; }
.mf-panel { display: none; }
.mf-panel.is-active { display: block; }
.mf-grid { display: grid; gap: 16px; }
.mf-grid-2 { grid-template-columns: 1.2fr .8fr; }
.mf-grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.mf-large h2, .mf-card h2 { margin: 0 0 16px; font-size: 34px; letter-spacing: -.04em; }
.mf-card h3 { margin: 0 0 12px; font-size: 22px; }
.mf-state-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.mf-state-grid div, .mf-signal, .mf-risk-row, .mf-haven, .mf-causal {
  border: 1px solid var(--mf-line);
  border-radius: 18px;
  background: rgba(255,255,255,.045);
  padding: 16px;
}
.mf-state-grid span { display:block; color: var(--mf-muted); font-size: 13px; margin-bottom: 8px; }
.mf-state-grid strong { line-height: 1.35; }
.mf-signal { display: grid; grid-template-columns: 38px 1fr; gap: 4px 10px; align-items: center; margin-bottom: 10px; }
.mf-signal strong { grid-row: span 2; font-size: 25px; color: var(--mf-good); }
.mf-signal.mf-down strong { color: var(--mf-danger); }
.mf-signal small { grid-column: 2; }
.mf-flow-list { display: grid; gap: 10px; margin-top: 12px; }
.mf-flow-node { width: 100%; display: grid; grid-template-columns: 1fr 160px 1.7fr; gap: 12px; align-items: center; text-align: left; border-radius: 18px; }
.mf-flow-node:hover, .mf-flow-node.is-selected { border-color: rgba(216,180,93,.55); background: rgba(216,180,93,.12); }
.mf-causal { margin-top: 16px; }
.mf-causal p:last-child { color: var(--mf-muted); line-height: 1.65; margin-bottom: 0; }
.mf-cycle-ring { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.mf-cycle-phase { min-height: 120px; border: 1px solid var(--mf-line); border-radius: 24px; display: grid; place-items: center; color: var(--mf-muted); background: rgba(255,255,255,.045); }
.mf-cycle-phase.is-active { color: #ffe4a2; border-color: rgba(216,180,93,.65); background: var(--mf-soft); box-shadow: inset 0 0 40px rgba(216,180,93,.08); }
.mf-mini p { margin: 8px 0; color: var(--mf-muted); }
.mf-meter { height: 8px; background: rgba(255,255,255,.11); border-radius: 99px; overflow: hidden; margin: 14px 0 8px; }
.mf-meter span { display: block; height: 100%; background: var(--mf-gold); border-radius: inherit; }
.mf-risk-row { display: grid; grid-template-columns: 1fr 160px 120px; gap: 14px; margin-bottom: 10px; color: var(--mf-muted); }
.mf-risk-row strong { color: var(--mf-text); }
.mf-haven p { margin: 10px 0 0; color: var(--mf-muted); line-height: 1.5; }
.mf-ask-box { display: flex; gap: 10px; margin: 18px 0; }
.mf-ask-box input { flex: 1; border: 1px solid var(--mf-line); background: rgba(0,0,0,.28); color: var(--mf-text); border-radius: 999px; padding: 14px 16px; font-size: 15px; }
.mf-answer { border: 1px solid rgba(216,180,93,.35); background: var(--mf-soft); border-radius: 18px; padding: 18px; }
.mf-answer p { color: var(--mf-muted); line-height: 1.65; margin: 10px 0; }
@media (max-width: 860px) {
  .mf-shell { width: min(100% - 20px, 1180px); padding: 18px; border-radius: 22px; }
  .mf-hero, .mf-grid-2, .mf-grid-3 { grid-template-columns: 1fr; }
  .mf-flow-node, .mf-risk-row { grid-template-columns: 1fr; }
  .mf-cycle-ring, .mf-state-grid { grid-template-columns: 1fr; }
}
