/* ============================================
   LifestyleFit — Warm Hearth Theme
   Cozy, organic dark theme with amber accents
   ============================================ */

/* ── Palette ── */
:root {
  --bg-primary: #151413;
  --bg-secondary: #1d1b19;
  --bg-tertiary: #262422;
  --bg-sidebar: #191714;
  --bg-hover: #2d2a27;
  --bg-message-user: #1d1b19;
  --bg-message-assistant: #191714;

  --text-primary: #ece6df;
  --text-secondary: #b0a89e;
  --text-muted: #7d756c;

  --accent: #c4956a;
  --accent-hover: #d4a87c;
  --accent-soft: rgba(196, 149, 106, 0.12);
  --accent-glow: rgba(196, 149, 106, 0.06);

  --border-color: #2a2725;
  --border-hover: #3d3935;

  --font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-family-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-family-mono: 'IBM Plex Mono', 'SF Mono', 'Consolas', monospace;

  --shadow-sm: 0 2px 8px rgba(10, 8, 6, 0.2);
  --shadow-md: 0 8px 24px rgba(10, 8, 6, 0.3);
  --shadow-lg: 0 16px 40px rgba(10, 8, 6, 0.35);

  --max-content-width: 900px;
  --consent-banner-height: 0px;
}

/* Force dark even when light is stored */
[data-theme="light"] {
  --bg-primary: #f5efe6;
  --bg-secondary: #f0e8dc;
  --bg-tertiary: #e7ddcf;
  --bg-sidebar: #ece2d5;
  --bg-hover: #ddd1c1;
  --bg-message-user: #e9dece;
  --bg-message-assistant: #f4ebdf;
  --text-primary: #2d241b;
  --text-secondary: #655548;
  --text-muted: #887869;
  --accent: #a87242;
  --accent-hover: #935f31;
  --border-color: #d8c9b7;
}

/* ── Base ── */
body {
  background: var(--bg-primary);
  font-family: var(--font-family);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle warm grain texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse 80% 60% at 30% 20%, rgba(196, 149, 106, 0.04), transparent 60%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(ellipse 60% 50% at 80% 80%, rgba(180, 130, 80, 0.03), transparent 55%);
}

/* ── Sidebar ── */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  box-shadow: none;
}

.sidebar__header {
  border-bottom: 1px solid var(--border-color);
  padding: 14px;
}

.sidebar__title {
  font-family: var(--font-family-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.sidebar__title::before {
  content: none;
}

.sidebar__empty {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.sidebar__footer {
  background: transparent;
  border-top: 1px solid var(--border-color);
}

.sidebar__chats {
  padding: 8px 10px 12px;
}

.sidebar__new-chat {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  transition: all 180ms ease;
}

.sidebar__new-chat:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Chat history items */
.chat-history-item {
  display: block;
  position: relative;
  padding: 0;
  font-size: 0.84rem;
  line-height: 1.32;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  transition: all 160ms ease;
}

.chat-history-item:hover {
  border-color: var(--border-color);
  background: var(--bg-hover);
}

.chat-history-item--active {
  border-color: rgba(196, 149, 106, 0.3);
  background: rgba(196, 149, 106, 0.08);
}

.chat-history-item--active:hover {
  background: rgba(196, 149, 106, 0.1);
}

.chat-history-item__title {
  display: block;
  width: 100%;
  flex: none;
  text-align: left;
  background: transparent;
  border: none;
  padding: 10px 36px 10px 10px;
  border-radius: 9px;
  font-size: 0.84rem;
  line-height: 1.3;
  color: var(--text-primary);
  cursor: pointer;
}

.chat-history-item__open {
  display: block;
  width: 100%;
  min-height: 0;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 10px 36px 10px 10px;
}

.chat-history-item__open:hover {
  border: none;
  background: transparent;
}

.chat-history-item--active .chat-history-item__open {
  border: none;
  background: transparent;
}

.chat-history-item__open:focus-visible,
.chat-history-item__menu:focus-visible {
  outline: 2px solid rgba(196, 149, 106, 0.55);
  outline-offset: 1px;
}

.chat-history-item__menu {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  opacity: 0.45;
  border-radius: 8px;
  color: var(--text-muted);
}

.chat-history-item:hover .chat-history-item__menu,
.chat-history-item:focus-within .chat-history-item__menu,
.chat-history-item--active .chat-history-item__menu {
  opacity: 1;
}

.chat-history-item__menu:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-color);
}

@media (hover: none) {
  .chat-history-item__menu {
    opacity: 0.82;
  }
}

/* Sidebar auth button */
.sidebar__auth-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 10px;
  transition: all 160ms ease;
}

.sidebar__auth-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

[data-theme="light"] .sidebar__auth-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

