/* ============================================================
 * Vilkax · /predict — Human Risk Intelligence Engine demonstrator
 * Reuses the /scan palette (--scan-*) + the /features monoline
 * icon technique for a single, cohesive premium system.
 * ============================================================ */

.predict-page { background: var(--scan-bg); min-height: 100dvh; }

/* ── Hero ─────────────────────────────────────────────────── */
.predict-hero {
  text-align: center;
  padding: clamp(64px, 8vw, 100px) 24px 36px;
  position: relative;
}
.predict-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 50% -10%, rgba(91,107,255,0.14), transparent 70%);
  pointer-events: none;
}
.predict-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(91,107,255,0.38);
  background: rgba(91,107,255,0.10);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--scan-accent-text);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.predict-badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--scan-accent);
  box-shadow: 0 0 0 0 rgba(91,107,255,0.6);
  animation: predictPulse 2.4s ease-out infinite;
}
@keyframes predictPulse {
  0%   { box-shadow: 0 0 0 0 rgba(91,107,255,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(91,107,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(91,107,255,0); }
}
.predict-hero h1 {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--scan-ink-0);
  margin: 0 0 16px;
  line-height: 1.15;
}
.predict-hero p {
  font-size: clamp(14px, 2vw, 17px);
  color: var(--scan-ink-2);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Panel ────────────────────────────────────────────────── */
.predict-panel {
  max-width: 720px;
  margin: 0 auto 40px;
  padding: 0 20px;
}

/* Scenario selector — three rich cards */
.predict-scenarios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.predict-scenario {
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.028);
  color: var(--scan-ink-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.predict-scenario:hover { background: rgba(255,255,255,0.05); transform: translateY(-1px); }
.predict-scenario[aria-pressed="true"] {
  background: rgba(91,107,255,0.12);
  border-color: rgba(91,107,255,0.55);
  box-shadow: 0 0 0 1px rgba(91,107,255,0.20), 0 8px 24px -12px rgba(91,107,255,0.4);
}

/* Monoline glyph — same masked-gradient technique as /features .fx-mini-glyph */
.predict-scenario-glyph {
  width: 34px; height: 34px;
  border-radius: 10px;
  position: relative;
  background: linear-gradient(150deg, rgba(96,165,250,0.16), rgba(59,130,246,0.04));
  border: 1px solid rgba(96,165,250,0.28);
  overflow: hidden;
}
.predict-scenario-glyph::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(150deg, #93C5FD, #60A5FA 55%, #3B82F6);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: 19px 19px; mask-size: 19px 19px;
  filter: drop-shadow(0 0 5px rgba(96,165,250,0.40));
}
.pg-message::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 15a2 2 0 0 1-2 2H8l-4 3V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z'/%3E%3Cpath d='M9 10h6M9 13h4'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 15a2 2 0 0 1-2 2H8l-4 3V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z'/%3E%3Cpath d='M9 10h6M9 13h4'/%3E%3C/svg%3E"); }
.pg-device::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='3' width='12' height='18' rx='2'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='3' width='12' height='18' rx='2'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E"); }
.pg-fraud::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='18' height='13' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M8 3v3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='18' height='13' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M8 3v3'/%3E%3C/svg%3E"); }
.predict-scenario-title { font-size: 14px; font-weight: 700; color: var(--scan-ink-0); }
.predict-scenario[aria-pressed="true"] .predict-scenario-title { color: var(--scan-accent-text); }
.predict-scenario-note { font-size: 11.5px; color: var(--scan-ink-3); line-height: 1.4; }

/* Own-message input */
.predict-textarea-wrap {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.028);
  overflow: hidden;
  transition: border-color 0.15s;
}
.predict-textarea-wrap:focus-within {
  border-color: rgba(91,107,255,0.5);
  box-shadow: 0 0 0 3px rgba(91,107,255,0.10);
}
#predict-input {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 14px 16px;
  font: inherit;
  font-size: 14px;
  color: var(--scan-ink-0);
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  line-height: 1.6;
  box-sizing: border-box;
}
#predict-input::placeholder { color: var(--scan-ink-4); }
.predict-input-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px 11px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
#predict-char-count { font-size: 11px; color: var(--scan-ink-4); }
.predict-input-hint { font-size: 11px; color: var(--scan-ink-4); margin-left: auto; }

/* When the active scenario is not the message one, dim the input pane */
#predict-text-pane { transition: opacity 0.15s; }
#predict-text-pane[data-inactive="true"] { opacity: 0.45; }

/* Run button */
.predict-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px 24px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--scan-accent) 0%, var(--scan-accent-end) 100%);
  color: var(--scan-ink-0);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 4px 20px rgba(91,107,255,0.28);
}
.predict-btn:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.predict-btn:active:not(:disabled) { transform: translateY(0); }
.predict-btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.predict-btn--loading { opacity: 0.7; cursor: default; }

