/* ---------- The app (post-Muse) ----------
   72px icon rail · chat in a 768px column with frosted floating controls · 360px profile panel ·
   Settings as a large modal. On phones the rail becomes a bottom tab bar. */
/* clip, not hidden: a hidden overflow can still be scrolled by focus, and the frame should never move */
.shell { display: flex; height: 100dvh; overflow: clip; background: var(--page); }

/* Frosted glass, for anything that floats over content */
.glass { background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }

/* ---------- Rail ---------- */
.rail {
  width: var(--rail-w); flex: none; display: flex; flex-direction: column; align-items: center;
  padding: 12px 0 14px; border-right: 1px solid var(--hairline); background: var(--page); z-index: 5;
}
.rail-top { height: 64px; display: grid; place-items: center; }
.rail-face { padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; box-shadow: var(--e1); transition: transform var(--d-short) var(--spring); }
.rail-face:hover { transform: scale(1.05); }
/* In the chat the profile is in the panel, so the face steps aside */
.shell[data-view="chat"] .rail-face { visibility: hidden; }
.rail-nav { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.rail-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-btn {
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: background-color var(--d-micro) var(--ease);
}
.rail-btn .ti { font-size: 24px; transition: transform var(--d-short) var(--spring); }
.rail-btn:hover { background: var(--panel); }
.rail-btn:active .ti { transform: scale(.9); }
.rail-btn[aria-current="page"] { background: var(--panel); }
.rail-btn[aria-current="page"] .ti { transform: scale(1.04); }

/* ---------- Main column ---------- */
.main { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; overflow: clip; }
.view { flex: 1; min-height: 0; overflow-y: auto; scroll-padding-bottom: 120px; }

/* Floating top controls in the chat: Chats on the left, Howard on the right when the panel is closed */
.chat-top {
  position: absolute; z-index: 8; top: 12px; left: 12px; right: 12px; height: 0;
  display: flex; justify-content: space-between; pointer-events: none;
}
.glass-pill {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px;
  border: 0; border-radius: var(--r-pill); color: var(--ink); font-size: 15px; font-weight: 500; cursor: pointer;
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--e1); transition: transform var(--d-short) var(--spring), background-color var(--d-micro) var(--ease);
}
.glass-pill .ti { font-size: 20px; }
.glass-pill:hover { background: rgba(255, 255, 255, 0.92); }
.glass-pill:active { transform: scale(.97); }
.face-pill { padding-left: 6px; transition: height var(--d-short) var(--ease), transform var(--d-short) var(--spring), background-color var(--d-micro) var(--ease); }
.face-pill[hidden] { display: none; }
.face-pill-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
/* While Howard works on a task: what he's doing, under his name */
.face-pill-status { display: none; align-items: center; gap: 4px; font-size: 12px; font-weight: 400; color: var(--gray); white-space: nowrap; }
.face-pill-status .ti { font-size: 13px; }
.face-pill.working { height: 46px; }
.face-pill.working .face-pill-name { font-size: 14px; }
.face-pill.working .face-pill-status { display: inline-flex; animation: status-in var(--d-short) var(--ease) both; }
@keyframes status-in { from { opacity: 0; transform: translateY(-2px); } }

/* ---------- Chats drawer ---------- */
.chats-drawer {
  position: absolute; z-index: 9; top: 0; bottom: 0; left: 0; width: 264px;
  display: flex; flex-direction: column; background: var(--page); border-right: 1px solid var(--hairline);
  animation: drawer-in var(--d-short) var(--ease) both;
}
@keyframes drawer-in { from { transform: translateX(-12px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 4px; padding: 12px 8px 8px 12px; }
.drawer-search-wrap {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--gray);
  transition: border-color var(--d-micro) var(--ease), box-shadow var(--d-micro) var(--ease);
}
.drawer-search-wrap .ti { font-size: 18px; flex: none; }
.drawer-search-wrap:focus-within { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); }
.drawer-search { flex: 1; min-width: 0; border: 0; background: none; font-size: 15px; color: var(--ink); outline: none; }
.drawer-search::placeholder { color: var(--gray); }
.drawer-search::-webkit-search-cancel-button { cursor: pointer; }
.drawer-more { width: 36px; height: 36px; color: var(--gray); }
.drawer-close { display: none; width: 36px; height: 36px; }
@media (max-width: 760px) { .drawer-close { display: inline-flex; } }
.drawer-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.drawer-label { padding: 12px 10px 4px; font-size: 13px; color: var(--gray); }
.drawer-foot { padding: 8px 12px 14px; }
.drawer-foot .btn { width: 100%; }
.drawer-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 20px; text-align: center; }
.drawer-empty .ti { font-size: 28px; margin-bottom: 6px; color: var(--gray); }
.drawer-empty-title { font-weight: 500; font-size: 15px; }
.drawer-empty-body { font-size: 14px; color: var(--gray); margin-bottom: 12px; line-height: 1.4; }
.chat-row { position: relative; display: flex; align-items: center; border-radius: var(--r-sm); }
.chat-row:hover { background: var(--fill); }
.chat-row.active { background: var(--fill-pressed); }
.chat-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 40px 0 10px;
  border: 0; background: none; color: var(--ink); font-size: 15px; text-align: left; cursor: pointer;
}
.chat-link-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.unread .chat-link-title { font-weight: 500; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--action); flex: none; }
.chat-row .row-more { position: absolute; right: 2px; width: 32px; height: 32px; color: var(--gray); opacity: 0; transition: opacity var(--d-micro) var(--ease); }
.chat-row .row-more .ti { font-size: 18px; }
.chat-row:hover .row-more, .chat-row .row-more:focus-visible, .chat-row .row-more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .chat-row .row-more { opacity: 1; } }
.rename-input { min-height: 36px; padding: 6px 10px; font-size: 15px; background: var(--card); }
.chat-row.renaming { padding: 2px 0; }

/* ---------- Thread ---------- */
.thread {
  max-width: var(--column); margin: 0 auto; padding: 72px 24px 132px;
  display: flex; flex-direction: column;
}
.thread-time { align-self: center; margin: 16px 0 8px; font-size: 12px; line-height: 16px; color: var(--gray); }
.msg { position: relative; display: flex; flex-direction: column; margin-top: 16px; max-width: 100%; }
/* Back-to-back messages from the same side sit close; a change of speaker always gets the full gap, even
   for a live reply (which is marked grouped before it knows what's above it) */
.msg-howard + .msg-howard.grouped, .msg-user + .msg-user.grouped { margin-top: 4px; }
.thread-time + .msg { margin-top: 4px; }
.msg-howard { align-self: flex-start; align-items: flex-start; padding-right: 44px; max-width: min(100%, 560px); }
.msg-user { align-self: flex-end; align-items: flex-end; padding-left: 44px; max-width: min(100%, 564px); }
.bubble-stack { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
.msg-howard .bubble-stack { align-items: flex-start; }
.msg-user .bubble-stack { align-items: flex-end; }
.bubble {
  position: relative; max-width: 100%; padding: 11px 15px; border-radius: var(--r-bubble);
  font-size: 16px; line-height: 24px; overflow-wrap: anywhere;
  animation: bubble-in var(--d-medium) var(--spring) both;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.msg-howard .bubble { background: var(--bubble-agent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); transform-origin: bottom left; } /* brand: tint with a hairline edge */
.bubble-user { background: var(--bubble-user); color: var(--bubble-user-ink); white-space: pre-wrap; transform-origin: bottom right; }
/* A bubble whose blocks are all still hidden while typing doesn't show yet */
.msg-howard .bubble:not(.bubble-typing):not(:has(> :not([hidden]))) { display: none; }
.bubble-card { padding: 14px 15px; }

/* Formatted text inside a bubble */
.bubble.md > :not(:first-child) { margin-top: 10px; }
.md p, .md ul, .md ol { margin-bottom: 0; }
.md ul, .md ol { padding-left: 22px; margin-top: 0; }
.md li + li { margin-top: 2px; }
.md li::marker { color: var(--gray); }
.md strong { font-weight: 500; }
.md code { font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--fill); padding: 1px 5px; border-radius: 6px; }
.md pre { margin: 0; padding: 12px 14px; background: var(--panel); border-radius: 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--gray); }
.md a { color: var(--action); text-decoration: none; }
.md a:hover { text-decoration: underline; }
.md-heading { font-weight: 500; }
.md.typing > :last-child:not([hidden])::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: var(--ink); vertical-align: middle; opacity: .6; }