[data-theme="light"] .sidebar__auth-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(21, 20, 19, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.header__title {
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: 0;
}

.header-title-nav {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.header__title-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 1 auto;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 7px 10px;
  max-width: min(68vw, 440px);
  min-width: 0;
  cursor: pointer;
}

.header__title-btn>span {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__title-btn:hover {
  border-color: var(--border-color);
  background: var(--bg-hover);
}

.header__title-btn:focus-visible {
  outline: 2px solid rgba(196, 149, 106, 0.52);
  outline-offset: 2px;
}

.header__title-caret {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 160ms ease;
}

.header__title-btn[aria-expanded="true"] .header__title-caret {
  transform: rotate(180deg);
}

.header-title-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 130;
}

.header-title-menu__item {
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}

.header-title-menu__item:hover {
  background: var(--bg-hover);
}

.header__backend-pill {
  display: none;
}

.header__new,
.header__menu {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  min-width: 40px;
  min-height: 40px;
  transition: all 160ms ease;
}

.header__new:hover,
.header__menu:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.header-quick-menu {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-lg);
}

.header-quick-menu__item {
  color: var(--text-primary);
  border-radius: 8px;
}

.header-quick-menu__item:hover {
  background: var(--bg-hover);
}

/* ── Chat container ── */
.chat-container {
  background: var(--bg-primary);
}

.messages {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 12px 10px 40px;
  display: grid;
  gap: 2px;
}

/* ── Messages — clean, borderless flow ── */
.message {
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-bottom: 0 !important;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  animation: msg-in 200ms ease-out;
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.message--assistant {
  border-color: transparent;
  background: transparent;
}

.message--assistant+.message--assistant {
  margin-top: 2px;
}

.message:hover {
  background: rgba(255, 248, 240, 0.02);
}

.message--user {
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
  padding: 4px 0 8px;
  border: none;
  background: transparent;
}

.message--user .message__avatar {
  display: none;
}

.message--user .message__content {
  max-width: min(82%, 680px);
  width: auto;
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 11px 13px;
  background: var(--bg-message-user);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

/* ── Avatars — warm initials ── */
.message__avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  letter-spacing: 0.02em;
}

.message--user .message__avatar {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.message--assistant .message__avatar {
  background: rgba(196, 149, 106, 0.15);
  color: var(--accent);
  border: none;
}

/* ── Message content ── */
.message__content {
  color: var(--text-primary);
  min-width: 0;
}

.message__text {
  font-size: 0.95rem;
  line-height: 1.66;
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-break: normal;
}

.message--user .message__text {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.message__text br+br {
  content: "";
  display: block;
  margin-top: 4px;
}

.message__content code {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: var(--font-family-mono);
  font-size: 0.88em;
  padding: 2px 6px;
}

.message__content ul,
.message__content ol {
  margin: 10px 0;
  padding-left: 22px;
}

.message__content li {
  margin-bottom: 6px;
}

.message__content ul li::marker {
  color: var(--accent);
}

/* ── Message actions ── */
.message__actions {
  margin-top: 14px;
  gap: 8px;
}

@media (hover: hover) and (pointer: fine) {
  .message__actions {
    opacity: 0;
    transition: opacity 160ms ease;
  }

  .message--assistant:hover .message__actions,
  .message__actions:focus-within {
    opacity: 1;
  }
}

@media (hover: none),
(pointer: coarse) {
  .message__actions {
    opacity: 1;
  }
}

.message__action-btn {
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  padding: 6px 10px;
  transition: all 160ms ease;
}

.message__action-btn:hover:not(:disabled) {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ============================================
   Thinking Panel — Seamless inline design
   ============================================ */

.thinking-panel {
  margin: 12px 0 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}

/* Live state: subtle pulse on the accent bar */
.thinking-panel:not(.thinking-panel--done) {
  border-left-color: var(--accent);
  animation: thinking-pulse 2s ease-in-out infinite;
}

@keyframes thinking-pulse {

  0%,
  100% {
    border-left-color: var(--accent);
  }

  50% {
    border-left-color: rgba(196, 149, 106, 0.35);
  }
}

.thinking-panel--done {
  border-left-color: rgba(196, 149, 106, 0.25);
  animation: none;
}

.thinking-panel__toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.thinking-panel__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.thinking-panel__label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
}

.thinking-panel__count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.thinking-panel__status {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 999px;
  border: none;
}

.thinking-panel__status--live {
  background: rgba(196, 149, 106, 0.12);
  color: var(--accent);
}

.thinking-panel__status--done {
  background: rgba(120, 160, 120, 0.12);
  color: #8cb88c;
}

.thinking-panel__chevron {
  color: var(--text-muted);
  transition: transform 250ms ease;
  width: 14px;
  height: 14px;
}

.thinking-panel__toggle[aria-expanded="true"] .thinking-panel__chevron {
  transform: rotate(180deg);
}

.thinking-panel__content {
  padding: 6px 0 4px;
  border-top: none;
}

.thinking-panel__content[hidden] {
  display: none;
}

/* Steps — clean minimal timeline */
.thinking-panel__steps {
  list-style: none;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.thinking-panel__step {
  border: none;
  border-radius: 8px;
  background: rgba(255, 248, 240, 0.025);
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  animation: step-fade 200ms ease-out;
}

@keyframes step-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.thinking-panel__step+.thinking-panel__step {
  margin-top: 0;
}

.thinking-panel__step-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.thinking-panel__step-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.thinking-panel__step-source {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: none;
}

.thinking-panel__step-state {
  margin-left: auto;
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: none;
}

.thinking-panel__step-state--live {
  color: var(--accent);
}

.thinking-panel__step-text {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.4;
}

.thinking-panel__step-time {
  color: var(--text-muted);
  font-size: 0.68rem;
}

/* ============================================
   Welcome Screen
   ============================================ */

.welcome {
  max-width: 820px;
  padding-top: 40px;
}

.welcome__eyebrow {
  font-family: var(--font-family-mono);
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.welcome__eyebrow::before {
  content: none;
}

.welcome__title {
  font-family: var(--font-family-display);
  font-size: clamp(1.6rem, 1.3rem + 1.5vw, 2.4rem);
  font-weight: 400;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.welcome__subtitle {
  color: var(--text-secondary);
}

.welcome__status-grid {
  gap: 10px;
}

.welcome__status-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: border-color 160ms ease;
}

.welcome__status-item:hover {
  border-color: var(--border-hover);
}

/* Feature cards */
.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: none;
  transition: all 200ms ease;
}

.feature-card:hover {
  border-color: rgba(196, 149, 106, 0.3);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.feature-card__icon {
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  border-radius: 10px;
  color: var(--accent);
}

.feature-card__title {
  color: var(--text-primary);
}

.feature-card__desc {
  color: var(--text-secondary);
}

/* Suggested prompts */
.prompt-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 180ms ease;
}

.prompt-btn::before {
  color: var(--accent);
}

.prompt-btn:hover {
  background: var(--bg-hover);
  border-color: rgba(196, 149, 106, 0.25);
  transform: translateY(-1px);
}

/* ============================================
   Input Bar
   ============================================ */

/* iMessage-inspired: pill shape, inline row, circular send */
.input-bar {
  background: var(--bg-secondary);
  border: 1.5px solid rgba(196, 149, 106, 0.22);
  border-radius: 28px;
  padding: 8px 8px 8px 6px;
  width: min(100%, 860px);
  margin: 10px auto 14px;
  align-items: center;
  gap: 6px;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.input-bar:focus-within {
  border-color: rgba(196, 149, 106, 0.5);
  box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.07);
}

.input-bar__attach {
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 160ms ease, background 160ms ease;
}

.input-bar__attach:hover {
  color: var(--accent);
  background: rgba(196, 149, 106, 0.1);
}

/* inline row — no column stacking, no separator */
.input-bar__controls {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding-left: 0;
  border-left: none;
  align-self: auto;
}

/* small chip, sits before the send button */
.input-bar__mode-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 4px 8px;
  gap: 3px;
  white-space: nowrap;
  transition: all 140ms ease;
}

.input-bar__mode-toggle:hover {
  background: rgba(196, 149, 106, 0.1);
  color: var(--accent);
}

.input-bar__mode-toggle.quick {
  background: transparent;
  color: var(--text-muted);
  opacity: 0.7;
}

.input-bar__mode-toggle.detailed {
  background: rgba(196, 149, 106, 0.12);
  color: var(--accent);
  opacity: 1;
}

/* Web search toggle — globe icon, sits between mode toggle and send */
.input-bar__web-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 140ms ease;
  flex-shrink: 0;
}

.input-bar__web-toggle:hover {
  background: rgba(196, 149, 106, 0.1);
  color: var(--accent);
}

.input-bar__web-toggle.active {
  background: rgba(196, 149, 106, 0.18);
  color: var(--accent);
  box-shadow: 0 0 0 1.5px rgba(196, 149, 106, 0.4);
}

.input-bar__input {
  font-size: 0.93rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.input-bar__input::placeholder {
  color: var(--text-muted);
}

/* circular send button — the iMessage signature */
.input-bar__send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  transition: background 180ms ease, transform 120ms ease, color 180ms ease;
}

.input-bar__send:not(:disabled) {
  background: var(--accent);
  color: #151413;
}

.input-bar__send:not(:disabled):hover {
  background: var(--accent-hover);
  transform: scale(1.08);
}

/* ============================================
   Coach Guide
   ============================================ */

.coach-guide {
  position: fixed;
  top: auto;
  left: 12px;
  right: auto;
  bottom: 126px;
  z-index: 120;
  pointer-events: none;
}

.coach-guide__fab {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 6px 10px;
  box-shadow: var(--shadow-sm);
  transition: all 160ms ease;
  opacity: 0.88;
  pointer-events: auto;
}

.coach-guide__fab:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-hover);
  opacity: 1;
}

