/*
  Claudia design language
  - Light, calm surfaces in black and white with one yellow accent. The blue-green gradient is Claudia's alone.
  - Concentric corners: inner radius = outer radius - inset.
      card radius 32, edge inset 8  -> edge-hugging controls radius 24 (48px tall = pill)
      pill radius 24, inset 6       -> circles inside pills are 36px
      rail pill 60 wide, inset 8    -> rail circles are 44px
  - Text sits 24px from a card edge (8 inset + 16 control padding), so labels, rows and
    field text all line up.
  - Notches are drawn by shape.js with filleted junctions: no sharp corners anywhere.
*/
/* Fonts are served by Claudia herself (SIL Open Font License), so the page never waits on a third party. */
@font-face {
  font-family: "Manrope";
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/manrope.woff2) format("woff2");
}
@font-face {
  font-family: "Unbounded";
  font-weight: 700;
  font-display: swap;
  src: url(fonts/unbounded-700.woff2) format("woff2");
}

:root {
  --bg: #e9ebee;
  --surface: #ffffff;
  --soft: #f2f4f6;
  --soft-2: #e8ebef;
  --line: #e1e4e8;
  --text: #121417;
  --muted: #747c86;
  --dark: #121417;
  /* UI accent: black, white and one yellow. The blue-green gradient belongs to Claudia only (avatar.js). */
  --accent: #ffc21a;
  --accent-hover: #f5b400;
  --warn: #f0a92e;
  --warn-soft: #fff5e2;
  --bad: #e5484d;
  --ok: #22b77a;

  --r-card: 32px;
  --inset: 8px;
  --r-ctl: 24px;
  --ctl-h: 48px;
  --text-x: 16px; /* control padding; + inset = 24px from card edge */
  --gap: 12px;

  --display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; margin: 0; line-height: 1.15; }
.muted { color: var(--muted); margin: 0; }
h2 { margin: 0; font-size: 15px; font-weight: 800; }

/* ---------- Building blocks ---------- */

.card { background: var(--surface); border-radius: var(--r-card); padding: var(--inset); }

.field {
  height: var(--ctl-h); border-radius: var(--r-ctl);
  border: 1px solid transparent; background: var(--soft);
  padding: 0 var(--text-x); outline: none; font-size: 16px; width: 100%;
}
.field:focus { background: var(--surface); border-color: var(--dark); }

