/* Екрани «Гермес»: чат і сесії. Графіт, компактно; на телефоні без нижнього меню, зі стрілкою «назад». */
body[data-view='hermes-chat'] #metrics,
body[data-view='hermes-chat'] .toolbar,
body[data-view='hermes-chat'] .category-tabs,
body[data-view='hermes-chat'] .list-heading,
body[data-view='hermes-chat'] #goal-card {
  display: none !important;
}

/* --- Чат ---------------------------------------------------------------------------------- */
html.graphite[data-theme] body[data-view='hermes-chat'] main { padding-bottom: 0 !important; }
.hm-screen {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 70px);
}
.hm-thread {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  padding: 2px 0 14px;
}
html.graphite[data-theme] .hm-empty {
  display: grid;
  flex: 1;
  color: var(--g-line-strong);
  place-items: center;
}
html.graphite[data-theme] .hm-msg {
  color: var(--g-text);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
html.graphite[data-theme] .hm-msg.user {
  align-self: flex-end;
  max-width: 84%;
  padding: 9px 13px;
  border-radius: 18px 18px 6px 18px;
  background: var(--g-accent-soft);
}
html.graphite[data-theme] .hm-msg.assistant { align-self: stretch; }
html.graphite[data-theme] .hm-msg b { font-weight: 750; }
html.graphite[data-theme] .hm-msg code,
html.graphite[data-theme] .hm-text code {
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--g-surface-2);
  font: 600 12.5px/1.4 'JetBrains Mono', ui-monospace, monospace;
}
html.graphite[data-theme] .hm-msg.hm-typing {
  display: flex;
  align-self: flex-start;
  gap: 5px;
  padding: 8px 0;
}
html.graphite[data-theme] .hm-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--g-muted);
  animation: hm-typing 1.2s infinite ease-in-out;
}
.hm-typing i:nth-child(2) { animation-delay: .15s; }
.hm-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes hm-typing { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hm-typing i { animation: none; } }
html.graphite[data-theme] .hm-error {
  align-self: center;
  margin: 0;
  color: var(--g-bad);
  font-size: 13px;
  font-weight: 650;
}

/* Низ екрана: готові питання рядком і поле введення, завжди під рукою. */
html.graphite[data-theme] .hm-dock {
  position: sticky;
  z-index: 2;
  bottom: 0;
  padding: 4px 0 calc(10px + env(safe-area-inset-bottom));
  background: var(--g-bg);
}
html.graphite[data-theme] .hm-dock::before {
  content: '';
  position: absolute;
  top: -16px;
  right: 0;
  left: 0;
  height: 16px;
  background: linear-gradient(transparent, var(--g-bg));
  pointer-events: none;
}
html.graphite[data-theme] .hm-quick {
  display: flex;
  gap: 6px;
  margin: 0 -16px;
  padding: 0 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
html.graphite[data-theme] .hm-quick::-webkit-scrollbar { display: none; }
html.graphite[data-theme] .hm-quick button {
  flex: none;
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--g-line-strong);
  border-radius: 16px;
  background: var(--g-surface);
  color: var(--g-soft-text);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
html.graphite[data-theme] .hm-composer {
  display: flex;
  gap: 8px;
  align-items: center;
}
html.graphite[data-theme] .hm-composer input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--g-line-strong);
  border-radius: 22px;
  background: var(--g-surface);
  color: var(--g-text);
  font-size: 16px;
}
html.graphite[data-theme] .hm-composer button {
  display: grid;
  flex: none;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  place-items: center;
}

/* --- Сесії: відповіді без Markdown, як у чаті ------------------------------------------- */
html.graphite[data-theme] .hm-text { white-space: pre-wrap; }

/* Телефон: нижнє меню ховається, повернення - стрілкою в шапці або системною «Назад». */
@media (max-width: 700px) {
  html.graphite[data-theme] body[data-view^='hermes'] aside nav { display: none !important; }
  html.graphite[data-theme] body[data-view='hermes'] main {
    padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
  }
}

/* --- Історія чатів: «З телефона / Усі» і чат як розмова ----------------------------------- */
html.graphite[data-theme] .hm-filter {
  display: flex;
  gap: 22px;
  margin: 0 -16px 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--g-line);
}
html.graphite[data-theme] .hm-filter button,
html.graphite[data-theme] .hm-filter button.active {
  min-height: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--g-muted);
  font-size: 14px;
  font-weight: 650;
}
html.graphite[data-theme] .hm-filter button.active {
  border-bottom-color: var(--g-accent);
  color: var(--g-text);
  font-weight: 800;
}
html.graphite[data-theme] .hm-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 12px;
}
html.graphite[data-theme] .hm-steps {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--g-muted);
  font: 500 12px/1.5 'JetBrains Mono', ui-monospace, monospace;
  overflow-wrap: anywhere;
}
html.graphite[data-theme] .hm-steps svg { flex: none; margin-top: 3px; }

/* --- Фото і голос у чаті (2026-11-10): скріпка, мікрофон, мініатюри ------------- */
/* Компактно під 360 px: скріпка, поле, мікрофон, «надіслати» — один рядок 44 px,
   поле введення в спокійному стані не стає вищим. */
html.graphite[data-theme] .hm-pics {
  display: flex;
  gap: 6px;
  padding: 0 2px 6px;
}
html.graphite[data-theme] .hm-pic {
  position: relative;
  display: block;
  flex: none;
  width: 56px;
  height: 56px;
}
html.graphite[data-theme] .hm-pic img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
}
html.graphite[data-theme] .hm-pic button {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  place-items: center;
  background: var(--g-surface-2);
  color: var(--g-text);
}
html.graphite[data-theme] .hm-attach {
  display: grid;
  flex: none;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--g-line-strong);
  border-radius: 50%;
  background: var(--g-surface);
  color: var(--g-soft-text);
  cursor: pointer;
}
html.graphite[data-theme] .hm-composer .hm-mic {
  background: var(--g-surface);
  color: var(--g-soft-text);
}
html.graphite[data-theme] .hm-composer .hm-mic.recording {
  border-color: var(--g-bad);
  color: var(--g-bad);
}
html.graphite[data-theme] .hm-rec {
  font: 700 12.5px/1 'JetBrains Mono', ui-monospace, monospace;
}
html.graphite[data-theme] .hm-msg .hm-photo {
  display: block;
  max-width: min(240px, 100%);
  margin: 4px 0;
  border-radius: 12px;
}
html.graphite[data-theme] .hm-photo-tag {
  display: inline-grid;
  place-items: center;
  color: var(--g-muted);
}