.coach-guide__fab-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
}

.coach-guide__panel {
  left: 0;
  right: auto;
  top: calc(100% + 8px);
  bottom: auto;
  width: min(324px, calc(100vw - 18px));
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: 14px;
  pointer-events: auto;
}

.coach-guide__panel::after {
  display: none;
}

.coach-guide--launcher-hidden .coach-guide__fab {
  display: none;
}

.coach-guide--launcher-hidden:not(.coach-guide--open) {
  display: none;
}

/* ============================================
   Landing Page
   ============================================ */

.landing-page {
  max-width: 1020px;
  margin: 0 auto;
  padding: 28px 16px 20px;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  grid-template-areas:
    "hero"
    "stats"
    "actions"
    "poll";
}

.landing-page__hero {
  grid-area: hero;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 24px 20px;
  background: var(--bg-secondary);
}

/* Warm glow on hero */
.landing-page__hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 149, 106, 0.12), transparent 65%);
  pointer-events: none;
}

.landing-page__eyebrow {
  font-family: var(--font-family-mono);
  color: var(--accent);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.landing-page__title {
  margin-top: 8px;
  font-family: var(--font-family-display);
  font-size: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.landing-page__subtitle {
  margin-top: 8px;
  color: var(--text-secondary);
  max-width: 58ch;
}

.landing-page__hero-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.landing-page__hero-actions .btn {
  min-height: 42px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
  transition: all 200ms ease;
}

.landing-page__hero-actions .btn--primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #151413;
}

.landing-page__hero-actions .btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.landing-page__hero-actions .btn--secondary {
  border: 1px solid var(--border-hover);
  background: transparent;
  color: var(--text-primary);
}

.landing-page__hero-actions .btn--secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Stats */
.landing-page__stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.landing-page__stat {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.landing-page__stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.landing-page__stat:nth-child(2)::before {
  background: #b8a088;
}

.landing-page__stat:nth-child(3)::before {
  background: #8cb88c;
}

.landing-page__stat span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.landing-page__stat strong {
  font-size: 0.92rem;
  color: var(--text-primary);
}

/* Action cards */
.landing-page__actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.landing-action-card {
  text-align: left;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  transition: all 200ms ease;
}

.landing-action-card::before {
  content: "";
  display: none;
}

.landing-action-card:hover {
  border-color: rgba(196, 149, 106, 0.3);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.landing-action-card h3 {
  font-size: 0.94rem;
  color: var(--text-primary);
}

.landing-action-card p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Featured action card (Workout Plan) */
.landing-action-card--featured {
  border-color: rgba(196, 149, 106, 0.35);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(196, 149, 106, 0.08) 100%);
  grid-column: 1 / -1;
}

.landing-action-card--featured:hover {
  border-color: rgba(196, 149, 106, 0.55);
  background: linear-gradient(135deg, var(--bg-hover) 0%, rgba(196, 149, 106, 0.14) 100%);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm), 0 4px 20px rgba(196, 149, 106, 0.1);
}

.landing-action-card--featured h3 {
  font-size: 1.05rem;
}

/* Poll */
.landing-page__poll {
  grid-area: poll;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 16px;
}

.landing-page__poll h3 {
  font-size: 0.96rem;
  color: var(--text-primary);
}

.landing-page__poll p {
  margin-top: 6px;
  color: var(--text-secondary);
}

.landing-page__poll-options {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.landing-poll-option {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 180ms ease;
}

.landing-poll-option:hover {
  border-color: rgba(196, 149, 106, 0.35);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* Landing layout — desktop */
@media (min-width: 980px) {
  .landing-page {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
    grid-template-areas:
      "hero poll"
      "stats poll"
      "actions actions";
  }
}

@media (min-width: 1240px) {
  .landing-page__actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ============================================
   Interactive Cards (Coach Check-ins)
   ============================================ */

.interaction-card {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-secondary);
}

.interaction-card__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.interaction-card__question {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.interaction-card__hint {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.73rem;
}

.interaction-card__options {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.interaction-card__options--scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.interaction-card__option {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 160ms ease;
}

.interaction-card__option:hover {
  border-color: rgba(196, 149, 106, 0.4);
  background: var(--accent-soft);
}

.interaction-card__option--scale {
  justify-content: center;
  text-align: center;
  padding: 7px 6px;
}

.interaction-card__option.is-selected,
.interaction-card__option:disabled.is-selected {
  background: rgba(196, 149, 106, 0.15);
  border-color: var(--accent);
  color: var(--text-primary);
}

.interaction-card__actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.interaction-card__submit {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #151413;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 160ms ease;
}

.interaction-card__submit:hover {
  background: var(--accent-hover);
}

.interaction-card__submit:disabled {
  opacity: 0.5;
  cursor: default;
}

.interaction-card--confirm .interaction-card__option {
  min-width: 90px;
}

.interaction-card--multi_select .interaction-card__option {
  background: transparent;
}

.interaction-card__option:disabled {
  opacity: 0.7;
  cursor: default;
}

.interaction-card--analyze-log .interaction-card__options--actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.interaction-card--proposal .interaction-card__options--actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.coach-proposal__details {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

.coach-proposal__row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  font-size: 0.8rem;
}

.coach-proposal__row span {
  color: var(--text-muted);
}

.coach-proposal__row strong {
  color: var(--text-primary);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.coach-proposal__badges {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.coach-proposal__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(196, 149, 106, 0.08);
  color: var(--text-secondary);
  font-size: 0.74rem;
}

.coach-proposal-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 10, 14, 0.52);
  backdrop-filter: blur(2px);
}

body.has-coach-proposal-modal {
  overflow: hidden;
}

.coach-proposal-modal__panel {
  width: min(680px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-secondary);
  padding: 16px;
  position: relative;
}

.coach-proposal-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.coach-proposal-modal__close:hover {
  color: var(--text-primary);
  border-color: rgba(196, 149, 106, 0.45);
}

.coach-proposal-modal__title {
  margin-top: 6px;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.45;
}

.coach-proposal-modal__details {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.coach-proposal-modal__row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.coach-proposal-modal__row span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.coach-proposal-modal__row strong {
  color: var(--text-primary);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.coach-proposal-modal__actions-list {
  margin-top: 12px;
}

.coach-proposal-modal__actions-list p {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.coach-proposal-modal__actions-list ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--text-primary);
  font-size: 0.86rem;
}

.coach-proposal-modal__actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.analyze-log-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  display: grid;
  gap: 8px;
}

.analyze-log-form input,
.analyze-log-form select {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.8rem;
}

.analyze-log-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.analyze-log-form__actions {
  justify-content: flex-start;
  gap: 8px;
}

.interaction-card__status[data-tone="success"] {
  color: #8fd3a5;
}

.interaction-card__status[data-tone="warning"] {
  color: #d4b282;
}

.interaction-card__status[data-tone="error"] {
  color: #e7a0a0;
}

/* ============================================
   Logs Modal
   ============================================ */

.logs-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.logs-modal .modal__title,
.logs-modal .modal__subtitle {
  padding-right: 68px;
}

.logs-modal #closeLogs.modal__close {
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.logs-modal #closeLogs.modal__close:hover {
  background: var(--bg-hover);
}

.logs-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-primary);
}

.logs-controls input[type="date"] {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 6px 10px;
}

.logs-nav-btn {
  min-width: 38px;
  padding-inline: 0;
}

.logs-tabs {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.logs-tab {
  flex: 1;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease;
}

.logs-tab:hover {
  color: var(--text-primary);
}

.logs-tab.is-active {
  color: var(--text-primary);
  border-color: rgba(196, 149, 106, 0.3);
  background: rgba(196, 149, 106, 0.08);
}

.logs-summary__item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.logs-summary__label {
  color: var(--text-muted);
}

.logs-summary__value {
  color: var(--text-primary);
}

.logs-overview-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 160ms ease;
}

.logs-overview-card:hover {
  border-color: var(--border-hover);
}

.logs-overview-card__action {
  color: var(--accent);
}

.logs-weekly {
  margin-top: 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg-primary);
}

