/* ============================================================
   Throughline AI — Meeting → Actions (demo)
   Demo-specific styles. Loads on top of ../styles.css + demo.css.
   All synthetic data; fictional firm "Banyan Consulting".
   ============================================================ */

/* ---------- app shell (fills space under .demo-bar) ---------- */
.ma-app {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 360px 1fr;
}

/* ---------- left: source + pipeline ---------- */
.ma-source {
  border-right: 1px solid var(--line);
  background: var(--paper-2);
  padding: 1.2rem 1.1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ma-aside-head {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 0.7rem;
}
.ma-transcript-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.7rem;
}
.ma-transcript-meta strong {
  font-family: var(--serif);
  font-size: 1rem;
}
.ma-transcript-meta span {
  font-size: 0.78rem;
  color: var(--muted);
}
.ma-transcript {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  font-size: 0.86rem;
  line-height: 1.55;
  max-height: 38vh;
  overflow-y: auto;
}
.ma-transcript:focus { outline: 2px solid var(--accent); }
.ma-line { margin-bottom: 0.55rem; }
.ma-line:last-child { margin-bottom: 0; }
.ma-line .spk {
  font-weight: 700;
  color: var(--accent-ink);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}
.ma-line .txt { color: var(--ink); }

/* pipeline */
.ma-pipeline {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
}
.ma-stage {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.2rem;
  font-size: 0.9rem;
  color: var(--muted);
  position: relative;
}
.ma-stage .pip {
  width: 22px; height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: #fffdf8;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  color: var(--muted);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
/* connector line between pips */
.ma-stage:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 10.5px; top: 28px;
  width: 1.5px; height: calc(100% - 12px);
  background: var(--line);
}
.ma-stage.run::before,
.ma-stage.done + .ma-stage::before { }
.ma-stage .pip-label { font-weight: 600; }
.ma-stage.run { color: var(--ink); }
.ma-stage.run .pip {
  border-color: var(--accent);
  color: var(--accent);
  animation: ma-pip-pulse 1.1s ease infinite;
}
.ma-stage.done { color: var(--ink); }
.ma-stage.done .pip {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
@keyframes ma-pip-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  70%  { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}

/* run button */
.ma-run {
  margin-top: 1.1rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.96rem;
  padding: 0.7rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease, transform .04s ease;
}
.ma-run:hover { background: var(--accent-ink); }
.ma-run:active { transform: translateY(1px); }
.ma-run:disabled { opacity: 0.5; cursor: default; }
.ma-run:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.ma-run-lg { font-size: 1rem; padding: 0.8rem 1.6rem; margin-top: 0.4rem; }

.ma-aside-note {
  margin-top: auto;
  padding-top: 1.2rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ---------- right: outputs ---------- */
.ma-out {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.ma-out-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.6rem clamp(1rem, 4vw, 2.4rem) 2rem;
}

/* empty / intro state */
.ma-empty {
  padding-top: clamp(1rem, 6vh, 4rem);
  animation: rise .35s ease both;
}
.ma-empty h2 { margin-bottom: 0.6rem; }
.ma-empty p { max-width: 56ch; }
.ma-flow {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

/* working indicator (reuses .searching feel) */
.ma-working {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.4rem 0 1.4rem;
}
.ma-working .dots { display: inline-flex; gap: 4px; }
.ma-working .dots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: blink 1.1s infinite both;
}
.ma-working .dots i:nth-child(2) { animation-delay: .18s; }
.ma-working .dots i:nth-child(3) { animation-delay: .36s; }

/* output cards */
.ma-card {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
  margin-bottom: 1.2rem;
  animation: rise .4s ease both;
}
.ma-card-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0 0 0.9rem;
}
.ma-card-head h3 {
  margin: 0;
  font-size: 1.12rem;
}
.ma-card-head .ma-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.ma-card-head .ma-count {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--muted);
}

