/* Phase 75 (stage 1, 2.5): "her work on screen" (docs/design/NEW_LOOK.md).
   Loaded last, after style.css and ui-tidy.css. Colours, shapes and motion come from theme.css.
   Sections: page and sidebar · chat header (her face and mood, quiet pills, the context ring) ·
   messages (hers without a bubble, yours compact) and their actions · step lines · result cards ·
   approvals and the activity line · the floating composer · phones · the native apps' title strip. */

/* ---------- Page and sidebar ---------- */
body { background: var(--surface-0); -webkit-font-smoothing: antialiased; }
#main { background: var(--page-glow), var(--surface-0); }
#sidebar { background: color-mix(in srgb, var(--surface-1) 86%, transparent); border-right: 1px solid var(--hairline); }
.brand { color: var(--text-1); letter-spacing: var(--tracking-tight); font-weight: 650; }
.brand .avatar { box-shadow: 0 0 0 1px var(--hairline-strong), 0 0 14px -3px var(--accent-glow); }
#conversations a { border-radius: var(--r-control); }
#conversations a.active { background: var(--accent-soft); color: var(--text-1); box-shadow: inset 2px 0 0 var(--accent-solid); }
#conversations a:hover:not(.active) { background: color-mix(in srgb, var(--surface-2) 80%, transparent); }
.side-go.is-open { background: var(--accent-soft); }
#new-chat { background: var(--accent-grad); color: var(--on-mine); border-radius: var(--r-pill); box-shadow: 0 4px 14px -6px var(--accent-glow); }
#new-chat:hover { filter: brightness(1.08); }
#chat { position: relative; min-height: 0; }

/* ---------- Chat header ---------- */
#chat-head {
  position: relative;
  z-index: 6;
  gap: 10px;
  min-height: 60px;
  padding: 10px max(18px, calc((100% - 900px) / 2));
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface-0) 72%, transparent);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}
#chat-head h2 { font-weight: 600; letter-spacing: var(--tracking-tight); }
.head-face {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--surface-0), 0 0 0 3.5px color-mix(in srgb, var(--accent-solid) 75%, var(--accent-to)), 0 0 18px 1px var(--accent-glow);
}
html.sara-busy .head-face { animation: her-breathe var(--breathe) ease-in-out infinite; }
html.sara-speaking .head-face { animation: her-pulse 1.3s ease-in-out infinite; }
@keyframes her-breathe {
  0%, 100% { box-shadow: 0 0 0 2px var(--surface-0), 0 0 0 3.5px color-mix(in srgb, var(--accent-solid) 75%, var(--accent-to)), 0 0 12px 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 2px var(--surface-0), 0 0 0 3.5px var(--accent-to), 0 0 26px 5px var(--violet-glow); }
}
@keyframes her-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--surface-0), 0 0 0 3.5px var(--accent-solid), 0 0 16px 2px var(--accent-glow); }
  50% { box-shadow: 0 0 0 2px var(--surface-0), 0 0 0 4px var(--accent-solid), 0 0 28px 7px var(--accent-glow); }
}
#chat-head .title-wrap { gap: 1px; }
.sara-status { font-size: 12.5px; color: var(--text-2); letter-spacing: .01em; }
.sara-status:hover { color: var(--accent-text); background: none; }
/* Quiet pills: model/workspace, voice, server, the AI disclosure. */
#chat-head .head-chips { display: flex; align-items: center; gap: 6px; min-width: 0; }
#conv-settings-btn, #chat-head .ai-badge, #speak-toggle, .server-btn, #chat-head .pl-badge {
  height: 30px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline-strong);
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
}
#conv-settings-btn:hover, #speak-toggle:hover, .server-btn:hover { color: var(--text-1); border-color: color-mix(in srgb, var(--accent-solid) 45%, var(--hairline-strong)); background: color-mix(in srgb, var(--surface-2) 85%, transparent); }
#chat-head .ai-badge { color: var(--text-2); }
#chat-head .pl-badge { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent-solid) 50%, transparent); }
.head-more { display: none; }
#toggle-sidebar, #chat-head button.head-more { border: 0; border-radius: 50%; background: transparent; color: var(--text-2); }
#toggle-sidebar:hover, #chat-head button.head-more:hover, #chat-head button.head-more.on { background: color-mix(in srgb, var(--surface-3) 80%, transparent); color: var(--text-1); }

/* The context ring: how much of what she keeps word for word this conversation fills. */
.ctx-wrap { position: relative; flex: none; display: flex; }
.ctx-ring {
  --ctx: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(var(--accent-from), var(--accent-to) calc(var(--ctx) * 1%), var(--hairline-strong) 0);
  cursor: pointer;
}
.ctx-ring:hover { background: conic-gradient(var(--accent-from), var(--accent-to) calc(var(--ctx) * 1%), var(--text-3) 0); }
.ctx-ring::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface-0); }
.ctx-ring.full { background: conic-gradient(var(--warn) 0 100%); }
.ctx-pct { position: relative; font-size: 9.5px; font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ctx-dial { display: none; }

/* Small popovers from the header and the composer. */
.head-pop {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-card);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--shadow-2);
  color: var(--text-1);
}
.ctx-sheet p { margin: 0 0 6px; }
.ctx-sheet p:last-child { margin-bottom: 0; }
.ctx-full { font-weight: 600; }
.ctx-sheet .conv-usage { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--hairline); text-align: left; }