.logs-weekly__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.logs-weekly__streak {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.logs-weekly__streak strong {
  color: var(--accent);
}

.logs-weekly__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.logs-weekly-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-tertiary);
  padding: 10px;
}

.logs-weekly-card__label {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.logs-weekly-card__value {
  display: block;
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 1rem;
}

.logs-weekly-card__bar {
  position: relative;
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.logs-weekly-card__bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ddb58d);
  transition: width 220ms ease;
}

.logs-section--activity {
  margin-top: 16px;
}

.logs-activity-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.logs-activity-filters,
.logs-quick-exercise {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.logs-chip {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease;
}

.logs-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.logs-chip.is-active {
  color: var(--text-primary);
  border-color: var(--accent);
  background: rgba(196, 149, 106, 0.1);
}

.logs-chip--recent {
  font-size: 0.78rem;
}

.logs-quick-repeat {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.logs-section--compact {
  margin-top: 0;
}

.logs-recent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.logs-task-plan__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.logs-task-plan__title-wrap {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.logs-task-plan__meta {
  margin: 0;
}

.logs-task-plan__meta[data-tone="info"] {
  color: var(--text-secondary);
}

.logs-task-plan__meta[data-tone="success"] {
  color: #8fd3a5;
}

.logs-task-plan__meta[data-tone="warning"] {
  color: #d4b282;
}

.logs-task-plan__meta[data-tone="error"] {
  color: #e7a0a0;
}

.logs-task-plan__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logs-task-plan__toggle {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.logs-task-plan__toggle svg {
  transition: transform 180ms ease;
}

.logs-task-plan.is-open .logs-task-plan__toggle svg {
  transform: rotate(180deg);
}

.logs-task-plan__body {
  margin-top: 6px;
}

.logs-task-list {
  display: grid;
  gap: 8px;
}

.logs-task-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.12);
  padding: 9px 10px;
}

.logs-task-item input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent);
}

