/* V5 chat + cards layer for /emitter. Shared by chat.js (live append) and the
   server-rendered history markup in emitter.html — both emit .ec-* classes.
   Token values ported from data/identique/design/tokens/{colors,effects}.css.
   Token :root for the V5 chat layer. Some values intentionally duplicate
   emitter_workspace.css (identical values) so this layer is self-contained
   even though chat.css loads last. */
:root {
  --ent-ink: #232C46;
  --ent-ink-2: rgba(35, 44, 70, 0.62);
  --ent-ink-3: rgba(35, 44, 70, 0.42);
  --ent-line: rgba(35, 44, 70, 0.10);
  --ent-line-soft: rgba(35, 44, 70, 0.06);
  --ent-canvas: #F5F1EC;
  --ent-paper: #FBF8F4;
  --ent-teal: #63898C;
  --ent-mauve: #896278;
  --ent-mid: #6085AA;
  --ent-cream: #EDDDDD;
  --ent-gos: #0065B1;
  --ec-envelope-bg: rgba(99, 137, 140, 0.09);
  --ec-envelope-border: rgba(99, 137, 140, 0.18);
  --ec-agent-bg: rgba(99, 137, 140, 0.12);
  --ec-human-bg: rgba(137, 98, 120, 0.12);
  --ent-shadow-sm: 0 1px 0 rgba(35, 44, 70, 0.04), 0 1px 2px rgba(35, 44, 70, 0.04);
  --ent-shadow-md: 0 1px 0 rgba(35, 44, 70, 0.05), 0 8px 24px -8px rgba(35, 44, 70, 0.18);
  --ent-shadow-lg: 0 1px 0 rgba(35, 44, 70, 0.06), 0 24px 60px -20px rgba(35, 44, 70, 0.30);
  --ec-font-display: "Fraunces", "Manrope", serif;
  --ec-font-mono: "JetBrains Mono", ui-monospace, monospace;
}

/* Shared helpers used across cards (filled in by later tasks). */
.ec-eyebrow {
  font-family: var(--ec-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ent-ink-3);
  font-weight: 600;
}

/* ── Block 1: message surface ─────────────────────────────── */
.ec-turn { display: flex; flex-direction: column; gap: 10px; }
.ec-agent-id { display: flex; align-items: center; gap: 9px; }
.ec-avatar {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  background: var(--ent-ink); color: var(--ent-cream);
  display: flex; align-items: center; justify-content: center;
}
.ec-avatar img { width: 16px; height: 16px; }
.ec-agent-name {
  font-family: var(--ec-font-mono); font-size: 11px; font-weight: 600;
  color: var(--ent-ink-2); letter-spacing: 0.04em;
}
.ec-owner-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px;
  border-radius: 999px; font-family: var(--ec-font-mono); font-size: 10.5px;
  font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
}
.ec-owner-badge .ec-dot { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }
.ec-owner-agent { background: var(--ec-agent-bg); color: var(--ent-teal); }
.ec-owner-agent .ec-dot { background: var(--ent-teal); }
.ec-owner-dcm { background: var(--ec-human-bg); color: var(--ent-mauve); }
.ec-owner-dcm .ec-dot { background: var(--ent-mauve); }
.ec-owner-human-note { font-family: "Manrope", sans-serif; letter-spacing: 0; opacity: 0.7; }

.ec-envelope, .ec-bubble {
  align-self: flex-start; max-width: 90%;
  background: var(--ec-envelope-bg); border: 1px solid var(--ec-envelope-border);
  border-radius: 16px; border-top-left-radius: 6px;
}
.ec-envelope { width: 100%; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.ec-envelope--waiting { width: fit-content; padding: 8px 14px; }
.ec-reply-status { color: var(--ent-ink-2); font-size: 13px; line-height: 1.5; }
.ec-bubble { padding: 12px 16px; font-size: 14px; line-height: 1.55; color: var(--ent-ink); }
.ec-envelope .ec-prose { padding: 2px 5px; font-size: 14px; line-height: 1.55; color: var(--ent-ink); }
.ec-assistant-text { white-space: normal; overflow-wrap: anywhere; }
.ec-assistant-text :is(p, ul, ol) { margin-block: 0; }
.ec-assistant-text :is(p, ul, ol) + :is(p, ul, ol) { margin-block-start: 0.65em; }
.ec-assistant-text :is(ul, ol) { padding-inline-start: 1.5em; }
.ec-assistant-text ul { list-style: disc outside; }
.ec-assistant-text ol { list-style: decimal outside; }
.ec-assistant-text strong { font-weight: 600; }
.ec-assistant-text em { font-style: italic; }
.ec-saved-notice[data-msg-id] { display: grid; grid-template-columns: auto 1fr; }
.ec-saved-notice .ec-time { grid-column: 2; }
.ec-time:not(.hidden) { display: block; }
.ec-time { text-align: right; font-family: var(--ec-font-mono); font-size: 10px; color: var(--ent-ink-3); letter-spacing: 0.03em; }

.ec-user {
  align-self: flex-end; max-width: 76%; padding: 11px 15px;
  border-radius: 16px; border-top-right-radius: 6px;
  background: var(--ent-ink); color: var(--ent-cream);
  font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}

.ec-composer { border-top: 1px solid var(--ent-line); padding: 14px 0 18px; background: var(--ent-canvas); flex-shrink: 0; }
.ec-composer-inner {
  background: var(--ent-paper); border: 1px solid var(--ent-line); border-radius: 16px;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; box-shadow: var(--ent-shadow-sm); cursor: text;
}
.ec-composer textarea {
  flex: 1; resize: none; background: transparent; outline: none; border: none;
  color: var(--ent-ink); font-size: 14px; line-height: 1.5; max-height: 128px; font-family: inherit;
}
.ec-composer textarea::placeholder { color: var(--ent-ink-3); }
.ec-send {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--ent-ink); color: var(--ent-cream);
  display: flex; align-items: center; justify-content: center; border: none; cursor: pointer;
}