/* Typing bubble: three soft dots and the status word */
.bubble-typing { display: inline-flex; align-items: center; gap: 10px; color: var(--gray); font-size: 15px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--gray); animation: dot 1.2s var(--ease) infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.status-word { display: inline-block; transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
.status-word.swap { opacity: 0; transform: translateY(-3px); }

/* Action bar under a message (or a chain of them), on hover. It floats over the gap below, so
   showing it never shifts the conversation. */
.msg-bar {
  position: absolute; top: calc(100% + 6px); z-index: 3; display: flex; align-items: center; gap: 4px;
  height: 40px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--e1);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity var(--d-micro) var(--ease), transform var(--d-micro) var(--ease), visibility 0s linear var(--d-micro);
}
.msg-howard .msg-bar { left: 0; }
.msg-user .msg-bar { right: 0; }
.msg:hover > .msg-bar, .msg:focus-within > .msg-bar, .msg.show-bar > .msg-bar {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.msg[aria-busy="true"] > .msg-bar { display: none; }
.bar-time { padding: 0 10px 0 8px; margin-right: 2px; border-right: 1px solid var(--line); font-size: 12px; line-height: 20px; color: var(--gray); white-space: nowrap; }
.bar-btn {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: transparent; color: var(--gray); cursor: pointer; transition: background-color var(--d-micro) var(--ease);
}
.bar-btn .ti { font-size: 18px; }
.bar-btn[hidden] { display: none; }
.bar-btn:hover { background: var(--fill); color: var(--ink); }
.bar-btn:focus-visible { outline: 2px solid var(--action); outline-offset: 1px; }

/* Reaction on a bubble's corner */
.reaction {
  position: absolute; bottom: -12px; min-width: 26px; height: 24px; padding: 0 5px; border-radius: var(--r-pill);
  display: grid; place-items: center; font-size: 14px; line-height: 1; background: var(--card); box-shadow: var(--e1);
  animation: pop-in var(--d-medium) var(--spring) both;
}
.msg-howard .reaction { right: -6px; }
.bubble-user .reaction { left: -6px; }
.msg:has(.reaction) { margin-bottom: 10px; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } }

/* Message popover: time, reactions, actions */
.msg-pop {
  position: fixed; z-index: 120; width: 232px; padding: 8px; border-radius: var(--r-lg);
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--e3); animation: pop-in var(--d-short) var(--spring) both; transform-origin: top center;
}
.pop-time { padding: 2px 8px 6px; font-size: 12px; color: var(--gray); }
.pop-reactions { display: flex; justify-content: space-between; padding: 2px 2px 8px; border-bottom: 1px solid var(--hairline); }
.pop-emoji { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; font-size: 19px; cursor: pointer; transition: transform var(--d-short) var(--spring), background-color var(--d-micro) var(--ease); }
.pop-emoji:hover { transform: scale(1.22); }
.pop-emoji.on { background: var(--fill-pressed); }
.pop-items { padding-top: 6px; display: flex; flex-direction: column; }
.pop-item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); font-size: 15px; text-align: left; cursor: pointer; }
.pop-item .ti { font-size: 18px; }
.pop-item:hover, .pop-item:focus-visible { background: var(--fill); }

/* Attachments in the thread */
.msg-atts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 4px; }

/* Quiet error where a reply would have been */
.msg-error { align-self: flex-start; margin-top: 12px; display: flex; align-items: flex-start; gap: 8px; color: var(--err-text); font-size: 15px; line-height: 1.45; cursor: pointer; }
.msg-error .ti { font-size: 18px; margin-top: 2px; flex: none; }
.msg-error-details {
  margin: 8px 0 0; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--gray);
  background: var(--panel); border-radius: 10px; cursor: text; user-select: text;
}

/* A new chat: Howard says hello */
.thread-empty { min-height: 100%; justify-content: center; }
.chat-hello { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding-bottom: 80px; animation: fade-in var(--d-medium) var(--ease) both; }
.chat-hello .howard-face { margin-bottom: 10px; box-shadow: var(--e1); }
.chat-hello-title { font-size: 24px; font-weight: 500; letter-spacing: -0.015em; }
.chat-hello-body { font-size: 16px; color: var(--gray); }
.bubble-skel { height: 66px; width: 70%; border-radius: var(--r-bubble); margin-top: 16px; }
.bubble-skel.user { width: 40%; height: 44px; align-self: flex-end; }

/* ---------- Composer: one frosted pill floating over the thread ---------- */
.composer-slot { position: absolute; z-index: 7; left: 0; right: 0; bottom: 0; pointer-events: none; }
.composer { max-width: var(--column); margin: 0 auto; padding: 0 12px max(12px, env(safe-area-inset-bottom)); pointer-events: auto; }
.composer-box {
  border-radius: 32px; padding: 12px; border: 1px solid transparent;
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--e1); transition: border-radius var(--d-short) var(--ease), box-shadow var(--d-micro) var(--ease);
}
.composer-box:focus-within { box-shadow: var(--e2); }
.composer-box.tall { border-radius: 26px; }
.composer-row { display: flex; align-items: flex-end; gap: 4px; }
.composer textarea {
  flex: 1; min-width: 0; display: block; min-height: 32px; max-height: 192px; resize: none; overflow-y: auto;
  border: 0; background: transparent; padding: 4px 6px; font-size: 16px; line-height: 24px; color: var(--ink);
}
.composer textarea::placeholder { color: var(--gray-muted); }
.composer textarea:focus { outline: none; }
.c-btn {
  width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: background-color var(--d-micro) var(--ease);
}
.c-btn .ti { font-size: 22px; }
.c-btn:hover, .c-btn[aria-expanded="true"] { background: var(--fill); }
.c-btn:disabled { opacity: .4; cursor: default; }
.c-btn[hidden], .send-btn[hidden] { display: none; }
.mic-btn.listening { color: var(--err-text); animation: mic-pulse 1.4s var(--ease) infinite; }
@keyframes mic-pulse { 50% { opacity: .45; } }
.send-btn {
  width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 50%;
  background: var(--action-solid); color: #fff; display: grid; place-items: center; cursor: pointer;
  animation: pop-in var(--d-short) var(--spring) both;
  transition: background-color var(--d-micro) var(--ease), opacity var(--d-micro) var(--ease);
}
.send-btn .ti { font-size: 18px; }
.send-btn:hover:not(:disabled) { background: var(--action-hover); }
.send-btn:disabled { opacity: .35; cursor: default; }
.composer-tray { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; }
.tray-item { position: relative; flex: none; animation: fade-in var(--d-short) var(--ease) both; }
.tray-remove {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--card); background: var(--thunder); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0;
}
.tray-remove .ti { font-size: 12px; }
.main.dropping::after {
  content: "Drop to attach"; position: absolute; inset: 12px; z-index: 20;
  display: grid; place-items: center; border: 2px dashed var(--action); border-radius: var(--r-lg);
  background: rgba(252, 252, 252, .9); color: var(--action); font-weight: 500; font-size: 18px; pointer-events: none;
}