/* action items */
.ma-actions { list-style: none; margin: 0; padding: 0; }
.ma-action {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.ma-action:last-child { border-bottom: 0; }
.ma-action input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 0.18rem;
  accent-color: var(--accent);
  flex: 0 0 auto;
  cursor: pointer;
}
.ma-action .ma-action-body { flex: 1 1 auto; min-width: 0; }
.ma-action .ma-action-text {
  font-size: 0.98rem;
  line-height: 1.4;
}
.ma-action .ma-action-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.ma-action .ma-action-meta .owner { color: var(--accent-ink); font-weight: 600; }
/* rejected / pruned */
.ma-action.rejected .ma-action-text {
  text-decoration: line-through;
  color: var(--muted);
}
.ma-action.rejected .ma-tag-reject {
  display: inline-block;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--warm);
  border: 1px solid color-mix(in srgb, var(--warm) 45%, var(--line));
  background: color-mix(in srgb, var(--warm) 8%, transparent);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  vertical-align: 1px;
}

/* decisions */
.ma-decisions { list-style: none; margin: 0; padding: 0; }
.ma-decision {
  padding: 0.55rem 0 0.55rem 0.9rem;
  border-left: 3px solid var(--accent);
  margin-bottom: 0.7rem;
}
.ma-decision:last-child { margin-bottom: 0; }
.ma-decision .d-text { font-size: 0.96rem; line-height: 1.45; }
.ma-decision .d-meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }

/* email */
.ma-email-fields {
  font-size: 0.88rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.7rem;
  margin-bottom: 0.8rem;
}
.ma-email-fields div { margin-bottom: 0.15rem; }
.ma-email-fields .lbl { color: var(--accent-ink); font-weight: 600; }
.ma-email-body {
  font-size: 0.96rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.ma-email-edit {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.55;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
  min-height: 220px;
}
.ma-email-edit:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.ma-email-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

/* small inline buttons */
.ma-btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.45rem 0.9rem;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.ma-btn:hover { border-color: var(--accent); color: var(--accent); }
.ma-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ma-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.ma-btn.primary:hover { background: var(--accent-ink); color: #fff; }
.ma-btn.warm:hover { border-color: var(--warm); color: var(--warm); }

/* CRM updates */
.ma-crm { list-style: none; margin: 0; padding: 0; }
.ma-crm-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
}
.ma-crm-row:last-child { border-bottom: 0; }
.ma-crm-badge {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-ink);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  flex: 0 0 auto;
}
.ma-crm-row .arrow { color: var(--muted); }

/* ---------- gate ---------- */
.ma-gate {
  position: sticky;
  bottom: 0;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-top: 0.4rem;
  animation: rise .4s ease both;
}
.ma-gate-head {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.ma-gate-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}
.ma-gate-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.ma-gate-actions .ma-btn { font-size: 0.94rem; padding: 0.6rem 1.2rem; }

/* confirmation */
.ma-confirm {
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, #fffdf8);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  margin-top: 0.4rem;
  animation: rise .4s ease both;
}
.ma-confirm .check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 0.9rem; font-weight: 700;
  margin-right: 0.5rem;
  vertical-align: -6px;
}
.ma-confirm h3 { display: inline; font-size: 1.1rem; }
.ma-confirm .ma-confirm-list {
  list-style: none; margin: 0.9rem 0 0; padding: 0;
}
.ma-confirm .ma-confirm-list li {
  font-size: 0.95rem;
  padding: 0.35rem 0;
  display: flex; gap: 0.55rem; align-items: baseline;
}
.ma-confirm .ma-confirm-list li::before {
  content: "→";
  color: var(--accent);
  font-weight: 700;
}

/* honesty note */
.ma-honesty {
  border-left: 3px solid var(--warm);
  background: color-mix(in srgb, var(--warm) 5%, #fffdf8);
  padding: 0.7rem 1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 1rem;
}

/* word reveal helper (mirrors demo.css .rw) */
.ma-rw { opacity: 0; animation: rw .26s ease forwards; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .ma-app { grid-template-columns: 1fr; }
  .ma-source {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 44vh;
  }
  .ma-transcript { max-height: 22vh; }
  .demo-title { display: none; }
  .ma-out-inner { padding: 1.2rem 1rem 1.6rem; }
}