/* ── Result ───────────────────────────────────────────────── */
.predict-result {
  max-width: 720px;
  margin: 0 auto 32px;
  padding: 0 20px;
  animation: predictResultIn 0.32s cubic-bezier(0.18,0.9,0.28,1.08);
}
@keyframes predictResultIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.predict-card {
  border-radius: 18px;
  border: 1px solid var(--verdict-border);
  background: var(--verdict-bg);
  padding: 22px 24px;
}

/* Verdict header + predicted probability */
.predict-verdict-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.predict-verdict-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--verdict-icon-bg);
  flex-shrink: 0;
}
.predict-verdict-icon svg { width: 22px; height: 22px; stroke: var(--verdict-fg); }
.predict-verdict-label {
  font-size: 20px;
  font-weight: 800;
  color: var(--verdict-fg);
  letter-spacing: -0.01em;
}
.predict-verdict-conf {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--verdict-fg);
  opacity: 0.8;
  background: var(--verdict-icon-bg);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Big harm-probability + horizon read */
.predict-harm {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 4px;
}
.predict-harm-pct {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--verdict-fg);
  line-height: 1;
}
.predict-harm-label {
  font-size: 12.5px;
  color: var(--scan-ink-2);
  line-height: 1.4;
  max-width: 320px;
}
.predict-horizon-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--verdict-fg);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--verdict-fg);
  border-radius: 999px;
  padding: 4px 11px;
}

/* Section label */
.predict-sec-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--scan-ink-4);
  margin: 20px 0 12px;
}

/* Six human-risk dimension bars */
.predict-dims { display: flex; flex-direction: column; gap: 10px; }
.predict-dim { display: grid; grid-template-columns: 108px 1fr 40px; align-items: center; gap: 12px; }
.predict-dim-name { font-size: 12.5px; font-weight: 600; color: var(--scan-ink-1); }
.predict-dim-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.predict-dim-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--scan-accent), var(--scan-accent-text));
  width: 0;
  transition: width 0.6s cubic-bezier(0.2,0.7,0.2,1);
}
.predict-dim[data-dominant="true"] .predict-dim-name { color: var(--verdict-fg); }
.predict-dim[data-dominant="true"] .predict-dim-fill {
  background: linear-gradient(90deg, var(--verdict-fg), var(--verdict-fg));
}
.predict-dim-val { font-size: 11.5px; font-weight: 700; color: var(--scan-ink-2); text-align: right; }

/* Plain-language narrative + prediction */
.predict-narrative {
  margin-top: 6px;
  font-size: 14px;
  color: var(--scan-ink-1);
  line-height: 1.6;
}
.predict-prediction {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  font-size: 13px;
  color: var(--scan-ink-2);
  line-height: 1.55;
}
.predict-prediction strong { color: var(--scan-ink-0); font-weight: 700; }

/* Reasons — why the engine thinks so */
.predict-reasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.predict-reasons li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--scan-ink-1);
  line-height: 1.5;
}
.predict-reasons-dot {
  flex-shrink: 0;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--verdict-fg);
  margin-top: 7px;
  opacity: 0.7;
}

/* Recommended action */
.predict-action {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(91,107,255,0.08);
  border: 1px solid rgba(91,107,255,0.25);
}
.predict-action-glyph {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  position: relative;
  background: linear-gradient(150deg, rgba(96,165,250,0.16), rgba(59,130,246,0.04));
  border: 1px solid rgba(96,165,250,0.28);
  overflow: hidden;
}
.predict-action-glyph::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(150deg, #93C5FD, #60A5FA 55%, #3B82F6);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: 17px 17px; mask-size: 17px 17px;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 4.2-2.9 7-7 8.5C7.9 18 5 15.2 5 11V6l7-3z'/%3E%3Cpath d='M9 11.5l2 2 4-4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 4.2-2.9 7-7 8.5C7.9 18 5 15.2 5 11V6l7-3z'/%3E%3Cpath d='M9 11.5l2 2 4-4'/%3E%3C/svg%3E");
}
.predict-action-body { min-width: 0; }
.predict-action-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--scan-accent-text); margin-bottom: 4px;
}
.predict-action-text { font-size: 13.5px; color: var(--scan-ink-0); font-weight: 600; line-height: 1.45; }
.predict-action-reason { font-size: 12px; color: var(--scan-ink-2); margin-top: 4px; line-height: 1.45; }
.predict-review {
  margin-top: 10px;
  font-size: 12px;
  color: var(--scan-watch-fg);
  display: flex;
  align-items: center;
  gap: 7px;
}
.predict-review-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--scan-watch-fg); }