/* ---------- Messages ---------- */
#messages {
  gap: 14px;
  padding: 26px max(18px, calc((100% - 860px) / 2)) 28px;
  scroll-padding-bottom: 24px;
}
.msg { position: relative; }
.msg.user {
  max-width: min(560px, 80%);
  padding: 9px 15px;
  border-radius: 18px 18px 6px 18px;
  background: var(--mine-grad);
  color: var(--on-mine);
  box-shadow: 0 6px 18px -10px var(--accent-glow);
}
.msg.user .msg-photos img { border-radius: 12px; }
/* Hers: text on the surface, a thin accent line, her face at the start of a run. */
.msg.assistant.her {
  max-width: min(720px, calc(100% - 44px));
  margin-left: 44px;
  padding: 1px 4px 1px 16px;
  background: none;
  border: 0;
  border-radius: 0;
  line-height: 1.6;
}
.msg.assistant.her::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent-grad);
  opacity: .55;
}
.msg.her.run-start { margin-top: 4px; }
.msg.her.from-companion { border-left: 0; }
.msg.her.from-companion::before { background: var(--spk, var(--accent-solid)); opacity: .8; }
.msg.her.unverified { border: 0; }
.msg.her.unverified::before { background: var(--danger); opacity: .9; }
.msg.her.proactive, .msg.her.reminder { border-left: 0; }
.msg.her.reminder::before, .msg.her.proactive::before { opacity: .95; width: 3px; }
.msg.her.typing:empty::after, .msg.her.typing .md:empty::after { content: "▍"; }
.msg-face {
  position: absolute;
  left: -44px;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--hairline-strong), 0 0 14px -3px var(--accent-glow);
}
.msg.her .msg-speaker { margin-top: 0; }
.msg .md code { background: var(--surface-2); }
.msg .md .code-block { background: var(--surface-1); border-color: var(--hairline-strong); }
.msg .md .code-head { background: var(--surface-2); }
.msg .md a { color: var(--accent-text); }
.msg.notice {
  max-width: min(600px, 92%);
  padding: 8px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--surface-1) 80%, transparent);
  color: var(--text-2);
}
.msg.notice.crisis { color: var(--text-1); border: 1px solid var(--accent-solid); background: var(--accent-soft); }
.msg.notice.disclosure { color: var(--text-1); }
.claim-flag { color: var(--danger); border-top-color: color-mix(in srgb, var(--danger) 55%, transparent); }