.btn {
  height: var(--ctl-h); border-radius: var(--r-ctl); border: 0;
  background: var(--dark); color: #fff; font-weight: 800; cursor: pointer; width: 100%;
}
.btn:hover { background: #262a30; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-quiet { background: transparent; color: var(--muted); font-weight: 600; }
.btn-quiet:hover { background: var(--soft); }

.stack { display: flex; flex-direction: column; gap: var(--inset); }

.circle {
  width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; flex: none; position: relative;
  background: transparent; color: var(--text); cursor: pointer;
}
.circle:hover { background: var(--soft); }
.circle.active { background: var(--dark); color: #fff; }
.circle-soft { width: 36px; height: 36px; background: var(--surface); }
.circle-soft:hover { background: var(--soft-2); }
.circle-accent { background: var(--accent); color: var(--dark); }
.circle-accent:hover { background: var(--accent-hover); }

.chip {
  height: 34px; border-radius: 17px; padding: 0 14px;
  border: 1.5px solid rgba(18, 20, 23, .7); background: transparent; color: var(--dark);
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.chip:hover { background: var(--dark); color: #fff; }
.chip-quiet { border-color: var(--line); color: var(--text); background: var(--surface); }
.chip-quiet:hover { background: var(--soft); color: var(--text); }
select.chip { appearance: none; padding-right: 14px; }
.chip-danger { border-color: #f3c4c6; color: var(--bad); background: var(--surface); }
.chip-danger:hover { background: #fdeeee; color: var(--bad); }

.icon-circle { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; color: var(--dark); flex: none; }
.icon-circle svg { width: 16px; height: 16px; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: #c7ccd3; flex: none; }
.dot.running { background: var(--ok); }
.dot.queued { background: var(--dark); }
.dot.waiting { background: var(--warn); }
.dot.thinking { background: var(--accent); }

/* ---------- Sign-in ---------- */

body:not(.locked) .gate { display: none; }
body.locked .app { display: none; }
.gate {
  height: 100%; overflow-y: auto;
  display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
.gate-wrap { position: relative; width: min(380px, 100%); padding-top: 75px; }
/* Claudia (150px box, body radius ~48px) floats in the card's top notch: notch radius 58
   (body 48 + float 2 + gap 8), centered on the card's top edge. */
.gate-face { position: absolute; top: 0; left: 50%; width: 150px; height: 150px; transform: translateX(-50%); z-index: 1; }
.gate-card { padding-top: 72px; }
.gate-text { text-align: center; padding: 0 var(--text-x) 16px; }
.gate-text h1 { font-size: 24px; }
.gate-text .muted { margin-top: 4px; }
.gate-msg { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.gate-msg:empty { display: none; }
.gate-msg.error { color: var(--bad); }
.field.code { font-family: var(--mono); font-size: 22px; letter-spacing: .5em; text-align: center; padding-left: calc(var(--text-x) + .5em); }

.divider { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#passkey-step + #email-form #send-code { background: var(--soft); color: var(--text); }
#passkey-step + #email-form #send-code:hover { background: var(--soft-2); }
#passkey-step[hidden] + #email-form #send-code { background: var(--dark); color: #fff; }

/* Passkey offer: a soft card inside the stage (radius 24 at the 8px inset). */
.offer {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 var(--inset); padding: 12px var(--text-x);
  border-radius: var(--r-ctl); background: var(--surface);
}
.offer-text { flex: 1; min-width: 180px; display: flex; flex-direction: column; font-size: 13px; }
.offer-text span { color: var(--muted); }
.offer-buttons { display: flex; gap: 8px; }
.chip-dark { background: var(--dark); color: #fff; border-color: var(--dark); }
.btn-soft { background: var(--soft); color: var(--text); }
.btn-soft:hover { background: var(--soft-2); }
.chip-dark:hover { background: #262a30; }

/* Account sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(18, 20, 23, .35);
  display: grid; place-items: center; padding: 16px;
}
.sheet { width: min(420px, 100%); max-height: 90%; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px var(--inset); }
.sheet-head .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sheet-head .meta span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.sheet-title { padding: 12px var(--text-x) 4px; }
.sheet-tall { height: min(640px, 90%); }
.sheet-head .circle { flex: none; }
.link-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 0 var(--inset) var(--inset); }
.link-controls .field { flex: 1; min-width: 160px; height: 40px; }
#folder-list { min-height: 120px; }
#folder-list .row .tag { font-size: 11px; font-weight: 800; color: var(--muted); flex: none; }
#folder-path-form { padding-top: var(--inset); }
.passkey-row { cursor: default; }
.passkey-row:hover { background: transparent; }
.sheet-actions { margin-top: 8px; }

/* ---------- App frame: projects | Claudia | actions ---------- */

.app {
  height: 100%; height: 100dvh;
  display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 24px;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  max-width: 1560px; margin: 0 auto;
}
.mobile-bar, .sheet-close { display: none !important; }

.card-head { display: flex; align-items: center; gap: 10px; padding: 12px var(--text-x); }
.card-head h2 { flex: 1; }
.rows { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px;
  padding: 8px var(--text-x); border: 0; border-radius: var(--r-ctl);
  background: transparent; color: inherit; text-align: left; cursor: pointer;
}
.row:hover { background: var(--soft); }
.row.active { background: var(--dark); color: #fff; }
.row .meta { min-width: 0; flex: 1; }
.row .name { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .desc { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.active .desc { color: #a3aab3; }
.empty-note { color: var(--muted); font-size: 13px; padding: 4px var(--text-x) 12px; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Left: the project hierarchy on a black card. The + sits in its bottom-right corner cut-out
   (cornerCutPath in shape.js: centre 26px from both edges, 8px ring, 32px shoulders). */
.col-left { position: relative; min-height: 0; }
.projects-card {
  height: 100%; display: flex; flex-direction: column;
  background: var(--dark); color: #fff; border-radius: var(--r-card); padding: var(--inset);
}
.count { color: #8b929c; font-size: 13px; font-weight: 700; }
.projects-card .rows { padding-bottom: 72px; } /* last row stays clear of the + cut-out */
.projects-card .row:hover { background: #23272d; }
.projects-card .row.active { background: #fff; color: var(--dark); }
.projects-card .row .desc, .projects-card .empty-note { color: #8b929c; }
.projects-card .row.active .desc { color: var(--muted); }
.projects-card .dot { background: #4a5059; }
.projects-card .dot.running { background: var(--ok); }
.projects-card .dot.waiting { background: var(--warn); }
.projects-card .dot.queued { background: #fff; }
.corner-btn { position: absolute; right: 0; bottom: 0; width: 52px; height: 52px; }
.corner-btn svg, .talk svg { width: 22px; height: 22px; stroke-width: 2.2; }

/* Center: Claudia is the central figure, on the page itself. */
.col-center { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.col-center > .offer, .col-center > .messages, .col-center > .attachments, .col-center > .composer {
  width: 100%; max-width: 760px; margin-left: auto; margin-right: auto;
}
/* By default Claudia fills the middle (talk to her); the full conversation opens on demand
   (.chat-open), which tucks her into a compact header. */
.hero { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4px 0 12px; }
.hero-face {
  width: clamp(200px, 40vh, 380px); height: clamp(200px, 40vh, 380px);
  border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; flex: none;
  transition: width .3s ease, height .3s ease;
}
.latest { flex: none; width: 100%; max-width: 640px; margin: 0 auto 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.latest-you { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.latest-you:empty { display: none; }
.latest-reply {
  background: var(--surface); border-radius: var(--r-ctl); padding: 14px 20px;
  font-size: 16px; line-height: 1.55; max-height: 30vh; overflow-y: auto; text-align: left;
}
.latest-reply p { margin: 0 0 8px; }
.latest-reply p:last-child { margin: 0; }
.convo-toggle { flex: none; align-self: center; margin: 0 0 12px; background: transparent; border-color: rgba(18, 20, 23, .2); }
.col-center:not(.chat-open) .messages { display: none; }
.col-center.chat-open .hero { flex: none; flex-direction: row; gap: 16px; text-align: left; padding-bottom: 8px; }
.col-center.chat-open .hero-face { width: 88px; height: 88px; }
.col-center.chat-open .talk { margin-top: 0; }
.col-center.chat-open .latest { display: none; }
.hero-face:focus-visible { outline: 2px solid var(--dark); outline-offset: 4px; }
.hero-text h1 { font-size: 28px; }
.hero-text p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.talk { width: 56px; height: 56px; margin-top: 14px; }
#mic.listening { background: var(--bad); color: #fff; }

/* Right: actions on yellow, activity on white. */
.col-right { min-height: 0; display: flex; flex-direction: column; gap: var(--gap); }
.actions-card {
  position: relative; flex: none; display: flex; flex-direction: column; gap: 12px;
  background: var(--accent); border-radius: var(--r-card); padding: 20px 24px;
}
.actions-card h2 { padding-right: 56px; }
#feed-tools, #project-tools { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
/* Account: white circle concentric with the card corner (8px inset + 24px radius = 32). */
.account {
  position: absolute; top: 8px; right: 8px; width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: #fff; color: var(--dark); font: 800 17px var(--body); cursor: pointer;
}
.account:hover { background: #fff8e0; }
.actions-card .segmented { background: rgba(18, 20, 23, .1); }
.actions-card .segmented button { color: rgba(18, 20, 23, .7); }
.actions-card .segmented button:hover { color: var(--dark); }
.actions-card .segmented button[aria-checked="true"] { color: #fff; }
.actions-card .tools-note { margin: 0; color: rgba(18, 20, 23, .72); font-size: 12px; }
.actions-card .tools-note.warn { color: #6b4300; font-weight: 700; }
.actions-card select.chip { background: transparent; max-width: 100%; }
.actions-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid rgba(18, 20, 23, .12); }
#voice-toggle[aria-pressed="true"] { background: var(--dark); color: #fff; }
.usage { margin: 0; font-size: 12px; font-weight: 700; opacity: .7; }

.activity-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.activity-card .approvals { max-height: none; overflow: visible; }
#activity-list .row { min-height: 52px; }
.dot.done { background: var(--ok); }

/* Thermometers: 14px tube, 30px bulb; mercury colour by level (green, yellow > 60%, red > 85%). */
.usage-card { flex: none; padding-bottom: 16px; }
.thermos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 var(--text-x); }
.thermo { display: flex; align-items: flex-end; gap: 12px; }
.glass { position: relative; width: 30px; height: 112px; flex: none; }
.tube { position: absolute; left: 8px; bottom: 18px; width: 14px; height: 92px; border-radius: 7px; background: var(--soft-2); overflow: hidden; }
.mercury { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; border-radius: 7px; background: var(--ok); transition: height .8s ease, background .4s ease; }
.bulb { position: absolute; left: 0; bottom: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--ok); box-shadow: inset 0 0 0 4px var(--soft-2); transition: background .4s ease; }
.thermo[data-level="warn"] .mercury, .thermo[data-level="warn"] .bulb { background: var(--warn); }
.thermo[data-level="high"] .mercury, .thermo[data-level="high"] .bulb { background: var(--bad); }
.thermo-text { display: flex; flex-direction: column; padding-bottom: 2px; min-width: 0; }
.thermo-text b { font: 700 22px var(--display); line-height: 1.1; }
.thermo-text span { font-size: 12px; font-weight: 700; }
.thermo-text small { font-size: 11px; color: var(--muted); }
.usage-today { margin: 12px var(--text-x) 0; font-size: 12px; color: var(--muted); }
.usage-today:empty { display: none; }

.badge {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--warn); color: var(--dark); font-size: 10px; font-weight: 800; line-height: 16px;
}

/* ---------- Conversation ---------- */

.messages { flex: 1; overflow-y: auto; padding: 8px var(--text-x) 16px; display: flex; flex-direction: column; gap: 10px; }
.messages > * { flex-shrink: 0; }
.msg { max-width: min(720px, 86%); padding: 12px 16px; border-radius: 20px; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--dark); color: #fff; }
.msg.user .via { font-size: 11px; font-weight: 800; opacity: .65; }
.msg.assistant { align-self: flex-start; background: var(--surface); }
.msg.error { align-self: flex-start; background: #fdeeee; color: #8f1f24; white-space: pre-wrap; }
.msg.system { align-self: center; color: var(--muted); font-size: 12px; padding: 2px; }
.msg p { margin: 0 0 8px; }
.msg p:last-child { margin-bottom: 0; }
.msg pre { background: var(--soft); border: 1px solid var(--line); padding: 10px 12px; border-radius: 12px; overflow-x: auto; margin: 8px 0; font: 13px/1.45 var(--mono); }
.msg :not(pre) > code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font: 13px var(--mono); }
.msg a { color: #0b72d9; }
.msg.user a { color: inherit; }
.msg.user :not(pre) > code, .msg.user pre { background: rgba(255, 255, 255, .14); border-color: transparent; color: #fff; }
.msg .open-link { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 800; color: #0b72d9; cursor: pointer; }

.tool, .note {
  align-self: flex-start; max-width: 86%;
  font: 12px var(--mono); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px;
}
.tool b { color: var(--text); font-weight: 700; }
.tool.asked, .tool.asked b { color: #b97700; }
.note.ok::before { content: "● "; color: var(--ok); }
.note.fail::before { content: "● "; color: var(--bad); }
.note .denials { color: #b97700; }

.welcome { margin: auto; text-align: center; max-width: 420px; color: var(--muted); }
.welcome b { color: var(--text); font-size: 17px; }

.approvals { display: flex; flex-direction: column; gap: var(--inset); padding-bottom: var(--inset); max-height: 42vh; overflow-y: auto; }
.approval { background: var(--warn-soft); border-radius: var(--r-ctl); padding: 14px var(--text-x); display: flex; flex-direction: column; gap: 10px; }
.approval-head { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.approval-why { color: var(--muted); font-size: 13px; margin-top: -4px; }
.approval pre { margin: 0; background: var(--surface); padding: 10px 12px; border-radius: 12px; font: 13px/1.45 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 150px; overflow-y: auto; }
.approval-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.approval-buttons .allow { background: var(--dark); color: #fff; border-color: var(--dark); }

/* Segmented switch: 40px pill, 4px inset, 32px options (16 + 4 = 20 radius, concentric). */
.segmented { display: inline-flex; gap: 2px; padding: 4px; height: 40px; border-radius: 20px; background: var(--soft); }
.segmented button {
  height: 32px; border-radius: 16px; border: 0; padding: 0 14px;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-checked="true"] { background: var(--dark); color: #fff; }
.tools-note { font-size: 12px; color: var(--muted); }
.tools-note.warn { color: #b97700; }

/* Attachments waiting to be sent */
.attachments { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 0 var(--inset) 6px; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 16px; overflow: hidden; background: var(--soft); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: rgba(18, 20, 23, .75); color: #fff; font-size: 13px; line-height: 22px; padding: 0; cursor: pointer;
}

/* Images inside messages */
.msg .shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin-top: 8px; max-width: 420px; }
.msg .shots img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; cursor: zoom-in; background: var(--surface); }
.msg.user .shots { margin-left: auto; }

.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(18, 20, 23, .88);
  display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 16px; background: #fff; }

/* Composer: a white pill under the conversation; send is a 36px circle at its 6px inset. */
.composer {
  flex: none; display: flex; align-items: flex-end; gap: 8px;
  min-height: var(--ctl-h); border-radius: var(--r-ctl);
  background: var(--surface); padding: 6px;
}
.composer textarea {
  flex: 1; resize: none; border: 0; outline: none; background: transparent;
  padding: 7px 4px; min-height: 36px; max-height: 160px; line-height: 22px; font-size: 16px;
}
.composer textarea::placeholder { color: var(--muted); }
.composer .circle-soft { background: var(--soft); }
.composer .circle-soft:hover { background: var(--soft-2); }
.send { width: 36px; height: 36px; }
.send svg { width: 18px; height: 18px; stroke-width: 2.2; }

/* ---------- Claudia ---------- */

.claudia-face { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: none; }
.claudia-face stop { transition: stop-color .6s ease; }
.cf-aura, .cf-dot { transition: fill .6s ease; }
.cf-rim { transition: stroke .6s ease; }

/* ---------- Phone (and the iPhone home-screen app) ---------- */

@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px; padding: 10px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .col-center { grid-row: 1; }
  .hero-face { width: clamp(170px, 36vh, 300px); height: clamp(170px, 36vh, 300px); }
  .col-center.chat-open .hero { gap: 12px; padding: 0 4px 8px; }
  .col-center.chat-open .hero-face { width: 64px; height: 64px; }
  .col-center.chat-open .hero-text { flex: 1; min-width: 0; }
  .latest-reply { max-height: 24vh; font-size: 15px; }
  .hero-text h1 { font-size: 20px; }
  .hero-text p { font-size: 13px; margin-top: 4px; }
  .talk { margin: 0; width: 48px; height: 48px; flex: none; }
  .msg { max-width: 92%; }
  .segmented button { padding: 0 11px; }

  /* Projects and Actions open as sheets above the bottom bar. */
  .col-left, .col-right {
    position: fixed; z-index: 30; left: 10px; right: 10px;
    top: max(10px, env(safe-area-inset-top));
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 70px);
    transform: translateY(calc(100% + 120px)); transition: transform .28s ease;
  }
  .col-left.open, .col-right.open { transform: none; }
  .col-right { overflow-y: auto; }
  .col-right .activity-card { flex: none; min-height: 200px; }
  .sheet-close { display: grid !important; }
  .projects-card .sheet-close { background: #23272d; color: #fff; width: 36px; height: 36px; }
  .actions-card .sheet-close { position: absolute; top: 14px; right: 64px; width: 36px; height: 36px; background: rgba(18, 20, 23, .1); }
  .actions-card h2 { padding-right: 100px; }
  .mobile-bar {
    display: flex !important; grid-row: 2; justify-content: space-between; align-items: center;
    position: relative; z-index: 31;
    height: 60px; padding: 8px; border-radius: 30px; background: var(--surface);
  }
  /* The mic lives in the middle of the bar on phones (44px, concentric with the 60px bar). */
  .hero .talk { display: none; }
  .talk-mobile svg { width: 20px; height: 20px; stroke-width: 2.2; }
  body.listening .talk-mobile { background: var(--bad); color: #fff; }
  .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(18, 20, 23, .4); }
}