/* ---------- Profile panel ---------- */
.profile {
  width: var(--panel-w); flex: none; position: relative; overflow-y: auto;
  scrollbar-gutter: stable; /* the plan scrolls and Howard's profile doesn't: keep the width the same either way */
  border-left: 1px solid var(--hairline); background: var(--page); padding: 0 16px 24px;
}
.shell.panel-closed .profile { display: none; }
/* Medium screens: it slides over the chat */
.shell.panel-float .profile { position: absolute; z-index: 20; top: 0; right: 0; bottom: 0; box-shadow: var(--e3); animation: panel-in var(--d-medium) var(--ease) both; }
@keyframes panel-in { from { transform: translateX(24px); opacity: 0; } }
.profile-close { position: absolute; top: 12px; right: 12px; color: var(--gray); }
.profile-head { display: flex; flex-direction: column; align-items: center; padding: 56px 0 24px; text-align: center; }
.howard-face {
  display: grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--card); border: 1px solid var(--line);
}
.howard-face img { width: 62%; height: 62%; object-fit: contain; }
.howard-face .core-icon { display: grid; place-items: center; color: var(--ink); }
.howard-face .core-icon svg { display: block; }
.profile-face { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; transition: transform var(--d-short) var(--spring); }
.profile-face:hover { transform: scale(1.03); }
.face-edit {
  position: absolute; right: -2px; bottom: 2px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--card); color: var(--ink); box-shadow: var(--e1);
}
.face-edit .ti { font-size: 15px; }
.profile-name { margin-top: 12px; font-size: 22px; font-weight: 500; letter-spacing: -0.015em; }
.profile-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 16px; color: var(--gray); }
.profile-status .ti { font-size: 18px; color: var(--ok); }

