/* Coach IA — iPhone-first (Pedro only works on his phone). Built on the app's
   tokens in styles.css. Status language shared by every view:
   solid blue tape = published · hatched grey = draft · hatched electric =
   proposal · faint = empty · green = Open Box. */

body.ia { overflow: hidden; }
body.ia::before { z-index: 2; }

.ia-app {
  height: var(--app-h, 100dvh);
  max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
.ia-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ia-app svg, .ia-sheet svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Top bar ---------- */
.ia-top {
  flex: 0 0 auto; height: 54px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 8px; padding: 0 10px;
}
.ia-top > :first-child { justify-self: start; }
.ia-top > :last-child { justify-self: end; }
.ia-top-actions { display: flex; align-items: center; gap: 2px; }
.ia-top-actions.off { visibility: hidden; }
.ia-histbtn { width: 44px; height: 40px; border: 0; background: none; color: #c9d4e3; }
.ia-top h1 { font-size: 20px; letter-spacing: 0.04em; }
.ia-back, .ia-top-action {
  min-height: 44px; min-width: 72px; display: inline-flex; align-items: center; gap: 4px;
  padding: 0 6px; border: 0; background: none; color: #c9d4e3;
  font: 600 13px var(--font-body); text-decoration: none;
}
.ia-back svg { width: 18px; height: 18px; stroke-width: 2.2; }
.ia-top-action { justify-content: flex-end; color: var(--blue-text); font-weight: 700; }
.ia-top-action { min-width: 0; }

/* ---------- Views ---------- */
.ia-view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
#view-week, #view-brain { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Week strip (chat) ---------- */
.ia-stripwrap { flex: 0 0 auto; padding: 0 14px 8px; border-bottom: 1px solid var(--line-soft); touch-action: pan-y; }
.ia-stripnav { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ia-stripbtn { width: 44px; height: 34px; border-radius: 10px; }
.ia-stripbtn svg { width: 18px; height: 18px; }
.ia-stripweek {
  flex: 1; min-height: 34px; border: 0; background: none; color: var(--ink);
  font: 600 14px var(--font-display); letter-spacing: 0.05em; text-transform: uppercase;
}
.ia-stripweek small { font: 600 12px var(--font-body); letter-spacing: 0; text-transform: none; color: var(--ink-dim); margin-left: 6px; }
.ia-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.ia-legend {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px;
  font-size: 11px; font-weight: 600; color: var(--ink-dim);
}
.ia-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ia-legend .ia-dot { display: inline-block; }
.ia-day-pill {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 60px; padding: 7px 0 8px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06); background: rgba(16, 47, 87, 0.55); color: var(--ink);
}
.ia-day-pill.today { border-color: var(--accent); background: var(--card-hi); }
.ia-day-pill .dow { font: 600 11px var(--font-display); letter-spacing: 0.08em; color: var(--ink-dim); text-transform: uppercase; }
.ia-day-pill .num { font: 600 20px/1 var(--font-display); }
.ia-dot { width: 8px; height: 8px; border-radius: 50%; box-sizing: border-box; background: rgba(255, 255, 255, 0.12); }
.ia-dot.st-pub { background: var(--accent); box-shadow: 0 0 8px rgba(61, 120, 255, 0.7); }
.ia-dot.st-prop { background: none; border: 2px solid var(--accent); }
.ia-dot.st-draft { background: none; border: 2px solid var(--ink-dim); }
.ia-dot.st-openbox { background: var(--ok); }

/* ---------- Thread ---------- */
.ia-thread {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 12px; padding: 14px 16px;
}
/* A long conversation scrolls; its items never shrink to fit (a proposal card
   squeezed below its content height spills its text over its border). */
.ia-thread > * { flex-shrink: 0; }
.ia-empty { margin: auto 0; text-align: center; color: var(--ink-dim); font-size: 14px; line-height: 1.5; padding: 0 12px; }
.ia-empty strong { display: block; color: var(--ink); font: 600 18px var(--font-display); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.ia-starters { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.ia-starter {
  min-height: 44px; padding: 10px 14px; border-radius: 12px; text-align: left;
  border: 1px dashed rgba(61, 120, 255, 0.55); background: rgba(61, 120, 255, 0.06);
  color: #cfdcff; font: 600 13.5px var(--font-body);
}

.msg-me {
  align-self: flex-end; max-width: 86%; padding: 9px 13px 10px;
  border-radius: 14px 14px 4px 14px; background: linear-gradient(180deg, var(--blue-lift), var(--blue));
  box-shadow: 0 6px 16px -8px rgba(4, 66, 191, 0.9);
  font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg-me.sending { opacity: 0.7; }
.msg-voice { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; opacity: 0.85; margin-bottom: 3px; }
.msg-voice svg { width: 12px; height: 12px; stroke-width: 2.4; }
.msg-bot { max-width: 94%; font-size: 15px; line-height: 1.5; color: #e7edf5; overflow-wrap: anywhere; }
/* The bot's replies: a small Markdown subset (D-034), laid out for a phone. */
.msg-bot p { margin: 0 0 9px; }
.msg-bot ul, .msg-bot ol { margin: 2px 0 11px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.msg-bot li { padding-left: 2px; }
.msg-bot li::marker { color: var(--accent); font-weight: 700; }
.msg-bot li ul { margin: 6px 0 0; gap: 4px; }
.msg-bot h4 {
  margin: 14px 0 6px; font: 600 14px var(--font-display); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink);
}
.msg-bot .who + h4 { margin-top: 2px; }
.msg-bot hr { border: 0; height: 1px; margin: 13px 0; background: linear-gradient(90deg, var(--line), transparent); }
.msg-bot strong { color: #fff; font-weight: 700; }
.msg-bot code { font-size: 13.5px; padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); }
.msg-bot > :last-child { margin-bottom: 0; }
.msg-bot .who, .ia-who {
  display: block; margin-bottom: 3px;
  font: 600 11.5px var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-text);
}
.ia-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-dim); }
.ia-status::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent); animation: ia-pulse 1.1s ease-in-out infinite;
}
@keyframes ia-pulse { 50% { opacity: 0.3; transform: scale(0.7); } }
.ia-error { font-size: 13px; color: #ffb4b4; border: 1px solid rgba(255, 95, 95, 0.35); background: rgba(255, 95, 95, 0.08); border-radius: 10px; padding: 8px 11px; }

/* Proposal cards in the chat — a tap opens the full day */
.ia-prop {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 58px; padding: 10px 14px; border-radius: 12px; text-align: left;
  border: 1px dashed var(--accent); background: rgba(61, 120, 255, 0.08); color: var(--ink);
}
.ia-prop.done { border-color: rgba(143, 161, 184, 0.45); background: rgba(16, 47, 87, 0.4); }
.ia-prop.dim { opacity: 0.6; border-color: rgba(255, 255, 255, 0.12); background: none; }
.ia-prop-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ia-prop-title { font: 600 15px var(--font-display); letter-spacing: 0.03em; text-transform: uppercase; }
.ia-prop-sub { font-size: 12.5px; color: var(--ink-dim); line-height: 1.35; }
.ia-prop-go { flex: 0 0 auto; font-size: 12.5px; font-weight: 700; color: #9dbbff; white-space: nowrap; }
.ia-publish {
  padding: 11px 14px 12px; border-radius: 12px; border: 1px solid rgba(61, 120, 255, 0.55);
  background: linear-gradient(158deg, var(--card) 0%, #0c274a 100%);
}
.ia-publish p { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.ia-publish .ia-actions { margin: 0; }

/* Memory note in the chat */
.ia-memnote {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 11px;
  border: 1px dashed rgba(143, 161, 184, 0.4); background: rgba(61, 120, 255, 0.05);
  font-size: 13px; line-height: 1.45; color: #c9d4e3;
}
.ia-memnote svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; color: var(--ink-dim); }
.ia-memnote p { margin: 0; flex: 1; }

/* ---------- Recording ---------- */
.ia-rec {
  flex: 0 0 auto; margin: 0 12px 8px; padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--accent); background: var(--navy-deep);
  box-shadow: 0 0 22px rgba(61, 120, 255, 0.25);
  display: flex; flex-direction: column; gap: 8px;
}
.ia-rec-wave { height: 34px; display: flex; align-items: center; justify-content: center; gap: 3px; }
.ia-rec-wave span { width: 4px; border-radius: 2px; background: var(--accent); min-height: 4px; transition: height 80ms linear; }
.ia-rec-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ia-rec-time { font: 600 18px var(--font-display); letter-spacing: 0.04em; }
.ia-rec-hint { font-size: 12.5px; color: var(--ink-dim); text-align: right; }
.ia-switch {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; border: 0; background: none;
  color: var(--ink-dim); font: 600 12px var(--font-body);
}
.ia-switch-track {
  position: relative; width: 38px; height: 22px; border-radius: 999px; box-sizing: border-box;
  background: var(--navy-deep); border: 1px solid rgba(255, 255, 255, 0.18);
}
.ia-switch-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: left 0.15s; }
.ia-switch[aria-pressed="true"] .ia-switch-track { background: var(--blue); border-color: var(--accent); }
.ia-switch[aria-pressed="true"] .ia-switch-knob { left: 18px; }

/* ---------- Composer (A1's lower section) ---------- */
.ia-composer {
  flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, 0.07); background: rgba(7, 26, 49, 0.92);
}
.ia-composer textarea {
  flex: 1; min-width: 0; resize: none; max-height: 132px; min-height: 46px; box-sizing: border-box;
  padding: 12px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--navy-deep); color: var(--ink); font: 16px/1.3 var(--font-body);
}
.ia-composer textarea::placeholder, .ia-field::placeholder { color: var(--ink-faint); }
.ia-composer textarea:focus, .ia-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61, 120, 255, 0.18); }
.ia-mic, .ia-send {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 50%; border: 0; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, var(--blue-lift), var(--blue));
  box-shadow: 0 8px 18px -8px rgba(4, 66, 191, 0.95);
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.ia-mic svg { width: 21px; height: 21px; }
.ia-send svg { width: 19px; height: 19px; }
.ia-mic.recording { background: var(--accent); box-shadow: 0 0 0 6px rgba(61, 120, 255, 0.2), 0 0 20px rgba(61, 120, 255, 0.6); }
.ia-send:disabled { opacity: 0.45; }