/* Actions: on hover or keyboard focus on desktop; long-press or the small ⋯ on touch. */
.msg > .msg-actions {
  position: absolute;
  z-index: 4;
  top: -19px;
  right: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1px;
  max-width: calc(100% + 8px);
  padding: 2px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--shadow-1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.msg.her > .msg-actions { left: 12px; right: auto; }
.msg:hover > .msg-actions, .msg:focus-within > .msg-actions, .msg.show-actions > .msg-actions { opacity: 1; pointer-events: auto; transform: none; }
.msg > .msg-actions button { min-height: 28px; padding: 2px 9px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.msg > .msg-actions button:hover, .msg > .msg-actions button:focus-visible { background: var(--surface-3); color: var(--text-1); }
.msg > .msg-actions button.on { color: var(--accent-text); }
.msg-actions .msg-meta { padding: 0 8px; font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.msg-actions .msg-model { color: var(--text-3); }
.msg.user > .msg-actions .msg-meta { color: var(--text-3); }
.msg-more { display: none; }
@media (hover: none) {
  button.msg-more {
    display: grid;
    place-items: center;
    position: absolute;
    width: 44px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: var(--r-control);
    background: transparent;
    color: var(--text-3);
    font-size: 16px;
    line-height: 1;
    opacity: .7;
  }
  .msg.her > .msg-more { left: -46px; top: 30px; }
  .msg.her:not(.run-start) > .msg-more { top: -4px; }
  .msg.user > .msg-more { left: -48px; top: calc(50% - 18px); }
  .msg-more[aria-expanded="true"] { color: var(--accent-text); }
  .msg > .msg-actions button { min-height: 40px; padding: 2px 12px; }
  /* On touch the actions open as a small sheet above the composer, for the message that's lit. */
  .msg.show-actions > .msg-actions { position: fixed; z-index: 45; top: auto; left: 10px; right: 10px; bottom: calc(84px + var(--safe-b)); max-width: none; justify-content: center; padding: 6px; border-radius: 18px; box-shadow: var(--shadow-2); }
  .msg.her.show-actions::before { opacity: 1; width: 3px; }
  .msg.user.show-actions { box-shadow: 0 0 0 2px var(--accent-text); }
  .msg-actions .msg-meta { flex-basis: 100%; text-align: center; padding: 2px 0 4px; }
}

/* ---------- The step line ---------- */
.steps { display: block; align-self: flex-start; margin: -6px 0 0 60px; max-width: min(700px, calc(100% - 60px)); font-size: var(--fs-meta); color: var(--text-2); }
.steps[open] > summary { margin-bottom: 0; }
.steps-sum {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 32px;
  padding: 4px 12px 4px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface-1) 65%, transparent);
  color: var(--text-2);
  list-style: none;
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.steps-sum::-webkit-details-marker { display: none; }
.steps-sum::after { content: "›"; color: var(--text-3); transition: transform var(--dur-fast) var(--ease-out); }
.steps[open] > .steps-sum::after { transform: rotate(90deg); }
.steps-sum:hover { border-color: var(--hairline-strong); color: var(--text-1); }
.steps-sum:focus-visible { outline: 2px solid var(--accent-solid); outline-offset: 2px; }
.steps-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px -1px var(--success); }
.steps.live .steps-dot { background: var(--accent-solid); animation: step-pulse 1.3s ease-in-out infinite; }
.steps.has-error .steps-dot { background: var(--warn); box-shadow: 0 0 8px -1px var(--warn); }
.steps.live .steps-text { color: var(--text-1); }
.steps-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps-total:empty { display: none; }
.steps-total { color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
@keyframes step-pulse { 50% { box-shadow: 0 0 0 5px transparent, 0 0 12px 2px var(--accent-glow); opacity: .65; } }
.steps-list { list-style: none; display: grid; gap: 2px; margin: 8px 0 2px 12px; padding: 2px 0 2px 12px; border-left: 1px solid var(--hairline-strong); }
li.step { animation: step-in var(--dur-slow) var(--ease-out) both; }
@keyframes step-in { from { opacity: 0; transform: translateY(3px); } }
.step-detail { display: block; }
.step-detail[open] > summary { margin-bottom: 0; }
.step-head { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 8px; border-radius: 8px; color: var(--text-1); list-style: none; cursor: pointer; }
.step-head::-webkit-details-marker { display: none; }
.step-detail > .step-head:hover { background: color-mix(in srgb, var(--surface-2) 80%, transparent); }
.step-icon { flex: none; width: 20px; text-align: center; font-size: 14px; }
.step-verb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.running .step-verb, .step.waiting .step-verb { color: var(--accent-text); }
.step.error .step-verb, .step.denied .step-verb { color: var(--danger); }
.step-ms { flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.step.memory .step-head { cursor: default; }
.step-link { color: var(--accent-text); text-decoration: none; white-space: nowrap; }
.step-link:hover { text-decoration: underline; }
.step-body { display: grid; gap: 6px; margin: 2px 0 8px 28px; min-width: 0; }
.step-what-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.step-what { flex: 1; min-width: 0; padding: 4px 8px; border-radius: 6px; background: var(--surface-1); color: var(--text-2); font: 12px/1.45 var(--font-mono); overflow-wrap: anywhere; }
.step-out { margin: 0; max-height: 260px; overflow: auto; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface-1); color: var(--text-2); font: 12px/1.45 var(--font-mono); white-space: pre-wrap; word-break: break-word; }
.step-body .undo { justify-self: start; margin: 0; }

/* Live cards of a file being written (Phase 63), in the new colours. */
.tool { border-color: var(--hairline-strong); background: color-mix(in srgb, var(--surface-1) 85%, transparent); border-radius: var(--r-control); }
.tool.building { margin-left: 60px; max-width: min(700px, calc(100% - 60px)); }
#messages > .tool:not(.building) { margin-left: 60px; max-width: min(700px, calc(100% - 60px)); }
.preview-card { margin-left: 60px; border-color: var(--hairline-strong); background: var(--surface-1); }

/* ---------- Result cards ---------- */
.rcard {
  display: grid;
  gap: 6px;
  align-self: flex-start;
  width: min(440px, calc(100% - 60px));
  margin-left: 60px;
  padding: 12px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-card);
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface-2) 95%, var(--accent-to)), var(--surface-1) 75%);
  box-shadow: var(--glow-edge);
  animation: step-in var(--dur-slow) var(--ease-out) both;
}
.rcard-weather { width: min(380px, calc(100% - 60px)); }
.rcard.ok { border-color: color-mix(in srgb, var(--success) 40%, var(--hairline-strong)); }
.rcard.bad { border-color: color-mix(in srgb, var(--danger) 50%, var(--hairline-strong)); }
.rcard-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-meta); font-weight: 600; color: var(--text-2); }
.rcard-icon { font-size: 16px; line-height: 1; }
.rcard-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-main { margin: 0; font-size: 15px; font-weight: 550; color: var(--text-1); overflow-wrap: anywhere; }
.rc-main.struck { text-decoration: line-through; color: var(--text-2); }
.rc-meta { margin: 0; font-size: var(--fs-meta); color: var(--text-2); }
.rcard-link { justify-self: start; display: inline-flex; align-items: center; min-height: 30px; font-size: var(--fs-meta); color: var(--accent-text); text-decoration: none; }
.rcard-link:hover { text-decoration: underline; }
.rc-weather-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.rc-temp { font-size: 36px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text-1); }
.rc-cond { font-size: 15px; color: var(--text-1); text-transform: capitalize; }
.rcard-weather .rcard-icon { font-size: 20px; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-chip { padding: 2px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--surface-3) 75%, transparent); color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.rc-chip.ok { color: var(--success); background: var(--success-soft); }
.rc-chip.bad { color: var(--danger); background: var(--danger-soft); }
.rc-days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rc-day { display: grid; gap: 1px; padding: 6px 8px; border-radius: var(--r-control); background: color-mix(in srgb, var(--surface-3) 55%, transparent); font-size: 12px; }
.rc-day-name { color: var(--text-2); }
.rc-day-range { color: var(--text-1); font-variant-numeric: tabular-nums; }
.rc-source { margin: 0; font-size: 11.5px; color: var(--text-3); }
.rc-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rc-event { display: grid; gap: 1px; padding-left: 10px; border-left: 2px solid var(--accent-solid); }
.rc-when { font-size: 12px; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.rc-what { color: var(--text-1); }
.rc-where { font-size: 12px; color: var(--text-2); }
.rc-file { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.rc-path { min-width: 0; font: 12.5px var(--font-mono); color: var(--text-1); overflow-wrap: anywhere; }
.rc-tag { flex: none; font-size: 11.5px; color: var(--text-3); }
.rc-tag.wrote { color: var(--success); }
.rc-cmd { font: 12px var(--font-mono); color: var(--text-3); overflow-wrap: anywhere; }
.rc-source-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.rc-source-link { min-width: 0; color: var(--text-1); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-source-link:hover { color: var(--accent-text); text-decoration: underline; }
.rc-host { flex: none; font-size: 12px; color: var(--text-3); }
/* Gmail organizing: the result card (done, Undo, Open in Gmail) and the count-first approval section. */
.gm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.gm-undo { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.rcard-link.gm-open { min-height: 44px; }
.gm-undo svg.ic { width: 16px; height: 16px; }
.gm-status:empty { display: none; }
.gm-approval { display: grid; gap: 6px; min-width: 0; }
.gm-query { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; }
.gm-k { margin: 0; font-size: var(--fs-meta); color: var(--text-3); }
.gm-q { font: 12.5px var(--font-mono); color: var(--text-1); overflow-wrap: anywhere; }
.gm-line { margin: 0; font-size: var(--fs-meta); color: var(--text-2); }
.gm-samples { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.gm-sample { display: grid; grid-template-columns: minmax(0, 12em) minmax(0, 1fr); gap: 10px; padding: 4px 8px; border-radius: var(--r-control); background: color-mix(in srgb, var(--surface-3) 45%, transparent); font-size: 12.5px; }
.gm-from { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.gm-subj { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); }
.gm-notes { margin: 0; padding-left: 18px; font-size: var(--fs-meta); color: var(--text-2); }
@media (max-width: 640px) {
  .gm-sample { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .approval-gmail .row button { min-height: 44px; }
}

/* ---------- Approvals and the activity line ---------- */
#messages > .approval {
  margin-left: 60px;
  max-width: min(640px, calc(100% - 60px));
  border: 1px solid color-mix(in srgb, var(--accent-solid) 55%, var(--hairline-strong));
  border-radius: var(--r-card);
  background: var(--surface-1);
  box-shadow: var(--glow-edge);
}
.approval pre { background: var(--surface-0); border-color: var(--hairline-strong); }
#activity {
  width: min(860px, calc(100% - 24px));
  margin: 0 auto 6px;
  padding: 6px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}
#activity[data-status="running"] #activity-text { font-family: inherit; }
#activity[data-status="waiting"] { border-color: color-mix(in srgb, var(--accent-solid) 55%, transparent); background: var(--glass-strong); }
#activity .spinner { border-color: var(--hairline-strong); border-top-color: var(--accent-solid); }
.editing-bar, .offrecord-bar, .jobs-strip, #attachments { width: min(860px, calc(100% - 24px)); margin-left: auto; margin-right: auto; }
.pins { background: color-mix(in srgb, var(--surface-1) 70%, transparent); border-bottom-color: var(--hairline); }

/* ---------- The composer: one floating frosted bar ---------- */
#composer {
  position: relative;
  z-index: 5;
  width: min(860px, calc(100% - 24px));
  margin: 4px auto max(14px, var(--safe-b));
  padding: 5px 6px 5px 16px;
  gap: 2px;
  align-items: flex-end;
  border: 1px solid var(--hairline-strong);
  border-radius: 24px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--shadow-2);
  transition: border-color var(--dur), box-shadow var(--dur);
}
#composer:focus-within { border-color: color-mix(in srgb, var(--accent-solid) 50%, var(--hairline-strong)); box-shadow: var(--shadow-2), 0 0 0 3px var(--accent-soft); }
#composer #input { flex: 1; min-width: 0; min-height: 44px; padding: 11px 4px; border: 0; border-radius: 0; background: transparent; color: var(--text-1); }
#composer #input:focus { outline: none; }
#composer #input::placeholder { color: var(--text-3); }
#composer > button.icon, #composer-plus {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  font-size: 18px;
}
#composer > button.icon:hover, #composer-plus:hover, #composer-plus.on { background: color-mix(in srgb, var(--surface-3) 85%, transparent); color: var(--text-1); }
#composer-plus { font-size: 26px; font-weight: 300; line-height: 1; }
#composer-plus.on { transform: rotate(45deg); }
#composer-plus { transition: transform var(--dur) var(--ease-out), background var(--dur-fast); }
#mic.recording, #call.active { background: var(--accent-grad); color: var(--on-mine); }
#composer #send {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--accent-grad);
  color: var(--on-mine);
  box-shadow: 0 6px 18px -6px var(--accent-glow);
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast);
}
#composer #send:hover { filter: brightness(1.08); transform: translateY(-1px); }
#composer #send svg { width: 20px; height: 20px; }
#composer #stop { flex: none; height: 44px; border-radius: var(--r-pill); color: var(--text-1); border-color: var(--hairline-strong); }
.plus-wrap { position: static; flex: none; display: flex; }
.composer-menu { top: auto; left: auto; right: 8px; bottom: calc(100% + 10px); width: min(260px, calc(100vw - 32px)); padding: 6px; }
.composer-menu .pop-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-control); font-size: 14.5px; color: var(--text-1); }
.composer-menu .pop-item:hover, .composer-menu .pop-item:focus-visible { background: color-mix(in srgb, var(--surface-3) 85%, transparent); }
#main.offrecord #attach-photo, #main.in-group #attach-photo, body.demo #attach-photo { display: none; }

