/* ---------- 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. */
.shell { display: flex; height: 100dvh; overflow: hidden; 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; }
.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; }
.face-pill[hidden] { display: none; }

/* ---------- 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: 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: 600; 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: 600; }
.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%; }
.msg.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: 22px;
  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); transform-origin: bottom left; }
.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: 600; }
.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: 600; }
.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); }

/* The ⋯ beside a message, on hover */
.msg-more {
  position: absolute; bottom: 6px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: transparent; color: var(--gray); cursor: pointer;
  opacity: 0; transition: opacity var(--d-micro) var(--ease), background-color var(--d-micro) var(--ease);
}
.msg-more .ti { font-size: 18px; }
.msg-howard .msg-more { right: 4px; }
.msg-user .msg-more { left: 4px; }
.msg:hover .msg-more, .msg-more:focus-visible, .msg-more[aria-expanded="true"] { opacity: 1; }
.msg-more:hover { background: var(--fill); color: var(--ink); }
@media (hover: none) { .msg-more { opacity: .6; } }

/* 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: 18px;
  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: 600; letter-spacing: -0.015em; }
.chat-hello-body { font-size: 16px; color: var(--gray); }
.bubble-skel { height: 66px; width: 70%; border-radius: 22px; 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: 600; font-size: 18px; pointer-events: none;
}

/* ---------- Profile panel ---------- */
.profile {
  width: var(--panel-w); flex: none; position: relative; overflow-y: auto;
  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: radial-gradient(circle at 50% 35%, #FFFFFF, #F1F2F3); border: 1px solid var(--hairline);
}
.howard-face img { width: 62%; height: 62%; object-fit: contain; }
.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: 600; 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: 600; }
.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: 600; }
.panel-empty-body { font-size: 14px; color: var(--gray); }
.identity-card { padding: 16px; border-radius: 20px; background: var(--panel); display: flex; flex-direction: column; gap: 12px; }
.identity-name { font-size: 16px; font-weight: 500; }
.identity-card .btn { background: var(--fill); }
.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: 0; border-radius: 22px; color: #fff; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
  transition: transform var(--d-medium) var(--spring), box-shadow var(--d-short) var(--ease);
}
.soul-card::before {
  content: ""; position: absolute; inset: -40%; z-index: -1; filter: blur(18px);
  animation: soul-drift 14s ease-in-out infinite alternate;
}
.soul-card.soul::before { background: radial-gradient(circle at 30% 30%, #D93B4E, transparent 55%), radial-gradient(circle at 70% 70%, #8E1022, transparent 60%), #B4162D; }
.soul-card.memory::before { background: radial-gradient(circle at 70% 40%, #5B86E5, transparent 55%), radial-gradient(circle at 25% 75%, #1E2A9C, transparent 60%), #2E3FB8; }
@keyframes soul-drift { to { transform: translate(8%, -6%) rotate(12deg); } }
.soul-card:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: var(--e2); }
.soul-title { font-size: 18px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.soul-sub { margin-top: 2px; font: 10px/1.3 Georgia, "Times New Roman", serif; letter-spacing: 0.08em; text-transform: uppercase; opacity: .8; }
.soul-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font: 13px Georgia, "Times New Roman", serif; opacity: .9; }
.soul-foot .ti { font-size: 20px; opacity: .85; }

/* ---------- 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: 600; 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(--action-solid); color: #fff; }
.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: 600; }
.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: 14px; display: grid; place-items: center; background: linear-gradient(160deg, #FFFFFF, #ECEEF0); box-shadow: var(--e1); }
.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: 24px; 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: 600; 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: 34px; padding: 0 10px; 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: 32px; 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; height: 22px; padding: 0 9px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--tone) 18%, #fff); color: var(--pill-ink);
}
.rc-line1 .rc-state { margin-left: 6px; vertical-align: 1px; }
.rc-row { display: flex; align-items: center; gap: 12px; }
.rc-media { width: 44px; height: 44px; 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: 22px; }
.rc-thumb.square { width: 52px; height: 52px; border-radius: 14px; }
.rc-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-real { opacity: 0; transition: opacity var(--d-medium) var(--ease); }
.loaded > .photo-real { opacity: 1; }
.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 { width: 12px; border-top: 1px solid var(--dashed); flex: none; }
.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: 600; }
.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: 12px; font-size: 13px; line-height: 18px;
  background: color-mix(in srgb, var(--tone) 14%, #fff); color: var(--ink);
}
.rc-foot { font-size: 12px; line-height: 16px; color: var(--gray); }
.rc-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.rc-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-pill);
  background: #fff; color: var(--ink); font: 500 14px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color var(--d-micro) var(--ease), transform var(--d-short) var(--spring);
}
.rc-btn .ti { font-size: 16px; }
.rc-btn:hover { background: #F7F7F8; color: var(--ink); }
.rc-btn:active { transform: scale(.97); }
.rc-btn.primary { background: var(--action-solid); color: #fff; }
.rc-btn.primary:hover { background: var(--action-hover); color: #fff; }

/* 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 dashed var(--dashed); border-radius: 10px;
  background: transparent; 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 { background: rgba(255, 255, 255, .5); border-style: solid; border-color: var(--ink); }
.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: 600; }

/* Email draft */
.rc-subject { font-size: 15px; font-weight: 600; }
.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: 600; 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: 600; 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: 600; 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(--fill); border: 0; border-radius: 16px; }
.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); }
