/* Client updates inside Clients (portal rethink stage 6; clientupdates.js).
   Drawn only for the owner while CONFIG.CLIENT_UPDATES is 'owner'; every rule
   is scoped under .cu (inside .cb, whose colour tokens it uses). Red only for
   "needs a line from you". */
.cb .cu { --cu-gap: 22px; }
.cb .cu-mute { color: var(--cb-mute); }
.cb .cu-small { font-size: 12.5px; }
.cb .cu-grow { flex: 1; }
.cb .cu-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cb .cu-dot { color: var(--cb-mute); }
.cb .cu-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border: 1px solid var(--cb-line);
  border-radius: 10px; background: var(--cb-card); font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cb .cu-btn:hover { background: #FAFAF7; }
.cb .cu-btn.is-k { background: var(--cb-ink); border-color: var(--cb-ink); color: #fff; }
.cb .cu-btn.is-soft { background: var(--cb-col); border-color: transparent; }
.cb .cu-btn[disabled] { opacity: .45; cursor: default; }
.cb .cu-link { padding: 0; border: 0; background: none; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cb .cu-link[disabled] { opacity: .45; cursor: default; }
.cb .cu-note { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--cb-mute); }
.cb .cu-note.is-you, .cb .cu-you { color: var(--cb-red); font-style: normal; }
.cb .cu-empty { margin: 8px 0; padding: 28px 30px; background: var(--cb-card); border: 1px solid var(--cb-line); border-radius: 14px; max-width: 640px; }
.cb .cu-empty b { display: block; font-size: 16px; margin-bottom: 6px; }
.cb .cu-empty p { margin: 0 0 12px; color: var(--cb-mute); font-size: 14px; line-height: 1.5; }

/* the sentence */
.cb .cu-head { margin: 4px 0 20px; }
.cb .cu-head h1 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.cb .cu-head p { margin: 6px 0 0; color: var(--cb-mute); font-size: 15px; }

/* list beside the preview */
.cb .cu-split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.cb .cu-list { background: var(--cb-card); border: 1px solid var(--cb-line); border-radius: 14px; overflow: hidden; }
.cb .cu-list-h { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 18px 12px; }
.cb .cu-list-h b { font-size: 15.5px; font-weight: 600; }
.cb .cu-list-h span { font-size: 13px; color: var(--cb-mute); }
.cb .cu-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 18px 0 15px; border: 0; border-top: 1px solid var(--cb-line2);
  border-left: 3px solid transparent; background: none; text-align: left; cursor: pointer; }
.cb .cu-row:hover { background: #FAFAF7; }
.cb .cu-row.is-needs_line { border-left-color: var(--cb-red); }
.cb .cu-row.is-sel { background: #FFF6D1; }
.cb .cu-row.is-sent .cu-row-name b, .cb .cu-row.is-skipped .cu-row-name b { color: var(--cb-mute); font-weight: 500; }
.cb .cu-row-name { flex: 1; min-width: 0; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb .cu-row-name b { font-weight: 600; }
.cb .cu-row-state { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; white-space: nowrap; }
.cb .cu-row-state.is-you { color: var(--cb-red); font-weight: 600; }
.cb .cu-row-state.is-sent, .cb .cu-row-state.is-skip, .cb .cu-row-state.is-card { color: var(--cb-mute); }

/* the mail preview */
.cb .cu-mail { display: flex; flex-direction: column; min-height: 560px; padding: 22px 28px 20px; background: var(--cb-card); border: 1px solid var(--cb-line); border-radius: 14px; }
.cb .cu-mail.is-empty { justify-content: center; align-items: center; }
.cb .cu-meta { margin-bottom: 18px; }
.cb .cu-kv { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--cb-line2); font-size: 14.5px; }
.cb .cu-kv span { color: var(--cb-mute); }
.cb .cu-kv b { font-weight: 600; overflow-wrap: anywhere; }
.cb .cu-kv b.is-plain { font-weight: 400; }
.cb .cu-body { max-width: 700px; font-size: 15px; line-height: 1.6; }
.cb .cu-body p { margin: 0 0 14px; }
.cb .cu-built { display: flex; align-items: center; gap: 7px; margin: 6px 0 0; color: var(--cb-mute); font-size: 13.5px; }
.cb .cu-mail > .cu-built, .cb .cu-mail > .cu-note { margin-bottom: 20px; }
.cb .cu-mail > .cu-note.is-you { margin: 0 0 12px; }
.cb .cu-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--cb-line2); }
.cb .cu-mail > .cu-built + .cu-foot, .cb .cu-mail > .cu-note + .cu-foot { margin-top: auto; }
.cb .cu-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cb .cu-hint { color: var(--cb-mute); font-size: 13px; }

/* editing in place */
.cb .cu-edit { display: flex; flex-direction: column; gap: 10px; }
.cb .cu-f { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 0; font-size: 14.5px; }
.cb .cu-f > span { color: var(--cb-mute); }
.cb .cu-f input, .cb .cu-f textarea { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--cb-line); border-radius: 9px; background: #fff;
  font: inherit; font-size: 14.5px; color: var(--cb-ink); }