.logs-task-item--completed {
  border-color: rgba(90, 172, 112, 0.45);
  background: rgba(42, 89, 55, 0.24);
}

.logs-task-item__content {
  min-width: 0;
}

.logs-task-item__title-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.logs-task-item__title-row strong {
  color: var(--text-primary);
  font-size: 0.86rem;
}

.logs-task-item__status {
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.logs-task-item__meta {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.logs-task-item__checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.logs-task-item__checklist span {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--text-secondary);
  font-size: 0.68rem;
}

.logs-exercise-preview {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(35, 53, 80, 0.58), rgba(19, 75, 61, 0.5));
  padding: 12px;
  display: grid;
  gap: 8px;
}

.logs-exercise-preview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-primary);
}

.logs-exercise-preview__head span {
  color: var(--text-secondary);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.logs-exercise-preview__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.logs-exercise-preview__chip {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 4px 8px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.16);
}

.logs-exercise-preview__meta {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.logs-exercise-preview__meta strong {
  color: var(--text-primary);
}

.logs-activity-feed {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}

.logs-activity-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  padding: 10px 12px;
}

.logs-activity-item__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: grid;
  place-items: center;
  background: var(--bg-tertiary);
}

.logs-activity-item__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.logs-activity-item__top span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.logs-activity-item__meta {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-top: 3px;
}

