/* ============================================================
   AI Analytics Agent — dark, monochrome, dynamic
   ============================================================ */
.ai { background: var(--dark); color: var(--dark-ink); position: relative; overflow: hidden; }
.ai .wrap { position: relative; z-index: 1; }
.ai .eyebrow { color: var(--dark-ink2); }
.ai .eyebrow::before { background: var(--dark-line2); }
.ai .sec-head h2.title { color: var(--dark-ink); }
.ai .sec-head .lead { color: var(--dark-ink2); }
.ai .demo-flag {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dark-ink2); border: 1px solid var(--dark-line2); background: var(--dark-2); border-radius: 999px;
  padding: 7px 14px; align-self: start;
}
.ai .demo-flag .b { width: 6px; height: 6px; border-radius: 50%; background: var(--dark-ink2); }

/* dashboard window */
.dash { margin-top: 48px; border: 1px solid var(--dark-line); border-radius: 16px; overflow: hidden; background: var(--dark-2); box-shadow: 0 60px 110px -55px rgba(0,0,0,.9); }
.dash-bar { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--dark-line); background: #08080a; }
.dash-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: #2a2a2c; }
.dash-bar .title { font-family: var(--mono); font-size: 12.5px; color: var(--dark-ink2); }
.dash-bar .title b { color: var(--dark-ink); font-weight: 600; }
.dash-bar .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.dash-bar .watermark { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dark-ink2); border: 1px solid var(--dark-line2); border-radius: 5px; padding: 3px 8px; }
.dash-bar .live { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11.5px; color: var(--dark-ink2); }
.dash-bar .live .d { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px color-mix(in oklab, var(--accent) 70%, transparent); animation: livepulse 2s infinite; }