/* ---------- Phones: the same concept, one column ---------- */
@media (max-width: 720px) {
  #chat-head { gap: 6px; min-height: 56px; padding: 8px 10px; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface-0); }
  .head-face { width: 30px; height: 30px; }
  #toggle-sidebar { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; font-size: 18px; }
  .head-more { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 18px; }
  .head-chips.folded { position: absolute; z-index: 40; top: calc(100% + 6px); right: 8px; display: grid; gap: 4px; width: min(300px, calc(100vw - 16px)); padding: 8px; border: 1px solid var(--hairline-strong); border-radius: var(--r-card); background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter); box-shadow: var(--shadow-2); }
  .head-chips.folded > button { width: 100%; height: 44px; max-width: none; justify-content: flex-start; padding: 0 12px; border-radius: var(--r-control); }
  .head-chips.folded #conv-settings-btn { width: 100%; padding: 0 12px; }
  .head-chips.folded #conv-summary { display: inline; overflow: hidden; text-overflow: ellipsis; }
  #chat-head .ai-badge { height: 26px; padding: 0 8px; font-size: 11px; }
  .ctx-sheet { position: fixed; top: auto; right: 8px; left: 8px; bottom: max(10px, var(--safe-b)); width: auto; padding: 16px; border-radius: 18px; }
  #messages { padding: 18px 12px 18px; gap: 12px; }
  .msg.user { max-width: 86%; }
  .msg.assistant.her { margin-left: 36px; max-width: calc(100% - 36px); padding-left: 12px; }
  .msg-face { left: -36px; width: 26px; height: 26px; }
  .msg.her > .msg-more { left: -40px; }
  .steps, .rcard, .tool.building, #messages > .tool:not(.building), #messages > .approval, .preview-card { margin-left: 48px; max-width: calc(100% - 48px); }
  .rcard { width: calc(100% - 48px); }
  #composer { width: calc(100% - 16px); margin-bottom: max(8px, var(--safe-b)); padding: 4px 4px 4px 12px; gap: 0; border-radius: 22px; }
  #composer > button.icon, #composer-plus { width: 40px; height: 40px; }
  #activity, .editing-bar, .offrecord-bar, .jobs-strip, #attachments { width: calc(100% - 16px); }
}
@media (max-width: 380px) {
  .head-face { display: none; }
  #composer { padding-left: 10px; }
  #composer > button.icon, #composer-plus { width: 38px; }
}
@media (pointer: coarse) {
  .ctx-ring { width: 40px; height: 40px; }
  .ctx-ring::before { inset: 4px; }
  #composer > button.icon, #composer-plus, #composer #send { width: 44px; height: 44px; }
  .steps-sum { min-height: 40px; }
  .step-head { min-height: 44px; }
  .rcard-link { min-height: 44px; }
}
@media (max-width: 380px) and (pointer: coarse) {
  #composer > button.icon, #composer-plus { width: 40px; }
}