/* ── Block 2: card chrome ─────────────────────────────────── */
.ec-card {
  background: var(--ent-paper); border: 1px solid var(--ent-line);
  border-radius: 14px; box-shadow: var(--ent-shadow-md); overflow: hidden;
}
.ec-card--embedded { box-shadow: none; }
.ec-card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--ent-line);
  border-top: 3px solid var(--ec-accent, var(--ent-line));
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.ec-card-title { font-family: var(--ec-font-display); font-size: 18px; font-weight: 400; letter-spacing: -0.01em; color: var(--ent-ink); }
.ec-card-head-right { font-family: var(--ec-font-mono); font-size: 10px; color: var(--ent-ink-3); letter-spacing: 0.04em; white-space: nowrap; }
.ec-card-body { padding: 18px; }
.ec-accent-teal { --ec-accent: var(--ent-teal); }
.ec-accent-mauve { --ec-accent: var(--ent-mauve); }
.ec-accent-mid { --ec-accent: var(--ent-mid); }
.ec-smartan-json {
  max-height: 24rem; margin: 0; overflow: auto; padding: 12px;
  border: 1px solid var(--ent-line); border-radius: 10px;
  background: var(--ent-canvas); color: var(--ent-ink);
  font-family: var(--ec-font-mono); font-size: 11px; line-height: 1.55;
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
}

/* ── Block 3: scoring + company ──────────────────────────── */
.ec-facts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; font-size: 12.5px; color: var(--ent-ink-2); }
.ec-headline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--ent-line); border-bottom: 1px solid var(--ent-line); }
.ec-metric { display: flex; flex-direction: column; gap: 6px; }
.ec-metric-val { display: flex; align-items: baseline; gap: 6px; }
.ec-metric-val b { font-family: var(--ec-font-display); font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: -0.02em; color: var(--ent-ink); }
.ec-metric-val span { font-family: var(--ec-font-mono); font-size: 12px; color: var(--ent-ink-3); }
.ec-scenarios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.ec-scenario { border: 1px solid var(--ent-line); border-radius: 12px; padding: 13px; background: var(--ent-canvas); }
.ec-scenario--mid { border-color: var(--ent-mid); background: rgba(96, 133, 170, 0.06); }
.ec-scenario-name { font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--ent-ink); }
.ec-scenario-vol { font-family: var(--ec-font-display); font-size: 22px; letter-spacing: -0.02em; color: var(--ent-ink); }
.ec-scenario-sub { font-family: var(--ec-font-mono); font-size: 11px; color: var(--ent-ink-2); margin-top: 4px; }
.ec-disclaimer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ent-line); font-size: 11.5px; color: var(--ent-ink-3); line-height: 1.5; }
.ec-mt { margin-top: 16px; }