.dash-body { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1px; background: var(--dark-line); }
@media (max-width: 900px) { .dash-body { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .dash { margin-top: 32px; border-radius: 12px; }
  .dash-bar { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .dash-bar .dots i { width: 8px; height: 8px; }
  .dash-bar .title { font-size: 11px; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dash-bar .right { gap: 8px; margin-left: auto; }
  .dash-bar .watermark { font-size: 9.5px; padding: 2px 6px; letter-spacing: .1em; }
  .dash-bar .live { font-size: 10px; }
  .dash-main, .dash-side { padding: 14px; }
  .chart-card, .bars-card { padding: 14px; }
  .ag-head { gap: 9px; flex-wrap: wrap; }
  .ag-status { font-size: 9.5px; margin-left: 0; }
}
.dash-main { background: var(--dark-2); padding: 22px; display: grid; gap: 16px; align-content: start; }
.dash-side { background: #0a0a0c; padding: 22px; display: grid; align-content: start; }

/* kpi row */
.kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; }
@media (max-width: 520px){ .kpis { grid-template-columns: 1fr; } }
.kpi-card { border: 1px solid var(--dark-line); border-radius: 11px; padding: 14px 15px; background: #121215; display: grid; gap: 7px; transition: border-color .4s var(--ease), background .4s var(--ease), box-shadow .4s var(--ease); }
.kpi-card.lit { border-color: color-mix(in oklab, var(--accent) 60%, var(--dark-line)); background: #18181c; box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 40%, transparent), 0 0 30px -8px color-mix(in oklab, var(--accent) 50%, transparent); }
.kpi-card .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dark-ink2); }
.kpi-card .v { font-family: var(--mono); font-size: clamp(22px,2.6vw,30px); font-weight: 700; letter-spacing: -0.02em; color: var(--dark-ink); }
.kpi-card .chg { font-family: var(--mono); font-size: 11px; display: inline-flex; align-items: center; gap: 5px; color: var(--dark-ink2); }
.kpi-card .chg.up::first-letter, .kpi-card .chg.dn::first-letter { color: var(--dark-ink); }

/* main chart */
.chart-card, .bars-card { border: 1px solid var(--dark-line); border-radius: 12px; background: #121215; padding: 18px; transition: border-color .4s var(--ease), box-shadow .4s var(--ease); }
.chart-card.lit, .bars-card.lit { border-color: color-mix(in oklab, var(--accent) 55%, var(--dark-line)); box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 35%, transparent), 0 0 30px -10px color-mix(in oklab, var(--accent) 45%, transparent); }
.chart-card .ch-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.chart-card .ch-head h4 { margin: 0; font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--dark-ink); }
.chart-card .ch-head .legend { display: flex; gap: 14px; font-family: var(--mono); font-size: 10.5px; color: var(--dark-ink2); }
.chart-card .ch-head .legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-card .ch-head .legend i { width: 14px; height: 0; border-top: 2px solid #fff; }
.chart-card .ch-head .legend i.dash { border-top: 2px dashed #6a6a69; }
.chart-wrap { position: relative; width: 100%; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.area-line { fill: none; stroke: #ffffff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--len,1200); stroke-dashoffset: var(--len,1200); }
.area-line.draw { transition: stroke-dashoffset 2s var(--ease); stroke-dashoffset: 0; }
.area-line.sec { stroke: #6a6a69; stroke-dasharray: 4 5; stroke-width: 1.5; opacity: .85; }
.area-fill { fill: url(#agrad); opacity: 0; transition: opacity 1.4s ease .6s; }
.area-fill.show { opacity: 1; }
.dot-live { fill: var(--accent); }
.grid-line { stroke: rgba(255,255,255,.06); stroke-width: 1; }

/* bars */
.bars-card h4 { margin: 0 0 14px; font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--dark-ink); }
.bars { display: flex; align-items: flex-end; gap: 9px; height: 96px; }
.bars .bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; transition: opacity .4s; }
.bars .bar .col { width: 100%; height: 0; background: linear-gradient(180deg, #ffffff, #8a8a88); border-radius: 4px 4px 0 0; transition: height 1s var(--ease), background .4s; }
.bars .bar.mut .col { background: #34343a; }
.bars .bar .bl { flex: none; margin-top: 6px; font-family: var(--mono); font-size: 9.5px; color: var(--dark-ink2); text-align: center; }

/* ---- AI Analytics Agent panel ---- */
.agent { display: grid; gap: 16px; align-content: start; height: 100%; }
.ag-head { display: flex; align-items: center; gap: 11px; }
.ai-orb { width: 30px; height: 30px; border-radius: 9px; flex: none; background: radial-gradient(circle at 32% 28%, #ffffff, #76767a 55%, #1c1c20); position: relative; box-shadow: 0 0 18px -4px rgba(255,255,255,.4); }
.ai-orb::after { content:""; position:absolute; inset:0; border-radius:9px; box-shadow:0 0 0 0 rgba(255,255,255,.5); animation: orbpulse 2.4s ease-in-out infinite; }
@keyframes orbpulse { 0%,100%{box-shadow:0 0 0 0 rgba(255,255,255,.0)} 50%{box-shadow:0 0 0 6px rgba(255,255,255,.06)} }
.ag-id { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--dark-ink); line-height: 1.25; }
.ag-id small { display: block; font-weight: 400; color: var(--dark-ink2); font-size: 10.5px; }
.ag-status { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--dark-ink2); }
.ag-status em { font-style: normal; transition: opacity .3s; }
.dot3 { display: inline-flex; gap: 3px; }
.dot3 i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: .3; animation: dot3 1.2s infinite; }
.dot3 i:nth-child(2){ animation-delay: .2s; } .dot3 i:nth-child(3){ animation-delay: .4s; }
@keyframes dot3 { 0%,100%{opacity:.25} 50%{opacity:1} }

.ag-now {
  font-family: var(--mono); font-size: 14px; line-height: 1.55; color: var(--dark-ink);
  min-height: 66px; padding: 14px 15px; border-radius: 10px;
  background: #121215; border: 1px solid var(--dark-line);
}
.ag-now .hl { color: #fff; font-weight: 600; border-bottom: 1px solid var(--accent); }
.ag-cursor { display: inline-block; width: 7px; height: 14px; background: #fff; vertical-align: -2px; margin-left: 1px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.ag-findings { display: grid; gap: 8px; align-content: start; }
.ag-finding {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
  font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--dark-ink2);
  opacity: 0; transform: translateY(6px); animation: findIn .45s var(--ease) forwards;
}
@keyframes findIn { to { opacity: 1; transform: none; } }
.ag-finding .mk { width: 16px; height: 16px; border-radius: 5px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 9px; font-weight: 700; margin-top: 1px; }
.ag-finding b { color: var(--dark-ink); font-weight: 600; }

.ai-foot { margin-top: 30px; display: grid; gap: 18px; }
.ai-cred { font-family: var(--mono); font-size: 13.5px; color: var(--dark-ink2); line-height: 1.65; max-width: 72ch; }
.ai-cred b { color: var(--dark-ink); font-weight: 600; }
.stack-row { display: flex; gap: 8px; flex-wrap: wrap; }
.stack-row .chip { font-family: var(--mono); font-size: 12px; color: var(--dark-ink); border: 1px solid var(--dark-line2); border-radius: 7px; padding: 6px 12px; background: #121215; }
