/* Theme: light by default; dark when the device is dark (unless the person chose Light on the
   Account page, data-theme="light"), or always when they chose Dark (data-theme="dark"). */
:root {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --accent: #b45309; --muted: #57534e; --ground: #fafaf9; --ink: #1c1917; --on-accent: #ffffff;
  --line: color-mix(in srgb, currentColor 25%, transparent); --online: #16a34a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #fbbf24; --muted: #a8a29e; --ground: #1c1917; --ink: #fafaf9; --on-accent: #1c1917; --online: #22c55e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #fbbf24; --muted: #a8a29e; --ground: #1c1917; --ink: #fafaf9; --on-accent: #1c1917; --online: #22c55e;
  color-scheme: dark;
}
html, body { margin: 0; }
html { background: var(--ground); }  /* also inline in base.html's head, so no white shows between pages */
[hidden] { display: none !important; } /* beats display: flex etc. on hidden elements */
body {
  min-height: 100vh; box-sizing: border-box; padding-top: calc(24px + env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--ground); color: var(--ink);
}
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  margin: -1px !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Presence: a green dot on the avatar (in Messages) of whoever has the app open right now */
.presence-dot {
  width: 10px; height: 10px; border-radius: 50%; pointer-events: none;
  background: var(--online); box-shadow: 0 0 0 2px var(--ground); transform: scale(0); transition: transform .25s;
}
.presence-dot.online { transform: scale(1); }
.channel-avatar-wrap { position: relative; display: inline-flex; flex: none; }
.channel-avatar-wrap .presence-dot { position: absolute; right: -1px; bottom: -1px; }

/* Page content */
p { font-size: 1.125rem; opacity: .7; margin: 12px 16px 0; text-align: center; }
.icon { width: 1.25em; height: 1.25em; vertical-align: -.25em; }
h1 { font-size: clamp(2rem, 6vw, 4rem); font-weight: 600; margin: 0 16px; text-align: center; }
figure { margin: 48px 16px 0; max-width: 36rem; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.mark { font-family: var(--serif); font-size: 96px; line-height: .6; height: 40px; color: var(--accent); }
blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.6rem; line-height: 1.45; text-wrap: balance; }
.rule { width: 40px; height: 2px; border-radius: 1px; background: var(--accent); }
figcaption { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.photo { margin: 56px 16px 0; max-width: 22rem; width: calc(100% - 32px); }
.photo img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 12px 32px rgba(28, 25, 23, .18); }

