/* Zavation Intelligence question bar (src/components/ziAsk.js). Phone first: the input
   and Ask button are 48px tall, the thumbs 44px, text at least 16px so iOS does not zoom. */

.zi-card {
  background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--zv-red);
  border-radius: 10px; padding: 16px; margin: 0 0 18px;
}
.zi-compact { margin-top: 4px; }
.zi-h { font-family: var(--font-display, inherit); font-size: 15px; font-weight: 700; margin: 0 0 8px; color: var(--text-strong); }
.zi-intro { font-size: 13px; color: var(--muted); margin: 0 0 10px; line-height: 1.5; }

.zi-form { display: flex; gap: 8px; }
.zi-input {
  flex: 1; min-width: 0; min-height: 48px; font-size: 16px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel);
}
.zi-input:focus-visible { outline: 2px solid var(--zv-blue); outline-offset: 1px; }
.zi-send {
  min-height: 48px; min-width: 76px; padding: 0 16px; border: none; border-radius: 8px;
  background: var(--zv-red); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
}
.zi-send:hover { background: var(--zv-red-hover); }
.zi-send:disabled { background: var(--panel-2); color: var(--muted); cursor: wait; }

.zi-out:empty { display: none; }
.zi-answer { margin-top: 12px; }
.zi-text { font-size: 16px; line-height: 1.5; margin: 0 0 8px; color: var(--text-strong); }
.zi-muted .zi-text { color: var(--muted); font-size: 15px; }
.zi-caution {
  font-size: 13px; background: #fbf3e0; color: #7a5600; border: 1px solid #f0dfb0;
  border-radius: 6px; padding: 8px 10px; margin: 0 0 8px;
}
.zi-facts summary { cursor: pointer; font-size: 13px; color: var(--zv-blue); padding: 6px 0; min-height: 32px; }
.zi-facts ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.zi-fact { border: 1px solid var(--border-soft, var(--border)); border-radius: 8px; padding: 10px 12px; background: var(--panel-2); }
.zi-fact-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.zi-sys { font-size: 12px; font-weight: 700; color: var(--text-strong); }
.zi-badge { font-size: 11px; font-weight: 700; border-radius: 4px; padding: 2px 7px; white-space: nowrap; }
.zi-ok { background: #e3f2ea; color: #0f5c37; }
.zi-warn { background: #fbf3e0; color: #7a5600; }
.zi-bad { background: var(--zv-red-wash); color: var(--zv-red-deep); }
.zi-fact-body { font-size: 14px; line-height: 1.45; }
.zi-fact-note { font-size: 13px; color: var(--zv-red-deep); margin-top: 4px; }
.zi-fact-src { font-size: 11px; color: var(--muted); margin-top: 4px; }
.zi-draft { font-size: 11px; color: var(--muted); margin: 8px 0 0; }
.zi-left { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* A clarifying question, with the line to answer it, and the reply shown above the answer. */
.zi-clarify { border-left: 3px solid var(--zv-blue); padding-left: 12px; }
.zi-reply { display: flex; gap: 8px; }
.zi-recap { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.zi-recap b { color: var(--text-strong); font-weight: 600; }

.zi-rate { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.zi-rate-q { font-size: 13px; color: var(--muted); margin-right: 2px; }
.zi-thumb {
  min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.zi-thumb[aria-pressed="true"][data-rate="1"] { background: #e3f2ea; border-color: #157347; color: #0f5c37; }
.zi-thumb[aria-pressed="true"][data-rate="-1"] { background: var(--zv-red-wash); border-color: var(--zv-red); color: var(--zv-red-deep); }
.zi-thumb:focus-visible { outline: 2px solid var(--zv-blue); outline-offset: 2px; }
.zi-note { flex-basis: 100%; display: grid; gap: 6px; margin-top: 4px; }
.zi-note[hidden] { display: none; }
.zi-note-label { font-size: 13px; color: var(--text-strong); }
.zi-note-text { font-size: 16px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.zi-note-send {
  justify-self: start; min-height: 44px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--zv-blue); background: var(--zv-blue); color: #fff; font-weight: 600; cursor: pointer;
}
.zi-rate-status { font-size: 13px; color: var(--muted); }


/* On a phone, Home keeps the bar to its single input row (no heading) so "Needs your
   update" stays above the fold; the input's label still names it for screen readers. */
@media (max-width: 640px) {
  .zi-compact { padding: 10px 12px; margin-bottom: 12px; }
  .zi-compact .zi-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Speak an update (src/components/voiceUpdate.js): one button row until opened. */
.vu-card { margin: 0 0 18px; }
.vu-open, .vu-mic {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px;
  border: 1px solid var(--zv-blue); border-radius: 8px; background: var(--panel); color: var(--zv-blue);
  font-weight: 700; font-size: 15px; cursor: pointer;
}
.vu-open[aria-expanded="true"], .vu-mic[aria-pressed="true"] { background: var(--zv-blue); color: #fff; }
.vu-panel { margin-top: 10px; background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--zv-blue); border-radius: 10px; padding: 14px; }
.vu-panel[hidden] { display: none; }
.vu-help { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 10px; }
.vu-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.vu-text { flex: 1; min-width: 200px; font-size: 16px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.vu-draft-btn {
  margin-top: 10px; min-height: 48px; padding: 0 18px; border: none; border-radius: 8px;
  background: var(--zv-red); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
}
.vu-draft-btn:disabled { background: var(--panel-2); color: var(--muted); }
.vu-msg { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.vu-draft { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.vu-deal { font-size: 15px; }
.vu-summary { font-size: 14px; margin: 6px 0; }
/* min-width 0 and the th resets undo components.css's wide data-table defaults (min-width
   900px, 9px uppercase sortable headers), which pushed the draft off a phone screen. */
.vu-changes { width: 100%; min-width: 0; border-collapse: collapse; font-size: 14px; margin: 6px 0 10px; }
.vu-changes th { text-align: left; font-size: 13px; font-weight: 600; letter-spacing: normal; text-transform: none; cursor: default; padding: 6px 8px 6px 0; color: var(--text-strong); white-space: nowrap; vertical-align: top; }
.vu-changes th:hover { color: var(--text-strong); }
.vu-changes td { padding: 6px 8px; font-size: 14px; overflow-wrap: anywhere; vertical-align: top; }
/* On a phone each field stacks: its name, then the value (and what it replaces). */
@media (max-width: 520px) {
  .vu-changes, .vu-changes tbody, .vu-changes tr { display: block; }
  .vu-changes tr { padding: 8px 0; border-bottom: 1px solid var(--border-soft, var(--border)); }
  .vu-changes th { display: block; padding: 0 0 2px; font-size: 12px; color: var(--muted); }
  .vu-changes td { display: inline; padding: 0; border: 0; }
  .vu-changes td.vu-old:not(:empty)::after { content: " \2192 "; color: var(--muted); text-decoration: none; display: inline-block; margin: 0 4px; }
}
.vu-old { color: var(--muted); text-decoration: line-through; }
.vu-new { color: #0f5c37; font-weight: 700; }
.vu-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vu-save { min-height: 48px; padding: 0 18px; border: none; border-radius: 8px; background: #157347; color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.vu-cancel { min-height: 48px; padding: 0 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); font-size: 15px; cursor: pointer; }
.vu-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vu-phi { font-size: 12px; color: var(--zv-red-deep); font-weight: 600; }

/* Product facts / Sales data switch, and the sales answer table. */
.zi-modes { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.zi-mode { min-height: 40px; padding: 0 14px; border: none; background: var(--panel); color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.zi-mode[aria-pressed="true"] { background: var(--zv-blue); color: #fff; }
.zi-mode:focus-visible { outline: 2px solid var(--zv-blue); outline-offset: -2px; }
.zi-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 14px; margin: 4px 0 6px; }
.zi-table th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 4px 6px; }
.zi-table td { padding: 7px 6px; border-top: 1px solid var(--border-soft, var(--border)); }
.zi-rank { color: var(--muted); width: 1.5em; }
.zi-amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vu-clear { margin-top: 10px; min-height: 48px; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); font-size: 15px; cursor: pointer; }
.vu-new-deal { margin-top: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--zv-red); border-radius: 8px; background: var(--panel); color: var(--zv-red); font-weight: 700; cursor: pointer; }
.entry-prefill { background: var(--zv-blue-wash); color: var(--zv-blue); border: 1px solid #c9daea; border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 0 0 12px; }
.entry-prefill[hidden] { display: none; }

/* Which path answered, now that the server picks it (lib/zi-route.js). */
.zi-source { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