/* ---------- Tab bar (A1's lower section) ---------- */
.ia-tabs {
  flex: 0 0 auto; display: flex; justify-content: center; gap: 2px;
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  background: rgba(4, 14, 28, 0.92); border-top: 1px solid var(--line);
}
.ia-tab {
  position: relative; flex: 1 1 0; max-width: 110px; min-height: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 2px; border: 0; border-radius: 12px; background: none; color: var(--ink-dim);
  font: 600 10.5px/1 var(--font-display); letter-spacing: 0.05em; text-transform: uppercase;
}
.ia-tab svg { width: 23px; height: 23px; }
.ia-tab[aria-current="page"] { color: var(--blue-text); background: rgba(61, 120, 255, 0.12); }
.ia-badge {
  position: absolute; top: 3px; left: 58%; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  border-radius: 999px; background: var(--accent); color: #fff; font: 700 10px/16px var(--font-body); text-align: center;
}
/* The keyboard is up: give the thread the room. */
body.kbd .ia-tabs, body.kbd .ia-stripwrap { display: none; }

/* ---------- Buttons & fields ---------- */
.ia-btn {
  min-height: 44px; padding: 0 16px; border-radius: 11px; font: 700 13.5px var(--font-body);
  border: 1px solid rgba(255, 255, 255, 0.14); background: transparent; color: #c9d4e3;
}
.ia-btn.primary { border: 0; background: linear-gradient(180deg, var(--blue-lift), var(--blue)); color: #fff; box-shadow: 0 8px 18px -10px rgba(4, 66, 191, 0.95); }
.ia-btn:disabled { opacity: 0.5; }
.ia-actions { display: flex; gap: 8px; margin-top: 12px; }
.ia-actions .ia-btn.primary { flex: 1; }
.ia-link { min-height: 40px; border: 0; background: none; color: var(--blue-text); font: 700 13px var(--font-body); padding: 0 2px; }
.ia-iconbtn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); display: flex; align-items: center; justify-content: center;
}
.ia-iconbtn svg { width: 20px; height: 20px; }
.ia-field {
  width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--navy-deep); color: var(--ink); font: 15px/1.5 var(--font-body);
}
.ia-chip {
  display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.ia-chip.st-pub { background: linear-gradient(180deg, var(--blue-lift), var(--blue)); color: #fff; }
.ia-chip.st-draft { border: 1px dashed var(--ink-dim); color: #c9d4e3; }
.ia-chip.st-prop { border-color: var(--accent); background: rgba(61, 120, 255, 0.12); color: #9dbbff; }
.ia-chip.st-empty, .ia-chip.st-dim { border-color: var(--line); color: var(--ink-dim); }
.ia-chip.st-openbox { border-color: rgba(53, 210, 154, 0.5); background: rgba(53, 210, 154, 0.1); color: var(--ok); }

/* ---------- Semana ---------- */
.ia-weeknav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 12px 10px; }
.ia-weeknav h2 { font-size: 19px; letter-spacing: 0.04em; text-align: center; }
.ia-days { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 20px; }
.ia-daycard { border-radius: 13px; overflow: hidden; border: 1px dashed rgba(255, 255, 255, 0.12); background: rgba(3, 15, 31, 0.35); }
.ia-daycard::before { content: ''; display: block; height: 5px; background: rgba(255, 255, 255, 0.06); }
.ia-daycard.st-pub { border: 1px solid var(--line); background: linear-gradient(158deg, var(--card) 0%, #0c274a 100%); box-shadow: var(--shadow-card); }
.ia-daycard.st-pub::before { background: linear-gradient(90deg, var(--accent), var(--blue)); box-shadow: 0 0 14px rgba(61, 120, 255, 0.45); }
.ia-daycard.st-draft { border-color: rgba(143, 161, 184, 0.5); background: rgba(16, 47, 87, 0.5); }
.ia-daycard.st-draft::before { background: repeating-linear-gradient(135deg, var(--ink-dim) 0 6px, transparent 6px 12px); }
.ia-daycard.st-prop { border-color: var(--accent); background: rgba(61, 120, 255, 0.07); }
.ia-daycard.st-prop::before { background: repeating-linear-gradient(135deg, var(--accent) 0 6px, transparent 6px 12px); }
.ia-daycard.st-openbox { border: 1px solid rgba(53, 210, 154, 0.3); background: linear-gradient(158deg, rgba(53, 210, 154, 0.1), rgba(16, 47, 87, 0.55) 55%); }
.ia-daycard.st-openbox::before { background: var(--ok); }
.ia-dayhead {
  width: 100%; min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border: 0; background: none; color: var(--ink); text-align: left;
}
.ia-daynum { display: flex; flex-direction: column; align-items: center; width: 40px; flex: 0 0 auto; }
.ia-daynum .dow { font: 600 12px var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }
.ia-daynum .num { font: 600 24px/1 var(--font-display); }
.ia-daysum { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ia-daysum .s1 { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.ia-daysum .s2 { font-size: 12.5px; color: var(--ink-dim); line-height: 1.35; }
.ia-daycard.st-openbox .ia-daysum .s1 { font: 600 14px var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ok); }
.ia-daybody { padding: 0 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ia-daybody .section { animation: none; }
.ia-daycard.st-draft .ia-daybody .section::before { background: repeating-linear-gradient(180deg, var(--ink-dim) 0 7px, transparent 7px 13px); box-shadow: none; }
.ia-warn {
  margin: 0 14px 12px; padding: 9px 11px; border-radius: 10px; font-size: 12.5px; line-height: 1.45;
  border: 1px solid rgba(245, 197, 66, 0.45); background: rgba(245, 197, 66, 0.08); color: #f3e2ad;
}
.ia-daybody .ia-actions { margin-top: 2px; }
.ia-daybody .ia-actions .ia-btn { flex: 1; }

/* ---------- Cerebro ---------- */
.ia-seg {
  flex: 0 0 auto; display: flex; margin: 0 16px 12px; border: 1px solid var(--line);
  border-radius: 11px; overflow: hidden; background: var(--navy-deep);
}
.ia-seg button {
  flex: 1; min-height: 44px; border: 0; background: none; color: var(--ink-dim);
  font: 600 12.5px var(--font-display); letter-spacing: 0.07em; text-transform: uppercase;
}
.ia-seg button[aria-selected="true"] { background: linear-gradient(180deg, var(--blue-lift), var(--blue)); color: #fff; }
.ia-brain { padding: 0 16px 24px; }
.ia-help { margin: 0 0 10px; font-size: 13px; line-height: 1.45; color: var(--ink-dim); }
.ia-instr { min-height: 50vh; resize: vertical; font-size: 14px; line-height: 1.55; }
.ia-addrow { display: flex; gap: 8px; margin-bottom: 14px; }
.ia-addrow .ia-field { flex: 1; min-width: 0; }
.ia-addrow .ac-wrap { flex: 1; min-width: 0; }
.ia-mems { display: flex; flex-direction: column; gap: 8px; }
.ia-mem {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08); background: linear-gradient(158deg, var(--card) 0%, #0c274a 100%);
}
.ia-mem.deleted { border-style: dashed; border-color: rgba(255, 255, 255, 0.12); background: none; }
.ia-mem-main { flex: 1; min-width: 0; }
.ia-mem-main p { margin: 0 0 5px; font-size: 14px; line-height: 1.45; color: #e7edf5; overflow-wrap: anywhere; }
.ia-mem.deleted .ia-mem-main p { color: var(--ink-dim); text-decoration: line-through; }
.ia-who-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: #c9d4e3; }
.ia-who-badge.ai { background: none; border: 1px solid var(--accent); color: #9dbbff; padding: 1px 8px; }
.ia-mem .ia-iconbtn { width: 36px; height: 36px; border-radius: 9px; background: transparent; color: var(--ink-dim); }
.ia-mem .ia-iconbtn svg { width: 15px; height: 15px; }
.ia-subhead { margin: 20px 0 6px; font-size: 14px; letter-spacing: 0.05em; color: var(--ink-dim); }
.ia-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ia-ban {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 95, 95, 0.5); background: rgba(255, 95, 95, 0.1); color: #ffd0d0;
  font-size: 13.5px; font-weight: 600;
}
.ia-ban button {
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.08);
  color: #fff; font-size: 17px; line-height: 1; padding: 0;
}
.ia-suggest {
  min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px dashed rgba(255, 255, 255, 0.22);
  background: transparent; color: #c9d4e3; font: 600 13px var(--font-body);
}
.ia-usage { margin: 26px 0 0; font-size: 12px; color: var(--ink-faint); text-align: center; }

/* ---------- Proposal sheet (full day) ---------- */
.ia-sheet {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  height: var(--app-h, 100dvh); padding-top: env(safe-area-inset-top);
  background:
    radial-gradient(120% 40% at 50% -8%, rgba(61, 120, 255, 0.16) 0%, transparent 60%),
    radial-gradient(135% 100% at 50% -10%, #0c2a4c 0%, #061a30 55%, var(--navy-deep) 100%);
}
.ia-sheet[hidden] { display: none; }
.ia-sheet > * { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.ia-pager { display: flex; gap: 6px; align-items: center; }
.ia-pager span { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); }
.ia-pager span.on { width: 18px; background: var(--accent); }
.ia-pager-count { min-width: 72px; text-align: right; font-size: 12px; font-weight: 600; color: var(--ink-dim); padding-right: 8px; }
.ia-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px 16px; }
.ia-sheet-title { font-size: 30px; line-height: 1; margin: 0 0 8px; }
.ia-sheet-day { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.ia-sheet-day .section { animation: none; }
/* A proposal is not the published day: its blocks carry the hatched tape. */
.ia-sheet.is-prop .ia-sheet-day .section::before { background: repeating-linear-gradient(180deg, var(--accent) 0 7px, transparent 7px 13px); box-shadow: none; }
.ia-sheet.is-draft .ia-sheet-day .section::before { background: repeating-linear-gradient(180deg, var(--ink-dim) 0 7px, transparent 7px 13px); box-shadow: none; }
.ia-sheet-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.07); background: rgba(7, 26, 49, 0.96);
}
.ia-sheet-bar .ia-btn { min-height: 50px; padding: 0 10px; }
.ia-sheet-bar .ia-btn.primary, .ia-sheet-bar .ia-btn.publish { flex: 1; font-size: 14.5px; }
/* Straight to the live WOD: outlined in the "Publicado" blue, so the saved-draft path stays the obvious one. */
.ia-btn.publish { border-color: var(--accent); color: #9dbbff; background: rgba(61, 120, 255, 0.1); }
.ia-sheet-bar .ia-mic { flex-basis: 50px; width: 50px; height: 50px; background: rgba(61, 120, 255, 0.12); border: 1px solid var(--accent); color: #9dbbff; box-shadow: none; }
.ia-sheet-bar .done { flex: 1; font-size: 14px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .ia-status::before { animation: none; }
  .ia-rec-wave span { transition: none; }
}

/* ---------- Conversations ---------- */
.ia-hist-new { width: 100%; margin: 4px 0 14px; }
.ia-hist { display: flex; flex-direction: column; gap: 8px; }
.ia-hist-row {
  display: flex; align-items: center; gap: 8px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08); background: linear-gradient(158deg, var(--card) 0%, #0c274a 100%);
}
.ia-hist-row.current { border-color: var(--accent); }
.ia-hist-open {
  flex: 1; min-width: 0; min-height: 60px; display: flex; flex-direction: column; gap: 3px;
  padding: 10px 4px 10px 14px; border: 0; background: none; color: var(--ink); text-align: left;
}
.ia-hist-title {
  font-size: 14.5px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ia-hist-meta { font-size: 12px; color: var(--ink-dim); }
.ia-hist-row .ia-iconbtn { width: 40px; height: 40px; margin-right: 8px; border-radius: 10px; background: transparent; color: var(--ink-dim); }
.ia-hist-row .ia-iconbtn svg { width: 16px; height: 16px; }

/* ---------- Rápido / Experto (D-035) ---------- */
.ia-mode {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 0; background: rgba(7, 26, 49, 0.92); border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.ia-mode + .ia-composer { border-top: 0; }
.ia-mode button {
  min-height: 34px; padding: 0 14px; border: 1px solid var(--line); background: var(--navy-deep); color: var(--ink-dim);
  font: 600 12px var(--font-display); letter-spacing: 0.07em; text-transform: uppercase;
}
.ia-mode button:first-of-type { border-radius: 10px 0 0 10px; }
.ia-mode button:last-of-type { border-radius: 0 10px 10px 0; margin-left: -1px; }
.ia-mode button[aria-checked="true"] { background: linear-gradient(180deg, var(--blue-lift), var(--blue)); border-color: transparent; color: #fff; }
.ia-mode button:disabled { opacity: 0.55; }
.ia-mode-hint { font-size: 12px; color: var(--ink-dim); line-height: 1.3; }

/* ---------- What the bot is doing (D-036) ---------- */
.ia-steps {
  border: 1px solid var(--line); border-radius: 12px; background: rgba(16, 47, 87, 0.45);
  padding: 10px 12px; font-size: 13px;
}
.ia-steps-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px;
  font: 600 11.5px var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-text);
}
.ia-timer { color: var(--ink-dim); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.ia-steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ia-steps li { display: flex; gap: 8px; align-items: flex-start; color: #c9d4e3; line-height: 1.4; }
.ia-steps li svg { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 2px; color: var(--ok); stroke-width: 3; }
.ia-steps li.active { color: var(--ink); font-weight: 600; }
.ia-spin {
  flex: 0 0 14px; width: 14px; height: 14px; margin-top: 2px; box-sizing: border-box; border-radius: 50%;
  border: 2px solid rgba(61, 120, 255, 0.25); border-top-color: var(--accent); animation: ia-rot 0.8s linear infinite;
}
@keyframes ia-rot { to { transform: rotate(360deg); } }
.msg-bot details.ia-steps-done { margin: 2px 0 10px; font-size: 12.5px; }
.msg-bot details.ia-steps-done summary {
  cursor: pointer; list-style: none; color: var(--ink-dim); font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px;
}
.msg-bot details.ia-steps-done summary::-webkit-details-marker { display: none; }
.msg-bot details.ia-steps-done summary::after { content: '›'; font-size: 16px; transition: transform 0.15s; }
.msg-bot details.ia-steps-done[open] summary::after { transform: rotate(90deg); }
.msg-bot details.ia-steps-done ol { list-style: none; margin: 4px 0 0; padding: 0 0 0 2px; display: flex; flex-direction: column; gap: 4px; }
.msg-bot details.ia-steps-done li { display: flex; gap: 7px; color: var(--ink-dim); line-height: 1.4; }
.msg-bot details.ia-steps-done li svg { flex: 0 0 12px; width: 12px; height: 12px; margin-top: 3px; color: var(--ok); stroke-width: 3; }
.msg-note { font-size: 14px; line-height: 1.45; color: #c9d4e3; font-style: italic; }
.msg-note .who { font-style: normal; }
@media (prefers-reduced-motion: reduce) { .ia-spin { animation: none; } }