/* ---------- The native apps (Windows / Mac): a drag strip of window.saraShell.titlebar px ---------- */
.shell-drag { display: none; }
html.shell .shell-drag { display: block; position: fixed; z-index: 1000; top: 0; left: 0; right: 0; height: var(--titlebar); app-region: drag; -webkit-app-region: drag; }
html.shell #chat-head { padding-top: calc(var(--titlebar) + 8px); app-region: drag; -webkit-app-region: drag; }
html.shell .side-head { padding-top: calc(var(--titlebar) + 10px); app-region: drag; -webkit-app-region: drag; }
html.shell #chat-head :is(button, a, input, select, textarea, .ai-badge, .head-pop, .head-chips, img),
html.shell .side-head :is(button, a, input, .companion-menu) { app-region: no-drag; -webkit-app-region: no-drag; }
html.shell #main.has-preview #preview-pane { padding-top: var(--titlebar); }
/* Trying it in a browser (?shell=windows&titlebar=32): stand-ins for the window buttons. */
html.shell-test .shell-drag { background: color-mix(in srgb, var(--surface-1) 60%, transparent); border-bottom: 1px dashed var(--hairline-strong); }
html.shell-test.shell-windows .shell-drag::after { content: "—     ☐     ✕"; position: absolute; top: 0; right: 16px; line-height: var(--titlebar); font-size: 12px; color: var(--text-2); }
html.shell-test.shell-mac .shell-drag::before { content: ""; position: absolute; left: 14px; top: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; box-shadow: 20px 0 0 #febc2e, 40px 0 0 #28c840; }
@media (max-width: 760px) {
  html.shell #sidebar { padding-top: 0; }
}

/* ---------- 2.7.1: below the status bar when the page draws under it (web/viewport.js) ----------
   --safe-t is 0 in a browser tab, the Windows/Mac apps and new iPhone home-screen icons; it is the
   status bar / notch in the iPhone and Android apps and on iPhone icons added before 2.7.1. */
#main { padding-top: var(--safe-t); }
@media (max-width: 760px) {
  #sidebar, .preview-pane { padding-top: var(--safe-t); }
}
.her-panel.mode-overlay { padding-top: var(--safe-t); }
@media (max-width: 720px) {
  dialog:modal:not(.ring, .lightbox, .cmdbar) { margin-top: var(--safe-t); }
  dialog.settings-dialog:modal { height: calc(100dvh - var(--safe-t)); max-height: calc(100dvh - var(--safe-t)); }
}
/* iOS zooms into a text field smaller than 16 px when it gets the focus (viewport.js also stops
   that on iPhone/iPad); the message box keeps the reader's chosen size, at least 16 px on touch. */
@media (pointer: coarse) {
  #input { font-size: max(16px, var(--chat-size, 15px)); }
}

/* ---------- Phase 78: "Show the run" and the Run view (web/run-view.js) ---------- */
.step-run { list-style: none; padding: 2px 8px 4px; }
.run-open { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0; font: inherit; cursor: pointer; min-height: 32px; }
.run-open .step-icon svg { width: 15px; height: 15px; }
dialog.run-view { width: min(920px, 94vw); max-height: 88vh; }
/* Room for the window's ✕ beside the step headers. */
@media (min-width: 761px) { .run-body { padding-right: 40px; } }
.run-body { display: grid; gap: var(--s-3); grid-template-columns: minmax(0, 1fr); }
.run-head { display: grid; gap: 4px; }
.run-title { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--font-display); letter-spacing: var(--tracking-display); }
.run-icon { display: inline-flex; flex: none; width: 18px; height: 18px; color: var(--text-2); }
.run-icon svg { width: 100%; height: 100%; }
.run-icon.big { width: 24px; height: 24px; color: var(--accent-text); }
.run-ask { margin: 0; padding: 8px 12px; border-left: 3px solid var(--accent-solid); background: var(--surface-1); border-radius: 0 var(--r-control) var(--r-control) 0; color: var(--text-1); overflow-wrap: anywhere; }
.run-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s-2); }
.run-stat { display: grid; gap: 2px; padding: 10px 12px; background: var(--glass-fill); border: 1px solid var(--hairline); border-radius: var(--r-card); box-shadow: var(--elev-1); }
.run-stat-v { font-size: 1.05rem; font-weight: 600; color: var(--text-1); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.run-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); grid-template-columns: minmax(0, 1fr); }
.run-step { border: 1px solid var(--hairline); border-radius: var(--r-card); background: var(--surface-1); min-width: 0; }
.run-step.stopped { border-color: var(--warn); }
.run-step[open] { background: var(--surface-2); }
.run-step-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "n title chips" "n meta meta"; align-items: center; gap: 2px 10px; padding: 10px 12px; cursor: pointer; list-style: none; min-height: var(--tap); }
.run-step-head::-webkit-details-marker { display: none; }
.run-step-head:focus-visible { outline: 2px solid var(--accent-solid); outline-offset: 2px; }
.run-step-n { grid-area: n; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.run-step-title { grid-area: title; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-step-chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.run-step-meta { grid-area: meta; font-variant-numeric: tabular-nums; }
.run-chip { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-size: var(--fs-small); white-space: nowrap; }
.run-chip.ok { background: var(--success-soft); color: var(--success); }
.run-chip.bad { background: var(--danger-soft); color: var(--danger); }
.run-chip.warn { background: var(--warn-soft); color: var(--warn); }
.run-step-body { display: grid; gap: var(--s-3); padding: 0 12px 12px; grid-template-columns: minmax(0, 1fr); }
.run-sec { display: grid; gap: 6px; min-width: 0; justify-items: start; }
.run-sec > * { max-width: 100%; }
.run-sec > ul, .run-sec > .run-sent { justify-self: stretch; }
.run-sec p, .run-tool-body p { margin: 0; }
.run-sec-h { margin: 0; font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.run-calls, .run-picks, .run-tools, .run-contras, .run-dirty { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; min-width: 0; }
.run-call, .run-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px; border-radius: var(--r-control); background: var(--surface-1); overflow-wrap: anywhere; }
.run-call.bad { border-left: 3px solid var(--danger); }
.run-pick-id { font-weight: 600; color: var(--text-1); }
.run-tool { border-radius: var(--r-control); background: var(--surface-1); min-width: 0; }
.run-tool.error, .run-tool.denied { border-left: 3px solid var(--danger); }
.run-tool-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px; cursor: pointer; list-style: none; min-height: var(--tap); }
.run-tool-head::-webkit-details-marker { display: none; }
.run-tool-verb { color: var(--text-1); }
.run-tool-body { display: grid; gap: 6px; padding: 0 8px 8px; grid-template-columns: minmax(0, 1fr); }
.run-what { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--text-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.run-out { margin: 0; max-height: 320px; overflow: auto; padding: 8px 10px; border-radius: var(--r-control); background: var(--surface-0); border: 1px solid var(--hairline); font-family: var(--font-mono); font-size: var(--fs-small); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.run-contra { margin: 0; color: var(--warn); }
.run-err { color: var(--danger); }
.run-sent { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
.run-prompt > summary { cursor: pointer; padding: 6px 0; color: var(--accent-text); min-height: 32px; }
.run-msg { display: grid; gap: 2px; margin: 6px 0; }
.run-msg-role { color: var(--text-3); }
.run-foot { margin: 0; }
@media (max-width: 760px) {
  /* Phone: a full-screen sheet (not the half sheet other windows use). */
  dialog.run-view[open] { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding-top: var(--safe-t); }
  .run-body { padding-bottom: calc(var(--s-6) + var(--safe-b)); }
  .run-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-step-head { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "n title" "n chips" "n meta"; }
  .run-step-chips { justify-content: flex-start; }
}

/* ---------- Phase 83: time-travel (Branch from here, the branch sheet, original vs branch; web/branch-view.js) ---------- */
.run-branch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.run-branch { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); }
.run-branch .run-icon, .br-btn-icon { width: 16px; height: 16px; color: var(--accent-text); display: inline-flex; }
.br-btn-icon svg { width: 100%; height: 100%; }
.run-branch-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px; border-radius: var(--r-card); background: var(--accent-soft); color: var(--accent-text); }
.run-branch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.run-branch-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 8px; border-radius: var(--r-control); background: var(--surface-1); overflow-wrap: anywhere; }
dialog.branch-sheet { width: min(1040px, 96vw); }
.branch-body { gap: var(--s-3); }
.br-edit, .br-live, .br-diff { display: grid; gap: var(--s-3); grid-template-columns: minmax(0, 1fr); min-width: 0; }
.br-edit[hidden], .br-live[hidden], .br-diff[hidden] { display: none; }
.br-edit label { display: grid; gap: 4px; }
.br-edit textarea { width: 100%; font-family: var(--font-mono); font-size: var(--fs-small); }
.br-notes-box { border: 1px solid var(--hairline); border-radius: var(--r-card); padding: 8px 12px 12px; display: grid; gap: 8px; min-width: 0; }
.br-notes { display: grid; gap: 4px; }
.br-note { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-control); background: var(--surface-1); min-height: var(--tap); }
.br-note-id { font-weight: 600; color: var(--text-1); white-space: nowrap; }
.br-note-text { color: var(--text-2); overflow-wrap: anywhere; }
.br-go { display: flex; flex-wrap: wrap; gap: 8px; }
.br-warn { color: var(--warn); }
.br-problem { color: var(--warn); }
.br-live-head, .br-summary { display: flex; align-items: center; gap: 10px; margin: 0; }
.br-notes-live { display: grid; gap: 2px; }
.br-notes-live p { margin: 0; }
.br-reply { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-1); }
.br-reply:empty { display: none; }
.br-cards { display: grid; gap: var(--s-2); }
.br-approval { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--warn); border-radius: var(--r-card); background: var(--warn-soft); }
.br-approval p { margin: 0; }
.br-approval-q { font-weight: 600; color: var(--text-1); }
.br-notice { margin: 0; padding: 6px 10px; border-radius: var(--r-control); background: var(--surface-2); }
.br-summary { padding: 10px 12px; border-radius: var(--r-card); background: var(--glass-fill); border: 1px solid var(--hairline); box-shadow: var(--elev-1); }
.br-summary-line { margin: 0; font-weight: 600; color: var(--text-1); }
.br-grid { display: grid; grid-template-columns: minmax(80px, auto) minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; align-items: baseline; }
.br-col-h { font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.br-num { font-variant-numeric: tabular-nums; color: var(--text-1); }
.br-steps, .br-files, .br-answers, .br-mem { display: grid; gap: 6px; min-width: 0; }
.br-step { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px; border-radius: var(--r-card); background: var(--surface-1); border: 1px solid var(--hairline); }
.br-step > .run-step-n { grid-area: auto; }
.br-step.differs { border-color: var(--accent-solid); }
.br-step.shared { background: transparent; }
.br-shared { margin: 4px 0 0; }
.br-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; min-width: 0; }
.br-cell { display: grid; gap: 4px; align-content: start; min-width: 0; padding: 6px 8px; border-radius: var(--r-control); background: var(--surface-0); }
.br-cell p { margin: 0; }
.br-cell-meta { color: var(--text-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.br-side { color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.br-tool > summary, .br-file > summary, .br-wordsd > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; cursor: pointer; min-height: 32px; overflow-wrap: anywhere; }
.br-tool.error, .br-tool.denied { border-left: 3px solid var(--danger); padding-left: 6px; }
.br-file { padding: 4px 8px; border-radius: var(--r-control); background: var(--surface-1); }
.br-file.differs { border-left: 3px solid var(--warn); }
.br-udiff .add { color: var(--success); }
.br-udiff .del { color: var(--danger); }
.br-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-1); }
.br-words { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.br-words ins { background: var(--success-soft); color: var(--success); text-decoration: none; }
.br-words del { background: var(--danger-soft); color: var(--danger); }
.br-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.br-actions button { display: inline-flex; align-items: center; gap: 6px; }
.msg.rerun .msg-from { color: var(--accent-text); }
@media (max-width: 760px) {
  dialog.branch-sheet[open] { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding-top: var(--safe-t); }
  .br-pair { grid-template-columns: minmax(0, 1fr); }
  .br-grid { grid-template-columns: minmax(70px, auto) minmax(0, 1fr) minmax(0, 1fr); gap: 4px 8px; }
  .br-note { grid-template-columns: auto minmax(0, 1fr); }
  .br-note-text { grid-column: 1 / -1; }
}

/* ---------- Phase 79: budgets (meter on the step line and in the Run view, "Budget reached" card, Settings) ---------- */
.budget-meter { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-2); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.steps-sum .budget-meter { margin-inline-start: auto; padding-inline-start: 8px; }
.budget-icon { display: inline-flex; flex: none; width: 15px; height: 15px; color: var(--text-3); }
.budget-icon .ic { width: 100%; height: 100%; }
.budget-bar { position: relative; flex: none; width: 56px; height: 5px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.budget-meter:not(.compact) .budget-bar { width: 96px; }
.budget-fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--budget-frac, 0) * 100%); border-radius: inherit; background: var(--accent-solid); transition: width var(--dur) var(--ease-out); }
.budget-meter.near .budget-fill { background: var(--warn); }
.budget-meter.reached .budget-fill { background: var(--danger); }
.budget-meter.near .budget-icon, .budget-meter.reached .budget-icon { color: var(--warn); }
.budget-words { white-space: nowrap; }
.budget-card { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); margin: 6px 0 10px; padding: 12px 14px; border: 1px solid var(--hairline-strong); border-inline-start: 3px solid var(--warn); border-radius: var(--r-card); background: var(--surface-1); color: var(--text-1); }
.budget-card p { margin: 0; }
.budget-title { display: flex; align-items: center; gap: 8px; }
.budget-title .budget-icon { width: 18px; height: 18px; color: var(--warn); }
.budget-label { color: var(--text-2); }
.budget-list { margin: 0; padding-inline-start: 20px; color: var(--text-2); overflow-wrap: anywhere; }
.budget-card .row { display: flex; flex-wrap: wrap; gap: 8px; }
.budget-override { margin-top: 4px; }
.approval-budget .budget-meter { margin: 4px 0; }
.run-budget { grid-column: 1 / -1; }
.run-budget .budget-meter { color: var(--text-1); min-width: 0; }
.bud-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; margin: 6px 0 4px; }
.bud-grid select:disabled { opacity: .55; }
@media (max-width: 760px) {
  .steps-sum .budget-meter .budget-words { display: none; }
  .budget-card { padding: 10px 12px; }
}