.cb .cu-f input:focus, .cb .cu-f textarea:focus { outline: 2px solid #111; outline-offset: -1px; }
.cb .cu-f.is-body { grid-template-columns: minmax(0, 1fr); }
.cb .cu-f textarea { line-height: 1.55; resize: vertical; min-height: 260px; }
.cb .cu-edit .cu-acts { margin-top: 6px; }

/* the client room: the Updates tab and the panel */
.cb .cu-room { padding: 4px 2px; }
.cb .cu-room .cu-empty { border: 0; padding: 18px 4px; }
.cb .cu-hrow { border-bottom: 1px solid var(--cb-line2); }
.cb .cu-hbtn { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 4px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 14px; }
.cb .cu-hweek { color: var(--cb-mute); }
.cb .cu-hsub { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb .cu-hbody { padding: 2px 4px 16px; font-size: 14px; line-height: 1.55; }
.cb .cu-hbody p { margin: 0 0 10px; }
.cb .cu-next .cu-next-state { margin: 10px 0 6px; font-size: 14.5px; font-weight: 600; }
.cb .cu-next .cu-next-state.is-you { color: var(--cb-red); }
.cb .cu-next .cu-next-state.is-sent, .cb .cu-next .cu-next-state.is-skip { color: var(--cb-mute); font-weight: 500; }
.cb .cu-next p { margin: 4px 0 0; }

/* phone */
.cb-phone.cb-updates { padding-bottom: 160px; }
.cb .cu-ph-title { margin: 6px 0 6px; font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.cb .cu-ph-lead { margin: 10px 0 2px; font-size: 18px; font-weight: 600; line-height: 1.35; }
.cb .cu-ph-sub { margin: 0 0 16px; font-size: 14.5px; }
.cb .cu-ph-card { background: var(--cb-card); border: 1px solid var(--cb-line); border-radius: 16px; overflow: hidden; }
.cb .cu-ph-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 10px 16px 10px 14px; border: 0; border-top: 1px solid var(--cb-line2);
  border-left: 3px solid transparent; background: none; text-align: left; cursor: pointer; }
.cb .cu-ph-row:first-child { border-top: 0; }
.cb .cu-ph-row.is-needs_line { border-left-color: var(--cb-red); }
.cb .cu-ph-row.is-more { justify-content: space-between; min-height: 54px; }
.cb .cu-ph-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cb .cu-ph-main b { font-size: 16px; font-weight: 600; }
.cb .cu-ph-main span { font-size: 14.5px; color: var(--cb-mute); }
.cb .cu-ph-row .cu-row-state { font-size: 15px; }
.cb .cu-ph-mail { padding: 18px 18px 6px; background: var(--cb-card); border: 1px solid var(--cb-line); border-radius: 16px; font-size: 16px; line-height: 1.6; }
.cb .cu-ph-mail p { margin: 0 0 14px; }
.cb .cu-ph-bar { position: fixed; left: 16px; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px; z-index: 5; }
.cb .cu-ph-bar.is-two { grid-template-columns: 1fr 1fr; }
.cb .cu-btn.is-big { height: 54px; border-radius: 14px; font-size: 17px; }
.cb .cu-ph-skip { display: block; margin: 18px auto 0; color: var(--cb-mute); font-weight: 500; }
.cb .cu-edit.is-phone .cu-f { grid-template-columns: 64px minmax(0, 1fr); }
.cb .cu-edit.is-phone .cu-acts { flex-wrap: wrap; }
.cb .cu-edit.is-phone .cu-hint { flex-basis: 100%; }

/* the iPad and narrower desktops: the list above the preview */
@media (max-width: 1100px) {
  .cb .cu-split { grid-template-columns: minmax(0, 1fr); }
  .cb .cu-mail { min-height: 0; }
}

/* stage 22: the review sheet. Everything that goes out, then one Confirm, right here.
   Centred on the desktop and iPad; a bottom sheet on the phone. */
.cb .cu-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(17, 17, 17, .38); }
.cb .cu-sheet-panel { display: flex; flex-direction: column; width: min(680px, 100%); max-height: min(820px, calc(100vh - 48px)); background: var(--cb-card); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22); overflow: hidden; }
.cb .cu-sheet-head { padding: 20px 26px 4px; }
.cb .cu-sheet-head h2 { margin: 0; font-size: 21px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
.cb .cu-sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 26px 4px; }
.cb .cu-sheet-scroll .cu-meta { margin-bottom: 14px; }
.cb .cu-sheet-body { padding: 4px 0 8px; }
.cb .cu-sheet-list { margin: 0; padding: 0; list-style: none; }
.cb .cu-sheet-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--cb-line2); font-size: 14.5px; }
.cb .cu-sheet-list li b { font-weight: 600; }
.cb .cu-sheet-panel > .cu-note { margin: 4px 26px 0; }
.cb .cu-sheet-foot { padding: 14px 26px 20px; border-top: 1px solid var(--cb-line2); }
.cb .cu-sheet-foot p { margin: 0 0 12px; }
.cb .cu-sheet-foot .cu-acts { justify-content: flex-end; }
.cb-phone .cu-sheet { align-items: flex-end; padding: 0; }
.cb-phone .cu-sheet-panel { width: 100%; max-height: calc(100vh - 56px); border-radius: 18px 18px 0 0; }
.cb-phone .cu-sheet-head, .cb-phone .cu-sheet-scroll { padding-left: 18px; padding-right: 18px; }
.cb-phone .cu-sheet-foot { padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px)); }
.cb-phone .cu-sheet-foot .cu-acts { display: grid; grid-template-columns: 1fr 1.6fr; }
.cb-phone .cu-sheet-foot .cu-btn { height: 52px; border-radius: 14px; font-size: 16.5px; }
