/* Live Coach: the tab and the small floating panel. Light, clean, green. */
#coach .coach-card { max-width: 1180px; }
.coach-label { display: block; font-weight: 700; font-size: 13.5px; color: var(--obsidian); margin: 16px 0 6px; }
#coachGoal { width: 100%; min-height: 104px; resize: vertical; }
.coach-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.coach-field select { width: 100%; min-height: 44px; }
.coach-inline { display: flex; gap: 8px; align-items: center; }
.coach-inline select { flex: 1; min-width: 0; }
.coach-check { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-size: 14.5px; color: var(--charcoal); cursor: pointer; }
.coach-check input { width: 18px; height: 18px; accent-color: var(--spruce); }
.coach-go { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.coach-go .sub { color: var(--alarm); }
.coach-promise { margin-top: 12px; }

.coach-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.coach-grow { flex: 1; }
.coach-title { font-size: 16px; color: var(--obsidian); overflow-wrap: anywhere; }
.coach-chip { font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--linen); color: var(--forest); white-space: nowrap; }
.coach-chip[data-s="paused"] { background: #fff3d6; color: #6b4a00; }
.coach-chip[data-s="planning"] { background: var(--fog); color: var(--charcoal); }
.coach-meta { font-size: 12.5px; color: var(--slate); margin: 8px 0 0; overflow-wrap: anywhere; }
.coach-err { font-size: 13.5px; color: var(--alarm); margin: 6px 0 0; }
.pill.danger { border-color: #e9b8ba; color: var(--alarm); background: #fff; }
.pill.small { min-height: 34px; padding: 6px 13px; font-size: 13.5px; }

.coach-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; margin-top: 14px; align-items: start; }
.coach-box { border: 1px solid var(--line, #d3d8cf); border-radius: 16px; padding: 16px 18px; background: #fff; min-width: 0; }
.coach-box.say { background: var(--wash, #f1faeb); border-color: #cfe8bd; }
.coach-box.do { border-color: var(--forest); box-shadow: 0 1px 0 var(--forest); }
.cb-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cb-tag { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--spruce); }
.cb-for { font-size: 12.5px; color: var(--slate); overflow-wrap: anywhere; }
.cb-say { font-size: 19px; line-height: 1.4; font-weight: 600; color: var(--forest); margin: 10px 0 8px; overflow-wrap: anywhere; }
.cb-do { font-size: 21px; line-height: 1.35; font-weight: 700; color: var(--obsidian); margin: 10px 0 6px; overflow-wrap: anywhere; }
.cb-why { font-size: 14px; color: var(--slate); margin: 0 0 4px; }
.cb-heard { display: grid; gap: 4px; margin-top: 6px; }
.ch-line { font-size: 13px; color: var(--charcoal); overflow-wrap: anywhere; }
.ch-line.them b { color: var(--signal); }
.ch-line.partial { opacity: .6; font-style: italic; }
.cb-ask { display: flex; gap: 8px; margin-top: 10px; }
.cb-ask input { flex: 1; min-width: 0; min-height: 36px; font-size: 14px; }
.cc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; margin-top: 10px; }
.cc-label { grid-column: 1 / -1; font-size: 12.5px; font-weight: 700; color: var(--charcoal); }
.cc-val { margin: 0; padding: 9px 11px; background: #f5f7f3; border: 1px solid var(--line, #d3d8cf); border-radius: 9px; font: 13.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 190px; overflow: auto; color: var(--obsidian); }
.cb-fix { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fff1f1; border: 1px solid #f0c4c6; color: #7a1419; font-size: 15px; line-height: 1.4; }
.cb-unsure { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fff8e3; border: 1px solid #ecd9a0; color: #5c4300; font-size: 14px; }
.cb-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.cb-note, .cb-next { font-size: 13px; color: var(--slate); margin: 10px 0 0; overflow-wrap: anywhere; }
.cb-next { color: var(--pebble); }

.coach-mapbox { border: 1px solid var(--line, #d3d8cf); border-radius: 16px; padding: 14px 16px; margin-top: 16px; }
.cm-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0; font-size: 12.5px; color: var(--charcoal); }
.cm-legend .lg::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1.5px solid #b9c0b4; background: #fff; }
.cm-legend .lg-current::before { border-color: var(--forest); background: var(--lime); }
.cm-legend .lg-done::before { border-color: var(--spruce); background: var(--spruce); }
.cm-legend .lg-fix::before { border-color: #b97a00; background: #ffe2a3; }
.cm-legend .lg-blocked::before { border-color: var(--alarm); background: #f7c9cb; }
.coach-map { overflow: auto; max-height: 460px; padding: 4px; }
.cm-edge { fill: none; stroke: #9aa396; stroke-width: 1.6; }
.cm-elabel { font: 600 11px Inter, system-ui, sans-serif; fill: var(--slate); paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.cm-node { cursor: pointer; }
.cm-node rect { fill: #fff; stroke: #b9c0b4; stroke-width: 1.5; }
.cm-node .cm-label { font: 700 13px Inter, system-ui, sans-serif; fill: var(--obsidian); }
.cm-node .cm-state { font: 500 11px Inter, system-ui, sans-serif; fill: var(--slate); }
.cm-node .cm-mark { font: 800 14px Inter, system-ui, sans-serif; fill: var(--forest); }
.cm-node.started rect { fill: #f6fbf2; stroke: #8fb37a; }
.cm-node.current rect { fill: var(--lime); stroke: var(--forest); stroke-width: 2.5; }
.cm-node.done rect { fill: var(--spruce); stroke: var(--spruce); }
.cm-node.done text { fill: #fff; }
.cm-node.fix rect { fill: #ffe9b8; stroke: #b97a00; stroke-width: 2; }
.cm-node.blocked rect { fill: #fbe1e2; stroke: var(--alarm); }
.cm-node.sel rect { stroke-dasharray: 5 3; }
.coach-node { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: #f7f9f5; border: 1px solid var(--line, #d3d8cf); }
.cn-head { display: flex; justify-content: space-between; gap: 10px; }
.cn-steps { margin: 6px 0 0 18px; font-size: 13.5px; color: var(--charcoal); display: grid; gap: 4px; }
.cn-steps li.verified, .cn-steps li.confirmed { color: var(--spruce); }
.coach-all { margin-top: 14px; }
.coach-all summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--obsidian); }
.coach-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.cs { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 9px; align-items: start; font-size: 13.5px; color: var(--charcoal); }
.cs-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #b9c0b4; margin-top: 4px; }
.cs.verified .cs-dot { background: var(--spruce); border-color: var(--spruce); }
.cs.confirmed .cs-dot { background: #8fb37a; border-color: #8fb37a; }
.cs.now { color: var(--obsidian); font-weight: 700; }
.cs.now .cs-dot { background: var(--lime); border-color: var(--forest); }
.cs-how { font-size: 11.5px; color: var(--slate); white-space: nowrap; }

/* the small floating panel */
body.coach-panel { margin: 0; padding: 12px 14px 16px; background: #fff; -webkit-app-region: drag; overflow-y: auto; }
body.coach-panel button, body.coach-panel input, body.coach-panel pre, body.coach-panel p, body.coach-panel .cb-heard { -webkit-app-region: no-drag; }
body.coach-panel .coach-cols { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; }
body.coach-panel .coach-bar { margin-top: 0; }
body.coach-panel .coach-title { font-size: 13.5px; flex-basis: 100%; order: 5; }
body.coach-panel .cb-say { font-size: 16px; }
body.coach-panel .cb-do { font-size: 17.5px; }
body.coach-panel .coach-box { padding: 12px 14px; border-radius: 13px; }
body.coach-panel .coach-meta { display: none; }
.cp-off { padding: 30px 10px; text-align: center; color: var(--slate); font-size: 14.5px; }
body.coach-panel.coach-off .cp-on, body.coach-panel:not(.coach-off) .cp-off { display: none; }

@media (max-width: 860px) {
  .coach-cols, .coach-row { grid-template-columns: minmax(0, 1fr); }
}

.coach-bar .pill:not(.primary):not(.danger), .cb-actions .pill:not(.primary), .cb-ask .pill, .cc-row .pill, .coach-inline .pill, .coach-mapbox .pill { border: 1px solid var(--line, #d3d8cf); background: #fff; }

.ch-en { margin: 2px 0 0 14px; padding-left: 8px; border-left: 2px solid #b9c0b4; color: var(--slate); font-style: italic; }
#coachLimit, #coachLang { width: 100%; min-height: 44px; }
#coachOver { margin-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#coachOver.hidden { display: none; }

#coachWatchRow { margin-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--wash, #f1faeb); border-color: #cfe8bd; color: var(--forest); }
#coachWatchRow.hidden { display: none; }
#coachWatchRow select { min-height: 36px; max-width: 360px; }
#coachPrepare { border: 1px solid var(--line, #d3d8cf); background: #fff; }

.coach-perms { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0 0; font-size: 13px; }
.perm.ok { color: var(--spruce); } .perm.no { color: var(--alarm); font-weight: 600; }
#coachPastAll { margin-top: 10px; }
.cs.blocked .cs-dot { background: #f7c9cb; border-color: var(--alarm); }

/* ---------- pre-session: sessions card, setup sheet, preparation screen ---------- */
.ps-card { border: 1px solid #cfe8bd; background: var(--wash, #f1faeb); border-radius: 16px; padding: 18px 20px; margin: 16px 0; }
.ps-card.hidden, .ps-sheet.hidden { display: none; }
.ps-head, .ps-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ps-head h2, .ps-top h2 { margin: 0; font-size: 20px; color: var(--obsidian); }
.ps-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.ps-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--line, #d3d8cf); border-radius: 12px; padding: 10px 12px; }
.ps-main { flex: 1; min-width: 220px; display: grid; gap: 2px; }
.ps-sub { font-size: 12.5px; color: var(--slate); overflow-wrap: anywhere; }
.ps-chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--fog); color: var(--charcoal); white-space: nowrap; }
.ps-chip.ready { background: var(--linen); color: var(--forest); } .ps-chip.running { background: #fff3d6; color: #6b4a00; } .ps-chip.partial { background: #fff3d6; color: #6b4a00; }
.ps-sheet { position: fixed; inset: 0; z-index: 60; background: rgba(14, 15, 12, .38); overflow-y: auto; padding: 28px 16px; }
.ps-box { max-width: 860px; margin: 0 auto; background: #fff; border-radius: 20px; padding: 24px 26px; box-shadow: 0 18px 50px rgba(0, 0, 0, .18); }
.ps-steps { list-style: none; display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 4px; padding: 0; font-size: 13px; color: var(--slate); }
.ps-steps li { padding: 5px 11px; border-radius: 999px; background: var(--fog); }
.ps-steps li.on { background: var(--lime); color: var(--forest); font-weight: 700; } .ps-steps li.done { background: var(--linen); color: var(--spruce); }
.ps-body { margin-top: 10px; }
.ps-types { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ps-type { border: 1px solid var(--line, #d3d8cf); background: #fff; border-radius: 999px; padding: 8px 13px; font-size: 13.5px; cursor: pointer; color: var(--charcoal); }
.ps-type.on { background: var(--forest); color: #fff; border-color: var(--forest); }
.ps-field { display: grid; gap: 5px; margin-top: 12px; }
.ps-field > span { font-size: 13px; font-weight: 700; color: var(--obsidian); }
.ps-field input, .ps-field textarea, .ps-field select, .ps-add input, .ps-qa input, .ps-qa textarea { width: 100%; min-height: 42px; font-size: 14.5px; }
.ps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.ps-softlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.ps-soft { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line, #d3d8cf); background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.ps-soft span { display: grid; min-width: 0; } .ps-soft small, .ps-file small { color: var(--slate); font-size: 12px; }
.ps-logo { width: 22px; height: 22px; flex: none; } .ps-logo.letter { display: grid; place-items: center; border-radius: 6px; background: var(--fog); color: var(--charcoal); font-weight: 800; font-size: 12px; }
.ps-picked { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ps-pick { display: flex; gap: 8px; align-items: center; border: 1px solid #cfe8bd; background: var(--wash, #f1faeb); border-radius: 999px; padding: 5px 10px; font-size: 13.5px; }
.ps-pick input { width: 84px; min-height: 28px; font-size: 12.5px; padding: 3px 8px; }
.ps-file { display: flex; gap: 8px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--fog); cursor: pointer; flex-wrap: wrap; }
.ps-file input { width: 17px; height: 17px; accent-color: var(--spruce); }
.ps-add { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; } .ps-add input[type="text"] { flex: 1; min-width: 200px; }
.ps-err { color: var(--alarm); font-size: 13.5px; min-height: 18px; margin: 8px 0 0; }
.ps-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; } .ps-left { display: flex; gap: 8px; flex-wrap: wrap; }
.ps-box .pill:not(.primary) { border: 1px solid var(--line, #d3d8cf); background: #fff; }
.ps-state { font-weight: 700; margin: 12px 0 6px; color: var(--forest); } .ps-state.running { color: #6b4a00; } .ps-state.failed { color: var(--alarm); }
.ps-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ps-stages li { display: grid; grid-template-columns: 22px auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: 13.5px; color: var(--charcoal); padding: 7px 10px; border-radius: 10px; background: #f7f9f5; }
.ps-stages li.done .ps-mark { color: var(--spruce); font-weight: 800; } .ps-stages li.working { background: #fff8e3; } .ps-stages li.failed { background: #fff1f1; color: #7a1419; }
.ps-stages small { color: var(--slate); }
.ps-review { margin-top: 14px; border-top: 1px solid var(--fog); padding-top: 6px; }
.ps-review h3 { font-size: 15px; margin: 16px 0 4px; color: var(--obsidian); }
.ps-line { font-size: 14px; color: var(--charcoal); margin: 8px 0 0; overflow-wrap: anywhere; } .ps-line.warn { background: #fff8e3; border-radius: 8px; padding: 8px 10px; }
.ps-qa { display: grid; gap: 4px; margin-top: 8px; } .ps-qa input { font-weight: 600; }
.ps-next { margin: 6px 0 0 18px; font-size: 13.5px; color: var(--charcoal); display: grid; gap: 3px; }
@media (max-width: 720px) { .ps-grid, .ps-softlist { grid-template-columns: minmax(0, 1fr); } .ps-box { padding: 18px 16px; } }
.ps-field textarea, .ps-field input, .ps-qa textarea { font-weight: 400; }
.ps-top .link, .ps-row .link, .ps-pick .link { background: none; border: 0; color: var(--spruce); font-weight: 600; cursor: pointer; padding: 4px 6px; }

/* sessions first; conversation and assistant chat in the live view */
#coachHome .ps-card { margin-top: 14px; }
.ps-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ps-actions .pill:not(.primary) { border: 1px solid #b9d7a4; background: #fff; }
.ps-flow { margin: 10px 0 2px; } .ps-flow li { background: #fff; border: 1px solid #cfe8bd; color: var(--spruce); }
.ps-pointer { font-size: 14px; color: var(--charcoal); margin: 8px 0 0; } .ps-pointer.hidden { display: none; }
.ps-pointer .link { background: none; border: 0; color: var(--spruce); font-weight: 700; cursor: pointer; text-decoration: underline; }
.coach-quick { margin-top: 16px; border: 1px solid var(--line, #d3d8cf); border-radius: 14px; padding: 12px 16px; }
.coach-quick > summary { cursor: pointer; font-weight: 700; color: var(--obsidian); }
.coach-talk { margin-top: 16px; align-items: stretch; }
.coach-box.convo, .coach-box.chat { display: flex; flex-direction: column; min-height: 220px; }
.cv-list { flex: 1; overflow-y: auto; max-height: 300px; margin-top: 8px; display: grid; gap: 8px; align-content: start; }
.cv { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; font-size: 14px; line-height: 1.45; color: var(--charcoal); overflow-wrap: anywhere; }
.cv b { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.cv.them b { color: var(--signal); } .cv.me b { color: var(--slate); } .cv.ai b { color: var(--spruce); }
.cv.ai span { background: var(--wash, #f1faeb); border-radius: 10px; padding: 8px 10px; }
.cv.partial { opacity: .6; font-style: italic; }
.cv .ch-en { display: block; margin: 2px 0 0; }
.cv-code { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; margin: 6px 0; }
.cv-code pre { margin: 0; padding: 8px 10px; background: #fff; border: 1px solid var(--line, #d3d8cf); border-radius: 8px; font: 13px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.cv.ai span { display: block; }

/* designs and websites the assistant produces, shown in the chat */
.cv-art { background: #fff; border: 1px solid var(--line, #d3d8cf); border-radius: 10px; padding: 8px; margin: 6px 0 2px; overflow: auto; }
.cv-art svg { max-width: 100%; height: auto; display: block; }
.cv-web { margin: 6px 0 2px; }
.cv-frame { width: 100%; height: 300px; border: 1px solid var(--line, #d3d8cf); border-radius: 10px; background: #fff; }
.cv-artbar { display: flex; gap: 8px; margin-top: 4px; }
.cv-artbar .pill, .cv-code .pill { border: 1px solid var(--line, #d3d8cf); background: #fff; }
.cv-list { max-height: 420px; }
.coach-box.chat { min-height: 300px; }

/* ======================================================================
   LIVE COACH — CLEAN REDESIGN (Wise-style: airy, flat, one green accent)
   This block is appended last so it wins the cascade over the older rules.
   ====================================================================== */
:root {
  --w-ink: #0e0f0c;        /* display headings */
  --w-body: #3f433d;       /* body text */
  --w-muted: #7a7e76;      /* helper text */
  --w-line: #e4e7e0;       /* hairline borders */
  --w-surface: #ffffff;    /* cards */
  --w-wash: #f4f7f1;       /* soft tinted panels */
  --w-forest: #163300;     /* dark green */
  --w-lime: #9fe870;       /* accent */
  --w-radius: 18px;
  --w-radius-sm: 12px;
}

/* ---- the whole Live Coach canvas ---- */
#coach.card.coach-card { max-width: 820px; border: none; box-shadow: none; background: transparent; padding: 0; margin: 0 auto; }
#coach .after-head { margin-bottom: 14px; }
#coach h1 { font-size: 40px; font-weight: 800; letter-spacing: -0.035em; color: var(--w-ink); }
#coach .after-head .sub { color: var(--w-muted); font-size: 15px; }
#coach nav.tabs.in-card { margin-bottom: 22px; }

/* ---- the sessions home: calm hero ---- */
#coachHome .ps-card { background: var(--w-surface); border: 1px solid var(--w-line); border-radius: var(--w-radius); padding: 26px 28px; margin: 0; box-shadow: 0 1px 2px rgba(14,15,12,.03); }
#coachHome .ps-head { align-items: center; }
#coachHome .ps-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--w-ink); margin: 0; }
#coachHome .ps-card > .sub { color: var(--w-muted); font-size: 14.5px; line-height: 1.55; margin: 8px 0 0; max-width: 60ch; }
.ps-flow { display: none; } /* the 7-step chip row was clutter; the wizard shows the steps */
#coachHome .ps-list { margin-top: 18px; gap: 10px; }
.ps-row { border: 1px solid var(--w-line); border-radius: var(--w-radius-sm); padding: 14px 16px; background: var(--w-surface); transition: border-color .12s; }
.ps-row:hover { border-color: #c9d3c0; }
.ps-row .ps-main b { font-size: 15px; color: var(--w-ink); }
.ps-chip { background: var(--w-wash); color: var(--w-body); font-weight: 600; }
.ps-chip.ready { background: #e8f8dc; color: var(--w-forest); }
.ps-list .ps-row:only-child .ps-sub, #coachHome .ps-list > .ps-row > .ps-sub:only-child { color: var(--w-muted); }

/* ---- buttons: Wise pills ---- */
#coach .pill, .ps-box .pill, .ps-sheet .pill { border-radius: 999px; font-weight: 600; font-size: 14.5px; min-height: 42px; padding: 9px 20px; border: 1px solid var(--w-line); background: var(--w-surface); color: var(--w-ink); transition: background .12s, border-color .12s; }
#coach .pill.primary, .ps-box .pill.primary, .ps-sheet .pill.primary { background: var(--w-lime); border-color: var(--w-lime); color: var(--w-forest); font-weight: 700; }
#coach .pill.primary:hover, .ps-sheet .pill.primary:hover { background: #93df62; }
#coach .pill.primary.big, .ps-sheet .pill.primary.big { min-height: 52px; font-size: 16px; padding: 14px 26px; }
#coach .pill:not(.primary):not(.danger):hover { border-color: var(--w-forest); }
#coach .pill.danger { color: #b3261e; border-color: #ecc7c4; background: #fff; }
.ps-actions .pill:not(.primary) { border-color: var(--w-line); }

/* ---- inputs ---- */
#coach input, #coach textarea, #coach select, .ps-sheet input, .ps-sheet textarea, .ps-sheet select { border: 1px solid #d3d8cf; border-radius: 10px; font-size: 15px; color: var(--w-ink); background: #fff; padding: 11px 14px; }
#coach input:focus, #coach textarea:focus, #coach select:focus, .ps-sheet input:focus, .ps-sheet textarea:focus, .ps-sheet select:focus { outline: none; border-color: var(--w-forest); box-shadow: 0 0 0 3px rgba(159,232,112,.4); }

/* ---- the quiet footer: quick-start, permissions, past, promise ---- */
#coachQuick { border: 1px solid var(--w-line); border-radius: var(--w-radius-sm); padding: 0; margin-top: 18px; background: var(--w-surface); }
#coachQuick > summary { padding: 14px 18px; font-weight: 600; font-size: 14.5px; color: var(--w-body); list-style: none; }
#coachQuick > summary::-webkit-details-marker { display: none; }
#coachQuick > summary::before { content: "⚡ "; }
#coachQuick[open] { padding: 0 18px 18px; }
.coach-perms { margin-top: 18px; padding: 14px 16px; background: var(--w-wash); border-radius: var(--w-radius-sm); gap: 18px; }
.perm.ok { color: var(--w-forest); font-weight: 600; } .perm.ok::before { content: ""; }
#coachPast { border: none; margin-top: 12px; }
#coachPast > summary { color: var(--w-muted); font-weight: 600; font-size: 13.5px; }
.coach-promise { color: var(--w-muted); font-size: 12.5px; line-height: 1.6; margin-top: 16px; border-top: 1px solid var(--w-line); padding-top: 14px; }

/* ---- create-session + preparation sheet ---- */
.ps-sheet { background: rgba(14,15,12,.32); backdrop-filter: blur(2px); }
.ps-box { border-radius: 22px; padding: 28px 30px; box-shadow: 0 24px 60px rgba(14,15,12,.22); max-width: 720px; }
.ps-top h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.ps-top .link, .ps-row .link { color: var(--w-muted); text-decoration: none; font-weight: 600; }
.ps-top .link:hover { color: var(--w-ink); }
.ps-steps { gap: 6px; margin: 18px 0 8px; }
.ps-steps li { background: var(--w-wash); color: var(--w-muted); padding: 5px 12px; font-size: 12.5px; font-weight: 600; }
.ps-steps li.on { background: var(--w-forest); color: #fff; }
.ps-steps li.done { background: #e8f8dc; color: var(--w-forest); }
.ps-body { margin-top: 6px; }
.ps-field > span { font-size: 13.5px; font-weight: 600; color: var(--w-body); }
.ps-field { margin-top: 16px; }
.ps-types { gap: 8px; }
.ps-type { border-radius: 999px; padding: 9px 15px; font-size: 14px; border-color: var(--w-line); }
.ps-type.on { background: var(--w-forest); border-color: var(--w-forest); }
.ps-soft { border-radius: 12px; }
.ps-nav { margin-top: 22px; }

/* the preparation stepper: calm, not candy-colored */
.ps-state { font-size: 15px; }
.ps-state.ready { color: var(--w-forest); }
.ps-state.running { color: #8a6d00; }
.ps-stages li { background: var(--w-wash); border-radius: var(--w-radius-sm); padding: 12px 14px; grid-template-columns: 20px auto 1fr auto; }
.ps-stages li.done { background: #f1faeb; }
.ps-stages li.working { background: #fdf7e3; }
.ps-stages li.done .ps-mark { color: var(--w-forest); }
.ps-mark { font-weight: 800; }
.ps-review h3 { font-size: 15.5px; font-weight: 700; margin: 18px 0 6px; }
.ps-line { font-size: 14px; color: var(--w-body); }
.ps-line.warn { background: #fdf7e3; }
.ps-qa input { font-weight: 600; }
#psStart { min-width: 180px; }

/* ---- the live coaching screen ---- */
#coachLive { max-width: 1120px; }
.coach-bar { margin: 6px 0 4px; }
.coach-chip { background: var(--w-wash); color: var(--w-forest); font-weight: 700; font-size: 12px; }
.coach-chip[data-s="coaching"] { background: #e8f8dc; }
.coach-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.coach-meta { color: var(--w-muted); font-size: 12.5px; }
.coach-cols { gap: 18px; }
.coach-box { border: 1px solid var(--w-line); border-radius: var(--w-radius); padding: 18px 20px; background: var(--w-surface); box-shadow: 0 1px 2px rgba(14,15,12,.03); }
.coach-box.say { background: #f3fbec; border-color: #d7edc4; }
.coach-box.do { border-color: #cdd6c4; box-shadow: 0 1px 0 var(--w-forest), 0 1px 2px rgba(14,15,12,.04); }
.cb-tag { color: var(--w-forest); font-size: 11.5px; letter-spacing: .07em; }
.cb-say { font-size: 19px; line-height: 1.42; color: var(--w-forest); font-weight: 600; }
.cb-do { font-size: 22px; line-height: 1.35; color: var(--w-ink); font-weight: 700; }
.cb-why { color: var(--w-muted); }
.cv-code pre, .cc-val { border-radius: 10px; }
.coach-mapbox { border: 1px solid var(--w-line); border-radius: var(--w-radius); background: var(--w-surface); }
.coach-box.convo, .coach-box.chat { border-radius: var(--w-radius); }

/* ---- responsive: at the real window width (~1040) and narrower ---- */
@media (max-width: 1040px) { #coach.card.coach-card, #coachLive { max-width: 100%; } }
@media (max-width: 820px) { .coach-cols, .coach-talk, .coach-row, .ps-grid { grid-template-columns: minmax(0,1fr); } #coach h1 { font-size: 32px; } }

/* ---- Ask Wrapit: a real claude.ai-style chat ---- */
.coach-box.chat { background: var(--w-surface); display: flex; flex-direction: column; min-height: 360px; }
.coach-box.chat .cv-list { max-height: 440px; display: block; }
.msg { display: flex; gap: 10px; margin: 14px 0; align-items: flex-start; }
.msg.you { justify-content: flex-end; }
.msg.you .bub { background: var(--w-forest); color: #fff; border-radius: 16px 16px 4px 16px; padding: 10px 14px; max-width: 78%; font-size: 14.5px; line-height: 1.5; }
.msg.ai .ava { width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--w-lime); color: var(--w-forest); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.msg.ai .bub { background: var(--w-wash); border-radius: 4px 16px 16px 16px; padding: 11px 14px; max-width: 86%; font-size: 14.5px; line-height: 1.55; color: var(--w-body); overflow-wrap: anywhere; }
.msg.ai .bub pre, .msg.ai .bub .cv-art, .msg.ai .bub .cv-frame { max-width: 100%; }
.caret { display: inline-block; width: 7px; height: 15px; background: var(--w-forest); margin-left: 2px; vertical-align: -2px; animation: wblink 1s steps(2) infinite; border-radius: 1px; }
@keyframes wblink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--w-muted); animation: wbounce 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes wbounce { 0%,80%,100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
.chat-empty { text-align: center; color: var(--w-muted); padding: 24px 12px; display: grid; gap: 12px; justify-items: center; }
.chat-empty .ava.big { width: 40px; height: 40px; border-radius: 12px; background: var(--w-lime); color: var(--w-forest); font-weight: 800; font-size: 20px; display: grid; place-items: center; }
.chat-empty p { font-size: 14px; line-height: 1.55; max-width: 44ch; }
.coach-box.chat .cb-ask { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--w-line); }
.coach-box.chat .cb-ask input { min-height: 44px; border-radius: 12px; }
.msg.ai .bub > *:first-child { margin-top: 0; } .msg.ai .bub > *:last-child { margin-bottom: 0; }

/* markdown inside assistant replies, claude.ai-like */
.msg.ai .bub .ic-h { font-size: 14.5px; font-weight: 700; color: var(--w-ink); margin: 10px 0 4px; }
.msg.ai .bub .ic-l { margin: 4px 0 4px 18px; padding: 0; display: grid; gap: 3px; }
.msg.ai .bub .ic-l li { line-height: 1.5; }
.msg.ai .bub code.ic { background: #eef2ea; border-radius: 5px; padding: 1px 5px; font: 12.5px ui-monospace, Menlo, monospace; }
.msg.ai .bub strong { color: var(--w-ink); font-weight: 700; }
.msg.ai .bub a { color: var(--w-forest); }