/* Segmented control */
.segmented { display: flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--panel); margin-bottom: 20px; }
.seg-btn {
  flex: 1; height: 32px; padding: 0; border: 0; border-radius: var(--r-pill); background: none; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: background-color var(--d-short) var(--ease), box-shadow var(--d-short) var(--ease);
}
.seg-btn .ti { font-size: 18px; }
.seg-btn:hover:not(.on) { background: var(--fill); }
.seg-btn.on { background: var(--card); box-shadow: 0 1px 4px rgba(17, 17, 18, .12); }
.profile-body { animation: fade-in var(--d-short) var(--ease) both; }
.panel-label { margin: 4px 0 8px; font-size: 16px; font-weight: 500; }
.panel-label:not(:first-child) { margin-top: 16px; }
.activity-row {
  width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 8px; border: 0; border-radius: 10px;
  background: none; color: var(--ink); text-align: left; cursor: pointer; transition: background-color var(--d-micro) var(--ease);
}
.activity-row:hover { background: var(--fill); }
.activity-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--panel); }
.activity-icon .ti { font-size: 20px; }
.activity-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.activity-title { font-size: 15px; font-weight: 500; line-height: 20px; }
.activity-sub { font-size: 14px; line-height: 18px; color: var(--gray); }
.activity-time { font-size: 12px; line-height: 16px; color: var(--gray); font-variant-numeric: tabular-nums; }
.panel-empty { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 32px 0; text-align: center; }
.panel-empty .ti { font-size: 28px; margin-bottom: 6px; }
.panel-empty-title { font-size: 15px; font-weight: 500; }
.panel-empty-body { font-size: 14px; color: var(--gray); }
.soul-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.soul-card {
  position: relative; aspect-ratio: 1.12; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card);
  color: var(--ink); text-align: left; cursor: pointer; display: flex; flex-direction: column;
  transition: background-color .15s ease, border-color .15s ease;
}
.soul-card:hover { background: var(--action-tint); border-color: var(--ring); }
.soul-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--panel); margin-bottom: 14px; }
.soul-icon .ti { font-size: 20px; }
.soul-card.soul .soul-icon { color: var(--sand-ink); }
.soul-card.memory .soul-icon { color: var(--sky-ink); }
.soul-title { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.soul-sub { margin-top: 2px; font-size: 13px; color: var(--gray); }
.soul-foot { margin-top: auto; font-size: 13px; color: var(--gray); }

/* ---------- Pages: Feed, Ideas, Goals, Library ---------- */
.page { max-width: 664px; padding: 40px 40px 120px 60px; animation: fade-in var(--d-medium) var(--ease) both; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-title { font-size: 36px; font-weight: 500; line-height: 1.15; letter-spacing: -0.025em; }
.page-sub { margin-top: 14px; font-size: 18px; line-height: 1.45; color: var(--ink); }
.page-tools { display: flex; gap: 8px; }
.round-btn { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--ink); cursor: pointer; }
.round-btn .ti { font-size: 22px; }
.round-btn.primary { background: var(--btn-primary); color: #fff; transition: background-color .15s ease; }
.round-btn.primary:hover { background: var(--action-hover); }
.round-btn.primary:active { background: var(--action-active); }
.round-btn.primary:hover { background: var(--action-hover); }
.section-title { display: flex; align-items: center; gap: 8px; margin: 36px 0 10px; font-size: 18px; font-weight: 500; }
.section-title .ti { font-size: 20px; color: var(--gray); }
.page-empty { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 500; }
.page-empty .ti { font-size: 28px; }
.row-time { margin-left: auto; font-size: 13px; color: var(--gray); white-space: nowrap; }
.goal-list { display: flex; flex-direction: column; margin: 0 -10px; }
.goal-row {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 10px; border: 0; border-radius: 12px;
  background: none; color: var(--ink); font-size: 16px; text-align: left; cursor: pointer; transition: background-color var(--d-micro) var(--ease);
}
.goal-row > span:not(.row-time) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-row > .ti:first-child { font-size: 22px; flex: none; }
.goal-row > .ti:last-child { font-size: 18px; color: var(--gray-muted); flex: none; }
.goal-row:hover { background: var(--fill); }
.idea-list { display: flex; flex-direction: column; gap: 6px; margin: 28px -12px 0; }
.idea {
  display: flex; align-items: flex-start; gap: 14px; padding: 12px; border: 0; border-radius: 16px;
  background: none; color: var(--ink); text-align: left; cursor: pointer; transition: background-color var(--d-micro) var(--ease);
}
.idea:hover { background: var(--fill); }
.idea-icon { width: 44px; height: 44px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--panel); color: var(--ink); }
.idea-icon .ti { font-size: 22px; }
.idea-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.idea-title { font-size: 16px; font-weight: 500; line-height: 22px; }
.idea-body { font-size: 14px; line-height: 20px; color: var(--gray); }
.idea > .ti { font-size: 18px; color: var(--gray-muted); margin-top: 12px; }
.prompt-card {
  margin-top: 28px; padding: 20px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--e2);
  display: flex; flex-direction: column; gap: 8px;
}
.prompt-label { font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gray); }
.prompt-text { font-size: 16px; line-height: 1.5; }
.prompt-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.post { display: flex; gap: 16px; margin-top: 40px; }
.post-face { flex: none; }
.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 16px; line-height: 1.5; }
.post-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.post-title { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.post-time { font-size: 13px; color: var(--gray); white-space: nowrap; }
.post-actions { display: flex; gap: 6px; margin: 8px 0 0 -8px; }
.post-action { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: none; color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; }
.post-action .ti { font-size: 20px; }
.post-action:hover { background: var(--fill); }

/* ---------- Settings: a large modal ---------- */
.settings-overlay {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px;
  background: var(--scrim); animation: fade-in var(--d-short) var(--ease) both;
}
.settings-overlay.leaving { animation: fade-out 200ms var(--ease) both; }
@keyframes fade-out { to { opacity: 0; } }
.settings-dialog {
  position: relative; width: min(860px, 100%); height: min(640px, 100%); border-radius: var(--r-lg); overflow: hidden;
  background: var(--page); box-shadow: var(--e3); animation: dialog-in var(--d-medium) var(--spring) both;
}
@keyframes dialog-in { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.settings-dialog > .settings { height: 100%; }
.settings-close { position: absolute; z-index: 3; top: 14px; right: 14px; width: 36px; height: 36px; background: var(--card); box-shadow: var(--e1); }
.settings-close .ti { font-size: 18px; }

/* Keyboard shortcuts, Get the app */
.shortcuts { display: flex; flex-direction: column; }
.shortcut { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.shortcut:last-child { border-bottom: 0; }
.keys { display: flex; gap: 4px; }
kbd { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 8px; background: var(--panel); font: 500 13px/26px var(--font); text-align: center; }
.getapp { display: flex; flex-direction: column; gap: 12px; }
.getapp-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Medium screens ---------- */
@media (max-width: 1179px) {
  .page { padding-left: 40px; }
}

/* ---------- Phones: the rail becomes a bottom tab bar ---------- */
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .rail {
    order: 2; width: 100%; flex-direction: row; justify-content: space-around; height: calc(64px + env(safe-area-inset-bottom));
    padding: 6px 8px env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--hairline);
  }
  .rail-top, .rail-app, .rail-btn[aria-label="Search"] { display: none; }
  .rail-nav { flex-direction: row; justify-content: space-around; flex: 1; gap: 0; }
  .rail-foot { flex-direction: row; }
  .main { order: 1; min-height: 0; }
  .composer { padding-bottom: 10px; }
  .thread { padding: 64px 12px 112px; }
  .msg-howard { padding-right: 24px; }
  .msg-user { padding-left: 24px; }
  .chats-drawer { width: 100%; }
  .shell .profile { display: none; }
  .shell.panel-sheet .profile {
    display: block; position: fixed; z-index: 50; inset: 0; width: 100%; border-left: 0;
    animation: sheet-in var(--d-medium) var(--ease) both;
  }
  @keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
  .page { padding: 28px 20px 100px; }
  .page-title { font-size: 30px; }
  .settings-overlay { padding: 0; }
  .settings-dialog { width: 100%; height: 100%; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .soul-card::before { animation: none; }
}

/* ---------- Results inside Howard's bubble (formerly tiles) ----------
   A small header line, rows with a round or rounded image, a medium first line, quiet lines under it,
   tiny chips, and white pill buttons. Only the state pill, meters, and tracker carry color. */
.hcard { --tone: var(--info); --tone-text: var(--info); --pill-ink: #00489D; }
.hcard[data-tone="ok"] { --tone: var(--ok); --tone-text: var(--ok-text); --pill-ink: #006B00; }
.hcard[data-tone="caution"] { --tone: var(--caution); --tone-text: var(--caution-text); --pill-ink: #7A5A00; }
.hcard[data-tone="warn"] { --tone: var(--warn); --tone-text: var(--warn-text); --pill-ink: #A6431A; }
.hcard[data-tone="err"] { --tone: var(--err); --tone-text: var(--err-text); --pill-ink: #A8172D; }
.bubble-card { width: min(380px, 100%); }
.bubble-card:has(.rc.wide) { width: min(480px, 100%); }
.rc { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 20px; }
.rc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 500; }
.rc-head-text { min-width: 0; }
.rc-state {
  flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--pill-ink); white-space: nowrap;
}
.rc-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--tone); }
.rc-line1 .rc-state { margin-left: 6px; vertical-align: 1px; }
.rc-row { display: flex; align-items: center; gap: 12px; }
.rc-media { width: 40px; height: 40px; flex: none; position: relative; overflow: hidden; border-radius: 12px; background: #fff; }
.rc-media.round { border-radius: 50%; }
.rc-icon { display: grid; place-items: center; }
.rc-icon .ti { font-size: 20px; }
.rc-thumb.square { width: 48px; height: 48px; border-radius: 12px; }
.rc-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* A real image sits on white (logos often have see-through backgrounds), and the default tile steps away
   once it loads so the two never show at once */
.photo-real { opacity: 0; background: #fff; transition: opacity var(--d-medium) var(--ease); }
.loaded > .photo-real { opacity: 1; }
.loaded > .photo-default { opacity: 0; transition: opacity var(--d-medium) var(--ease); }
.rc-thumb img.is-logo { object-fit: contain; padding: 5px; }
.rc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rc-line1 { font-size: 14px; font-weight: 500; line-height: 20px; }
.rc-line2 { font-size: 13px; line-height: 18px; color: var(--ink); }
.rc-line3 { font-size: 13px; line-height: 18px; color: var(--gray); }
.rc-timeline { display: flex; align-items: center; gap: 6px; color: var(--gray); white-space: nowrap; }
.rc-dash { flex: 1; min-width: 8px; border-top: 1px solid var(--line-hover); }
.rc-chip { padding: 1px 8px; border-radius: var(--r-pill); background: var(--panel); font-size: 11px; line-height: 15px; color: var(--gray); }
.rc-was { color: var(--gray-muted); }
.rc-now { color: var(--tone-text); font-weight: 500; }
.rc-extra { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.rc-extra .ti { font-size: 16px; color: var(--gray); flex: none; }
.rc-note {
  padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; line-height: 18px;
  background: color-mix(in srgb, var(--tone) 14%, #fff); color: var(--ink); /* a soft colour by tone: Hendrik's call, an exception to the brand */
}
.rc-foot { font-size: 12px; line-height: 16px; color: var(--gray); }
.rc-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; } /* each button as wide as its label needs; a row that runs out wraps */
.rc-btn {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 20px; border: 0; border-radius: var(--r-pill); white-space: nowrap;
  background: #fff; color: var(--ink); font: 400 14px/1 var(--font); text-decoration: none; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color var(--d-micro) var(--ease), transform var(--d-short) var(--spring);
}
.rc-btn .ti { font-size: 16px; }
.rc-btn:hover { background: var(--action-tint); color: var(--action-hover); box-shadow: inset 0 0 0 1px var(--ring); } /* brand secondary hover */
.rc-btn:active { transform: scale(.97); }
.rc-btn.primary { background: var(--action-solid); color: #fff; box-shadow: none; } /* cards keep a blue main button at rest (Hendrik's call, an exception to the brand) */
.rc-btn.primary:hover { background: var(--action-hover); color: #fff; }
.rc-btn.primary:active { background: var(--action-active); }

/* Options: dashed choices to tap (like a name picker), or photo rows when the choices are one kind */
.rc-choices { display: flex; flex-direction: column; gap: 8px; }
.rc-choice {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font-size: 15px; line-height: 22px; text-align: left; cursor: pointer;
  transition: background-color var(--d-micro) var(--ease), border-color var(--d-micro) var(--ease);
}
.rc-choice:hover { border-color: var(--line-hover); background: #fff; }
.rc-choice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-choice-detail { flex: none; font-weight: 500; }
.rc-pick-rows { display: flex; flex-direction: column; margin: 0 -8px; }
.rc-pick-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border: 0; border-radius: 14px; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.rc-pick-row:hover { background: rgba(255, 255, 255, .55); }
.rc-pick-row > .ti { color: var(--gray); font-size: 18px; flex: none; }

/* Confirm: compact facts, then why Howard is asking */
.rc-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.rc-facts dt { color: var(--gray); }
.rc-facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.rc-reason { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 18px; }
.rc-reason .ti { font-size: 16px; color: var(--gray); flex: none; margin-top: 1px; }
.rc-reason strong { font-weight: 500; }

/* Email draft */
.rc-subject { font-size: 15px; font-weight: 500; }
.rc-email { white-space: pre-wrap; font-size: 14px; line-height: 21px; max-height: 220px; overflow-y: auto; padding: 10px 12px; border-radius: 12px; background: #fff; }

/* Package tracker, budget meter */
.rc-track { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.rc-step { height: 5px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .1); }
.rc-step.on { background: var(--tone); }
.rc-track-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--gray); margin-top: -6px; }
.rc-track-labels .rc-now { color: var(--tone-text); }
.rc-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.rc-events li { display: flex; gap: 10px; }
.rc-events li:not(:first-child) { color: var(--gray); }
.rc-when { flex: none; width: 52px; color: var(--gray); font-variant-numeric: tabular-nums; }
.rc-meter { height: 6px; border-radius: var(--r-pill); background: rgba(0, 0, 0, .1); overflow: hidden; }
.rc-meter span { display: block; height: 100%; border-radius: inherit; background: var(--tone); }

/* Weather */
.rc-wx { display: flex; align-items: center; gap: 14px; }
.rc-wx-temp { display: inline-flex; align-items: center; gap: 6px; font-size: 36px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.rc-wx-text { display: flex; flex-direction: column; font-size: 14px; }
.rc-hours { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 8px; border-radius: 12px; background: #fff; }
.rc-hour { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; font-weight: 500; }
.wx-icon { flex: none; overflow: visible; }
.rc-wx-temp .wx-icon { width: 36px; height: 36px; }
.rc-hour .wx-icon { width: 22px; height: 22px; }
.wx-cloud { fill: var(--gray); }
.wx-sun circle { fill: var(--caution); }
.wx-sun line { stroke: var(--caution); stroke-width: 2; stroke-linecap: round; }
.wx-bolt { fill: var(--caution); stroke: var(--caution); stroke-width: 0.8; stroke-linejoin: round; }
.wx-drop { stroke: var(--info); stroke-width: 2; stroke-linecap: round; }
.wx-snow, .wx-moon { fill: var(--thunder-light); }

/* Memory, error */
.rc-memory { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 22px; }
.rc-memory .ti { font-size: 18px; margin-top: 2px; color: var(--ok-text); }
.rc-error { display: flex; align-items: flex-start; gap: 8px; color: var(--err-text); font-size: 14px; }
.rc-error .ti { font-size: 18px; margin-top: 1px; flex: none; }
/* On a phone sheet, keep the profile at a readable width */
@media (max-width: 760px) {
  .shell.panel-sheet .profile > * { max-width: 440px; margin-left: auto; margin-right: auto; }
  .shell.panel-sheet .profile .profile-close { margin: 0; }
}

/* ---------- Settings, restyled: a plain section list on the left, gray grouped cards on the right ---------- */
.settings-dialog .settings { grid-template-columns: 240px 1fr; }
.settings-dialog .settings-nav { padding: 20px 14px; gap: 10px; border-right: 1px solid var(--hairline); }
.settings-search { min-height: 38px; padding-top: 8px; padding-bottom: 8px; font-size: 15px; background: var(--fill); }
.settings-search-wrap .lead { top: 9px; font-size: 18px; }
.settings-list { gap: 2px; }
.settings-card { background: none; border: 0; border-radius: 0; overflow: visible; }
.settings-list .settings-card + .settings-card { margin-top: 0; }
.settings-item, .settings-card .settings-item, .settings-list .settings-card + .settings-card .settings-item {
  min-height: 36px; padding: 0 10px; gap: 10px; border-radius: 12px; font-size: 15px;
}
.settings-item + .settings-item::before { display: none; }
.settings-item:hover { background: var(--fill); }
.settings-item.active { background: var(--fill-pressed); color: var(--ink); font-weight: 500; }
.settings-item .srow-chev { display: none; }
.nav-tile { width: 20px; height: 20px; border-radius: 0; background: none; color: var(--ink); }
.nav-tile .ti { font-size: 19px; }
.nav-tile .core-icon { color: var(--ink); }
.settings-item.active .nav-tile { background: none; }
/* Your account: first in the list, with your photo */
.settings-card:first-child .settings-item { min-height: 56px; padding: 8px 10px; margin-bottom: 8px; }
.settings-card:first-child .avatar-lg { width: 38px; height: 38px; font-size: 14px; }
.settings-account-name { font-weight: 500; font-size: 15px; }
.settings-account-sub { font-size: 12px; color: var(--gray); opacity: 1; }
.settings-pane-inner { max-width: 600px; padding: 22px 28px 48px; }
.spage-title { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 20px; }
.sgroup { margin-bottom: 24px; }
.sgroup-head { margin: 0 0 8px 2px; font-size: 14px; font-weight: 500; color: var(--gray); text-transform: none; letter-spacing: 0; }
.sgroup-foot { margin: 8px 4px 0; }
.scard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.srow { min-height: 52px; padding: 8px 16px; }
.srow + .srow::before { left: 16px; right: 16px; border-top-color: rgba(0, 0, 0, .07); }
.srow-btn:hover { background: rgba(0, 0, 0, .03); }
.srow-action { font-weight: 500; }
.service-logo { background: #fff; border: 0; }
@media (max-width: 899px) {
  .settings-dialog .settings { grid-template-columns: 1fr; }
  .settings-dialog .settings-nav { border-right: 0; padding-top: 56px; }
  .settings-item, .settings-card .settings-item, .settings-list .settings-card + .settings-card .settings-item { min-height: 44px; }
  .settings-item .srow-chev { display: block; margin-left: auto; }
  .settings-item.active { background: none; font-weight: 400; }
  .settings-pane-inner { padding-top: 56px; }
}

/* Appearance: theme colors for your message bubbles */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px; }
.swatch {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform var(--d-short) var(--spring);
}
.swatch:hover { transform: scale(1.12); }
.swatch[aria-checked="true"]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ink); }

/* ---------- Setup, in the chat ---------- */
.shell.setup .main { width: 100%; }
.setup-title { gap: 10px; padding: 0 14px 0 6px; cursor: default; }
.setup-title:active { transform: none; }
.howard-face.tiny { width: 28px; height: 28px; }
.setup-progress { width: 56px; height: 4px; border-radius: var(--r-pill); background: var(--fill-pressed); overflow: hidden; }
.setup-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--action); transition: width var(--d-long) var(--ease); }
.setup-thread { padding-top: 80px; }
/* A picked choice turns solid with a check; the others step back */
.choice-check { display: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; place-items: center; flex: none; }
.choice-check .ti { font-size: 13px; }
.rc-choice.picked { border-color: color-mix(in srgb, var(--bubble-user) 65%, var(--action)); background: var(--bubble-user); color: var(--bubble-user-ink); }
.rc-choice.picked .choice-check { background: var(--bubble-user-ink); color: var(--bubble-user); }
.rc-choice.picked .choice-check { display: grid; animation: pop-in var(--d-short) var(--spring) both; }
.rc-choices.picked .rc-choice:not(.picked) { opacity: .45; }
.rc-choice:disabled { cursor: default; }
.rc-choices.picked .rc-choice:not(.picked):hover { border-color: var(--line); }
/* Small forms inside a bubble */
.rc-inline { display: flex; gap: 8px; align-items: center; }
.rc-input, .rc-form .input { background: #fff; min-height: 42px; padding: 9px 14px; font-size: 15px; }
.rc-inline .rc-input { flex: 1; min-width: 0; }
.rc-form { display: flex; flex-direction: column; gap: 10px; }
.rc-form .field + .field { margin-top: 0; }
.rc-form .field-label { font-size: 13px; }
.rc-form .helper, .rc-form .error { font-size: 12px; }
.bubble-card:has(.rc-form) { width: min(400px, 100%); }
.bubble:has(.done), .msg .done { opacity: .6; }

.bubble-card:has(.rc-choices) { width: min(320px, 100%); }

/* Messages in a row read as one chain: where two bubbles meet, their corners tighten (Howard on the
   left, you on the right). A corner only tightens once the next message has actually arrived: the
   typing dots and bubbles still waiting to be typed in (hidden) don't count. */
.bubble[hidden] { display: none; }
.msg-howard .bubble-stack > .bubble:has(~ .bubble:not([hidden]):not(.bubble-typing)),
.msg-howard:has(+ .msg-howard .bubble:not([hidden]):not(.bubble-typing)) .bubble-stack > .bubble:last-child { border-bottom-left-radius: var(--r-tail); }
.msg-howard .bubble-stack > .bubble:not(.bubble-typing):not(:first-child),
.msg-howard + .msg-howard .bubble-stack > .bubble:not(.bubble-typing):first-child { border-top-left-radius: var(--r-tail); }
.msg-user .bubble-stack > .bubble:not(:last-child),
.msg-user:has(+ .msg-user) .bubble-stack > .bubble:last-child { border-bottom-right-radius: var(--r-tail); }
.msg-user .bubble-stack > .bubble:not(:first-child),
.msg-user + .msg-user .bubble-stack > .bubble:first-child { border-top-right-radius: var(--r-tail); }

/* ---------- Howard at work: a small card that says what he's doing ---------- */
.bubble-working { width: auto; min-width: 220px; }
.rc-media.work-spin { overflow: visible; }
.work-spin::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent;
  border-top-color: var(--action); border-right-color: var(--action); animation: work-spin 1s linear infinite;
}
@keyframes work-spin { to { transform: rotate(360deg); } }
.work-step { display: inline-block; transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
.work-step.swap { opacity: 0; transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .work-spin::after { animation-duration: 3s; } }

/* ---------- Tables in a reply (comparisons: hotels by price, distance, rating) ---------- */
.md-table { overflow-x: auto; margin: 2px -4px; -webkit-overflow-scrolling: touch; }
.md-table table { border-collapse: collapse; font-size: 14px; line-height: 19px; min-width: 100%; }
.md-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--gray); padding: 0 12px 6px 4px; white-space: nowrap; }
.md-table td { padding: 8px 12px 8px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.md-table td:first-child { font-weight: 500; }
.bubble:has(.md-table) { max-width: min(640px, 100%); }

/* ---------- Airline logos, flight options, confirmations ---------- */
.rc-logo { display: grid; place-items: center; background: #fff; }
.rc-logo-code { font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--ink); }
.rc-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bubble-card:has(.rc-flights) { width: min(400px, 100%); }
.rc-flights .rc-pick-rows { gap: 2px; }
.rc-flight-opt { align-items: flex-start; padding-top: 8px; padding-bottom: 8px; }
.rc-flight-opt .rc-text { gap: 3px; }
.rc-flight-opt .rc-timeline { font-size: 13px; line-height: 18px; }
.rc-line4 { font-size: 12px; line-height: 16px; color: var(--gray-muted); }
.rc-illus { background: transparent; border-radius: 0; overflow: visible; }
.rc-illus svg { display: block; }
.rc-sentence { font-size: 14px; line-height: 20px; }
/* A changed time (old struck through, new beside it) needs the room: drop the duration pill */
.rc-timeline:has(.rc-was) .rc-chip, .rc-timeline:has(.rc-was) .rc-chip + .rc-dash { display: none; }

/* Default images (brand): a Tabler icon drawn in an icon line colour on a pale tile. Colour never fills. */
.photo-default { position: absolute; inset: 0; display: grid; place-items: center; background: var(--panel); color: var(--pc-ink, var(--grey-ink)); }
.photo-default .ti { font-size: 22px; }
.rc-thumb.square .photo-default .ti { font-size: 24px; }
.ph-restaurant, .ph-cafe, .ph-landmark { --pc-ink: var(--sand-ink); }
.ph-hotel, .ph-city, .ph-plane { --pc-ink: var(--sky-ink); }
.ph-shop, .ph-event { --pc-ink: var(--lilac-ink); }
.ph-stadium, .ph-place { --pc-ink: var(--sage-ink); }
.ph-car { --pc-ink: var(--grey-ink); }

/* Quick replies at the end of Howard's message (Muse-style): the choices sit in the same bubble as the text */
.bubble .rc-choices.in-text { margin-top: 10px; }
.rc-attached { margin-top: 10px; }
.rc-attached .rc-choices.in-text { margin-top: 0; }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 28px; }
.project-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--card); color: var(--ink); text-align: left; cursor: pointer;
  transition: border-color var(--d-micro) var(--ease), box-shadow var(--d-micro) var(--ease), transform var(--d-short) var(--spring);
}
.project-card:hover { border-color: var(--ring); background: var(--action-tint); }
.project-card:active { transform: scale(.98); }
.project-name { font-size: 15px; font-weight: 500; line-height: 20px; overflow-wrap: anywhere; }
.project-meta { font-size: 13px; color: var(--gray); }
.page-back { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 16px -6px; padding: 4px 8px 4px 2px; border: 0; border-radius: var(--r-pill); background: none; color: var(--gray); font: 500 14px var(--font); cursor: pointer; }
.page-back:hover { background: var(--fill); color: var(--ink); }
.project-new-chat { display: inline-flex; width: auto; align-self: flex-start; margin: 24px 0 8px; }
.project-empty { margin: 4px 0 0; font-size: 15px; color: var(--gray); }

/* Project and face colours (brand): each is an icon line colour, drawn on a pale tile. The older named
   colours people may have saved map to the nearest one. */
.pc-sky, .pc-indigo { --pc-ink: var(--sky-ink); }
.pc-sage, .pc-green, .pc-teal { --pc-ink: var(--sage-ink); }
.pc-sand, .pc-orange, .pc-yellow, .pc-brown, .pc-red { --pc-ink: var(--sand-ink); }
.pc-lilac, .pc-purple, .pc-pink { --pc-ink: var(--lilac-ink); }
.pc-blue { --pc-ink: var(--blue-ink); }
.pc-grey, .pc-gray { --pc-ink: var(--grey-ink); }
.pc-custom { --pc-ink: color-mix(in srgb, var(--pc) 72%, #17171A); } /* darkened so it reads on the tile */
.project-badge {
  position: relative; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; overflow: hidden;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--hairline); color: var(--pc-ink, var(--sky-ink));
}
.project-badge .ti { font-size: 16px; }
.project-badge.tile { width: 40px; height: 40px; border-radius: var(--r-sm); }
.project-badge.tile .ti { font-size: 20px; }
.project-badge.big { width: 52px; height: 52px; border-radius: var(--r-sm); }
.project-badge.big .ti { font-size: 26px; }
.project-card .project-badge { margin-bottom: 10px; }
.page-title.with-badge { display: flex; align-items: center; gap: 12px; }

/* The project badge beside Chats at the top of a chat */
.chat-top-left { display: flex; align-items: flex-start; gap: 8px; } /* top-aligned: the bar is 0 tall, so centering pushed the pills above it */
.project-chip {
  pointer-events: auto; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: var(--e1);
  transition: transform var(--d-short) var(--spring); animation: pop-in var(--d-medium) var(--spring) both;
}
.project-chip[hidden] { display: none; }
.project-chip:active { transform: scale(.94); }
.project-chip .project-badge { width: 30px; height: 30px; }
.project-chip .project-badge .ti { font-size: 17px; }

/* Project picker */
.project-form { gap: 20px; }
.project-preview { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 500; }
.swatch-wrap { position: relative; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px; margin: 0 -4px -4px; } /* room for the selected ring */
.pick-swatch { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: var(--pc-ink); }
.pick-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--pc-ink); }
.icon-search { margin-bottom: 8px; }
.icon-count { font-size: 12px; color: var(--gray); margin-bottom: 8px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; flex: 1; min-height: 96px; max-height: 240px; overflow-y: auto; padding: 2px; align-content: start; }
/* The picker dialog doesn't scroll as a whole (only the symbol grid does), so there's one scrollbar and the
   selected color's ring isn't cropped */
/* The picker dialogs fit the window: the dialog is capped at the window's height and the symbol grid takes
   whatever room is left (one scrollbar, in the grid) */
.modal:has(.project-form) { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.modal-body:has(.project-form) { flex: 1; min-height: 0; max-height: none; overflow-y: auto; display: flex; flex-direction: column; padding: 4px; margin: -4px -4px 0; }
/* (the body only scrolls on a very short window, when even the smallest grid doesn't fit; the padding keeps
   rings and focus outlines from being cropped) */
.project-form { flex: 1; min-height: 0; }
.project-form > .field:last-child { flex: 1; min-height: 0; }
.icon-pick { display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--ink); cursor: pointer; }
.icon-pick .ti { font-size: 21px; }
.icon-pick:hover { background: var(--fill); }
.icon-pick.on { background: var(--panel); color: var(--pc-ink); box-shadow: inset 0 0 0 1.5px var(--pc-ink); }

/* Toolbar hover label */
.rail-tip {
  position: fixed; z-index: 60; transform: translate(-4px, -50%); opacity: 0; pointer-events: none;
  padding: 7px 12px; border-radius: 10px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap;
  box-shadow: var(--e2); transition: opacity var(--d-micro) var(--ease), transform var(--d-micro) var(--ease);
}
.rail-tip.on { opacity: 1; transform: translate(0, -50%); }

/* Projects pages sit centered in the space beside the toolbar */
.page.page-center { margin: 0 auto; padding-left: 40px; padding-right: 40px; }
@media (max-width: 760px) { .page.page-center { padding-left: 20px; padding-right: 20px; } }

/* Howard's face when they've picked a symbol: the symbol on a soft color, with the same gloss as projects */
.howard-face.custom { position: relative; background: var(--panel); border: 1px solid var(--hairline); color: var(--pc-ink); }
.howard-face.custom .ti { position: relative; font-size: 1em; }
/* Customize: the Howard Core look, or a color and symbol */
.look-core {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font: 500 15px var(--font); text-align: left; cursor: pointer;
}
.look-core.on { border-color: color-mix(in srgb, var(--bubble-user) 65%, var(--action)); background: var(--bubble-user); }
.look-or { margin: 10px 0 8px; font-size: 13px; color: var(--gray); }

/* ---------- Plans ---------- */
.plans-loading { display: flex; justify-content: center; padding: 48px 0; }
.plans-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 56px 16px; color: var(--gray); font-size: 15px; }
.plans-empty > .ti { font-size: 30px; color: var(--ink); }
.plans-empty-title { font-size: 17px; font-weight: 500; color: var(--ink); }
.plans-empty .btn { margin-top: 8px; }
.plan-list { display: flex; flex-direction: column; gap: 20px; }
.plan { display: flex; gap: 16px; align-items: flex-start; }
.plan-date { flex: none; width: 44px; display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.plan-dow { font-size: 12px; font-weight: 500; color: var(--gray); text-transform: uppercase; letter-spacing: .04em; }
.plan-day { font-size: 22px; font-weight: 500; line-height: 1.1; }
.plan-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.plan-body .msg { margin-top: 0; width: 100%; }
.plan-body .bubble-card { width: min(420px, 100%); }
.plan-from { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border: 0; border-radius: var(--r-pill); background: none; color: var(--gray); font: 400 13px var(--font); cursor: pointer; }
.plan-from:hover { background: var(--fill); color: var(--ink); }
.plan-from .ti { font-size: 15px; }

/* Any color from the picker: tinted the same way as the named colors */
.swatch-more { display: grid; place-items: center; color: #fff; }
.swatch-more .ti { font-size: 16px; }
.swatch-more.is-empty { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.swatch-more.is-empty[aria-checked="true"] { box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--ink); }
.color-input { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* Settings → Voice */
.voice-play { width: 34px; height: 34px; }
.voice-check { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-hover); }
.voice-check.on { background: var(--action-solid); box-shadow: none; color: #fff; }
.voice-check .ti { font-size: 14px; }

/* Read aloud: a spinner while the voice loads; the bar stays up while it loads or plays */
.bar-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-hover); border-top-color: var(--action); animation: work-spin .8s linear infinite; }
.bar-btn.busy { color: var(--action); }
.msg:has(.bar-btn.busy) > .msg-bar { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

/* Asking before the one-time voice download */
.voice-ask { display: flex; flex-direction: column; gap: 14px; color: var(--ink); }
.voice-ask p { margin: 0; color: var(--gray-strong); line-height: 1.5; }
.voice-ask-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--r-sm); background: var(--panel); color: var(--sky-ink); }
.voice-ask-icon .ti { font-size: 27px; }
.voice-meter { height: 6px; border-radius: var(--r-pill); background: var(--fill); overflow: hidden; }
.voice-meter[hidden] { display: none; }
.voice-meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--action); transition: width .3s var(--ease); }
.voice-status { font-size: 13px; color: var(--gray); margin-top: -6px; }