/* ---------- Phase 94: the computer check-up report card (checkup-view.js) ---------- */
.rcard-checkup { width: min(720px, calc(100% - 60px)); }
.ck-sub { margin: 0; font-size: var(--fs-meta); color: var(--text-3); }
.ck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ck-tile { display: grid; align-content: start; gap: 2px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: var(--r-control); background: color-mix(in srgb, var(--surface-3) 45%, transparent); }
.ck-tile.ck-warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--hairline)); }
.ck-tile.ck-bad { border-color: color-mix(in srgb, var(--danger) 55%, var(--hairline)); }
.ck-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ck-name { font-size: var(--fs-meta); font-weight: 600; color: var(--text-2); }
.ck-status { padding: 1px 8px; border-radius: var(--r-pill); font-size: 11.5px; white-space: nowrap; color: var(--text-2); background: color-mix(in srgb, var(--surface-3) 80%, transparent); }
.ck-status-good { color: var(--success); background: var(--success-soft); }
.ck-status-warn { color: var(--warn); background: var(--warn-soft); }
.ck-status-bad { color: var(--danger); background: var(--danger-soft); }
.ck-main { margin: 0; font-size: 15px; font-weight: 550; color: var(--text-1); overflow-wrap: anywhere; }
.ck-detail, .ck-note { margin: 0; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.ck-note { color: var(--text-3); }
.ck-flag { margin: 0; padding: 8px 10px; border-radius: var(--r-control); font-size: var(--fs-meta); color: var(--warn); background: var(--warn-soft); }
.ck-h { margin: 6px 0 0; font-size: var(--fs-meta); color: var(--text-2); }
.ck-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ck-sugg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border-radius: var(--r-control); background: color-mix(in srgb, var(--surface-3) 40%, transparent); }
.ck-sugg.ck-first { background: var(--accent-soft); }
.ck-id { min-width: 28px; font-size: 12px; font-weight: 600; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.ck-text { font-size: 14px; color: var(--text-1); overflow-wrap: anywhere; }
.ck-do, .ck-how { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: var(--r-control); white-space: nowrap; }
.ck-foot { margin: 0; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 720px) {
  .rcard-checkup { width: calc(100% - 48px); }
  .ck-grid { grid-template-columns: minmax(0, 1fr); }
  .ck-sugg { grid-template-columns: auto minmax(0, 1fr); }
  .ck-sugg .ck-do, .ck-sugg .ck-how { grid-column: 1 / -1; width: 100%; }
}