.logs-activity-item__badge {
  font-size: 0.72rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 8px;
  text-transform: capitalize;
}

.logs-exercise-form {
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 12px;
}

.logs-food-form>*,
.logs-exercise-form>* {
  min-width: 0;
}

#logsExerciseCategory,
#logsExerciseSubcategory,
#logsExerciseEntryMode,
#logsExerciseActivity,
#logsExerciseDuration,
#logsExerciseIntensity,
#logsExerciseType,
#logsExerciseCaloriesInput,
#logsExerciseNotes,
#saveExerciseLogBtn,
#cancelExerciseEditBtn {
  grid-column: span 6;
}

.logs-exercise-picker-row,
.logs-custom-exercise,
.logs-exercise-ratings {
  grid-column: span 6;
}

.logs-exercise-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: stretch;
}

.logs-icon-btn {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  min-height: 40px;
  cursor: pointer;
}

.logs-icon-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.logs-custom-exercise {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.logs-strength-fields {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.logs-stepper {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.logs-stepper__label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.logs-stepper__controls {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 6px;
}

.logs-stepper__btn {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
}

.logs-stepper__btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.logs-stepper__controls input {
  width: 100%;
}

.logs-exercise-ratings {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-primary);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.logs-rating-group {
  display: grid;
  gap: 6px;
}

.logs-rating-group__label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.logs-rating-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.logs-rating-btn {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-height: 34px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.logs-rating-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.logs-rating-btn.is-selected {
  border-color: var(--accent);
  background: rgba(196, 149, 106, 0.12);
  color: var(--text-primary);
}

.logs-coach-prompt {
  margin-top: 12px;
  border: 1px solid rgba(196, 149, 106, 0.26);
  background: rgba(196, 149, 106, 0.06);
  border-radius: 10px;
  padding: 10px;
}

.logs-coach-prompt__title {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.86rem;
}

.logs-coach-prompt__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.logs-exercise-detail {
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.logs-table-wrap {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.logs-table th {
  background: var(--bg-primary);
  color: var(--text-secondary);
}

.logs-table tr:hover td {
  background: var(--bg-hover);
}

/* ============================================
   Transitions — unified timing
   ============================================ */

.sidebar__new-chat,
.header__new,
.header__menu,
.feature-card,
.prompt-btn,
.input-bar,
.input-bar__attach,
.input-bar__mode-toggle,
.input-bar__web-toggle,
.message__action-btn,
.coach-guide__fab,
.chat-history-item,
.landing-action-card,
.landing-poll-option,
.interaction-card__option {
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 200ms ease,
    transform 160ms ease;
}

/* ============================================
   Light theme overrides (keep dark)
   ============================================ */

[data-theme="light"] body,
[data-theme="light"] .header,
[data-theme="light"] .sidebar,
[data-theme="light"] .chat-container,
[data-theme="light"] .sidebar__footer {
  background: var(--bg-primary);
}

[data-theme="light"] body::before,
[data-theme="light"] body::after,
[data-theme="light"] .sidebar__title::before {
  display: block;
}

[data-theme="light"] .message--assistant {
  border-color: rgba(168, 141, 116, 0.35);
  background: rgba(255, 255, 255, 0.42);
}

[data-theme="light"] .message:hover {
  background: rgba(255, 255, 255, 0.65);
}

[data-theme="light"] .feature-card__icon {
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

[data-theme="light"] .coach-guide__fab {
  border-color: var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

[data-theme="light"] .coach-guide__panel {
  background: #f7f1e6;
  border-color: rgba(133, 112, 89, 0.34);
}

[data-theme="light"] .coach-guide__input {
  background: #fffdf8;
  color: #2a231b;
  border-color: rgba(133, 112, 89, 0.45);
}

[data-theme="light"] .coach-guide__input::placeholder {
  color: rgba(76, 62, 48, 0.78);
}

/* ============================================
   Animations
   ============================================ */

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .coach-guide {
    top: auto;
    left: 10px;
    right: auto;
    bottom: 112px;
  }

  .coach-guide__fab {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  .coach-guide__panel {
    right: auto;
    left: 0;
    width: min(300px, calc(100vw - 20px));
    position: absolute !important;
    top: calc(100% + 8px) !important;
  }

  .coach-guide--open .coach-guide__panel {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    top: 66px !important;
    bottom: auto !important;
    width: auto;
    max-height: min(64vh, 540px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .header-title-menu {
    left: auto;
    right: 0;
    transform: none;
    width: min(240px, calc(100vw - 22px));
  }

  body.consent-banner-visible .main {
    padding-bottom: calc(var(--consent-banner-height, 0px) + env(safe-area-inset-bottom, 0px) + 8px);
  }

  .consent-banner {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .consent-banner__content {
    gap: 10px;
    align-items: flex-start;
  }

  .consent-banner__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .auth-verify-actions {
    flex-direction: column;
  }

  .auth-verify-btn {
    width: 100%;
  }

  .message {
    padding: 10px 8px;
    grid-template-columns: 24px minmax(0, 1fr);
    border-radius: 10px;
    gap: 8px;
  }

  .message__avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .thinking-panel {
    margin: 8px 0 6px;
    padding-left: 10px;
  }

  .header__title {
    font-size: 1rem;
  }

  .header__title-btn {
    max-width: calc(100vw - 132px);
  }

  .header__title-btn>span {
    max-width: calc(100vw - 170px);
  }

  .input-bar {
    width: calc(100% - 14px);
    margin: 8px auto 10px;
  }

  .message--user {
    padding-inline: 0;
    grid-template-columns: minmax(0, 1fr);
    justify-items: end;
  }

  .message--user .message__content {
    max-width: 100%;
    width: auto;
    min-width: 0;
    border-radius: 14px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .messages {
    padding: 10px 8px 110px;
  }

  .message__text {
    font-size: 0.92rem;
    line-height: 1.52;
  }

  .landing-page {
    gap: 10px;
    padding-top: 18px;
  }

  .landing-page__hero {
    padding: 16px;
  }

  .landing-page__hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .landing-page__hero-actions .btn {
    width: 100%;
  }

  .landing-page__stats,
  .landing-page__actions {
    grid-template-columns: 1fr;
  }

  .interaction-card__options--scale {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .logs-controls {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px auto;
    align-items: center;
    gap: 8px;
    padding: 10px;
  }

  #logsPrevDayBtn {
    grid-column: 1;
    grid-row: 1;
  }

  #logsDate {
    grid-column: 2;
    grid-row: 1;
  }

  #logsNextDayBtn {
    grid-column: 3;
    grid-row: 1;
  }

  #refreshLogsBtn {
    grid-column: 4;
    grid-row: 1;
  }

  .logs-controls label {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .logs-controls input[type="date"] {
    min-width: 0;
    width: 100%;
  }

  .logs-modal {
    width: calc(100vw - 10px);
    max-width: calc(100vw - 10px);
    max-height: 92vh;
    margin: 4px auto;
    overflow-y: auto;
  }

  .logs-modal .modal__title,
  .logs-modal .modal__subtitle {
    padding-right: 72px;
  }

  .logs-modal {
    max-width: calc(100vw - 12px);
  }

  .logs-view {
    overflow-x: hidden;
  }

  .logs-section,
  .logs-view-intro {
    margin-left: 12px;
    margin-right: 12px;
  }

  .logs-food-form,
  .logs-exercise-form {
    grid-template-columns: 1fr;
  }

  .logs-food-form>*,
  .logs-exercise-form>* {
    grid-column: 1 / -1 !important;
  }

  .logs-controls label {
    width: 100%;
  }

  .logs-tab {
    font-size: 0.82rem;
  }

  .logs-weekly__grid {
    grid-template-columns: 1fr;
  }

  .logs-strength-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logs-custom-exercise {
    grid-template-columns: 1fr;
  }

  .logs-exercise-preview {
    padding: 10px;
    gap: 6px;
  }

  .logs-exercise-preview__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .logs-task-plan__head {
    flex-direction: column;
    align-items: stretch;
  }

  .logs-task-plan__actions {
    width: 100%;
  }

  .logs-task-plan__head .btn {
    flex: 1;
    width: 100%;
  }

  .logs-task-plan__toggle {
    width: 40px;
    flex: 0 0 40px;
  }

  .logs-task-item__title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .logs-stepper__btn {
    min-height: 32px;
  }

  .food-log-date-nav {
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
  }

  .food-log-date-nav__display {
    min-width: 0;
    flex: 1;
  }

  .food-log-date-nav__date {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logs-table-wrap {
    overflow: visible;
  }

  .logs-table {
    min-width: 0;
  }

  .logs-table thead {
    display: none;
  }

  .logs-table,
  .logs-table tbody,
  .logs-table tr,
  .logs-table td {
    display: block;
    width: 100%;
  }

  .logs-table tr {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    background: var(--bg-primary);
    overflow: hidden;
  }

  .logs-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .logs-table td::before {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .logs-table td:nth-child(1)::before {
    content: "Time";
  }

  .logs-table td:nth-child(2)::before {
    content: "Activity";
  }

  .logs-table td:nth-child(3)::before {
    content: "Duration";
  }

  .logs-table td:nth-child(4)::before {
    content: "Calories";
  }

  .logs-table td:nth-child(5)::before {
    content: "Action";
  }

  .logs-table td:last-child {
    border-bottom: none;
  }

  .logs-table td.logs-empty {
    display: block;
    text-align: left;
  }

  .logs-table td.logs-empty::before {
    content: none;
  }

  .logs-action-btn {
    width: 100%;
  }

  .logs-activity-item {
    grid-template-columns: auto 1fr;
  }

  .logs-activity-item__badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row .form-group {
    min-width: 0;
  }

  .training-activity-shell,
  .training-tab {
    min-width: 0;
  }

  .training-tab {
    width: 100%;
    justify-content: space-between;
  }

  .training-tab span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-modal .modal__header {
    text-align: left;
    margin-bottom: 12px;
  }

  .auth-modal .modal__title {
    font-size: 1.6rem;
    line-height: 1.1;
  }

  .auth-modal .modal__footer {
    text-align: left;
    margin-top: 12px;
    font-size: 0.79rem;
  }

  .auth-modal .auth-btn,
  .auth-modal .auth-submit,
  .auth-modal .auth-input {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {

  .message,
  .feature-card,
  .prompt-btn,
  .thinking-panel,
  .thinking-panel__step {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* ============================================
   Suggested prompts label
   ============================================ */

.suggested-prompts__label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================
   Rate limit notice
   ============================================ */

.rate-limit-notice {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.rate-limit-notice--warning {
  border-color: rgba(196, 149, 106, 0.6);
  color: #e8c99a;
}

.rate-limit-notice--error {
  border-color: rgba(200, 90, 90, 0.6);
  color: #e8a0a0;
}

/* ============================================
   Account menu
   ============================================ */

.account-menu {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  border-radius: 12px;
}

.account-menu__item {
  color: var(--text-primary);
  border-radius: 8px;
}

.account-menu__item:hover {
  background: var(--bg-hover);
}

.account-menu__item--danger {
  color: #d08080;
}

.account-menu__item--danger:hover {
  background: rgba(200, 90, 90, 0.08);
}

.account-menu__divider {
  background: var(--border-color);
}

/* ============================================
   Modals — warm treatment
   ============================================ */

.modal-overlay {
  background: rgba(10, 9, 8, 0.7);
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.modal__content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.auth-modal {
  width: min(420px, calc(100vw - 20px));
  max-width: min(420px, calc(100vw - 20px));
  max-height: min(92vh, 720px);
  margin: 10px;
  overflow-y: auto;
}

.modal__title {
  font-family: var(--font-family-display);
  font-weight: 400;
  color: var(--text-primary);
}

.modal__subtitle {
  color: var(--text-secondary);
}

/* Auth modal */
.auth-btn--google {
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 10px;
  transition: all 160ms ease;
}

.auth-btn--google:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.auth-input {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 10px;
}

.auth-input:focus {
  border-color: rgba(196, 149, 106, 0.4);
  outline: none;
  box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.06);
}

.auth-submit {
  background: var(--accent);
  color: #151413;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  transition: all 160ms ease;
}

.auth-submit:hover {
  background: var(--accent-hover);
}

.auth-submit:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.auth-status {
  margin: 2px 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.auth-status--success {
  border-color: rgba(104, 207, 84, 0.4);
  color: #9be784;
  background: rgba(104, 207, 84, 0.12);
}

.auth-status--warning {
  border-color: rgba(212, 160, 63, 0.4);
  color: #f0c86a;
  background: rgba(240, 200, 106, 0.12);
}

.auth-status--error {
  border-color: rgba(199, 109, 109, 0.45);
  color: #f4a5a5;
  background: rgba(199, 109, 109, 0.14);
}

#authCredentialsFields,
#authVerificationFields {
  display: grid;
  gap: 8px;
}

.auth-verify-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-verify-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 10px;
  min-height: 38px;
  padding: 0 12px;
  font-family: var(--font-family);
  font-size: 0.84rem;
  cursor: pointer;
}

.auth-verify-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.auth-verify-btn--ghost {
  color: var(--text-secondary);
}

/* ============================================
   Consent banner
   ============================================ */

.consent-banner {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

body.consent-banner-visible .main {
  padding-bottom: calc(var(--consent-banner-height, 0px) + 10px);
}

.consent-banner__btn--accept {
  background: var(--accent);
  color: #151413;
}

/* ============================================
   Image preview
   ============================================ */

.image-preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
}

.toggle-btn {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all 160ms ease;
}

.toggle-btn--active {
  border-color: var(--accent);
  background: rgba(196, 149, 106, 0.1);
  color: var(--text-primary);
}

/* ============================================
   Settings modal
   ============================================ */

.settings-modal {
  background: var(--bg-secondary);
}

.settings-section__title {
  color: var(--text-primary);
}

.settings-section__desc {
  color: var(--text-secondary);
}

.settings-info__label {
  color: var(--text-muted);
}

.settings-info__value {
  color: var(--text-primary);
}

/* ============================================
   Form coach modal
   ============================================ */

.form-coach-modal {
  background: var(--bg-secondary);
}

/* ============================================
   Scrollbar — subtle warm
   ============================================ */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(196, 149, 106, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(196, 149, 106, 0.25);
}

/* ============================================
   Selection color
   ============================================ */

::selection {
  background: rgba(196, 149, 106, 0.25);
  color: var(--text-primary);
}

/* In-chat workflow action cards */
.interaction-card--actions .interaction-card__options--actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.interaction-card__option--action {
  min-height: 38px;
  justify-content: center;
  text-align: center;
  font-weight: 600;
}

@media (max-width: 640px) {
  .interaction-card--actions .interaction-card__options--actions {
    grid-template-columns: 1fr;
  }

  .interaction-card--analyze-log .interaction-card__options--actions {
    grid-template-columns: 1fr;
  }

  .interaction-card--proposal .interaction-card__options--actions {
    grid-template-columns: 1fr;
  }

  .coach-proposal__row,
  .coach-proposal-modal__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .coach-proposal-modal {
    padding: 12px;
    align-items: flex-end;
  }

  .coach-proposal-modal__panel {
    max-height: min(82vh, 760px);
    border-radius: 14px;
    padding: 14px;
  }

  .coach-proposal-modal__actions {
    justify-content: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .analyze-log-form__grid {
    grid-template-columns: 1fr;
  }
}
