/* Daily Life Doc, round 10 (zone C): the care team's one chat beside the field (docs/build/r10/PLAN.md 3.2; the page's
   Part 2). Pink (--tint-team, --care-d) is what only the care team sees; blue (--note, --note-d) the clinician and
   "@Clinician"; yellow (--try-bg, --try-d) a Note. Tinted surfaces, no borders; every change moves with DD.motion.
     9. the state under an item and Close; the team entries (js/convo/chat-team-rows.js)
    10. "Waiting for the patient": the strip and its list (chat-strip.js)
    11. the head: place, clock, Today · Atlas · Rules, Call (chat-head.js)
    12. three columns at a computer (chat-cols.js) */

/* ---------- 9. The state under an item, Close; the team entries ---------- */
.ch-under[data-under="state"] { align-self: stretch; }
.rc-m.me .ct-st { justify-content: flex-end; }
.ct-st { display: flex; align-items: center; gap: 4px; margin: 3px 4px 0; min-height: 26px; font-size: var(--t-xs); color: var(--ink3); transition: opacity var(--m-step) ease; }
.ct-st[data-st="notseen"] span, .ct-st[data-st="missed"] span { color: var(--ink2); font-weight: 500; }
.ct-st[data-st="closed"], .ct-st[data-st="passed"], .ct-st[data-st="cleared"], .ct-st[data-st="cancelled"] { opacity: .8; }
.ct-st.is-closing { opacity: .45; }
.ct-close, .cw-x { flex: none; height: 28px; padding: 0 10px; border-radius: 10px; font-size: var(--t-xs); font-weight: 600; color: var(--ink); background: var(--soft);
  transition: transform var(--m-press) var(--ease-out), opacity var(--m-press) ease; }
.ct-close:active, .cw-x:active { transform: scale(0.95); }
.ct-close:disabled, .cw-x:disabled { opacity: .4; }
.ct-st .ct-close { margin-left: 6px; }
.ct-st.is-clin { color: var(--note-d); }
/* An item that ended greys in the chat (it stays where it was sent; the patient never reads "Closed"). */
.rc-m:has(> .ch-under .ct-st[data-st="closed"]) > :not(.ch-under) { opacity: .55; transition: opacity var(--m-step) ease; }
/* The team entries: only the care team sees them. */
.tm-e { align-self: stretch; max-width: 560px; margin: 8px 0 2px; padding: 9px 13px 10px; border-radius: 18px; font-size: 15px; line-height: 1.45; }
.tm-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 3px; font-size: var(--t-2xs); }
.tm-h b { font-weight: 600; }
.tm-h span { opacity: .85; }
.tm-h small { margin-left: auto; color: var(--ink3); }
.tm-b p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tm-b a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.tm-note { background: var(--try-bg); color: var(--ink); }
.tm-note .tm-h { color: var(--try-d); }
.tm-clin { background: var(--note); color: var(--ink); }
.tm-clin .tm-h { color: var(--note-d); }
.tm-at { font-weight: 600; color: var(--note-d); }
.tm-clin.is-from { cursor: pointer; transition: transform var(--m-press) var(--ease-out); }
.tm-clin.is-from:active { transform: scale(0.99); }
.tm-clin .ct-st { margin: 4px 0 0; }
.tm-ask { background: var(--tint-team); color: var(--ink); }
.tm-ask .tm-h { color: var(--care-d); }
.tm-about { margin: 5px 0 0; font-size: var(--t-xs); color: var(--ink2); }
.tm-about b { font-weight: 600; color: var(--care-d); }
.tm-rule { align-self: center; max-width: 92%; margin: 10px auto 4px; padding: 5px 12px; border-radius: 12px; background: var(--tint-team); text-align: center; }
.tm-rule p { margin: 0; font-size: var(--t-xs); line-height: 1.45; color: var(--care-d); overflow-wrap: anywhere; }
.tm-e .mg-files { margin: 2px 0 6px; }