/* Videos */
.video { margin: 56px 16px 64px; width: calc(100% - 32px); max-width: 44rem; display: flex; flex-direction: column; gap: 16px; }
.video label { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.video .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.video input { flex: 1 1 16rem; min-width: 0; padding: 10px 14px; font: inherit; color: inherit; background: transparent; border: 1px solid var(--line); border-radius: 10px; }
.video input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.video button { padding: 10px 20px; font: inherit; font-weight: 600; color: var(--on-accent); background: var(--accent); border: 0; border-radius: 10px; cursor: pointer; }
.video button:disabled { opacity: .5; cursor: default; }
.video .error { margin: 8px 0 0; font-size: .9rem; opacity: 1; text-align: left; color: var(--accent); min-height: 1.3em; }
.player { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 12px 32px rgba(28, 25, 23, .18); }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.videos { display: flex; flex-direction: column; gap: 28px; margin-top: 8px; }
.videos .empty { margin: 0; text-align: left; font-size: 1rem; }
.card { display: flex; flex-direction: column; gap: 10px; }
.card-info { display: flex; flex-direction: column; gap: 6px; }
.thumb { position: relative; width: 100%; height: 100%; padding: 0 !important; border: 0; cursor: pointer; background: #000 !important; border-radius: 0 !important; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; }
.thumb:hover img { opacity: 1; }
.thumb svg { position: absolute; inset: 0; margin: auto; width: 68px; height: 48px; }
.card-meta { display: flex; align-items: flex-start; gap: 12px; }
.card-meta a { flex: 1; min-width: 0; color: inherit; text-decoration: none; font-weight: 500; line-height: 1.4; }
.card-meta a:hover { text-decoration: underline; }
.video .remove, .video .like, .video .notify button {
  padding: 4px 12px; font-size: .85rem; font-weight: 500; color: var(--muted); background: none;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
}
.video .remove:hover { color: var(--accent); }
.video .like { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; }
.video .like svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.video .like[aria-pressed="true"] { color: var(--accent); border-color: currentColor; }
.video .like[aria-pressed="true"] svg { fill: currentColor; }
.card-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: .8rem; text-align: left; }
.card-sub:empty { display: none; }
.added-by { display: inline-flex; align-items: center; gap: 6px; }
.avatar-sm { width: 18px; height: 18px; border-radius: 50%; }
.notify { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.video .notify button { padding: 6px 14px; font-size: .9rem; color: inherit; }
.messages { margin-bottom: 0; }
.message-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.message { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, currentColor 4%, transparent); }
.message.mine { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.message-who, .message-times { font-size: .8rem; color: var(--muted); }
.message-body { font-weight: 500; overflow-wrap: anywhere; }
.message-log .empty { font-size: .9rem; color: var(--muted); }
.message-log-wrap { display: flex; flex-direction: column; gap: 10px; }
.open-messages { align-self: flex-start; font-size: .95rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.open-messages .count { display: inline-block; padding: 1px 8px; border-radius: 9px; background: #dc2626; color: #fff; font-size: .75rem; }

/* Messages page: channels (a row on top on a phone, a list on the left on a wide screen), then the open one */
.channels ul {
  list-style: none; margin: 0 -16px 12px; padding: 4px 16px 8px; display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none; scroll-padding-inline: 16px;
}
.channels ul::-webkit-scrollbar { display: none; }
.channel {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  color: inherit; text-decoration: none; white-space: nowrap; border: 1px solid var(--line);
}
.channel:hover { background: color-mix(in srgb, currentColor 6%, transparent); }
.channel.current { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
/* The open channel stays in view, like in Messenger: pinned to the edge of the row (or list) instead of scrolling away */
.channels li.current { position: sticky; left: 0; right: 0; z-index: 1; border-radius: 999px; background: var(--ground); }
.channel-avatar { width: 28px; height: 28px; flex: none; border-radius: 50%; object-fit: cover; }
.channel-avatar.general {
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--on-accent); background: var(--accent);
}
.channel-avatar.agent-avatar { font-size: .95rem; }
.channel-text { display: flex; flex-direction: column; min-width: 0; }
.channel-name { font-size: .95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.channel-preview, .channel-time { display: none; }
.channel-unread {
  min-width: 20px; padding: 1px 6px; box-sizing: border-box; border-radius: 10px; font-size: .75rem; font-weight: 700;
  text-align: center; color: #fff; background: #dc2626;
}
/* Messages fills the screen above the tab bar and doesn't scroll itself: on a phone the title and the channel row
   stay on top and the conversation scrolls on its own between them and the box; on a wide screen the left column
   (title and channels) and the conversation each scroll on their own */
body.messenger-body { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.page main.messenger-page { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 8px; }
.messenger { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.messenger-side .channels { margin-top: 12px; }
.chat-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-top: 10px; }
.chat-pane .chat-form { flex: none; }
.chat-pane > .error:empty { display: none; }
.channel-title { margin: 0; font-size: 1.3rem; }
.chat-pane .lede { margin-top: 4px; }
@media (min-width: 900px) {
  .page main.messenger-page { max-width: 66rem; }
  .messenger { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 32px; }
  .messenger-side { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .messenger-side .channels { margin-top: 20px; }
  .chat-pane { padding-left: 16px; margin-left: -16px; border-left: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
  .chat-scroll { padding-right: 8px; }
  .channels ul { flex-direction: column; gap: 2px; margin: 0; padding: 0; overflow: visible; }
  .channel { gap: 10px; padding: 8px 10px; border: 0; border-radius: 12px; white-space: normal; }
  .channels li.current { top: 0; bottom: 0; border-radius: 12px; }
  .channel-avatar { width: 40px; height: 40px; }
  .channel-text { flex: 1; }
  .channel-name, .channel-preview { white-space: nowrap; }
  .channel-preview { display: block; font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
  .channel-time { display: block; align-self: flex-start; margin-top: 2px; font-size: .75rem; color: var(--muted); }
  .channel-unread { position: absolute; right: 10px; bottom: 10px; }
  .channel:has(.channel-unread) .channel-preview { padding-right: 28px; color: inherit; font-weight: 600; }
}

/* Messages page: a conversation, newest at the bottom */
/* Laid out like Messenger (messages.arrange): a time line after a pause; one author's messages close together
   with the corners between them tighter; their picture beside the last; yours on the right with no picture; the
   time and details beside a message on hover (below it after a tap on a phone); reactions on the bubble's corner */
.chat-log { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; }
.chat-log .empty { color: var(--muted); }
.chat-log .empty p { margin: 0 0 8px; }
.chat-older { align-self: center; margin-bottom: 8px; }
.chat-break { margin: 18px 0 6px; text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); }
.chat-break:first-child, .chat-older + .chat-break { margin-top: 4px; }
.chat-item { display: flex; flex-direction: column; align-items: flex-start; margin-top: 10px; scroll-margin-top: 96px; }
.chat-item:not(.first) { margin-top: 2px; }
.chat-break + .chat-item { margin-top: 0; }
.chat-item.has-reactions { margin-bottom: 14px; }
.chat-item.mine { align-items: flex-end; }
.chat-sender { margin: 0 0 2px 48px; font-size: .75rem; color: var(--muted); }
.bubble-row { display: flex; align-items: flex-end; gap: 8px; width: 100%; }
.chat-item.mine .bubble-row { flex-direction: row-reverse; }
.chat-avatar-wrap { position: relative; flex: none; width: 28px; height: 28px; }
.chat-avatar { display: block; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.chat-avatar-wrap .presence-dot { position: absolute; right: -1px; bottom: -1px; }
.bubble-wrap { position: relative; flex: none; max-width: min(70ch, 75%); }  /* keeps its size when the time shows beside it */
.chat-item.mine .bubble-wrap { max-width: min(70ch, 80%); }
.bubble {
  position: relative; padding: 8px 12px; border-radius: 18px;
  background: color-mix(in srgb, currentColor 9%, transparent); -webkit-touch-callout: none;
}
.chat-item:not(.mine):not(.last) .bubble { border-bottom-left-radius: 5px; }
.chat-item:not(.mine):not(.first) .bubble { border-top-left-radius: 5px; }
.chat-item.mine .bubble { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.chat-item.mine:not(.last) .bubble { border-bottom-right-radius: 5px; }
.chat-item.mine:not(.first) .bubble { border-top-right-radius: 5px; }
.chat-item.jumbo .bubble { padding: 0 2px; background: none; }
.chat-item.jumbo .chat-body { font-size: 2.6rem; line-height: 1.15; }
/* On a phone a long-press on yours opens its menu (with Copy), so no text selection there; with a mouse, select away */
.bubble[data-mine] { -webkit-user-select: none; user-select: none; }
@media (hover: hover) and (pointer: fine) { .bubble[data-mine] { -webkit-user-select: text; user-select: text; } }
.bubble.editing { width: min(480px, 70vw); cursor: auto; -webkit-user-select: text; user-select: text; }
/* On hover: a React (theirs) or ⋯ (yours) button beside the bubble, and the time; on a phone, long-press and tap */
.bubble-actions { flex: none; align-self: center; visibility: hidden; }
.chat-meta { flex: 0 1 auto; min-width: 0; align-self: center; display: none; margin: 0; font-size: .75rem; color: var(--muted); opacity: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) {
  .chat-item:hover .bubble-actions, .chat-item:focus-within .bubble-actions { visibility: visible; }
  .chat-item:hover .chat-meta { display: block; }
}
@media (hover: none) {
  .bubble-actions { display: none; }
  .bubble-row { flex-wrap: wrap; }
  .chat-item.show-meta .chat-meta { display: block; flex-basis: 100%; margin: 2px 4px 0 36px; }
  .chat-item.mine.show-meta .chat-meta { margin-left: 0; text-align: right; }
}
.bubble-act {
  display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  font: inherit; font-size: 1.1rem; line-height: 1; color: var(--muted); background: none; cursor: pointer;
}
.bubble-act svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bubble-act:hover, .bubble-act:focus-visible { color: var(--ink); background: color-mix(in srgb, currentColor 10%, transparent); }
/* Nora or an agent working on an answer: three dots bouncing in a bubble */
/* It appears a moment after the message went, like someone starting to type (counting time already waited, so a
   refresh of the conversation doesn't start the wait again) */
.chat-working { margin-top: 10px; animation: typing-in .25s ease-out both; animation-delay: calc(1.2s - var(--working-for, 0s)); }
@keyframes typing-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bubble.typing { display: flex; align-items: center; gap: 4px; padding: 12px 14px; }
.bubble.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s ease-in-out infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .15s; }
.bubble.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bubble.typing i { animation: none; opacity: .7; } }
/* Seen: their picture under the newest of yours they've read; "Sent" under your newest until then */
.chat-seen { align-self: flex-end; margin: 3px 2px 0; font-size: .72rem; color: var(--muted); }
.chat-seen img { display: block; width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.chat-edit { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.chat-edit textarea {
  width: 100%; box-sizing: border-box; padding: 8px 10px; font: inherit; font-size: 1rem; line-height: 1.4; color: inherit;
  resize: vertical; background: var(--ground); border: 1px solid var(--line); border-radius: 10px;
}
.chat-edit textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.chat-edit .error { margin: 0; font-size: .85rem; color: var(--accent); text-align: left; opacity: 1; }
.chat-edit .error:empty { display: none; }
.chat-edit-buttons { display: flex; align-items: center; gap: 14px; }
.chat-body { margin: 0; font-size: 1rem; line-height: 1.45; text-align: left; opacity: 1; white-space: pre-line; overflow-wrap: anywhere; }
.chat-body a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.bubble[data-react]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.reactions { position: absolute; right: 6px; bottom: -16px; z-index: 1; display: flex; gap: 2px; }
.chat-item.mine .reactions { right: auto; left: 6px; }
.reactions form { margin: 0; }
.reaction {
  display: inline-flex; align-items: center; gap: 3px; min-height: 22px; padding: 0 6px; border-radius: 999px; font: inherit;
  font-size: .85rem; line-height: 1.2; color: inherit; background: var(--ground); border: 1px solid var(--line); cursor: pointer;
}
.reaction span { font-size: .78rem; color: var(--muted); }
.reaction.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--ground)); }
.reaction-picker {
  position: fixed; z-index: 60; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--ground);
  border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
.reaction-picker[hidden] { display: none; }
.reaction-picker button {
  width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; font-size: 1.45rem; line-height: 1;
  background: none; cursor: pointer; transition: transform .12s;
}
.reaction-picker button:hover, .reaction-picker button:focus-visible { transform: scale(1.18); outline: none; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.reaction-picker button.chosen { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.chat-pushed { margin: 2px 4px 0; font-size: .78rem; color: var(--muted); opacity: 1; }
.chat-item:not(.mine) .chat-pushed, .chat-item:not(.mine) .chat-action { margin-left: 36px; }
.chat-meta .read { color: var(--online); }
.chat-pushed { color: var(--online); }
.chat-action {
  display: flex; flex-direction: column; gap: 8px; max-width: 85%; margin-top: 4px; padding: 10px 12px; border-radius: 12px;
  font-size: .9rem; text-align: left; border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
}
.chat-action.done { margin: 0 4px; padding: 0; border: 0; }
.chat-action.done a { color: var(--online); font-size: .85rem; }
.suggest-buttons { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.suggest-buttons form { margin: 0; }
.button.small { padding: 7px 14px; font-size: .9rem; }
.chat-form { position: relative; display: flex; align-items: flex-end; gap: 8px; }
.mention-menu {
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 50; padding: 4px; border-radius: 12px;
  background: var(--ground); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
.mention-menu[hidden] { display: none; }
.mention-menu button {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px 9px 10px; border: 0; border-radius: 8px; font: inherit;
  font-size: .95rem; font-weight: 600; text-align: left; color: inherit; background: none; cursor: pointer; white-space: nowrap;
}
.mention-menu button span { font-weight: 400; font-size: .85rem; color: var(--muted); }
.mention-menu button.active { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.mention-menu .avatar-sm { width: 24px; height: 24px; flex: none; }
.mention-menu button[hidden] { display: none; }
.mention-menu button > span:not(.agent-avatar) { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
/* An agent's picture: its first letter (agents.py) */
.agent-avatar {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; flex: none;
  font-family: var(--serif); font-weight: 600; font-size: .7em; line-height: 1; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--ground)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
img.agent-avatar { object-fit: cover; border-radius: 50%; padding: 0; }
.agent-avatar.avatar-lg { font-size: 2.6rem; }
.mention-menu .agent-avatar { font-size: .8rem; }
.chat-avatar.agent-avatar { font-size: 1rem; }
.chat-item.agent .bubble { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.agent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.agent-list .account-link .agent-avatar { width: 40px; height: 40px; border-radius: 50%; font-size: 1.2rem; }
.agent-list .hint { overflow-wrap: anywhere; }
.chat-form textarea {
  flex: 1; min-width: 0; max-height: 160px; padding: 9px 14px; font: inherit; font-size: 1rem; line-height: 1.4; color: inherit;
  resize: none; overflow-y: auto; box-sizing: border-box; background: color-mix(in srgb, currentColor 6%, var(--ground));
  border: 1px solid transparent; border-radius: 20px;
}
/* Send: an arrow at the end of the box (Enter sends too where there's a keyboard) */
.chat-send {
  display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0;
  border-radius: 50%; color: var(--accent); background: none; cursor: pointer;
}
.chat-send svg { width: 24px; height: 24px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.chat-send svg path + path { stroke: var(--ground); }
.chat-send:hover, .chat-send:focus-visible { background: color-mix(in srgb, var(--accent) 14%, transparent); }
/* The conversation's header: who it's with, whether they're here, and what it is behind ⓘ */
.channel-head { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 0 10px;
  border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent); }
.channel-head .channel-avatar { width: 40px; height: 40px; }
.channel-head .channel-avatar.agent-avatar { font-size: 1.2rem; }
.channel-head-text { flex: 1; min-width: 0; }
.channel-head .channel-title { font-size: 1.05rem; line-height: 1.25; }
.channel-status { margin: 1px 0 0; font-size: .8rem; color: var(--muted); text-align: left; opacity: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-info summary { display: flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%;
  list-style: none; cursor: pointer; color: var(--muted); }
.channel-info summary::-webkit-details-marker { display: none; }
.channel-info summary:hover, .channel-info[open] summary { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.channel-info svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.channel-about { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; width: min(360px, 90vw); box-sizing: border-box;
  margin: 0; padding: 12px 14px; font-size: .88rem; line-height: 1.5; text-align: left; opacity: 1; border-radius: 12px;
  background: var(--ground); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.chat-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.chat-form { flex-wrap: wrap; }
.chat-attach {
  display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  color: var(--accent); border: 0; cursor: pointer;
}
.chat-attach:hover, .chat-attach:focus-within { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.chat-attach svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-attachment { position: relative; flex-basis: 100%; display: flex; }
.chat-attachment[hidden] { display: none; }
.chat-attachment-frame { position: relative; }
.chat-attachment img { display: block; max-width: 160px; max-height: 120px; border-radius: 10px; border: 1px solid var(--line); }
.chat-attachment-remove {
  position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%;
  font: inherit; font-size: 1.1rem; line-height: 1; color: #fff; background: rgba(0, 0, 0, .65); cursor: pointer;
}
.chat-image { display: block; margin: -2px 0 6px; }
.chat-image img { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; }
.chat-body:empty { display: none; }
.chat-voice { margin: -2px 0 6px; }
.chat-voice audio { display: block; width: 260px; max-width: 100%; height: 40px; }
.chat-voice-label { margin: 4px 0 0; font-size: .78rem; color: var(--muted); text-align: left; opacity: 1; }
.chat-mic { background: none; font: inherit; padding: 0; }
.chat-mic[hidden] { display: none; }
.chat-mic.recording { color: #dc2626; border-color: #dc2626; }
.voice-bar {
  order: -1; flex-basis: 100%; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, #dc2626 50%, transparent); background: color-mix(in srgb, #dc2626 6%, transparent);
}
.voice-bar[hidden] { display: none; }
.voice-status { display: flex; align-items: center; gap: 10px; font-size: .95rem; font-variant-numeric: tabular-nums; }
.voice-dot { width: 10px; height: 10px; border-radius: 50%; background: #dc2626; animation: voice-pulse 1.2s ease-in-out infinite; }
@keyframes voice-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .voice-dot { animation: none; } }
.voice-lang {
  margin-left: auto; padding: 4px 8px; font: inherit; font-size: .85rem; color: inherit;
  background: var(--ground); border: 1px solid var(--line); border-radius: 8px;
}
.voice-lang[hidden] { display: none; }
.voice-transcript { margin: 0; min-height: 1.3em; font-size: .95rem; text-align: left; opacity: 1; color: var(--muted); overflow-wrap: anywhere; }
.voice-transcript:empty { display: none; }
.voice-buttons { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.chat > .error { margin: 8px 0 0; min-height: 1.3em; font-size: .9rem; opacity: 1; text-align: left; color: var(--accent); }
.message-menu {
  position: fixed; z-index: 60; padding: 4px; border-radius: 12px; background: var(--ground);
  border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
.message-menu button {
  display: block; width: 100%; padding: 10px 14px; border: 0; border-radius: 8px; font: inherit; font-size: .95rem;
  text-align: left; color: inherit; background: none; cursor: pointer; white-space: nowrap;
}
.message-menu button:hover, .message-menu button:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); outline: none; }
.message-menu button[hidden] { display: none; }
.message-menu button.danger { color: #dc2626; }
.account { margin: 0 16px 48px; font-size: .85rem; color: var(--muted); }
.account button { padding: 0; font: inherit; color: inherit; background: none; border: 0; text-decoration: underline; cursor: pointer; }

/* Login */
.login-page { padding: 24px 16px; }
.login { width: 100%; max-width: 20rem; display: flex; flex-direction: column; gap: 14px; }
.login .logo { width: 64px; height: 64px; border-radius: 16px; align-self: center; }
.login h1 { margin: 4px 0 10px; font-size: 1.75rem; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.login input {
  padding: 12px 14px; font: inherit; font-size: 1rem; letter-spacing: normal; text-transform: none; color: inherit;
  background: color-mix(in srgb, var(--ground) 90%, var(--ink)); border: 1px solid var(--line); border-radius: 10px;
}
.login input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.login button { margin-top: 6px; padding: 12px 20px; font: inherit; font-weight: 600; color: var(--on-accent); background: var(--accent); border: 0; border-radius: 10px; cursor: pointer; }
.login .error { margin: 0; min-height: 1.3em; font-size: .9rem; opacity: 1; color: var(--accent); }

/* Launch screen: the K draws itself, fills, an underline sweeps; then it fades out */
.splash {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: #1c1917; transition: opacity 1s ease, visibility 1s;
}
.splash svg { width: 132px; height: 132px; overflow: visible; transition: transform 1s ease; }
.splash .k {
  fill: #fbbf24; fill-opacity: 0; stroke: #fbbf24; stroke-width: 6; stroke-linejoin: round;
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: k-draw .9s cubic-bezier(.6, 0, .3, 1) forwards, k-fill .35s ease .75s forwards;
}
.splash .bar-track { fill: #fbbf24; opacity: .18; }
.splash .bar {
  fill: #fbbf24; transform-box: fill-box; transform-origin: left; transform: scaleX(0);
  animation: bar-in .5s ease .85s forwards, bar-sweep 1.4s ease-in-out 1.35s infinite;
}
.splash .glow { fill: #fbbf24; opacity: 0; filter: blur(28px); animation: glow 1.2s ease .8s forwards; }
.splash.done { opacity: 0; visibility: hidden; }
.splash.done svg { transform: scale(1.12); }
@keyframes k-draw { to { stroke-dashoffset: 0; } }
@keyframes k-fill { to { fill-opacity: 1; stroke-width: 0; } }
@keyframes bar-in { to { transform: scaleX(1); } }
@keyframes bar-sweep { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.35); opacity: .6; } }
@keyframes glow { to { opacity: .22; } }
@media (prefers-reduced-motion: reduce) {
  .splash .k, .splash .bar, .splash .glow { animation: none; stroke-dashoffset: 0; fill-opacity: 1; transform: none; }
}

/* Bottom navigation: always visible in the app */
body[data-live] { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: center; gap: 2px;
  padding: 8px max(4px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}
/* Tabs share the width equally (up to 88px each), so six fit on a 360px phone; the label shrinks a little on narrow screens */
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1 1 0; min-width: 0; max-width: 88px; padding: 6px 1px;
  font-size: clamp(.625rem, 3vw, .75rem); font-weight: 500; color: var(--muted); text-decoration: none; border-radius: 12px;
}
.tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button { font-family: inherit; line-height: inherit; border: 0; background: none; cursor: pointer; }
.tabbar button:hover, .tabbar button:focus-visible { color: var(--accent); }
.tabbar a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* Content pages (updates, account): start at the top, readable width */
body.page { justify-content: flex-start; }
.page main { width: calc(100% - 32px); max-width: 40rem; margin: 0 16px 32px; }
.page h1 { text-align: left; margin: 0; font-size: clamp(1.8rem, 5vw, 2.6rem); }
.page .lede { text-align: left; margin: 8px 0 24px; font-size: 1rem; }
.update-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
.update-list li { border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
.update-list a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 4px;
  color: inherit; text-decoration: none;
}
.update-list a:hover .update-title { text-decoration: underline; }
.update-title { font-weight: 500; line-height: 1.4; }
.update-list time { flex: none; font-size: .85rem; color: var(--muted); }
.update-list .empty { padding: 14px 4px; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 16px; font-size: .9rem; color: var(--muted); text-decoration: none; }
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { color: var(--accent); }
.update-detail .when { display: block; margin-top: 6px; font-size: .9rem; color: var(--muted); }
.update-detail .description { margin: 20px 0 0; font-size: 1.05rem; line-height: 1.6; white-space: pre-line; }
.update-detail h2 { margin: 32px 0 12px; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.stats div { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, currentColor 5%, transparent); }
.stats dt { font-size: .8rem; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Account */
.account-page .notice { margin: 0 0 20px; padding: 10px 14px; border-radius: 10px; text-align: left; font-size: .95rem; opacity: 1;
  background: color-mix(in srgb, var(--online) 14%, transparent); }
.panel { margin: 0 0 28px; padding: 18px; border-radius: 16px; background: color-mix(in srgb, currentColor 4%, transparent); }
.panel h2 { margin: 0 0 14px; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
/* Account: the link to Updates, a panel you tap */
.account-link { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.account-link > span:first-child { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.account-link-title { font-weight: 600; }
.account-link .count { padding: 1px 8px; border-radius: 9px; background: #dc2626; color: #fff; font-size: .75rem; font-weight: 600; }
.account-link .count[hidden] { display: none; }
.account-link > [aria-hidden] { color: var(--accent); font-weight: 600; }
/* Account: server stats (only for Mattias) */
.server-meter + .server-meter { margin-top: 12px; }
.server-meter-head { display: flex; justify-content: space-between; font-size: .95rem; font-variant-numeric: tabular-nums; }
.server-meter-track { height: 8px; margin-top: 4px; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, currentColor 12%, transparent); }
.server-meter-fill { height: 100%; border-radius: inherit; background: var(--online); transition: width .4s ease; }
.server-meter.warn .server-meter-fill { background: var(--accent); }
.server-meter.high .server-meter-fill { background: #dc2626; }
.server-stats .hint { margin: 4px 0 0; }
.server-stats .hint.uptime { margin-top: 14px; }
.avatar-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 6px 18px rgba(28, 25, 23, .15); }
.avatar-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.avatar-actions form { margin: 0; }
.hint { margin: 0; font-size: .8rem; text-align: left; }
.button {
  display: inline-block; padding: 10px 18px; font: inherit; font-weight: 600; color: var(--on-accent); background: var(--accent);
  border: 0; border-radius: 10px; cursor: pointer; letter-spacing: normal; text-transform: none;
}
.button:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.link { padding: 0; font: inherit; font-size: .9rem; color: var(--muted); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 6px; width: 100%; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stack input {
  padding: 12px 14px; font: inherit; font-size: 1rem; letter-spacing: normal; text-transform: none; color: inherit;
  background: var(--ground); border: 1px solid var(--line); border-radius: 10px;
}
.stack input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.panel .error { margin: 10px 0 0; font-size: .9rem; opacity: 1; text-align: left; color: var(--accent); }
.stack .error { margin: 0; }
.logout { display: block; margin: 0 auto; }

/* Updates tab badge and the "new version" banner */
.tab-icon { position: relative; display: block; width: 24px; height: 24px; }
.badge {
  position: absolute; top: -5px; left: 15px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; background: #dc2626; color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--ground);
}
.badge:empty { min-width: 10px; width: 10px; height: 10px; padding: 0; top: -2px; left: 17px; }
.reload-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 0 0 20px; padding: 12px 14px; border-radius: 12px; font-size: .95rem;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.reload-banner .button { padding: 8px 16px; }

/* Finance */
.finance form label, .bill-form label {
  display: flex; flex-direction: column; gap: 6px; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.finance input, .bill-form input {
  padding: 10px 12px; font: inherit; font-size: 1rem; letter-spacing: normal; text-transform: none; color: inherit;
  background: var(--ground); border: 1px solid var(--line); border-radius: 10px; min-width: 0;
}
.finance input:focus, .bill-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.upload-bill { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.upload-bill label { flex: 1 1 10rem; }
.upload-bill input[type="file"] { padding: 8px; font-size: .9rem; }
.finance .hint { margin-top: 12px; }
.finance .error, .bill-page > .error { margin: 12px 0 0; font-size: .9rem; opacity: 1; text-align: left; color: var(--accent); }
.empty-state { text-align: left; font-size: 1rem; }
.headline { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; text-align: left; opacity: 1; }
.headline-value { font-size: 1.8rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.headline-label { font-size: .85rem; color: var(--muted); }
.bar-chart { width: 100%; height: auto; display: block; overflow: visible; }
.bar-chart .axis { stroke: color-mix(in srgb, currentColor 25%, transparent); stroke-width: 1; }
.bar-chart .bar { fill: color-mix(in srgb, var(--accent) 55%, var(--ground)); }
.bar-chart .bar.current { fill: var(--accent); }
.bar-chart .hit { fill: transparent; }
.bar-chart .bar-slot:hover .bar { fill: var(--accent); }
.bar-chart .tick { font-size: 9px; fill: var(--muted); }
.bar-chart .value-label { font-size: 8.5px; font-weight: 500; fill: var(--muted); }
.bar-chart .value-label.current { font-weight: 700; fill: var(--ink); }
.lines-table { width: 100%; border-collapse: collapse; font-size: .92rem; table-layout: auto; }
.lines-table tbody th { overflow-wrap: anywhere; }
.lines-table th, .lines-table td { padding: 10px 4px; text-align: left; vertical-align: middle; border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent); }
.lines-table thead th { font-size: .75rem; font-weight: 600; color: var(--muted); }
.lines-table tbody th { font-weight: 500; }
.lines-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines-table .change { color: var(--muted); font-size: .85rem; }
.sub { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); }
.bill-list { list-style: none; margin: 0; padding: 0; }
.bill-list li { border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent); }
.bill-list li:last-child { border-bottom: 0; }
.bill-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; color: inherit; text-decoration: none; }
.bill-list a:hover .bill-name { text-decoration: underline; }
.bill-list .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bill-page .lede a { color: var(--accent); }
.bill-page .notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; text-align: left; font-size: .95rem; opacity: 1;
  background: color-mix(in srgb, var(--online) 14%, transparent); }
.bill-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 12px; margin-bottom: 18px; }
.bill-form h2 { margin-top: 4px; }
.line-rows { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.line-row { display: grid; grid-template-columns: 1fr 6.5rem 2.5rem; gap: 8px; }
.line-row input[name="line_amount"] { text-align: right; font-variant-numeric: tabular-nums; }
.remove-line { font: inherit; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.remove-line:hover { color: var(--accent); }
.form-actions { margin-top: 18px; }
.delete-bill { margin: 0 0 24px; }

.check { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; text-align: left; font-size: .95rem; opacity: 1; }
.check.ok { background: color-mix(in srgb, var(--online) 14%, transparent); }
.check.off { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.change-value { display: inline-flex; align-items: center; gap: 4px; }
.change-value .trend { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.change-value.up, .change-value.down { color: var(--ink); font-weight: 600; }

/* Bill upload: a styled file picker (the native one overflows on iPhone and doesn't match) */
.upload-bill label { min-width: 0; }
.upload-bill input, .bill-form input { width: 100%; box-sizing: border-box; }
input[type="month"] { text-align: left; -webkit-appearance: none; appearance: none; min-height: 2.9em; }
input[type="month"]::-webkit-date-and-time-value { text-align: left; }
.file-pick { cursor: pointer; }
.file-box {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; box-sizing: border-box;
  font-size: 1rem; letter-spacing: normal; text-transform: none; color: var(--ink);
  background: var(--ground); border: 1px dashed color-mix(in srgb, currentColor 35%, transparent); border-radius: 10px;
}
.file-box svg { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.file-pick.chosen .file-box { border-style: solid; }
.file-pick.chosen .file-name { color: var(--ink); }
.file-pick:focus-within .file-box { outline: 2px solid var(--accent); outline-offset: 1px; }
.file-pick:hover .file-box { border-color: var(--accent); }

/* Appearance: System / Light / Dark */
.theme-form { margin: 0 0 8px; }
.segmented { display: inline-flex; gap: 2px; margin: 0; padding: 3px; border: 0; border-radius: 12px;
  background: color-mix(in srgb, currentColor 8%, transparent); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 8px 18px; border-radius: 9px; font-size: .95rem; font-weight: 500; color: var(--muted); }
.segmented input:checked + span { background: var(--ground); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Tasks */
.task-form { display: flex; flex-direction: column; gap: 12px; }
.task-form label, .inline-form label {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.task-form input, .task-form select, .task-form textarea, .inline-form input {
  width: 100%; box-sizing: border-box; min-width: 0; padding: 10px 12px; font: inherit; font-size: 1rem; letter-spacing: normal; text-transform: none;
  color: inherit; background: var(--ground); border: 1px solid var(--line); border-radius: 10px;
}
.task-form textarea { resize: vertical; line-height: 1.45; }
.task-form select { -webkit-appearance: none; appearance: none; padding-right: 34px;
  background: var(--ground) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 18px; }
input[type="date"] { -webkit-appearance: none; appearance: none; min-height: 2.9em; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.task-form :focus, .inline-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.task-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 12px; }
.task-form .form-actions { margin-top: 2px; }
.tasks .hint { margin-top: 12px; }
.tasks .error, .task-page > .error { margin: 12px 0 0; font-size: .9rem; opacity: 1; text-align: left; color: var(--accent); }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }

.project { scroll-margin-top: 16px; }
.project-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 6px; }
.panel h2.project-name {
  display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0;
  font-size: 1.1rem; letter-spacing: normal; text-transform: none; color: var(--ink);
}
.project-name span { overflow-wrap: anywhere; }
.project-name .avatar-sm { width: 22px; height: 22px; flex: none; }
.project-thumb {
  width: 32px; height: 32px; flex: none; border-radius: 8px; object-fit: cover; display: inline-flex;
  align-items: center; justify-content: center; box-sizing: border-box;
}
.project-thumb.placeholder {
  font-family: var(--serif); font-size: 1rem; font-weight: 600; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.project-thumb.large { width: 96px; height: 96px; border-radius: 18px; font-size: 2.6rem; }
img.project-thumb.large { box-shadow: 0 6px 18px rgba(28, 25, 23, .15); }
.new-project-form { display: flex; flex-direction: column; gap: 10px; }
.thumb-pick { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
.thumb-pick input[type="file"] { font-size: .85rem; max-width: 100%; color: var(--ink); }
.thumb-pick .optional { font-size: .8rem; }
.task-form .optional { letter-spacing: normal; text-transform: none; }
.project-more summary { font-size: .9rem; color: var(--muted); cursor: pointer; }
.project-more .task-form { margin-top: 10px; }
.project-about { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; text-align: left; }
.project-url { align-self: flex-start; max-width: 100%; font-size: .85rem; color: var(--accent); overflow-wrap: anywhere; }
.project-description {
  margin: 0; font-size: .9rem; line-height: 1.45; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere;
}
.shared-icon { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }
.project-questions-link { display: inline-block; margin: 0 0 8px; font-size: .85rem; color: var(--muted); text-decoration: none; }
.project-questions-link.open { color: var(--accent); font-weight: 500; }
.project-questions-link:hover { text-decoration: underline; }
/* Nora's questions about a project, each with its answer field */
.question-list { list-style: none; margin: 0; padding: 0; }
.panel.question { margin: 0 0 14px; }
.task-form label.question-text { font-size: 1rem; font-weight: 500; line-height: 1.45; letter-spacing: normal; text-transform: none; color: var(--ink); overflow-wrap: anywhere; }
.question.answered .question-text { color: var(--muted); }
.question-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.question-meta { font-size: .82rem; color: var(--muted); }
.questions-status { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: .95rem; text-align: left; color: var(--muted); }
.questions-spinner { width: 16px; height: 16px; flex: none; border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent); border-radius: 50%; animation: questions-spin .9s linear infinite; }
@keyframes questions-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .questions-spinner { animation: none; } }
.questions-again { margin: 4px 0 24px; text-align: left; }
.project-actions { display: flex; gap: 6px; flex: none; }
.chip-link {
  padding: 4px 10px; font-size: .85rem; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent); border-radius: 999px;
}
.chip-link:hover { color: var(--accent); border-color: currentColor; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent); }
.task:last-child { border-bottom: 0; }
.tick-form { margin: 0; flex: none; }
.tick {
  display: grid; place-items: center; width: 26px; height: 26px; margin: 0; padding: 0; box-sizing: border-box; flex: none;
  color: transparent; background: none; border: 2px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 50%;
}
button.tick { cursor: pointer; color: transparent; border-color: color-mix(in srgb, var(--ink) 35%, transparent); }
span.tick { border-color: color-mix(in srgb, var(--ink) 18%, transparent); }
button.tick:hover { border-color: var(--accent); color: color-mix(in srgb, var(--accent) 50%, transparent); }
button.tick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.is-done .tick { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.is-done span.tick { background: color-mix(in srgb, var(--ink) 30%, transparent); border-color: transparent; color: var(--ground); }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 2px; color: inherit; text-decoration: none; }
.task-title { font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.task-main:hover .task-title { text-decoration: underline; }
.is-done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 50%, transparent); }
.task-meta { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .82rem; color: var(--muted); }
.task-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.due { flex: none; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap;
  color: var(--muted); background: color-mix(in srgb, currentColor 10%, transparent); }
.due.week { color: var(--ink); }
.due.soon, .due.today { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.due.overdue { color: #fff; background: #dc2626; }
.task-empty { margin: 6px 0 2px; font-size: .95rem; text-align: left; }
.done-tasks { margin-top: 6px; }
.done-tasks summary { padding: 6px 0; font-size: .85rem; color: var(--muted); cursor: pointer; }
.shopping-add { margin: 2px 0 6px; }
.shopping-clear { margin: 4px 0 2px; text-align: left; }
.shopping-clear button { padding: 4px 0; font: inherit; font-size: .85rem; color: var(--accent); background: none; border: 0; cursor: pointer; }
.shopping-clear button:hover { text-decoration: underline; }
.task-page .lede .due { vertical-align: 1px; }
.task-page .notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; text-align: left; font-size: .95rem; opacity: 1;
  background: color-mix(in srgb, var(--online) 14%, transparent); }
.task-actions { display: flex; gap: 20px; flex-wrap: wrap; margin: 0 0 24px; }
.task-actions form { margin: 0; }
.task-description { white-space: pre-line; line-height: 1.55; }

/* Diary */
.portrait-link {
  display: flex; align-items: center; gap: 14px; margin: 0 0 24px; padding: 14px 16px; border-radius: 16px;
  color: inherit; text-decoration: none; background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.portrait-link svg { flex: none; width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portrait-link > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.portrait-link .chevron { width: 20px; height: 20px; stroke: var(--muted); }
.portrait-link:hover strong { text-decoration: underline; }
.diary-form textarea { min-height: 9rem; }
.diary .notice, .diary-entry-page .notice { margin: 0 0 20px; padding: 10px 14px; border-radius: 10px; text-align: left; font-size: .95rem; opacity: 1;
  background: color-mix(in srgb, var(--online) 14%, transparent); }
.diary .error, .diary-entry-page > .error { margin: 12px 0 0; font-size: .9rem; opacity: 1; text-align: left; color: var(--accent); }
.diary #write .hint { margin-top: 12px; }
.diary > .error { margin: 0 0 20px; }
.filing-status {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  margin: 0 0 20px; padding: 12px 14px; border-radius: 12px; font-size: .92rem;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.filing-status form { margin: 0; }
.chip-button {
  padding: 6px 14px; font: inherit; font-size: .88rem; font-weight: 600; color: var(--accent); cursor: pointer;
  background: transparent; border: 1px solid currentColor; border-radius: 999px;
}
.chip-button:hover { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.theme-filter { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 20px; padding-bottom: 4px; scrollbar-width: none; }
.theme-filter a {
  flex: none; padding: 5px 12px; font-size: .85rem; font-weight: 500; color: var(--muted); text-decoration: none;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent); border-radius: 999px;
}
.theme-filter a[aria-current] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
#entries { scroll-margin-top: 16px; }
.diary-day { margin: 0 0 28px; scroll-margin-top: 16px; }
.diary-day h2 { margin: 0 0 10px; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.diary-entry { padding: 16px 0; border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent); scroll-margin-top: 16px; }
.diary-body { white-space: pre-line; line-height: 1.6; overflow-wrap: anywhere; }
.diary-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 10px 0 0; font-size: .82rem; color: var(--muted); text-align: left; }
.diary-meta .edit { margin-left: auto; color: var(--muted); }
.diary-meta .edit:hover { color: var(--accent); }
.theme {
  padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; text-decoration: none;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.theme:hover { text-decoration: underline; }
.status-waiting { padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: color-mix(in srgb, currentColor 10%, transparent); }
.note-path code { font-size: .78rem; }
.claude-version { margin-top: 10px; padding: 0 14px; border-radius: 12px; background: color-mix(in srgb, currentColor 4%, transparent); }
.claude-version summary { padding: 10px 0; font-size: .88rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.claude-version[open] { padding-bottom: 14px; }
.diary-entry-page .panel .diary-meta { margin-top: 14px; }
.portrait .prose { line-height: 1.65; overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3 { margin: 1.6em 0 .5em; line-height: 1.3; text-align: left; }
.prose h1 { font-size: 1.5rem; }
.prose h2 { font-size: 1.2rem; }
.prose h3 { font-size: 1.05rem; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1em; text-align: left; font-size: 1rem; opacity: 1; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .25em 0; }
.prose a { color: var(--accent); }
.prose blockquote { padding: 2px 0 2px 14px; border-left: 3px solid var(--accent); color: var(--muted);
  font-family: inherit; font-style: normal; line-height: inherit; }
.prose blockquote p { margin: 0; }
.prose code { font-size: .9em; }

/* Confirm dialog (app.js askToConfirm) */
.confirm-dialog {
  width: min(22rem, calc(100% - 32px)); box-sizing: border-box; padding: 0; border: 0; border-radius: 18px;
  color: var(--ink); background: var(--ground); box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
.confirm-dialog::backdrop { background: rgba(28, 25, 23, .45); }
.confirm-dialog form { padding: 22px 20px 18px; }
.confirm-dialog h2 { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.35; text-align: left; }
.confirm-dialog p { margin: 8px 0 0; font-size: .95rem; line-height: 1.45; opacity: 1; text-align: left; color: var(--muted); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.button.secondary { color: var(--ink); background: color-mix(in srgb, var(--ink) 9%, transparent); }
.button.danger { color: #fff; background: #dc2626; }
.button.secondary:focus-visible, .button.danger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.announcement-dialog { width: min(24rem, calc(100% - 32px)); border: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.announcement-dialog h2 { margin-top: 4px; }
.announcement-dialog p { margin-top: 14px; }
.announcement-dialog p + p { margin-top: 14px; }
.announcement-dialog .confirm-actions { margin-top: 32px; }
.announcement-dialog .confirm-actions .button { white-space: nowrap; }
.announcement-dialog p strong { color: var(--accent); font-weight: 600; }
/* Command palette (Ctrl+K, ⌘K or the Search tab) and its Message Nora box */
.palette-list svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.palette {
  width: min(30rem, calc(100% - 24px)); box-sizing: border-box; margin: max(12vh, 16px) auto auto; padding: 8px;
  border: 2px solid var(--accent); /* the buttons' colour */ border-radius: 18px; color: var(--ink); background: var(--ground);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
.palette::backdrop { background: rgba(28, 25, 23, .45); }
.palette input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; font: inherit; font-size: 1rem; color: inherit;
  background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; outline: none;
}
.palette-list { max-height: min(55vh, 24rem); overflow-y: auto; margin: 6px 0 0; padding: 0; list-style: none; }
.palette-list [role=option] {
  display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; min-height: 44px; padding: 8px 12px;
  border: 0; border-radius: 10px; font: inherit; font-size: .95rem; text-align: left; color: inherit; background: none;
  text-decoration: none; cursor: pointer;
}
.palette-list [role=option].active { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.palette-list .avatar-sm { width: 24px; height: 24px; flex: none; }
.palette-label { font-weight: 600; flex: none; }
.palette-hint { min-width: 0; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; color: var(--muted); }
.palette-nora-row { position: relative; }
.palette-nora-row.switchable [role=option] { padding-right: 68px; }  /* room for ← → */
.palette-target { display: flex; align-items: center; gap: 10px; flex: none; min-width: 0; }
.palette-target[hidden] { display: none; }
.palette-switch { position: absolute; top: 0; right: 4px; bottom: 0; display: flex; align-items: center; }
.palette-switch button {
  width: 30px; height: 100%; padding: 0; border: 0; font: inherit; font-size: 1.05rem; line-height: 1;
  color: var(--muted); background: none; cursor: pointer;
}
.palette-switch button:hover { color: var(--accent); }
.palette-keys { margin: 6px 12px 4px; font-size: .78rem; color: var(--muted); text-align: left; opacity: 1; }
@media (hover: none) { .palette-keys { display: none; } }
.nora-dialog { width: min(26rem, calc(100% - 24px)); }
.nora-dialog h2 { display: flex; align-items: center; gap: 10px; }
.nora-dialog h2 .avatar-sm { width: 28px; height: 28px; flex: none; }
.nora-switch { display: flex; align-items: center; gap: 6px; }
.nora-switch h2 { flex: 1; min-width: 0; margin: 0; }
.nora-target { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.nora-target[hidden], .nora-arrow[hidden] { display: none; }
.nora-arrow {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line);
  border-radius: 50%; color: inherit; background: none; cursor: pointer;
}
.nora-arrow:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.nora-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nora-switch + input + p { margin-top: 12px; }
.nora-field { position: relative; margin-top: 14px; }
.nora-field textarea {
  display: block; width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; font-size: 1rem; line-height: 1.4;
  color: inherit; resize: vertical; background: var(--ground); border: 1px solid var(--line); border-radius: 12px;
}
.nora-field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.nora-field .mention-menu { top: calc(100% + 6px); bottom: auto; }
.nora-attachment { margin-top: 14px; }
.nora-attach { margin-right: auto; }  /* the picture button on the left, Cancel and Send on the right */
.nora-dialog .error { min-height: 1.3em; color: var(--accent); }
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 60; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 10px 16px; border-radius: 12px; font-size: .92rem;
  color: var(--ground); background: var(--ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.toast[hidden] { display: none; }
/* The voice announcement's try-it (announcements/voice.html, app.js): the button is the control, the microphone above
   only shows the state (data-state on .announcement-try). */
.announcement-try { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 32px; }
.announcement-mic { position: relative; width: 72px; height: 72px; padding: 18px; border-radius: 50%; box-sizing: border-box;
  background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--muted); transition: background .3s, color .3s; }
.announcement-mic svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.announcement-mic::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid transparent; }
.announcement-try[data-state="starting"] .announcement-mic { background: color-mix(in srgb, var(--accent) 40%, transparent); color: #1c1917; }
.announcement-try[data-state="listening"] .announcement-mic { background: var(--accent); color: #1c1917;
  animation: announcement-listening 1.8s ease-in-out infinite; }
@keyframes announcement-listening {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.announcement-try[data-state="thinking"] .announcement-mic { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--ink); }
.announcement-try[data-state="thinking"] .announcement-mic::after { border-color: var(--accent) transparent transparent transparent;
  animation: announcement-thinking 1s linear infinite; }
@keyframes announcement-thinking { to { transform: rotate(360deg); } }
.announcement-try[data-state="speaking"] .announcement-mic { background: var(--accent); color: #1c1917;
  animation: announcement-talk .9s ease-in-out infinite; }
@keyframes announcement-talk { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .announcement-try .announcement-mic, .announcement-try .announcement-mic::after { animation-duration: 4s; } }
.announcement-mic-label { margin: 4px 0 0 !important; color: var(--muted); font-size: .85rem; text-align: center !important; }
.announcement-heard { margin: 0 !important; min-height: 1.4em; text-align: center !important; color: var(--ink) !important; }
.announcement-talk { min-width: 9rem; margin-top: 8px; }
.announcement-avatar { display: block; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 50%; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
  .confirm-dialog[open] { animation: confirm-in .16s ease-out; }
  @keyframes confirm-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
}

/* Diary: Claude's filing runs, with time and usage */
.diary-runs { margin-top: 8px; }
.run-list { list-style: none; margin: 0; padding: 0; }
.run-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent); }
.run-list li:last-child { border-bottom: 0; }
.run-when { font-weight: 500; }
.run-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: .82rem; color: var(--muted);
  font-variant-numeric: tabular-nums; text-align: right; }
.run-stats strong { color: var(--ink); font-size: .95rem; }
.run-stats-grid { margin-top: 16px; }
.run-stats-grid + .hint { margin-top: 10px; }
@media (max-width: 420px) { .run-stats { align-items: flex-start; text-align: left; } }

/* Loading bar on top during navigation (app.js). It moves with transform, which browsers keep
   animating while they wait for the next page (a width animation stalls there). */
.nav-progress {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; z-index: 200; width: 100%; height: 3px;
  background: var(--accent); border-radius: 0 2px 2px 0; opacity: 0; pointer-events: none;
  transform: scaleX(0); transform-origin: left center; will-change: transform, opacity;
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}
.nav-progress.loading { opacity: 1; animation: nav-creep 15s linear forwards; }
/* 10 % at once, then a steady creep that slows down towards 90 % */
@keyframes nav-creep {
  0% { transform: scaleX(0); animation-timing-function: ease-out; }
  1.5% { transform: scaleX(.1); animation-timing-function: cubic-bezier(.2, .6, .35, 1); }
  100% { transform: scaleX(.9); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-progress.loading { animation: none; transform: scaleX(1); opacity: .7; }
}

/* Moving between pages: no view transition. The browser keeps the old page until the new one is painted, then
   swaps at once; a cross-fade showed both pages at half strength for a moment, which read as a light flash. */

/* Kama app wishlist: Claude's status on each wish */
.project-hint { margin: 0 0 6px; font-size: .85rem; text-align: left; }
.wish-status { flex: none; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap;
  color: var(--muted); background: color-mix(in srgb, currentColor 10%, transparent); }
.wish-status.working { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.wish-status.done { color: var(--online); background: color-mix(in srgb, var(--online) 14%, transparent); }
.wish-status.declined, .wish-status.failed { color: #fff; background: #dc2626; }
.wish-line { margin: 0; text-align: left; font-size: .95rem; opacity: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wish-line a { color: var(--accent); }
.wish-note { margin-top: 12px; white-space: pre-line; line-height: 1.55; }
.wish-panel .hint { margin-top: 10px; }

/* Messages: whether Claude has read each one (_ai_status.html) */
.ai-status { display: inline-flex; vertical-align: -3px; margin-left: 4px; }
.ai-status svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.ai-status.done { color: var(--accent); }
.ai-status.done svg { fill: currentColor; }
.ai-status.pending { color: var(--muted); }
.ai-status.pending svg { fill: none; }
.ai-status.pending:not(.off) svg { animation: ai-wait 1.4s ease-in-out infinite; }
.ai-status.off { opacity: .45; }
@keyframes ai-wait { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ai-status.pending svg { animation: none; } }

/* No long-press previews or callouts on links and images (the app's own menus only); text fields keep theirs */
body[data-live] { -webkit-touch-callout: none; }
body[data-live] input, body[data-live] textarea { -webkit-touch-callout: default; }

/* Claude's messages (wishlist news): on the left, tinted, with a link */
.chat-item.claude .bubble { background: color-mix(in srgb, var(--online) 12%, transparent); }
.chat-link { display: inline-block; margin-top: 6px; font-size: .9rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.chat-link:hover { text-decoration: underline; }
.claude-name { font-weight: 600; color: var(--ink); }

/* The progress bar on Nora's messages about a wish she's developing: keeps filling between refreshes */
.wish-progress { width: min(240px, 100%); margin-top: 8px; }
.wish-progress-track { height: 8px; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, currentColor 12%, transparent); }
.wish-progress-fill {
  height: 100%; width: var(--to); border-radius: inherit; background: var(--online);
  animation: wish-fill var(--seconds) linear both;
}
@keyframes wish-fill { from { width: var(--from); } to { width: var(--to); } }
@media (prefers-reduced-motion: reduce) { .wish-progress-fill { animation: none; width: var(--from); } }
.wish-progress-label { margin: 4px 0 0; font-size: .78rem; color: var(--muted); text-align: left; opacity: 1; }

.message-who { display: inline-flex; align-items: center; gap: 6px; }

/* Nora's questions and failure reports: answer or retry right under her message */
.wish-answer, .wish-retry { margin-top: 10px; }
.wish-answer summary { list-style: none; display: inline-block; cursor: pointer; }
.wish-answer summary::-webkit-details-marker { display: none; }
.wish-answer[open] summary { display: none; }
.wish-answer form { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.wish-answer textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; font-size: 1rem; line-height: 1.45; color: inherit;
  background: var(--ground); border: 1px solid var(--line); border-radius: 10px; resize: vertical;
}
.wish-answer textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.wish-resolved { margin: 8px 0 0; font-size: .85rem; color: var(--online); opacity: 1; text-align: left; }

/* Nora's morning ideas for the app, each with an Add to wishlist button */
.proposals { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.proposal {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; border-radius: 10px;
  background: var(--ground); border: 1px solid var(--line);
}
.proposal-title { font-size: .95rem; overflow-wrap: anywhere; }
.proposal-text { margin: 0; font-size: .88rem; line-height: 1.4; opacity: .85; overflow-wrap: anywhere; }
.proposal form { margin: 2px 0 0; }
.proposal-done { margin: 2px 0 0; font-size: .85rem; color: var(--online); opacity: 1; }

/* Daily reports: what happened on one day, with Nora's ideas from the morning after */
.report-summary { display: block; margin-top: 2px; font-size: .85rem; font-weight: 400; color: var(--muted); }
.report h1 { margin: 0; }
.report-days { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 20px; font-size: .9rem; }
.report-days a { color: var(--accent); text-decoration: none; }
.report-days a:only-child { margin-right: auto; }
.report-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 24px; }
.report-stats div { padding: 10px 6px; border-radius: 12px; text-align: center; background: color-mix(in srgb, currentColor 4%, transparent); }
.report-stats dt { font-size: .72rem; color: var(--muted); overflow-wrap: anywhere; }
.report-stats dd { margin: 2px 0 0; font-size: 1.4rem; font-weight: 600; }
.report-quiet { margin: 0 0 24px; color: var(--muted); }
.report-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; line-height: 1.4; }
.report-list li { overflow-wrap: anywhere; }
.report-list a { color: inherit; }
.report-list time, .report-who { font-size: .85rem; color: var(--muted); }
.report .proposals { margin: 0; }

/* Dialogs blur what's behind them (2px), easing in when they open and out when they close */
dialog { transition: opacity .2s ease, display .2s allow-discrete, overlay .2s allow-discrete; }
dialog:not([open]) { opacity: 0; }
dialog::backdrop {
  -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0);
  transition: -webkit-backdrop-filter .25s ease, backdrop-filter .25s ease, background-color .25s ease,
              display .25s allow-discrete, overlay .25s allow-discrete;
}
dialog[open]::backdrop { -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
@starting-style {
  dialog[open] { opacity: 0; }
  dialog[open]::backdrop { -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); background-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  dialog, dialog::backdrop { transition: none; }
}
/* Lightbox (app.js openLightbox): a picture over the dimmed page, dark in both themes; quick to open and close */
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  color: #fff; background: rgba(0, 0, 0, .9); overflow: hidden; transition-duration: .12s;
}
.lightbox::backdrop { background: transparent; }
.lightbox-stage {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: calc(56px + env(safe-area-inset-top, 0px)) 12px calc(56px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box; touch-action: pinch-zoom; user-select: none; -webkit-user-select: none; cursor: zoom-out;
}
.lightbox-img {
  display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px;
  cursor: grab; -webkit-touch-callout: none; will-change: transform;
}
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] .lightbox-img { animation: lightbox-in .14s ease-out; }
  @keyframes lightbox-in { from { transform: scale(.94); } }
}
.lightbox-count {
  position: absolute; top: calc(18px + env(safe-area-inset-top, 0px)); left: 18px; margin: 0;
  font-size: .9rem; color: rgba(255, 255, 255, .8); opacity: 1; pointer-events: none;
}
.lightbox-close, .lightbox-nav {
  position: absolute; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; font: inherit; font-size: 1.9rem; line-height: 1; color: #fff;
  background: rgba(255, 255, 255, .14); cursor: pointer;
}
.lightbox-close { top: calc(8px + env(safe-area-inset-top, 0px)); right: 8px; }
.lightbox-nav { top: 50%; margin-top: -22px; font-size: 2.2rem; }
.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .26); }
.lightbox-close:focus-visible, .lightbox-nav:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
@media (hover: none) { .lightbox-nav { display: none; } } /* phones swipe */

/* Messages on a phone: the title and the channel row on top, the conversation scrolling between them and the box */
@media (max-width: 899px) {
  .messenger-side { flex: none; }
  .channels {
    margin-inline: -16px; padding-inline: 16px;
    border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent);
  }
  .channels ul { margin-bottom: 0; }
  .chat-scroll { margin-inline: -16px; padding: 12px 16px 0; }
}
.chat-scroll .chat-item { scroll-margin-top: 12px; }

/* An agent's memory: its notes, editable by its owner */
.memory-notes { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem !important; line-height: 1.5; }
#memory .hint { margin-top: 10px; }
.check-row { flex-direction: row !important; align-items: center; gap: 10px !important; letter-spacing: normal !important;
  text-transform: none !important; font-size: 1rem !important; color: var(--ink) !important; cursor: pointer; }
.check-row input { width: auto !important; margin: 0; accent-color: var(--accent); }
#context .hint { margin-top: 10px; }
#web .hint { margin-top: 10px; }

/* An agent's model: three cards, plus an effort choice for Opus */
.model-choices { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.model-choice { position: relative; display: block !important; cursor: pointer; letter-spacing: normal !important; text-transform: none !important; }
.model-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.model-card { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.model-card strong { font-size: 1rem; }
.model-use { font-size: .9rem; line-height: 1.4; color: var(--muted); }
.model-effort { font-size: .78rem; color: var(--muted); }
.model-choice input:checked + .model-card { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.model-choice input:focus-visible + .model-card { outline: 2px solid var(--accent); outline-offset: 2px; }
#model .hint { margin-top: 10px; }

/* Nora's page under Agents (for Mattias): her personality prompt */
.nora-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.nora-head .lede { margin: 6px 0 0; }
.nora-link { margin-bottom: 12px; }
.nora-default { margin: 10px 0; font-size: .9rem; line-height: 1.5; text-align: left; white-space: pre-line; }
.nora-link > span:first-of-type { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nora-link .agent-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }

/* What an agent knows: its memory, project descriptions and notes, read-only */
.knowledge-link { display: inline-block; margin: 4px 0 18px; }
.knowledge-sublink { display: inline-block; margin: 6px 0 0 16px; font-size: .85rem; color: var(--accent); text-decoration: none; }
.knowledge-sublink:hover { text-decoration: underline; }
.nora-sublink { margin-bottom: 14px; }
.nora-link { margin-bottom: 0; }
.knowledge-prose { line-height: 1.6; overflow-wrap: anywhere; font-size: .95rem; }
.knowledge-prose > :first-child { margin-top: 0; }
.knowledge-projects { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.knowledge-text { margin: 6px 0 0; font-size: .95rem; line-height: 1.55; text-align: left; opacity: 1; white-space: pre-line; }
.knowledge-note { border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent); padding: 10px 0; }
.knowledge-note:first-of-type { border-top: 0; }
.knowledge-note summary { cursor: pointer; padding: 4px 0; }
.agent-knowledge .empty-state { margin: 0; }
.knowledge-prose pre { overflow-x: auto; max-width: 100%; }
.knowledge-prose code { overflow-wrap: anywhere; word-break: break-word; }
.knowledge-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.knowledge-prose th, .knowledge-prose td { padding: 4px 8px; border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent); text-align: left; }
.knowledge-note, .agent-knowledge .panel { min-width: 0; max-width: 100%; box-sizing: border-box; }

/* Voice: talking to Nora out loud (voice.html, voice.js). The stage's data-state drives the animation:
   idle breathes, listening follows your loudness (--level), thinking circles, speaking talks. */
.voice-engine { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; text-align: left; opacity: 1; }
/* Voice data (voice_log.html): a wide table that scrolls sideways on a phone. */
.page main.voice-log-page { max-width: none; }  /* the whole width: the table has many columns */
.voice-log-wrap { overflow-x: auto; }
.voice-log { border-collapse: collapse; font-size: .85rem; min-width: 900px; width: 100%; }
.voice-log th, .voice-log td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.voice-log th { font-weight: 600; color: var(--muted); vertical-align: bottom; }
.voice-log .num { text-align: right; font-variant-numeric: tabular-nums; }
.voice-log td.num { white-space: nowrap; }
.voice-log .nowrap { white-space: nowrap; }
.voice-log td:nth-child(4), .voice-log td:nth-child(5) { min-width: 180px; max-width: 300px; }
.voice-log-timeline { width: 160px; min-width: 160px; }
.updates-log { min-width: 760px; }
.updates-log tr.updates-log-splash td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.updates-log tr.updates-log-splash td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.updates-log-heading { margin-top: 40px; }
.updates-log-more { margin: 10px 0 0; font-size: .9rem; color: var(--muted); }
.updates-log-more a { color: var(--accent); font-weight: 600; }
.updates-log-trend { padding-left: 20px; font-size: .9rem; }
.deploys-log td:nth-child(4), .deploys-log td:nth-child(5) { min-width: 0; max-width: none; }
.updates-log-badge { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.updates-log td:nth-child(2) { min-width: 220px; max-width: 420px; }
.updates-log td:nth-child(4), .updates-log td:nth-child(5) { min-width: 0; max-width: none; }
.voice-log-timeline .voice-waterfall { margin: 4px 0 0; height: 10px; min-width: 4px; }
.voice-recordings { margin: 6px 0 0; font-size: .85rem; color: var(--muted); }
.voice-recordings a { margin: 0 2px; }
.voice-model-pick { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.voice-model-pick select { font-size: .85rem; padding: 2px 6px; }
.voice-engine .chip { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; color: var(--muted); }
.voice-guide summary { cursor: pointer; font-weight: 600; }
.voice-guide-count { margin-left: 6px; font-weight: 400; font-size: .85rem; color: var(--muted); }
.voice-steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.voice-steps li { display: flex; gap: 12px; align-items: flex-start; }
.voice-steps li .hint { margin: 2px 0 0; text-align: left; }
.voice-steps .button { margin-top: 8px; }
.voice-step-mark { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; }
.voice-steps li[data-state="done"] .voice-step-mark { background: var(--online); border-color: var(--online); color: #fff; }
.voice-steps li[data-state="done"] .voice-step-mark::before { content: "✓"; }
.voice-steps li[data-state="bad"] .voice-step-mark { border-color: var(--accent); color: var(--accent); }
.voice-steps li[data-state="bad"] .voice-step-mark::before { content: "!"; }
.voice-pick-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.voice-pick-row select { flex: 1 1 12rem; min-width: 0; max-width: 100%; padding: 8px 10px; font: inherit; color: inherit;
  background: transparent; border: 1px solid var(--line); border-radius: 10px; }
.voice-pick-row .button { margin-top: 0; }
.voice-source { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.voice-source label { display: flex; align-items: center; gap: 6px; }
.voice-source label:has(input:disabled) { color: var(--muted); }

.voice-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 28px; --level: 0; }
.voice-orb { position: relative; width: 140px; height: 140px; display: grid; place-items: center; }
.voice-face { position: relative; z-index: 1; width: 112px; height: 112px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); transition: transform .12s ease-out; animation: voice-breathe 4s ease-in-out infinite; }
.voice-ring { position: absolute; inset: 14px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; }
.voice-dots { position: absolute; inset: 0; z-index: 2; opacity: 0; pointer-events: none; transition: opacity .3s; }
.voice-dots i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--accent);
  animation: voice-orbit 1.4s linear infinite; }
.voice-dots i:nth-child(2) { animation-delay: -.47s; opacity: .7; }
.voice-dots i:nth-child(3) { animation-delay: -.93s; opacity: .4; }
.voice-bars { display: flex; align-items: center; gap: 5px; height: 28px; opacity: .25; transition: opacity .3s; }
.voice-bars i { width: 5px; height: 6px; border-radius: 3px; background: var(--accent); }
.voice-status { margin: 4px 0 0; font-weight: 600; opacity: 1; }
.voice-live { margin: 0; min-height: 1.4em; max-width: 32rem; font-size: 1rem; color: var(--muted); opacity: 1; }
.voice-talk { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 14px 28px; border: 0; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 1.1rem; color: var(--on-accent); background: var(--accent); cursor: pointer;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.voice-talk svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.voice-talk:disabled { opacity: .55; cursor: default; }
.voice-talk[aria-pressed="true"] { background: #dc2626; color: #fff; box-shadow: 0 6px 18px rgba(220, 38, 38, .35); }
.voice-keep { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.voice-type { display: flex; gap: 8px; width: 100%; max-width: 32rem; margin-top: 8px; }
.voice-type input { flex: 1; min-width: 0; padding: 10px 14px; font: inherit; color: inherit; background: transparent;
  border: 1px solid var(--line); border-radius: 10px; }

/* listening: rings swell with your voice */
.voice-stage[data-state="listening"] .voice-face { animation: none; transform: scale(calc(1 + var(--level) * .08)); }
.voice-stage[data-state="listening"] .voice-ring { opacity: calc(.15 + var(--level) * .7); transition: transform .08s linear;
  transform: scale(calc(1.05 + var(--level) * .5)); border-color: #dc2626; }
.voice-stage[data-state="listening"] .voice-ring:nth-child(2) { transform: scale(calc(1.1 + var(--level) * .8)); opacity: calc(var(--level) * .5); }
.voice-stage[data-state="listening"] .voice-ring:nth-child(3) { transform: scale(calc(1.15 + var(--level) * 1.1)); opacity: calc(var(--level) * .3); }
/* thinking: dots circle her */
.voice-stage[data-state="thinking"] .voice-dots { opacity: 1; }
.voice-stage[data-state="thinking"] .voice-face { animation: voice-ponder 2.4s ease-in-out infinite; }
/* speaking: rings ripple out, the bars talk, each word pops her face */
.voice-stage[data-state="speaking"] .voice-ring { animation: voice-ripple 1.8s ease-out infinite; }
.voice-stage[data-state="speaking"] .voice-ring:nth-child(2) { animation-delay: .6s; }
.voice-stage[data-state="speaking"] .voice-ring:nth-child(3) { animation-delay: 1.2s; }
.voice-stage[data-state="speaking"] .voice-face { animation: voice-talk .5s ease-in-out infinite alternate; }
.voice-stage[data-state="speaking"] .voice-bars { opacity: 1; }
.voice-stage[data-state="speaking"] .voice-bars i { animation: voice-bar .9s ease-in-out infinite; }
.voice-stage[data-state="speaking"] .voice-bars i:nth-child(2n) { animation-duration: .7s; animation-delay: -.2s; }
.voice-stage[data-state="speaking"] .voice-bars i:nth-child(3n) { animation-duration: 1.1s; animation-delay: -.5s; }
.voice-stage[data-state="speaking"] .voice-bars i:nth-child(4) { animation-duration: .6s; }
.voice-stage.word .voice-orb { animation: voice-word .18s ease-out; }
/* speaking in an OpenAI voice: her face and the bars follow the audio's loudness (--level) */
.voice-stage[data-state="speaking"].live-level .voice-face { animation: none; transform: scale(calc(1 + var(--level) * .09)); }
.voice-stage[data-state="speaking"].live-level .voice-bars i { animation: none; height: calc(6px + var(--level) * 20px); transition: height .06s linear; }
.voice-stage[data-state="speaking"].live-level .voice-bars i:nth-child(2n) { height: calc(6px + var(--level) * 14px); }
.voice-stage[data-state="speaking"].live-level .voice-bars i:nth-child(3n) { height: calc(6px + var(--level) * 9px); }
@keyframes voice-breathe { 50% { transform: scale(1.03); } }
@keyframes voice-ponder { 50% { transform: rotate(-4deg) scale(.98); } }
@keyframes voice-talk { from { transform: scale(1) translateY(0); } to { transform: scale(1.04) translateY(-2px); } }
@keyframes voice-ripple { from { transform: scale(1); opacity: .6; } to { transform: scale(1.6); opacity: 0; } }
@keyframes voice-bar { 0%, 100% { height: 6px; } 50% { height: 26px; } }
@keyframes voice-orbit { from { transform: rotate(0) translateX(66px); } to { transform: rotate(360deg) translateX(66px); } }
@keyframes voice-word { 40% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  .voice-stage *, .voice-stage.word .voice-orb { animation: none !important; }
}

/* The conversation, each turn with its numbers */
.voice-turns-title { margin: 24px 0 8px; font-size: 1.1rem; }
.voice-turns { display: flex; flex-direction: column; gap: 12px; }
.voice-turn { display: flex; flex-direction: column; gap: 10px; }
.voice-turn p { margin: 2px 0 0; text-align: left; opacity: 1; font-size: 1rem; }
.voice-who { font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.voice-said p { font-style: italic; }
.voice-reply { display: flex; gap: 10px; align-items: flex-start; }
.voice-reply .avatar-sm { width: 28px; height: 28px; flex: none; }
.voice-debug summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.voice-waterfall { display: flex; height: 12px; margin: 12px 0 8px; border-radius: 6px; overflow: hidden; background: var(--line); }
.voice-waterfall span { min-width: 2px; }
.voice-legend { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); }
.voice-legend li { display: flex; align-items: center; gap: 6px; }
.voice-legend span { width: 10px; height: 10px; border-radius: 3px; }
.voice-legend strong { color: var(--ink); font-weight: 600; }
.phase-hear { background: #c084fc; } .phase-listen { background: #a78bfa; } .phase-net { background: #60a5fa; } .phase-queue { background: #f87171; }
.phase-start { background: #fb923c; } .phase-think { background: #facc15; } .phase-server { background: #34d399; } .phase-voice { background: #f472b6; } .phase-tts { background: #2dd4bf; }
.voice-numbers { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.voice-numbers th { padding: 10px 0 4px; text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.voice-numbers td { padding: 3px 0; border-top: 1px solid color-mix(in srgb, currentColor 8%, transparent); }
.voice-numbers td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