/* Chats list: a reply still coming */
.chat-pending { flex: none; width: 14px; height: 14px; margin-left: 6px; }

/* ---------- The plan, in the right panel: a trip, event, or itinerary as a map ---------- */
.plan-btn[hidden] { display: none; }
/* The trip itself: the root of the map */
.plan-root { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); position: relative; z-index: 1; }
.plan-root-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--panel); color: var(--sky-ink); }
.plan-root-icon .ti { font-size: 21px; }
.plan-title { font-size: 16px; font-weight: 500; line-height: 1.25; }
.plan-meta { font-size: 13px; color: var(--gray); margin-top: 2px; }
/* Branches hang off one line from the root; each branch's items off its own */
.plan-tree { position: relative; margin-left: 20px; padding-top: 8px; }
.plan-tree::before { content: ''; position: absolute; left: 0; top: 0; bottom: 18px; border-left: 2px solid var(--line-hover); }
.plan-branch { position: relative; padding-left: 16px; margin-top: 8px; }
.plan-branch::before { content: ''; position: absolute; left: 0; top: 19px; width: 14px; border-top: 2px solid var(--line-hover); }
.plan-branch:last-child::after { content: ''; position: absolute; left: -2px; top: 20px; bottom: 0; width: 4px; background: var(--page); }
.plan-branch-head {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px;
  background: var(--card); color: var(--ink); font: 500 14px var(--font); text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line);
}
.plan-branch-head:hover { box-shadow: inset 0 0 0 1px var(--line-hover); }
.plan-branch-head > .ti { font-size: 16px; color: var(--gray); }
.plan-branch-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--fill); }
.plan-branch-icon .ti { font-size: 15px; color: var(--ink); }
.plan-branch-label { flex: 1; min-width: 0; }
.plan-count { font-size: 12px; font-weight: 500; color: var(--gray); }
.plan-leaves { list-style: none; margin: 0 0 0 12px; padding: 4px 0 0 14px; border-left: 1.5px dashed var(--line-hover); }
.plan-leaf { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; font-size: 13px; }
.plan-dot { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--gray-muted); }
.s-booked .plan-dot, .s-confirmed .plan-dot { background: var(--ok); }
.s-option .plan-dot, .s-options .plan-dot, .s-holding .plan-dot { background: var(--info); }
.s-todo .plan-dot, .s-decide .plan-dot { background: var(--caution); }
.s-idea .plan-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--gray-muted); }
.plan-leaf-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plan-leaf-label { font-weight: 500; line-height: 1.35; }
.plan-leaf-detail { color: var(--gray); line-height: 1.35; }
.plan-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.plan-legend .plan-leaf { padding: 0; font-size: 12px; color: var(--gray); align-items: center; }
.plan-legend .plan-dot { margin-top: 0; }