/* Estimate hierarchy is shared by live and saved coupon_preview cards. */
.ec-coupon-card { width: 100%; min-width: 0; container-type: inline-size; overflow-wrap: anywhere; }
.ec-coupon-card .ec-card-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end;
}
.ec-coupon-card .ec-card-head > div:first-child { display: contents; }
.ec-coupon-card .ec-card-head .ec-eyebrow { grid-column: 1 / -1; }
.ec-coupon-card .ec-card-title { min-width: 0; }
.ec-coupon-card .ec-card-head-right { justify-self: end; white-space: nowrap; }
.ec-coupon-card .ec-headline {
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  padding: 0; border: 0;
}
.ec-coupon-card .ec-metric { min-width: 0; }
.ec-coupon-card .ec-headline .ec-metric {
  padding: 16px 8px; border: 1px solid var(--ent-line); border-radius: 12px;
}
.ec-coupon-card .ec-metric-val { min-width: 0; }
.ec-coupon-card .ec-metric-val b { min-width: 0; font-size: clamp(38px, 7.7cqi, 48px); line-height: 1.2; }
.ec-coupon-card .ec-coupon-secondary {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0; margin-top: 16px; padding: 16px 0;
  border-top: 1px solid var(--ent-line); border-bottom: 1px solid var(--ent-line);
}
.ec-coupon-card .ec-coupon-secondary:has(> .ec-metric:nth-child(3)) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
}
.ec-coupon-card .ec-coupon-secondary > .ec-metric { padding-inline: 12px; }
.ec-coupon-card .ec-coupon-secondary > .ec-metric:first-child { padding-inline-start: 0; }
.ec-coupon-card .ec-coupon-secondary > .ec-metric:last-child { padding-inline-end: 0; }
.ec-coupon-card .ec-coupon-secondary > .ec-metric + .ec-metric {
  border-inline-start: 1px solid var(--ent-line);
}
.ec-coupon-card .ec-coupon-secondary .ec-metric-val b { font-size: clamp(28px, 5.1cqi, 32px); }
.ec-coupon-card .ec-scenario-vol { font-size: clamp(26px, 4.5cqi, 28px); }
@container (max-width: 559.99px) {
  .ec-coupon-card .ec-card-head { grid-template-columns: minmax(0, 1fr); }
  .ec-coupon-card .ec-coupon-secondary,
  .ec-coupon-card .ec-coupon-secondary:has(> .ec-metric:nth-child(3)) {
    grid-template-columns: minmax(0, 1fr); gap: 16px;
  }
  .ec-coupon-card .ec-coupon-secondary > .ec-metric,
  .ec-coupon-card .ec-coupon-secondary > .ec-metric + .ec-metric {
    padding-inline: 0; border-inline-start: 0;
  }
}
.ec-coupon-card .ec-scenarios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ec-coupon-card .ec-scenario { min-width: 0; }

