/* Home chat. Message and composer structure adapted from daiku ui/v2/chat.css, on the Noid dark theme. */
.view[data-view="home"] { padding-bottom: 0; display: flex; flex-direction: column; }
.hm { position: relative; flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 760px; margin: 0 auto; }
.hm-thread { flex: 1; display: flex; flex-direction: column; gap: 22px; padding: 8px 0 28px; }
.hm-empty .hm-thread { justify-content: center; }

/* Welcome */
.hm-welcome { display: grid; justify-items: center; gap: 14px; padding: 4vh 0 2vh; text-align: center; }
.hm-logo { display: block; width: 56px; height: 56px; }
.hm-logo svg { width: 100%; height: 100%; }
.hm-welcome h1 { font-size: clamp(26px, 3vw, 36px); font-weight: 600; letter-spacing: -.04em; margin-top: 10px; }
.hm-welcome > p { max-width: 52ch; color: var(--muted); }
.hm-topics, .hm-followups { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.hm-followups { justify-content: flex-start; margin: -8px 0 0 42px; }
.hm-chip {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  transition: background-color .15s, border-color .15s, color .15s;
}
.hm-chip:hover { background: var(--surface-3); border-color: var(--muted); color: var(--ink); }
.hm-prompts { display: grid; gap: 8px; width: min(100%, 520px); margin-top: 18px; }
.hm-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  text-align: left;
  transition: background-color .15s, border-color .15s;
}
.hm-prompt span { color: var(--quiet); display: inline-grid; transition: color .15s, transform .15s; }
.hm-prompt svg { width: 16px; height: 16px; }
.hm-prompt:hover { background: var(--surface-2); border-color: var(--line-strong); }
.hm-prompt:hover span { color: var(--ink); transform: translateX(2px); }

/* Messages */
.hm-msg { display: flex; gap: 12px; min-width: 0; animation: hm-in .22s var(--ease) both; }
@keyframes hm-in { from { opacity: 0; transform: translateY(6px); } }
.hm-user { justify-content: flex-end; }
.hm-user .hm-bubble {
  max-width: min(100%, 60ch);
  padding: 10px 15px;
  border-radius: 16px 16px 4px 16px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.hm-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
}
/* The agent's avatar is the Noid ring. */
.hm-mark svg { width: 24px; height: 24px; }
.hm-body { min-width: 0; flex: 1; }
.hm-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.hm-meta time { font-size: 11px; font-weight: 400; color: var(--quiet); }
.hm-assistant .hm-bubble { color: var(--ink-2); overflow-wrap: anywhere; }
.hm-assistant .hm-bubble > * + * { margin-top: 10px; }
.hm-assistant .hm-bubble strong { color: var(--ink); font-weight: 600; }
.hm-inbound .hm-meta span { color: var(--orange); }
.hm-inbound .hm-bubble { padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 4px 14px 14px 14px; background: var(--surface); }
.hm-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.hm-list li { position: relative; padding-left: 16px; line-height: 1.6; }
.hm-list li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 5px; height: 1px; background: var(--quiet); }
.hm-sub { color: var(--muted); font-size: 13px; }
.hm-label { color: var(--muted); font: 500 11px/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.hm-note { padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); font-size: 13px; }
.hm-warn { border-color: rgb(255 142 55 / .4); background: var(--orange-soft); color: var(--orange); }
.hm-time { color: var(--quiet); font-size: 12px; }
.hm-ref {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font: 600 12px/1 var(--font-mono);
  vertical-align: 1px;
  transition: background-color .15s, border-color .15s;
}
.hm-ref:hover { background: var(--surface-3); border-color: var(--muted); }
.hm-bubble .tag { vertical-align: 1px; }
.hm-open { min-height: 34px; font-size: 13px; }

/* Typing indicator */
.hm-dots { display: inline-flex; align-items: center; gap: 5px; height: 30px; }
.hm-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: hm-dot 1s infinite ease-in-out; }
.hm-dots i:nth-child(2) { animation-delay: .15s; }
.hm-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hm-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* Composer dock, pinned to the bottom of the view */
.hm-dock { position: sticky; bottom: 0; z-index: 5; padding: 12px 0 14px; background: linear-gradient(to bottom, rgb(0 0 0 / 0), var(--bg) 22px); }
.hm-dock-inner { display: grid; gap: 6px; }
.hm-composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 7px 7px 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color .15s;
}
.hm-composer:focus-within { border-color: var(--muted); }
.hm-composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  max-height: 160px;
  padding: 7px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 22px;
}
.hm-composer textarea::placeholder { color: var(--quiet); }
.hm-composer textarea:focus-visible { outline: 0; }
.hm-send { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--ink); color: var(--bg); transition: background-color .15s, opacity .15s; }
.hm-send:hover:not(:disabled) { background: var(--ink-2); }
.hm-send:disabled { opacity: .3; }
.hm-send svg { width: 18px; height: 18px; }
.hm-reset { justify-self: end; min-height: 28px; padding: 0 10px; font-size: 12px; }

@media (max-width: 760px) {
  .hm-followups { margin-left: 0; }
  .hm-msg { gap: 10px; }
  .hm-mark { width: 26px; height: 26px; }
  .hm-mark svg { width: 21px; height: 21px; }
  .hm-welcome { padding-top: 2vh; }
}