/* The switch at the top of the right panel when the chat has a plan: the plan, or Howard's profile */
.panel-switch { display: flex; gap: 4px; padding: 4px; margin: 14px 44px 18px 0; border-radius: var(--r-pill); background: var(--fill); }
.panel-switch-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 16px; border: 0;
  border-radius: var(--r-pill); background: none; color: var(--gray); font: 500 14px var(--font); cursor: pointer; white-space: nowrap;
}
.panel-switch-btn .ti { font-size: 16px; }
.panel-switch-btn.on { background: var(--card); color: var(--ink); box-shadow: var(--e1); }
.planmap { padding-bottom: 8px; } /* the map in the right panel (not .plan-body, which is the Plans page's) */

/* ---------- Rich answers (view.js): building blocks Howard composes, in the brand's style ---------- */
.bubble-card:has(.hv) { width: min(660px, 100%); }
.hv { display: flex; flex-direction: column; gap: 18px; font-size: 15px; line-height: 22px; }
.hv-title { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.hv-intro, .hv-text { color: var(--gray-strong); }
.hv-heading { margin: 4px 0 -6px; font-size: 16px; font-weight: 500; }
.hv-block { display: flex; flex-direction: column; gap: 10px; }
.hv-chart-title { font-size: 15px; font-weight: 500; }
.hv-chart-sub, .hv-chart-note, .hv-source-line { font-size: 13px; line-height: 18px; color: var(--gray); }
/* Stats: two across, or four on a wide bubble */
.hv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.hv-stat { padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
.hv-stat-label { font-size: 13px; color: var(--gray); }
.hv-stat-value { margin-top: 4px; font-size: 26px; line-height: 30px; font-weight: 500; letter-spacing: -0.01em; }
.hv-stat-value.up { color: var(--ok); }
.hv-stat-value.down { color: var(--err-text); }
.hv-stat-sub { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 13px; color: var(--gray); }
.hv-stat-sub.t-ok { color: var(--ok); }
.hv-stat-sub.t-err { color: var(--err-text); }
/* Charts */
.hv-chart-frame { padding: 12px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
.hv-svg { display: block; width: 100%; height: auto; }
.hv-grid-line { stroke: var(--hairline); stroke-width: 1; }
.hv-axis { font: 12px var(--font); fill: var(--gray); }
.hv-line { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.hv-dot { fill: #fff; stroke: currentColor; stroke-width: 2; }
.hv-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: 8px; font-size: 13px; color: var(--gray); }
.hv-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.hv-key { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.hv-donut { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hv-svg-donut { width: 150px; height: 150px; flex: none; }
.hv-donut-track { fill: none; stroke: var(--panel); stroke-width: 22; }
.hv-donut-arc { fill: none; stroke-width: 22; }
.hv-donut-center { font: 500 18px var(--font); fill: var(--ink); }
.hv-donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; flex: 1; min-width: 160px; }
.hv-donut-legend li { display: flex; align-items: center; gap: 8px; }
.hv-donut-val { margin-left: auto; color: var(--gray); }
/* Segmented switch (tabs and time ranges) */
.hv-seg { display: inline-flex; align-self: flex-start; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--fill); flex-wrap: wrap; }
.hv-seg-btn { height: 32px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: none; color: var(--gray); font: 400 14px var(--font); cursor: pointer; white-space: nowrap; }
.hv-seg-btn.on { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.hv-switch-body { display: flex; flex-direction: column; gap: 18px; }
/* Radio choices */
.hv-choices { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
.hv-switch-label { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.hv-choice { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border: 0; background: none; color: var(--ink); font: 400 15px var(--font); text-align: left; cursor: pointer; border-radius: var(--r-sm); }
.hv-choice:hover { background: var(--action-tint); }
.hv-radio { width: 18px; height: 18px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-hover); }
.hv-choice.on .hv-radio { box-shadow: inset 0 0 0 5.5px var(--ink); }
/* Tappable grid */
.hv-tiles { display: grid; gap: 8px; }
.hv-tiles.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hv-tiles.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hv-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--card); color: var(--ink); text-align: left; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.hv-tile:hover { background: var(--action-tint); border-color: var(--ring); }
.hv-tile.on { background: var(--action-tint); border-color: var(--action); }
.hv-tile-icon { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 6px; border-radius: var(--r-sm); background: var(--panel); color: var(--grey-ink); }
.hv-tile-icon .ti { font-size: 17px; }
.hv-tile.t-ok .hv-tile-icon { color: var(--sage-ink); }
.hv-tile.t-err .hv-tile-icon { color: var(--err-text); }
.hv-tile.t-caution .hv-tile-icon, .hv-tile.t-warn .hv-tile-icon { color: var(--sand-ink); }
.hv-tile.t-info .hv-tile-icon { color: var(--sky-ink); }
.hv-tile-title { font-size: 15px; font-weight: 500; }
.hv-tile-sub { font-size: 13px; color: var(--gray); }
.hv-grid-detail { padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.hv-grid-detail-title { font-size: 16px; font-weight: 500; }
.hv-grid-detail-sub { margin-top: -8px; font-size: 13px; color: var(--gray); }
/* Scores */
.hv-scores { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
.hv-score-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.hv-score-val { font-weight: 500; }
.hv-score-track { height: 8px; margin-top: 6px; border-radius: var(--r-pill); background: var(--panel); overflow: hidden; }
.hv-score-fill { display: block; height: 100%; border-radius: inherit; transition: width .15s ease; }
.hv-slider { width: 100%; margin: 6px 0 0; accent-color: var(--ink); }
/* Lists */
.hv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hv-li { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.hv-li:first-child { border-top: 0; padding-top: 4px; }
.hv-li-n { flex: none; width: 22px; font-size: 14px; color: var(--gray); padding-top: 1px; }
.hv-li-dot { flex: none; width: 6px; height: 6px; margin: 8px 8px 0 4px; border-radius: 50%; background: var(--gray-muted); }
.hv-li-title { font-weight: 500; }
.hv-li-detail { font-size: 14px; color: var(--gray); }
/* Pictures */
.hv-pictures { gap: 14px; }
.hv-pic { display: flex; gap: 14px; align-items: flex-start; }
.hv-pic .rc-thumb.square { width: 96px; height: 96px; border-radius: var(--r-lg); }
.hv-pic-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.hv-pic-title { font-weight: 500; }
.hv-pic-body { font-size: 14px; color: var(--gray-strong); }
.hv-tag { display: inline-block; margin-top: 2px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; background: var(--panel); color: var(--gray-strong); }
.hv-tag.t-ok { background: var(--ok-tint); color: var(--ok-text); }
.hv-tag.t-info { background: var(--action-tint); color: var(--action-hover); }
.hv-tag.t-caution, .hv-tag.t-warn { background: #FBF3E3; color: var(--sand-ink); }
.hv-tag.t-err { background: #FBE9E7; color: var(--err-text); }
/* Notes and sources */
.hv-note { padding: 12px 14px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--info) 8%, #fff); font-size: 14px; line-height: 20px; }
.hv-note.t-caution, .hv-note.t-warn { background: #FBF3E3; }
.hv-note.t-err { background: #FBE9E7; }
.hv-note.t-ok { background: var(--ok-tint); }
.hv-note strong { font-weight: 500; }
.hv-sources { padding-top: 12px; border-top: 1px solid var(--hairline); gap: 6px; }
.hv-sources-title { font-size: 14px; font-weight: 500; }
.hv-source-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.hv-source-list a { color: var(--action-solid); text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.hv-source-list a:hover { color: var(--action-hover); text-decoration: underline; }
.hv-source-list a .ti { font-size: 13px; }
.hv-site { margin-left: 6px; font-size: 12px; color: var(--gray); }
@media (max-width: 520px) {
  .hv-tiles.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hv-pic .rc-thumb.square { width: 72px; height: 72px; }
}