.ec-company-card {
  width: 100%; min-width: 0; container-type: inline-size;
  border-top: 3px solid var(--ec-accent); color: var(--ent-ink);
}
.ec-company-card-header {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 12px; padding: 16px 18px 14px;
}
.ec-company-card-icon-tile,
.ec-company-card-detail-icon {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #2f7d43; background: #edf5ea;
}
.ec-company-card-icon-tile { width: 44px; height: 44px; border-radius: 12px; }
.ec-company-card-icon { width: 23px; height: 23px; stroke-width: 1.8; }
.ec-company-card-heading { min-width: 0; }
.ec-company-card-eyebrow,
.ec-company-card-stat-label,
.ec-company-card-detail-label {
  font-family: var(--ec-font-mono); font-weight: 600; text-transform: uppercase;
  color: var(--ent-ink-2); letter-spacing: 0.07em;
}
.ec-company-card-eyebrow { font-size: 10px; margin-bottom: 4px; }
.ec-company-card-name {
  margin: 0; min-width: 0; font-family: var(--ec-font-display); font-size: 18px;
  font-weight: 400; line-height: 1.25; letter-spacing: -0.01em;
  color: #102957; overflow-wrap: anywhere;
}
.ec-company-card-status {
  display: inline-flex; align-items: center; gap: 6px; justify-self: end;
  max-width: 100%; padding: 6px 9px; border: 1px solid;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.ec-company-card-status-icon { width: 15px; height: 15px; flex-shrink: 0; }
.ec-company-card-status--green { color: #287a3c; background: #edf6eb; border-color: #cfe4ca; }
.ec-company-card-status--red { color: #a83a2f; background: #fbeceb; border-color: #f0cdc9; }
.ec-company-card-status--grey { color: #5b6573; background: #f1f3f5; border-color: #dfe3e7; }
.ec-company-card-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, .8fr);
  margin: 0 18px; padding: 0; border: 1px solid rgba(47, 125, 67, 0.16);
  border-radius: 10px; background: rgba(237, 245, 234, 0.28); overflow: hidden;
}
.ec-company-card-stat { min-width: 0; padding: 12px 13px; border-left: 1px solid var(--ent-line); }
.ec-company-card-stat:first-child { border-left: 0; }
.ec-company-card-stat-label { font-size: 10px; }
.ec-company-card-stat-value {
  margin: 6px 0 0; font-family: var(--ec-font-mono); font-size: 14px;
  font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.25;
  color: #102957; white-space: nowrap;
}
.ec-company-card-divider { height: 1px; margin: 16px 18px 0; background: rgba(47, 125, 67, 0.18); }
.ec-company-card-footer {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px 18px 18px;
}
.ec-company-card-detail {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  align-items: start; gap: 10px; min-width: 0; padding-right: 16px;
}
.ec-company-card-detail + .ec-company-card-detail {
  padding-right: 0; padding-left: 16px; border-left: 1px solid var(--ent-line);
}
.ec-company-card-detail-icon { width: 36px; height: 36px; border-radius: 10px; }
.ec-company-card-detail-icon-svg { width: 19px; height: 19px; stroke-width: 1.8; }
.ec-company-card-detail-content { min-width: 0; }
.ec-company-card-detail-label { margin: 1px 0 0; font-size: 9.5px; line-height: 1.35; }
.ec-company-card-detail-value {
  margin-top: 5px; font-size: 13.5px; line-height: 1.4;
  color: #102957; overflow-wrap: anywhere;
}
.ec-company-card-detail-value--manager { font-weight: 600; }
.ec-company-card-registration,
.ec-company-card-detail-meta {
  margin-top: 2px; font-size: 12px; line-height: 1.4;
  color: var(--ent-ink-2); overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .ec-coupon-card .ec-headline,
  .ec-coupon-card .ec-scenarios { grid-template-columns: minmax(0, 1fr); }
  .ec-company-card-header {
    grid-template-columns: minmax(0, 1fr); align-items: start;
    gap: 9px; padding: 14px;
  }
  .ec-company-card-status { justify-self: start; white-space: normal; }
  .ec-company-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 14px;
  }
  .ec-company-card-stat { padding: 12px; }
  .ec-company-card-stat:nth-child(odd) { border-left: 0; }
  .ec-company-card-stat:nth-child(n + 3) { border-top: 1px solid var(--ent-line); }
  .ec-company-card-divider { margin: 14px 14px 0; }
  .ec-company-card-footer {
    grid-template-columns: minmax(0, 1fr); padding: 14px;
  }
  .ec-company-card-detail { padding: 0; }
  .ec-company-card-detail + .ec-company-card-detail {
    margin-top: 12px; padding: 12px 0 0; border-top: 1px solid var(--ent-line); border-left: 0;
  }
}

@container (max-width: 520px) {
  .ec-company-card-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ec-company-card-stat { padding: 12px 8px; }
  .ec-company-card-stat:nth-child(odd) { border-left: 0; }
  .ec-company-card-stat:nth-child(n + 3) { border-top: 1px solid var(--ent-line); }
}

@container (max-width: 320px) {
  .ec-company-card-stats { margin: 0 2px; }
  .ec-company-card-stat { padding: 12px 1px; }
}

/* ── Block 4: step cards ─────────────────────────────────── */
.ec-check-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--ent-line); border-radius: 10px; background: var(--ent-canvas); }
.ec-check-row + .ec-check-row { margin-top: 7px; }
.ec-check-row--next { border-color: var(--ent-mid); background: rgba(96, 133, 170, 0.06); }
.ec-check-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ent-ink); }
.ec-state-pill { font-family: var(--ec-font-mono); font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.ec-state-done { color: var(--ent-teal); background: rgba(99, 137, 140, 0.13); }
.ec-state-work { color: var(--ent-mid); background: rgba(96, 133, 170, 0.14); }
.ec-state-need { color: var(--ent-mauve); background: rgba(137, 98, 120, 0.13); }
.ec-dropzone { border: 1.5px dashed var(--ent-line); border-radius: 12px; padding: 22px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--ent-canvas); text-align: center; cursor: pointer; }
.ec-dropzone-ic { width: 40px; height: 40px; border-radius: 11px; background: rgba(137, 98, 120, 0.12); color: var(--ent-mauve); display: flex; align-items: center; justify-content: center; font-size: 19px; }
.ec-dropzone-title { font-size: 13.5px; font-weight: 600; color: var(--ent-ink); }
.ec-dropzone-meta { font-family: var(--ec-font-mono); font-size: 10.5px; color: var(--ent-ink-3); letter-spacing: 0.03em; }
.ec-btn-ghost { font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 12px; border: 1px solid var(--ent-line); background: transparent; color: var(--ent-ink); cursor: pointer; }
.ec-file-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ent-ink-2); margin-top: 8px; }
.ec-field { display: block; margin-bottom: 12px; }
.ec-field > span { display: block; font-size: 12px; color: var(--ent-ink-2); margin-bottom: 5px; }
.ec-input, .ec-select { width: 100%; border: 1px solid var(--ent-line); border-radius: 8px; padding: 9px 11px; background: var(--ent-paper); color: var(--ent-ink); font-family: inherit; font-size: 13.5px; }
.ec-btn-primary { font-size: 14px; font-weight: 600; padding: 11px 20px; border-radius: 12px; border: none; background: var(--ent-ink); color: var(--ent-cream); cursor: pointer; }
.ec-box-row { width: 100%; text-align: left; display: block; border: 1px solid var(--ent-line); border-radius: 12px; padding: 11px 13px; background: var(--ent-paper); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.ec-box-row + .ec-box-row { margin-top: 8px; }
.ec-box-row:hover { border-color: rgba(99, 137, 140, 0.45); box-shadow: var(--ent-shadow-sm); }
.ec-box-main { font-size: 13.5px; font-weight: 600; color: var(--ent-ink); }
.ec-box-meta { font-size: 12px; color: var(--ent-ink-2); margin-top: 2px; }
.ec-error { border: 1px solid rgba(137, 98, 120, 0.3); background: rgba(137, 98, 120, 0.08); color: var(--ent-mauve); border-radius: 12px; padding: 12px 14px; font-size: 13px; }

/* ── Industry selection (onboarding only) ───────────────── */
.ec-industry-form { container-type: inline-size; }
.ec-industry-form .ec-industry-form-controls { display: flex; flex-direction: column; gap: 8px; }
.ec-industry-form .ec-industry-options { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ec-industry-form .ec-industry-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--ent-line); border-radius: 10px; background: var(--ent-canvas); color: var(--ent-ink); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.ec-industry-form .ec-industry-option:hover, .ec-industry-form .ec-industry-option:focus-within { border-color: rgba(99, 137, 140, 0.55); box-shadow: var(--ent-shadow-sm); }
.ec-industry-form .ec-industry-option--readonly { cursor: default; }
.ec-industry-form .ec-industry-option--readonly:hover { border-color: var(--ent-line); box-shadow: none; }
.ec-industry-form .ec-industry-option:has(input:checked) { border-color: var(--ent-teal); background: rgba(99, 137, 140, 0.08); }
.ec-industry-form .ec-industry-option input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--ent-teal); flex-shrink: 0; }
.ec-industry-form .ec-industry-option-label { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.ec-industry-form .ec-industry-submit { width: 100%; margin-top: 4px; }
.ec-industry-form .ec-industry-submit:disabled { background: var(--ent-line); color: var(--ent-ink-3); cursor: not-allowed; }
.ec-industry-form .ec-industry-hint { margin: 12px 0 0; color: var(--ent-ink-2); font-size: 12px; line-height: 1.45; }

/* ── Block 5: chat header (account menu → emitter_shell.css) ─ */
.ec-chat-header { display: flex; align-items: center; gap: 10px; padding: 13px 28px; border-bottom: 1px solid var(--ent-line); background: var(--ent-paper); flex-shrink: 0; }
.ec-chat-header-title { font-family: var(--ec-font-display); font-size: 16px; font-weight: 400; letter-spacing: -0.01em; color: var(--ent-ink); }
.ec-status-pill { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; border: 1px solid rgba(99, 137, 140, 0.45); color: var(--ent-teal); font-family: var(--ec-font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.ec-chat-header-step { margin-left: auto; font-family: var(--ec-font-mono); font-size: 10px; color: var(--ent-teal); letter-spacing: 0.06em; }

/* ── Block 9: artifact shelf ─────────────────────────────── */
.ec-rail-div { height: 1px; background: var(--ent-line); margin: 18px 0 16px; }
.ec-artifact-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ec-artifact-chip { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 9px; border: 1px solid var(--ent-line); background: var(--ent-canvas); font-family: inherit; font-size: 11.5px; font-weight: 600; color: var(--ent-ink); white-space: nowrap; cursor: pointer; }
.ec-artifact-chip:focus-visible { outline: 2px solid var(--ent-teal); outline-offset: 2px; }
.ec-card--seek { animation: ec-card-seek 1.2s ease; }
@keyframes ec-card-seek { 0%, 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } 15% { box-shadow: 0 0 0 3px var(--ent-teal); } }
.ec-artifact-arrow { color: var(--ent-ink-3); font-size: 10px; line-height: 1; flex-shrink: 0; transform: translateY(1px); }
.ec-artifact-ic { width: 13px; height: 13px; flex-shrink: 0; color: var(--ent-ink-2); }
.ec-artifact-empty { margin-top: 7px; padding: 16px 12px; border-radius: 10px; border: 1px dashed var(--ent-line); font-family: var(--ec-font-mono); font-size: 10px; color: var(--ent-ink-3); text-align: center; letter-spacing: 0.04em; }
.ec-completeness { margin-top: 14px; padding: 13px 14px; border-radius: 12px; background: var(--ent-canvas); border: 1px solid var(--ent-line); }
.ec-completeness-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; font-size: 11.5px; font-weight: 600; color: var(--ent-ink-2); }
.ec-completeness-num { font-family: var(--ec-font-mono); color: var(--ent-ink); }
.ec-completeness-bar { height: 7px; background: var(--ent-line); border-radius: 999px; overflow: hidden; }
.ec-completeness-bar span { display: block; height: 100%; background: var(--ent-teal); }

/* ── Block 8: quick replies ──────────────────────────────── */
.ec-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 2px 4px 8px; }
.ec-quick-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 16px; border-top-right-radius: 6px; border: 1px solid var(--ent-line); background: var(--ent-paper); color: var(--ent-ink); font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1.2; cursor: pointer; }
.ec-quick-ret { color: var(--ent-ink-3); font-size: 12px; }

