/* Aida: conversations | the conversation and its journey | Aida's assessment */
.aida-page {
  --grid: rgba(7, 37, 98, 0.035);
  --panel-shadow: 0 1px 2px rgba(7, 37, 98, 0.04), 0 10px 28px rgba(7, 37, 98, 0.07);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .aida-page { --grid: rgba(255, 255, 255, 0.025); --panel-shadow: none; }
}

:root[data-theme="dark"] .aida-page { --grid: rgba(255, 255, 255, 0.025); --panel-shadow: none; }

.aida-main { gap: 16px; grid-template-columns: 340px minmax(0, 1fr) 360px; padding: 16px 20px 20px; }

.aida-page .desk-panel { border-radius: 16px; box-shadow: var(--panel-shadow); }

.aida-page .desk-notice { font-size: 12.5px; padding: 6px 24px; }

.aida-page .desk-panel-head { padding: 14px 16px; }

/* segmented tabs */
.aida-page .desk-tabs { background: var(--surface-3); border-radius: 999px; gap: 2px; padding: 3px; }

.aida-page .desk-tab { border: 0; border-radius: 999px; padding: 5px 12px; }

.aida-page .desk-tab[aria-selected="true"] { background: var(--card-bg); box-shadow: 0 1px 3px rgba(7, 37, 98, 0.12); color: var(--ink); }

.aida-page .desk-tab b { color: var(--accent-text); }

/* ---------- list ---------- */
#list { display: flex; flex-direction: column; gap: 4px; padding: 8px; }

.ai-item { align-items: flex-start; background: transparent; border: 1px solid transparent; border-radius: 12px; color: var(--ink); cursor: pointer; display: flex; font: inherit; gap: 12px; padding: 12px; text-align: left; width: 100%; }

.ai-item:hover { background: var(--hover); }

.ai-item[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent-line); }

.ai-item.waiting { box-shadow: inset 3px 0 0 var(--hot); }

.ai-body { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }

.ai-top { align-items: baseline; display: flex; gap: 8px; justify-content: space-between; }