/* ---------- 10. "Waiting for the patient": the strip and its list ---------- */
.cw-strip { margin: 0 var(--gut) 6px; border-radius: 16px; background: var(--tint-team); }
.cw-strip[hidden] { display: none; }
.cw-bar { width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; font-size: var(--t-s); font-weight: 600; color: var(--care-d); }
.cw-chev { display: grid; place-items: center; transition: transform var(--m-step) var(--ease-out); }
.cw-chev svg { width: 16px; height: 16px; }
.cw-strip.is-open .cw-chev { transform: rotate(180deg); }
.cw-strip .cw-list { max-height: 46vh; overflow-y: auto; padding: 0 6px 6px; }
.cw-list[hidden] { display: none; }
.cw-i { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 0; transition: opacity var(--m-step) ease; }
.cw-i.is-closing { opacity: .45; }
.cw-o { flex: 1; min-width: 0; padding: 7px 8px; border-radius: 12px; text-align: left; transition: background var(--m-press) ease; }
.cw-o:active { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.cw-o b { display: block; font-size: var(--t-s); font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-o small { display: block; margin-top: 1px; font-size: var(--t-xs); color: var(--ink2); }
.cw-x { background: var(--surface); }
/* "Waiting for you · N" (chat-yours.js): what waits for the care team, above the patient's strip, in the care team's
   own grey so the two read apart. */
.cw-yours:empty { display: none; }
.cw-strip.is-you { background: var(--soft); }
.cw-strip.is-you .cw-bar { color: var(--ink); }

/* ---------- 11. The head: the patient's place and clock, Today · Atlas · Rules, Call ---------- */
.pg[data-page="chat"] .pg-head { flex-wrap: wrap; row-gap: 0; }
.chh-row { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; padding: 0 0 2px 46px; }
.chh-sub { margin: 0; font-size: var(--t-xs); color: var(--ink2); }
.chh-links { display: flex; gap: 2px; margin-left: auto; }
.chh-links button { height: 30px; padding: 0 9px; border-radius: 10px; font-size: var(--t-xs); font-weight: 600; color: var(--ink); transition: background var(--m-press) ease; }
.chh-links button:active { background: var(--soft); }
.chh-call { height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 12px; background: var(--ink); color: var(--on-ink); font-size: var(--t-s); font-weight: 600;
  transition: transform var(--m-press) var(--ease-out); }
.chh-call svg { width: 16px; height: 16px; }
.chh-call:active { transform: scale(0.96); }
.chh-call[hidden] { display: none; }
.ch-head { display: flex; align-items: center; gap: 4px; }
@media (max-width: 360px) {
  .chh-row { padding-left: 0; }
  .chh-links { margin-left: -6px; }
  .chh-call span { display: none; }
  .chh-call { padding: 0 10px; }
}

/* ---------- 12. Three columns at a computer (1100 px and wider, the care team's chat on top) ---------- */
.ch-left, .ch-right { display: none; }
@media (min-width: 1100px) {
  .phone.is-wide { --sb: 0px; width: calc(100vw - 32px); max-width: 1480px; height: calc(100dvh - 32px); border-radius: 22px; transition: width var(--m-push) var(--ease-drawer); }
  .phone.is-wide .sbar { display: none; }
  .phone.is-wide .pg[data-page="chat"] .pg-body { padding: 0; }
  .phone.is-wide .ch-cols { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; height: 100%; }
  .phone.is-wide .ch-left, .phone.is-wide .ch-right { display: block; min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 4px 16px 40px; }
  .phone.is-wide .ch-left { border-right: 1px solid var(--line); }
  .phone.is-wide .ch-right { border-left: 1px solid var(--line); }
  .phone.is-wide .ch-main { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
  .phone.is-wide .ch-main > .ch-scroll { flex: 1; }
  .phone.is-wide .ch-strip { display: none; }
  .phone.is-wide .ch-main .ch-list, .phone.is-wide .ch-foot { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
  .phone.is-wide .cs-body > *, .phone.is-wide .pv-body > .cv { max-width: 760px; margin-left: auto; margin-right: auto; }
  /* A sheet (the round +, Call time, Call) rises in the middle at a sheet's width, not across the whole screen
     (fixer G2, walk 1 fault 16). */
  .phone.is-wide .sheet { left: max(0px, calc(50% - 330px)); right: max(0px, calc(50% - 330px)); }
}
.cc-sec { padding: 14px 0 6px; }
.cc-sec + .cc-sec { border-top: 1px solid var(--line); margin-top: 8px; }
/* Round 11 (F1): "The patient's Today" on a soft panel in the patient's theme colours (data-look, css/themes.css). */
.cc-sec.cc-look[data-look] { margin: 12px -4px 0; padding: 12px 12px 8px; border-top: 0; border-radius: 16px; background: var(--tint); color: var(--ink); }
.cc-sec.cc-look[data-look] .cc-line:last-child { border-bottom: 0; }
.cc-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: var(--t-s); font-weight: 600; color: var(--ink); }
.cc-n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: inline-grid; place-items: center; background: var(--tint-team); color: var(--care-d); font-size: var(--t-xs); }
.cc-wait .cw-o { padding-left: 4px; }
.cc-none { margin: 4px 2px; font-size: var(--t-xs); color: var(--ink3); }
.cc-none[hidden] { display: none; }
/* Review C15 (c): what waits longer than a day, folded under "Earlier". */
.cc-earlier { margin-top: 6px; }
.cc-earlier[hidden] { display: none; }
.cc-earlier > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; padding: 6px 2px; font-size: var(--t-xs); color: var(--ink2); }
.cc-earlier > summary::-webkit-details-marker { display: none; }
.cc-earlier[open] > summary { color: var(--ink); }
.cc-today { list-style: none; margin: 0; padding: 0; }
.cc-today + .cc-today { margin-top: 10px; }
.cc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 7px 10px; margin-bottom: 4px; border-radius: 12px; background: var(--surface); font-size: var(--t-sm); }
.cc-top span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-top small { flex: none; font-size: var(--t-2xs); color: var(--ink3); }
.cc-exp { margin: 0 0 4px; font-size: var(--t-s); font-weight: 600; }
.cc-part { margin: 8px 0 2px; font-size: var(--t-2xs); font-weight: 600; color: var(--ink3); }
.cc-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 5px 0; font-size: var(--t-sm); border-bottom: 1px solid var(--line); }
.cc-line b { font-weight: 600; }
.cc-line small { grid-column: 1 / -1; font-size: var(--t-xs); color: var(--ink3); }
/* A Photo answer on the patient's Today in the right column: small pictures, a tap opens one large (fixer H2). */
.cc-ph { grid-column: 1 / -1; }
.cc-ph .mg-files { max-width: none; margin: 4px 0 2px; }
.cc-ph .mg-f, .cc-ph .mg-files.one .mg-f { width: 64px; height: 64px; border-radius: 12px; }

/* Fixer FA (DESIGN-1 #31): a reminder's earlier steps fold behind one quiet line, opened by a tap. */
.ch-fold-row { align-self: center; margin: 4px 0; }
.ch-fold-b { color: var(--ink3); text-decoration: none; }
.ch-fold-b::after { content: ' ›'; }
.ch-fold-b[aria-expanded="true"]::after { content: ' ‹'; }
.ch-fold { display: contents; }
.ch-fold[hidden] { display: none; }