/* ── 1С instruction document card ─────────────────────────── */
.ec-doc-card { max-width: 640px; }
.ec-doc-text { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ent-ink-2); }
.ec-doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ec-doc-btn {
  display: inline-flex; align-items: center; padding: 8px 13px; border-radius: 9px;
  border: 1px solid var(--ent-line); background: var(--ent-canvas); color: var(--ent-ink);
  font-family: inherit; font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.ec-doc-btn--solid { background: var(--ent-ink); color: var(--ent-cream); border-color: var(--ent-ink); }
.ec-doc-btn:focus-visible { outline: 2px solid var(--ent-teal); outline-offset: 2px; }

/* ── Partnership NDA card ────────────────────────────────── */
.ec-nda-card { max-width: 640px; }
.ec-nda-card-body { display: flex; flex-direction: column; gap: 13px; }
.ec-nda-document {
  display: inline-flex; align-items: center; width: fit-content; color: var(--ent-ink);
  font-size: 13.5px; font-weight: 600; text-decoration: underline;
  text-decoration-color: rgba(99, 137, 140, 0.55); text-underline-offset: 3px;
}
.ec-nda-document:focus-visible { outline: 2px solid var(--ent-teal); outline-offset: 3px; }
.ec-nda-status {
  width: fit-content; padding: 5px 9px; border-radius: 999px;
  background: rgba(99, 137, 140, 0.11); color: var(--ent-teal);
  font-family: var(--ec-font-mono); font-size: 10.5px; font-weight: 600;
}
.ec-nda-card--review .ec-nda-status {
  background: rgba(137, 98, 120, 0.11); color: var(--ent-mauve);
}
.ec-nda-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ec-nda-actions[hidden], .ec-nda-next-step[hidden] { display: none; }
.ec-nda-card--preparation .ec-nda-card-head { padding: 10px 18px; }
.ec-nda-card--preparation .ec-card-title { overflow-wrap: anywhere; }
.ec-nda-card--preparation .ec-nda-card-body { padding: 14px 18px; gap: 8px; }
.ec-nda-card--preparation .ec-nda-status {
  width: auto; padding: 0; border-radius: 0; background: none; color: var(--ent-ink);
  font-family: inherit; font-size: 14px; line-height: 1.6; font-weight: 500;
}
.ec-nda-next-step { margin: 0; color: var(--ent-ink-2); font-size: 13.5px; line-height: 1.6; }

.ec-nda-action { min-width: 128px; }
.ec-nda-action--secondary {
  padding: 10px 16px; border: 1px solid var(--ent-line); border-radius: 12px;
  background: var(--ent-canvas); color: var(--ent-ink); font: inherit;
  font-size: 13.5px; font-weight: 600; cursor: pointer;
}
/* The retry control stands where the link will be, so it takes the link's box
   exactly: swapping them must not move «Принимаю» / «У меня есть вопросы». */
.ec-nda-retry {
  display: inline-flex; align-items: center; width: fit-content; margin: 0; padding: 0;
  border: 0; background: none; color: var(--ent-teal); font: inherit;
  font-size: 13.5px; font-weight: 600; text-decoration: underline;
  text-decoration-color: rgba(99, 137, 140, 0.55); text-underline-offset: 3px; cursor: pointer;
}
.ec-nda-document, .ec-nda-retry { min-height: 22px; }
.ec-nda-retry:focus-visible { outline: 2px solid var(--ent-teal); outline-offset: 3px; }
.ec-nda-retry:disabled { opacity: 0.55; cursor: default; }
.ec-nda-action:focus-visible { outline: 2px solid var(--ent-teal); outline-offset: 2px; }
.ec-nda-action:disabled {
  opacity: 0.55; cursor: default; box-shadow: none;
}
.ec-nda-card--decided .ec-nda-document { opacity: 0.82; }

@media (max-width: 480px) {
  .ec-nda-actions { flex-direction: column; }
  .ec-nda-action { width: 100%; }
}

/* ── shared progress rows and controls (1С card and prescore) ── */
.ec-fd-strip {
  max-width: 640px; margin: 12px 0 4px; padding: 14px 16px;
  background: var(--ent-paper); border: 1px solid var(--ent-line);
  border-left: 3px solid var(--ent-teal); border-radius: 12px; box-shadow: var(--ent-shadow-sm);
}
.ec-fd-strip--arrived { border-left-color: #2f7d43; }
.ec-fd-strip--failed { border-left-color: #a83a2f; }
.ec-fd-steps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--ent-line); border-radius: 10px; overflow: hidden; background: var(--ent-canvas); }
.ec-fd-steps li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13px; color: var(--ent-ink); border-top: 1px solid var(--ent-line); position: relative; }
.ec-fd-steps li:first-child { border-top: 0; }
.ec-fd-steps li.is-wait { color: var(--ent-ink-2); }
.ec-fd-steps li.is-live { background: rgba(99, 137, 140, 0.08); }
/* Every glyph is centred off the mark's own box rather than hand-placed, so
   the cross carries the same optical weight as the check instead of reading
   as a smaller mark sitting off-centre. */