.ai-top strong { font-family: var(--font-head, inherit); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ai-top small { color: var(--muted); flex: none; font-size: 11.5px; }

.ai-typing { color: var(--accent-text); font-style: normal; font-weight: 600; }

.ai-sub { color: var(--muted); font-size: 12px; }

.ai-phase { display: flex; flex-direction: column; gap: 5px; margin-top: 5px; }

.ai-seg { display: grid; gap: 3px; grid-template-columns: repeat(5, minmax(0, 1fr)); }

.ai-seg i { background: var(--track); border-radius: 2px; height: 4px; }

.ai-seg i.done { background: var(--accent); }

.ai-seg i.now { animation: seg-pulse 1.6s ease-in-out infinite; background: var(--bar); }

.waiting .ai-seg i.now { background: var(--hot); }

@keyframes seg-pulse { 50% { opacity: 0.45; } }

.ai-phase-text { color: var(--ink-2); font-size: 12px; }

.ai-phase-text b { color: var(--accent-text); font-variant-numeric: tabular-nums; margin-right: 2px; }

.ai-last { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ai-last b { color: var(--ink-2); font-weight: 600; }

/* ---------- conversation ---------- */
.cv-thread {
  background-color: var(--bg);
  background-image: linear-gradient(90deg, var(--grid) 1px, transparent 1px), linear-gradient(0deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
}

.cv-thread .dm-list { padding: 20px 24px 16px; }

/* ---------- Aida's assessment ---------- */
.mind { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px 20px; }

.mind-facts { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }

.mind-facts > div { background: var(--surface-3); border-radius: 10px; min-width: 0; padding: 8px 10px; }

.mind-facts dt { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

.mind-facts dd { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; gap: 1px; margin: 3px 0 0; overflow-wrap: anywhere; }

.mind-facts dd small { color: var(--muted); font-size: 11.5px; font-weight: 400; }

.mind-score { align-items: center; border: 1px solid var(--line); border-radius: 12px; display: flex; gap: 14px; padding: 12px 14px; }

.mind-score > div { display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 0; }

.mind-score strong { font-size: 13px; }

.mind-score.empty span { color: var(--muted); font-size: 12px; line-height: 1.45; }

.mind-score svg { flex: none; }

.ring-track { fill: none; stroke: var(--track); stroke-width: 7; }

.ring-fill { fill: none; stroke-linecap: round; stroke-width: 7; }

.mind-score text.ring-empty { fill: var(--muted); }

.mind-score.empty > div { align-items: flex-start; text-align: left; }

.mind-score text { fill: var(--ink); font-family: var(--font-num, inherit); font-size: 22px; font-weight: 800; }

.mind-meter { align-items: center; color: var(--ink-2); display: grid; font-size: 11.5px; gap: 6px; grid-template-columns: 58px minmax(0, 1fr) 24px; }

.mm-track { background: var(--track); border-radius: 3px; height: 5px; overflow: hidden; }

.mm-track i { background: var(--bar); border-radius: 3px; display: block; height: 100%; }

.mind-meter b { font-variant-numeric: tabular-nums; text-align: right; }

.mind-h { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; margin: 2px 0 -4px; text-transform: uppercase; }

.mind-timeline { list-style: none; margin: 0; padding: 0; }

.mind-timeline > li { position: relative; }

.mind-timeline > li:not(:last-child)::before { background: var(--line); bottom: 0; content: ""; left: 12px; position: absolute; top: 28px; width: 2px; }

.mind-timeline > li.mt-done:not(:last-child)::before { background: var(--accent-line); }

.mind-step summary { align-items: center; cursor: pointer; display: flex; gap: 10px; list-style: none; padding: 4px 0 10px; }

.mind-step summary::-webkit-details-marker { display: none; }

.mind-node { align-items: center; border-radius: 50%; display: inline-flex; flex: none; height: 26px; justify-content: center; position: relative; width: 26px; z-index: 1; }

.mind-step[open] .mind-node { box-shadow: 0 0 0 3px var(--accent-soft); }

.mind-step-title { font-size: 13.5px; font-weight: 600; }

.mind-step summary::after { color: var(--muted); content: "▾"; font-size: 11px; margin-left: auto; transition: transform 0.15s ease; }

.mind-step:not([open]) summary::after { transform: rotate(-90deg); }

.mind-step ul { display: flex; flex-direction: column; gap: 9px; list-style: none; margin: -2px 0 12px 36px; padding: 0; }

.mind-step ul li { display: flex; gap: 8px; }

.mind-dot { align-items: center; border-radius: 50%; display: inline-flex; flex: none; height: 18px; justify-content: center; margin-top: 1px; width: 18px; }

.mind-dot svg { height: 10px; width: 10px; }

.mind-step ul li div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.mind-step ul strong { color: var(--ink-2); font-size: 12px; font-weight: 600; }

.mind-step ul span { font-size: 12.5px; overflow-wrap: anywhere; }

.mind-step ul small { color: var(--muted); font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere; }

.mt-done > details .mind-node, li.mt-done > .mind-dot { background: var(--good-soft); color: var(--good-text); }

.mt-pending > details .mind-node, li.mt-pending > .mind-dot { background: var(--accent-soft); color: var(--accent-text); }

.mt-warn > details .mind-node, li.mt-warn > .mind-dot { background: var(--warm-soft); color: var(--warm-text); }

.mt-fail > details .mind-node, li.mt-fail > .mind-dot { background: var(--hot-soft); color: var(--hot-text); }

.mt-skip > details .mind-node, li.mt-skip > .mind-dot { background: var(--surface-3); color: var(--muted); }

@media (max-width: 1280px) {
  .aida-main { grid-template-columns: 300px minmax(0, 1fr) 320px; }
  .cv-step b { font-size: 11px; }
}

@media (max-width: 1200px) {
  body.aida-page { height: auto; min-height: 100dvh; overflow: auto; }
  .aida-main { grid-auto-rows: minmax(0, 80vh); grid-template-columns: 300px minmax(0, 1fr); }
  .aida-main #mind { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .aida-main { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .cv-step b { display: none; }
}

/* narrow windows: the live counts move out of the way of the title */
@media (max-width: 980px) {
  .aida-page .top-live { display: none; }
}