/* How it works — the honest journey + stages */
.predict-journey {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--scan-ink-2);
  line-height: 1.55;
  font-style: italic;
}
.predict-stages { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.predict-stage {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: var(--scan-ink-2); line-height: 1.45;
}
.predict-stage-num {
  flex-shrink: 0;
  width: 18px; height: 18px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800;
  color: var(--scan-accent-text);
  background: rgba(91,107,255,0.12);
  border: 1px solid rgba(91,107,255,0.28);
}

/* Footer row — model + run-again + caveat */
.predict-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.predict-model-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--scan-ink-4);
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}
.predict-again-btn {
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(91,107,255,0.4);
  background: rgba(91,107,255,0.10);
  color: var(--scan-accent-text);
  cursor: pointer;
  transition: background 0.12s;
}
.predict-again-btn:hover { background: rgba(91,107,255,0.18); }
.predict-caveat {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--scan-ink-3);
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.028);
  border: 1px solid rgba(255,255,255,0.06);
}
.predict-caveat strong { color: var(--scan-warn-fg); font-weight: 700; }

/* Verdict themes — reuse /scan colour tokens */
.predict-card[data-band="ok"] {
  --verdict-bg: rgba(34,197,94,0.07);
  --verdict-border: rgba(34,197,94,0.30);
  --verdict-fg: var(--scan-ok-fg);
  --verdict-icon-bg: rgba(34,197,94,0.14);
}
.predict-card[data-band="watch"] {
  --verdict-bg: rgba(96,165,250,0.07);
  --verdict-border: rgba(96,165,250,0.30);
  --verdict-fg: var(--scan-watch-fg);
  --verdict-icon-bg: rgba(96,165,250,0.14);
}
.predict-card[data-band="warn"] {
  --verdict-bg: rgba(245,158,11,0.07);
  --verdict-border: rgba(245,158,11,0.30);
  --verdict-fg: var(--scan-warn-fg);
  --verdict-icon-bg: rgba(245,158,11,0.14);
}
.predict-card[data-band="block"] {
  --verdict-bg: rgba(239,68,68,0.07);
  --verdict-border: rgba(239,68,68,0.32);
  --verdict-fg: var(--scan-block-fg);
  --verdict-icon-bg: rgba(239,68,68,0.14);
}

/* Loading skeleton */
.predict-loading {
  max-width: 720px;
  margin: 0 auto 32px;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.028);
  text-align: center;
  color: var(--scan-ink-2);
  font-size: 13.5px;
}
.predict-loading-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--scan-accent);
  margin-right: 8px;
  animation: predictPulse 1.4s ease-out infinite;
  vertical-align: middle;
}

/* Error state — mirrors /scan */
.predict-error {
  border-radius: 12px;
  border: 1px solid rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.06);
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--scan-block-fg);
  margin: 12px auto 0;
  max-width: 720px;
  box-sizing: border-box;
  padding-left: calc(20px + 14px);
  padding-right: calc(20px + 14px);
  line-height: 1.5;
}

/* display:flex/grid would override the UA [hidden]{display:none} rule */
#predict-result[hidden], #predict-error[hidden] { display: none; }

/* Privacy footer */
.predict-privacy {
  text-align: center;
  font-size: 11px;
  color: var(--scan-ink-5);
  letter-spacing: 0.04em;
  padding: 4px 20px 60px;
  max-width: 720px;
  margin: 0 auto;
}
.predict-privacy-sep { margin: 0 8px; opacity: 0.5; }

/* Responsive */
@media (max-width: 640px) {
  .predict-scenarios { grid-template-columns: 1fr; }
  .predict-dim { grid-template-columns: 92px 1fr 36px; gap: 10px; }
  .predict-verdict-conf { display: none; }
  .predict-harm-pct { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .predict-badge-dot, .predict-loading-dot { animation: none; }
  .predict-result { animation: none; }
  .predict-dim-fill { transition: none; }
  .predict-btn { transition: none; }
}