.ec-fd-mark { position: relative; box-sizing: border-box; width: 18px; height: 18px; border-radius: 999px; flex-shrink: 0; border: 1.5px solid var(--ent-line); background: var(--ent-paper); }
.ec-fd-mark--done { background: #e4efe2; border-color: #cfe4ca; }
.ec-fd-mark--done::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4.4px; height: 8.4px; border: solid #2f7d43; border-width: 0 1.9px 1.9px 0; transform: translate(-50%, -58%) rotate(45deg); }
.ec-fd-mark--err { border-color: #a83a2f; background: #fbeceb; }
.ec-fd-mark--err::before,
.ec-fd-mark--err::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.9px; height: 9.6px; background: #a83a2f; border-radius: 1px; }
.ec-fd-mark--err::before { transform: translate(-50%,-50%) rotate(45deg); }
.ec-fd-mark--err::after { transform: translate(-50%,-50%) rotate(-45deg); }
.ec-fd-mark--live { border-color: rgba(99, 137, 140, 0.18); background: transparent; }
.ec-fd-mark--live::after { content: ""; position: absolute; inset: -1.5px; border-radius: 999px; border: 2px solid transparent; border-top-color: var(--ent-teal); border-right-color: var(--ent-teal); border-bottom-color: rgba(99, 137, 140, 0.35); animation: ec-fd-spin 1.05s linear infinite; }
@keyframes ec-fd-spin { to { transform: rotate(360deg); } }
/* The card's title and the total wait. The number is what tells a CFO to go
   chase their accountant, so it sits at the top rather than inside a row. */
.ec-fd-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 11px; }
.ec-fd-title { font-size: 13px; font-weight: 600; color: var(--ent-ink); letter-spacing: -0.01em; }
.ec-fd-elapsed { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--ent-ink-2); font-variant-numeric: tabular-nums; }
.ec-fd-elapsed--long { color: #b0701f; }
/* Time to the next automatic check. Sits in the slot the elapsed counter
   vacated when it moved up into the header. */
.ec-fd-next { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-style: normal; font-family: var(--ec-font-mono); font-size: 10.5px; color: var(--ent-ink-2); font-variant-numeric: tabular-nums; }
.ec-fd-next[hidden] { display: none; }
.ec-fd-next-glyph { font-size: 13.5px; line-height: 1; color: var(--ent-teal); }
.ec-fd-shimmer { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; background: rgba(99, 137, 140, 0.18); }
.ec-fd-shimmer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(99, 137, 140, 0.85), transparent); animation: ec-fd-sheen 1.9s ease-in-out infinite; }
@keyframes ec-fd-sheen { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .ec-fd-shimmer::after { animation: none; opacity: 0.5; }
  .ec-fd-mark--live::after { animation: none; opacity: 0.65; }
}
.ec-fd-sub { margin: 10px 0 0; font-size: 13px; line-height: 1.55; color: var(--ent-ink-2); }
.ec-fd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ec-fd-btn { padding: 8px 13px; border-radius: 9px; border: 1px solid var(--ent-line); background: var(--ent-canvas); color: var(--ent-ink); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ec-fd-btn--ghost { background: transparent; color: var(--ent-ink-2); font-weight: 500; }
.ec-fd-btn:focus-visible { outline: 2px solid var(--ent-teal); outline-offset: 2px; }

/* ── retained receipt and saving progress ── */
.ec-fd-result .ec-fd-steps { margin: 0; }
.ec-fd-document { display: block; margin-top: 10px; color: var(--ent-teal); font-size: 13px; overflow-wrap: anywhere; text-decoration: underline; }
.ec-fd-document:focus-visible { outline: 2px solid var(--ent-teal); outline-offset: 2px; }

/* ── observer mode (admin watching an emitter's chat) ──────────────────────
   The workspace renders unchanged; only the two docks that would let someone
   write are replaced — the top nav by an admin bar, the composer by a banner.
   Both reuse the archive banner's shapes so the page reads as one surface. */
.ec-observer-bar { justify-content: space-between; gap: 16px; }
.ec-observer-back { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ent-ink-2); text-decoration: none; padding: 6px 11px; border-radius: 9px; border: 1px solid transparent; }
.ec-observer-back:hover { background: rgba(35, 44, 70, .05); border-color: rgba(35, 44, 70, .14); color: var(--ent-ink); }
.ec-observer-who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.ec-observer-tag { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-family: var(--ec-font-mono, monospace); font-size: 10px; letter-spacing: .09em; font-weight: 700; color: var(--ent-teal); }
.ec-observer-email { font-size: 13px; font-weight: 600; color: var(--ent-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-observer-email[aria-current="page"] { color: var(--ent-teal); text-decoration: underline; }
.ec-observer-banner { justify-content: space-between; gap: 14px; }
.ec-observer-banner .ec-readonly-tag { color: var(--ent-teal); }

/* ── the floor (admin/chat-takeover): banner + admin composer ──────────────
   Both reuse `.ec-readonly-tag` / `.ec-readonly-sub` (emitter_workspace.css)
   for the eyebrow + copy line, and `.ec-composer-inner` for the input row, so
   the two new docks read as the same family as the existing archive/observer
   banners and the emitter's own composer. */
.ec-floor-banner-dock { border-top: 1px solid var(--ent-line); background: var(--ent-canvas); flex-shrink: 0; }
.ec-floor-banner { display: flex; align-items: center; gap: 13px; padding: 11px 16px; }
.ec-floor-banner-tag { color: var(--ent-mauve); }

.ec-admin-composer { border-top: 1px solid var(--ent-line); padding: 12px 0 18px; background: var(--ent-canvas); flex-shrink: 0; }
.ec-admin-composer-head { display: flex; align-items: center; gap: 10px; padding: 0 0 10px; }
.ec-admin-composer-tag { color: var(--ent-mauve); }
.ec-admin-composer-name {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ent-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ec-take-floor-btn {
  flex-shrink: 0; font-size: 13px; font-weight: 600; padding: 6px 12px;
  border-radius: 9px; border: 1px solid var(--ent-line);
  background: var(--ent-paper); color: var(--ent-ink); cursor: pointer;
}
.ec-take-floor-btn:hover { background: rgba(35, 44, 70, .05); border-color: rgba(35, 44, 70, .2); }

/* An admin post the floor moved on before delivering (`admin/chat-takeover`
   cor-4): the observer banner's own line, below the take-floor row, naming
   why and keeping the unsent text visible and selectable until the floor is
   taken again. */
.ec-admin-composer-refusal {
  padding: 0 16px 11px; font-size: 12.5px; color: var(--ent-ink-2);
}
.ec-admin-composer-refusal-text {
  margin-top: 2px; color: var(--ent-ink); white-space: pre-wrap; word-break: break-word;
}

/* The manager's NDA send (epic manager-sends-nda D-06): the attach button in
   the staff composer head, its one-item menu, and the dialog it opens. */
.ec-attach { position: relative; flex-shrink: 0; }
.ec-attach-btn:disabled { opacity: .45; cursor: not-allowed; }
.ec-attach-btn:disabled:hover { background: var(--ent-paper); border-color: var(--ent-line); }
.ec-attach-menu {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 30; min-width: 160px;
  padding: 4px; border-radius: 10px; border: 1px solid var(--ent-line);
  background: var(--ent-paper); box-shadow: 0 8px 24px rgba(35, 44, 70, .12);
}
.ec-attach-menu[hidden] { display: none; }
.ec-attach-item {
  display: block; width: 100%; text-align: left; font-size: 13px; font-weight: 600;
  padding: 7px 10px; border: 0; border-radius: 7px; background: transparent;
  color: var(--ent-ink); cursor: pointer;
}
.ec-attach-item:hover { background: rgba(35, 44, 70, .05); }
.ec-nda-dialog {
  width: min(440px, calc(100vw - 32px)); padding: 20px; border-radius: 16px;
  border: 1px solid var(--ent-line); background: var(--ent-paper); color: var(--ent-ink);
}
.ec-nda-dialog::backdrop { background: rgba(35, 44, 70, .35); }
.ec-nda-dialog-title { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.ec-nda-dialog-sub { font-size: 12.5px; color: var(--ent-ink-2); margin: 0 0 14px; }
.ec-nda-dialog-file { display: block; width: 100%; font-size: 13px; margin-bottom: 12px; }
.ec-nda-dialog .ec-error { margin-bottom: 12px; }
.ec-nda-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ec-nda-dialog-send { background: var(--ent-ink); color: var(--ent-paper); border-color: var(--ent-ink); }
.ec-nda-dialog-send:hover { background: var(--ent-ink); opacity: .9; }
.ec-nda-dialog-send:disabled { opacity: .5; cursor: progress; }
