/* Home-page dashboard sections and hero extras. Loaded after theme.css. */
body { background: radial-gradient(ellipse 80% 55% at 72% 30%, rgba(42, 116, 255, 0.28), transparent 70%), #01030c; }
.orb-panel { padding-bottom: 70px; }
.orb-panel::after {
  content: "";
  position: absolute;
  left: -10%; right: -10%; bottom: -60px; height: 160px;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  border-top: 2px solid rgba(42, 116, 255, 0.8);
  box-shadow: 0 -14px 50px rgba(42, 116, 255, 0.45), inset 0 20px 60px rgba(42, 116, 255, 0.18);
  pointer-events: none;
  z-index: -1;
}
.layer-tag { position: absolute; right: 8px; bottom: 6px; margin: 0; text-align: right; font-size: 0.75rem; letter-spacing: 0.18em; color: var(--cyan); line-height: 1.5; }
.layer-tag strong { color: #fff; letter-spacing: 0.22em; }
.scroll-hint { position: absolute; left: 8px; bottom: 6px; display: flex; align-items: center; gap: 10px; color: var(--soft-text); text-decoration: none; font-size: 0.78rem; }
.scroll-hint i { width: 18px; height: 28px; border: 1.5px solid var(--cyan); border-radius: 10px; position: relative; }
.scroll-hint i::after { content: ""; position: absolute; left: 50%; top: 5px; width: 3px; height: 6px; margin-left: -1.5px; border-radius: 2px; background: var(--cyan); }
.feature-trio { border-top: 0; }

.dash-section { width: 100%; max-width: 1180px; margin: 56px auto 0; display: grid; gap: 18px; text-transform: none; scroll-margin-top: 16px; }
.dash-section.two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.dash-head h2 { margin: 0; font-size: clamp(1.7rem, 3.6vw, 2.5rem); letter-spacing: -0.02em; color: #fff; }
.dash-head p { margin: 6px 0 0; color: var(--soft-text); }
.online-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border: 1px solid var(--edge); border-radius: 999px; background: rgba(7, 18, 46, 0.8); font-size: 0.85rem; color: var(--text); }
.online-pill i, .live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2bd47d; box-shadow: 0 0 8px #2bd47d; display: inline-block; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; color: #2bd47d; margin-left: 8px; }
.dash-grid { display: grid; gap: 18px; }
.dash-grid.top { grid-template-columns: 1.6fr 1fr; }
.dash-grid.mid, .dash-grid.bottom { grid-template-columns: 1fr 1fr; }
.dash-card { padding: 20px; border: 1px solid var(--edge); border-radius: 16px; background: linear-gradient(180deg, rgba(10, 26, 68, 0.78), rgba(5, 12, 34, 0.9)); box-shadow: var(--glow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 1.05rem; color: #fff; display: flex; align-items: center; gap: 6px; }
.card-head a { color: var(--cyan); font-size: 0.85rem; text-decoration: none; }
.muted { color: var(--soft-text); font-size: 0.8rem; }

.upload-card { text-align: center; border-style: dashed; border-color: rgba(42, 116, 255, 0.6); display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 220px; }
.upload-card.drag { background: rgba(42, 116, 255, 0.25); }
.upload-icon { width: 54px; height: 54px; fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.upload-card h3 { margin: 4px 0 0; font-size: 1.2rem; color: #fff; }
.upload-card p { margin: 0; color: var(--soft-text); }
.upload-status { min-height: 1.2em; font-size: 0.82rem; font-family: Consolas, monospace; }
.pill-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 24px; border: 1px solid rgba(110, 160, 255, 0.7); border-radius: 999px; background: linear-gradient(180deg, #2a74ff, #1450c8); color: #fff; font-family: inherit; font-size: 0.92rem; font-weight: 600; text-decoration: none; cursor: pointer; box-shadow: 0 0 16px rgba(42, 116, 255, 0.45); margin-top: 8px; }
.pill-button:hover { filter: brightness(1.15); }
.pill-button.small { min-height: 32px; padding: 0 16px; font-size: 0.82rem; }

.mascot-card { display: flex; align-items: center; gap: 16px; }
.mascot-card img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 2px solid var(--cyan); box-shadow: 0 0 20px rgba(42, 116, 255, 0.55); cursor: pointer; flex: none; }
.mascot-card strong { color: var(--cyan); letter-spacing: 0.08em; }
.mascot-card p { margin: 6px 0 0; font-style: italic; color: var(--text); }

.report-list, .legend, .flow-list, .mini-findings { list-style: none; margin: 0; padding: 0; }
.report-list li { border-bottom: 1px solid var(--edge); }
.report-list li:last-child { border: 0; }
.report-list li.empty { padding: 18px 0; color: var(--soft-text); }
.report-list a { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--text); text-decoration: none; }
.r-icon { width: 34px; height: 34px; border-radius: 9px; background: rgba(42, 116, 255, 0.22); border: 1px solid var(--edge); flex: none; }
.r-info { display: grid; flex: 1; min-width: 0; }
.r-info strong { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-info small { color: var(--soft-text); }
.tag { padding: 3px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: capitalize; }
.tag.low { background: rgba(43, 212, 125, 0.18); color: #2bd47d; }
.tag.medium { background: rgba(240, 180, 40, 0.2); color: #f0b428; }
.tag.high { background: rgba(255, 77, 77, 0.2); color: #ff6b6b; }

.wave-canvas, .flow-canvas { width: 100%; display: block; }
.wave-canvas { height: 150px; }
.donut-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 130px; height: 130px; transform: rotate(-90deg); flex: none; }
.donut-bg { fill: none; stroke: rgba(42, 116, 255, 0.15); stroke-width: 14; }
.donut-seg { fill: none; stroke-width: 14; }
.donut-label { fill: #fff; font: 700 20px Calibri, sans-serif; transform: rotate(90deg); transform-origin: 60px 60px; }
.legend li { display: flex; align-items: center; gap: 10px; padding: 3px 0; font-size: 0.9rem; }
.legend i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend span { flex: 1; min-width: 70px; }
.legend b { color: #fff; }
.legend.big li { padding: 5px 0; }

.findings-mini { display: flex; align-items: center; gap: 16px; }
.shield { width: 56px; height: 56px; fill: none; stroke: #2bd47d; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; filter: drop-shadow(0 0 8px rgba(43, 212, 125, 0.5)); }
.findings-mini p { margin: 0; color: var(--soft-text); }
.findings-mini strong { color: #fff; }
.mini-findings { display: grid; gap: 8px; width: 100%; }
.mini-findings li { display: flex; gap: 10px; align-items: center; }

.flow-card { overflow: hidden; }
.seg { display: inline-flex; border: 1px solid var(--edge); border-radius: 999px; overflow: hidden; }
.seg button { padding: 6px 16px; border: 0; background: transparent; color: var(--soft-text); font: inherit; font-size: 0.82rem; cursor: pointer; }
.seg button.active { background: var(--cyan); color: #fff; }
.flow-body { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; }
.flow-stage { min-height: 300px; position: relative; }
.flow-canvas { height: 300px; }
.flow-list { display: grid; gap: 10px; }
.flow-list[hidden], .flow-canvas[hidden] { display: none; }
.flow-list li { display: flex; align-items: center; gap: 10px; }
.flow-list i { width: 10px; height: 10px; border-radius: 50%; }
.flow-list span { color: var(--soft-text); font-size: 0.85rem; }
.flow-side { display: grid; align-content: space-between; gap: 14px; }
.mini-log, .terminal-out { margin: 0; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 10px; background: rgba(1, 4, 14, 0.85); font: 0.82rem/1.6 Consolas, "Courier New", monospace; color: #7fe0a6; white-space: pre-wrap; word-break: break-word; }
.terminal-out { min-height: 150px; }
.prompt { color: var(--cyan); font-family: Consolas, monospace; }

.chat-badge { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.beta { padding: 2px 8px; border-radius: 6px; background: rgba(42, 116, 255, 0.25); color: var(--cyan); font-size: 0.7rem; }
.chat-demo { display: grid; gap: 12px; }
.bubble { margin: 0; padding: 12px 14px; border-radius: 14px; font-size: 0.92rem; line-height: 1.45; }
.bubble.user { justify-self: end; max-width: 80%; background: linear-gradient(180deg, #2a74ff, #1450c8); color: #fff; }
.bubble.bot { background: rgba(2, 8, 24, 0.85); border: 1px solid var(--edge); }
.bubble.bot p { margin: 0 0 8px; }
.bubble.bot ul { margin: 4px 0 10px; padding-left: 18px; color: var(--soft-text); }
.bubble-row { display: flex; gap: 10px; align-items: flex-start; }
.bubble-row img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--cyan); flex: none; }
.demo-note { margin: 0; font-size: 0.75rem; color: var(--soft-text); }
.assistant-form { display: flex; gap: 8px; margin-top: 14px; }
.assistant-form input { flex: 1; min-width: 0; padding: 12px 16px; border: 1px solid var(--edge); border-radius: 999px; background: rgba(1, 4, 14, 0.85); color: var(--text); font: inherit; text-transform: none; }
.assistant-form input:focus { outline: none; border-color: var(--cyan); }
.assistant-form button { width: 44px; border: 0; border-radius: 50%; background: var(--cyan); color: #fff; cursor: pointer; font-size: 1rem; }
.stack { display: grid; gap: 18px; }
.explore-card { display: flex; align-items: center; gap: 14px; position: relative; }
.explore-card[hidden] { display: none; }
.explore-card img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--cyan); }
.explore-card strong { color: #fff; }
.explore-card p { margin: 2px 0 0; color: var(--soft-text); }
.explore-card button { position: absolute; top: 8px; right: 10px; border: 0; background: transparent; color: var(--soft-text); font-size: 1.3rem; cursor: pointer; }
.wave-banner { position: relative; padding: 0; overflow: hidden; min-height: 110px; }
.wave-banner canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.banner-text { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 110px; }
.banner-text img { height: 44px; }
.banner-text span { letter-spacing: 0.4em; font-weight: 700; color: #fff; }

/* Analysis results: match the dashboard card look */
.results-panel { margin-top: 56px; padding: 24px; border-radius: 20px; background: transparent; border: 1px solid var(--edge); text-transform: none; }
.result-header h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
.kpi-card, .detail-card, .plain-sidebar, .chart-card, .plain-card {
  border: 1px solid var(--edge);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(10, 26, 68, 0.78), rgba(5, 12, 34, 0.9));
  box-shadow: var(--glow);
}
.kpi-card.accent { background: linear-gradient(160deg, rgba(42, 116, 255, 0.6), rgba(5, 12, 34, 0.92)); }
.kpi-card strong { font-weight: 700; letter-spacing: -0.03em; color: #fff; }
.kpi-label, .detail-title { font-size: 0.8rem; letter-spacing: 0.06em; color: var(--cyan); font-weight: 700; }
.chart-card { padding: 16px; background: rgba(2, 8, 24, 0.7); box-shadow: none; }
.bar { border-radius: 999px; overflow: hidden; background: rgba(42, 116, 255, 0.14); }
.bar-fill { border-radius: 999px; }
.finding { border-top-color: var(--edge); }
.pill, .verdict-badge, .sec-chip, .chip, .copy-filter { border-radius: 999px; box-shadow: none; }
.pill { min-width: 0; padding: 0 14px; font-size: 0.72rem; letter-spacing: 0.06em; }
.pill.high { background: rgba(255, 77, 77, 0.2); border-color: rgba(255, 107, 107, 0.6); color: #ff8a8a; }
.pill.medium { background: rgba(240, 180, 40, 0.2); border-color: rgba(240, 180, 40, 0.6); color: #f0b428; }
.pill.low { background: rgba(43, 212, 125, 0.18); border-color: rgba(43, 212, 125, 0.55); color: #2bd47d; }
.verdict-review { background: rgba(240, 180, 40, 0.2); border-color: rgba(240, 180, 40, 0.6); color: #f0b428; }
.verdict-attention { background: rgba(255, 77, 77, 0.2); border-color: rgba(255, 107, 107, 0.6); color: #ff8a8a; }
.verdict-ok { background: rgba(43, 212, 125, 0.18); border-color: rgba(43, 212, 125, 0.55); color: #2bd47d; }
.evidence { border: 1px solid var(--edge); border-radius: 10px; background: rgba(1, 4, 14, 0.85); }
.evidence code { color: #7fe0a6; }
.copy-filter { background: rgba(42, 116, 255, 0.2); border: 1px solid var(--edge); color: #fff; padding: 3px 12px; cursor: pointer; }
.ap-table th, .ap-table td { border-bottom: 1px solid var(--edge); }
.ap-table th { color: var(--cyan); }
.sec-chip { background: rgba(42, 116, 255, 0.2); border-color: var(--edge); }
.sigbar { border-radius: 999px; overflow: hidden; background: rgba(42, 116, 255, 0.15); }
.sigbar i { background: var(--cyan); }
.chip { background: rgba(42, 116, 255, 0.18); border-color: var(--edge); }
.plain-sidebar { padding: 18px; }
.plain-card { background: rgba(2, 8, 24, 0.7); box-shadow: none; }
.glossary summary { color: var(--cyan); }

@media (max-width: 860px) {
  .dash-grid.top, .dash-grid.mid, .dash-grid.bottom, .dash-section.two-col, .flow-body { grid-template-columns: 1fr; }
}

/* Assistant page */
[data-page="assistant"] .chatbot { display: none; }
.assistant-layout { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); align-items: stretch; }
.assistant-layout .chat-card { display: flex; flex-direction: column; min-height: 520px; }
.assistant-log { flex: 1; display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.msg p { margin: 0; padding: 12px 14px; border-radius: 14px; font-size: 0.95rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; max-width: 80%; }
.msg.user p { background: linear-gradient(180deg, #2a74ff, #1450c8); color: #fff; }
.msg.bot { align-self: flex-start; max-width: 90%; }
.msg.bot p { background: rgba(2, 8, 24, 0.85); border: 1px solid var(--edge); }
.msg p.error { border-color: rgba(255, 107, 107, 0.6); color: #ff8a8a; }
.companion { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.companion-img { width: min(100%, 320px); aspect-ratio: 1; object-fit: contain; border: 0; background: none; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 18px rgba(42, 116, 255, 0.35)); transform-origin: 50% 92%; }
.companion-img.hop { animation: companion-hop 0.5s ease; }
.companion-caption { margin: 0; padding: 8px 16px; border: 1px solid var(--edge); border-radius: 999px; background: rgba(7, 18, 46, 0.8); color: var(--text); font-size: 0.9rem; }
@keyframes companion-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes companion-hop { 0% { transform: scale(1.04, 0.94); } 50% { transform: scale(0.98, 1.04); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .companion-img, .companion-img.hop { animation: none; } }
@media (max-width: 860px) { .assistant-layout { grid-template-columns: 1fr; } }
.companion-shadow { width: 70%; height: 34px; margin-top: -62px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.8) 0%, rgba(20, 60, 160, 0.35) 45%, transparent 72%); filter: blur(4px); }
