/* Health & Fitness Companion — dark athletic theme (default) */

:root,
[data-theme="dark"] {
  --bg: #090c13;
  --bg-elevated: #111622;
  --card: #1a2030;
  --card-hover: #212a3d;
  --surface: #1a2030;
  --surface-card: #1a2030;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(61, 214, 140, 0.3);
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --accent: #10b981;
  --accent-glow: #34d399;
  --accent-dim: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --water: #0ea5e9;
  --water-dim: rgba(14, 165, 233, 0.15);
  --header-bg: rgba(9, 12, 19, 0.75);
  --card-grad-end: rgba(26, 32, 48, 0.6);
  --ai-grad-end: rgba(15, 20, 25, 0.4);
  --radius: 20px;
  --radius-sm: 12px;
  --nav-height: 80px;
  --header-height: 70px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --touch: 52px;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #eef2f6;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-hover: #f3f6fa;
  --surface: #ffffff;
  --surface-card: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.16);
  --border-glow: rgba(5, 150, 105, 0.35);
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #059669;
  --accent-glow: #10b981;
  --accent-dim: rgba(5, 150, 105, 0.12);
  --warning: #d97706;
  --warning-dim: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --water: #0284c7;
  --water-dim: rgba(2, 132, 199, 0.12);
  --header-bg: rgba(238, 242, 246, 0.88);
  --card-grad-end: rgba(241, 245, 249, 0.95);
  --ai-grad-end: rgba(241, 245, 249, 0.85);
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}

.hidden {
  display: none !important;
}

.ai-workspace-hero,
.manual-ai-workspace {
  border-color: rgba(56, 189, 248, 0.3);
  background: linear-gradient(160deg, rgba(56, 189, 248, 0.1) 0%, var(--ai-grad-end) 100%);
}

.manual-ai-workspace {
  padding: 0;
  overflow: hidden;
}

.manual-ai-workspace-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.manual-ai-workspace-summary::-webkit-details-marker {
  display: none;
}

.manual-ai-workspace-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.manual-ai-workspace-heading .card-title {
  margin: 0;
}

.manual-ai-workspace-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.35;
}

.manual-ai-workspace-chevron {
  color: var(--accent);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  font-size: 1rem;
}

.manual-ai-workspace[open] .manual-ai-workspace-chevron {
  transform: rotate(90deg);
}

.manual-ai-workspace-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.manual-ai-workspace-body > .card-subtitle:first-of-type {
  margin-top: 12px;
}

.recipe-library-details {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  overflow: hidden;
}

.recipe-library-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  min-height: var(--touch);
}

.recipe-library-summary::-webkit-details-marker {
  display: none;
}

.recipe-library-summary-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  min-width: 0;
}

.recipe-library-summary-main .card-title {
  margin: 0;
  font-size: 0.95rem;
}

.recipe-library-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.recipe-library-details[open] .recipe-library-chevron {
  transform: rotate(90deg);
}

.recipe-library-list {
  border-top: 1px solid var(--border);
  max-height: min(55vh, 420px);
  overflow-y: auto;
  padding: 8px 10px 12px;
}

.manual-ai-workspace-body .sub-nav {
  margin-top: 12px;
}

.today-skincare-card {
  padding: 0;
  overflow: hidden;
}

.today-skincare-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.today-skincare-summary::-webkit-details-marker {
  display: none;
}

.today-skincare-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.today-skincare-heading .card-title {
  margin: 0;
}

.today-skincare-hint {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
}

.today-skincare-card[open] .manual-ai-workspace-chevron {
  transform: rotate(90deg);
}

.today-skincare-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.today-skincare-slot + .today-skincare-slot {
  margin-top: 12px;
}

.today-skincare-slot-title {
  margin: 12px 0 4px;
  font-size: 0.95rem;
}

.consistent-habits-card {
  margin-top: 12px;
  padding: 0;
  overflow: hidden;
}

.consistent-habits-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.consistent-habits-summary::-webkit-details-marker {
  display: none;
}

.consistent-habits-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.consistent-habits-heading .card-title {
  margin: 0;
}

.consistent-habits-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.35;
}

.consistent-habits-chevron {
  color: var(--accent);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  font-size: 1rem;
}

.consistent-habits-card[open] .consistent-habits-chevron {
  transform: rotate(90deg);
}

.consistent-habits-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.consistent-habits-body > .card-subtitle:first-of-type {
  margin-top: 12px;
}

.consistent-habits-item-title {
  margin: 16px 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.consistent-habits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.consistent-habit-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.consistent-habit-card-body {
  flex: 1;
  min-width: 0;
}

.consistent-habit-name {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.consistent-habit-trigger,
.consistent-habit-recipe,
.consistent-habit-log-hint {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.consistent-habit-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.food-daylog-timeline-card {
  margin-top: 12px;
}

.today-quick-add-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

#btn-today-quick-add.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.ai-copy-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.example-intro-card {
  border-color: rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.06);
}

.example-highlights {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.example-highlight strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.example-highlight p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  background: var(--header-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.app-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-date {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.date-picker {
  min-height: var(--touch);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

.date-picker:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Main */
.app-main {
  flex: 1;
  padding: 16px 16px calc(var(--nav-height) + var(--safe-bottom) + 16px);
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.view {
  display: none;
  animation: fadeIn 0.2s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
  background: linear-gradient(145deg, var(--card), var(--card-grad-end));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.card-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}

.card-subtitle {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.card-header-row .card-title {
  margin: 0;
}

.week-nav-btns {
  display: flex;
  gap: 4px;
  align-items: center;
}

.card-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  justify-content: flex-end;
}

/* Progress bars */
.progress-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-label span:last-child {
  color: var(--text);
  font-weight: 600;
}

.progress-track {
  height: 10px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.progress-track.large {
  height: 14px;
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #fcd34d);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-fill.accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.progress-fill.water {
  background: linear-gradient(90deg, var(--water), #38bdf8);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

.progress-fill.over {
  background: linear-gradient(90deg, #ef4444, #fca5a5);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-chip-btn {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font: inherit;
  color: inherit;
}

.stat-chip-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.stat-chip-btn:not(.done) {
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.5);
}

/* Today reminders (coach + scale) */
.today-reminders {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.today-reminders .coach-list {
  margin-bottom: 0;
}

.coach-body--action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-icon {
  font-size: 1.25rem;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-chip.done {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Coach suggestions */
.coach-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.coach-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

.coach-card.warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--warning-dim);
}

.coach-card.tip {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.coach-card.positive {
  border-color: rgba(61, 214, 140, 0.4);
  background: var(--accent-dim);
}

.coach-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.2rem;
  background: var(--bg);
}

.coach-card.warning .coach-icon { color: var(--warning); }
.coach-card.tip .coach-icon { color: var(--water); }
.coach-card.positive .coach-icon { color: var(--accent); }

.coach-body h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.coach-body p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.coach-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: scale(0.95);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-glow));
  color: #022c22;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--accent-glow);
  border: 2px solid var(--accent-dim);
  box-shadow: none;
}

.btn-outline:hover:not(:disabled) {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.btn-text {
  background: transparent;
  color: var(--accent);
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.btn-water {
  flex: 1;
  background: var(--water-dim);
  color: var(--water);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 1.1rem;
}

.btn-water.primary {
  background: var(--water);
  color: #0c2340;
  border-color: var(--water);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.8rem;
}

.full-width {
  width: 100%;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.progress-review-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.view-back-btn {
  margin-bottom: 12px;
}

.rest-day-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  min-height: 64px;
  white-space: normal;
}

.rest-day-option-label {
  font-weight: 600;
  color: var(--accent, var(--text));
}

.rest-day-option-hint {
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--text-muted, var(--muted));
  font-weight: 400;
}

.rest-day-status {
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--text);
}

.goal-type-switch {
  border: none;
  margin: 0 0 4px;
  padding: 0;
}

.goal-type-switch-legend {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.goal-type-switch-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.goal-type-option {
  margin: 0;
  cursor: pointer;
}

.goal-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.goal-type-option-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated, var(--bg));
  min-height: 64px;
}

.goal-type-option input:checked + .goal-type-option-card {
  border-color: var(--accent, #3b82f6);
  background: color-mix(in srgb, var(--accent, #3b82f6) 8%, var(--bg-elevated, var(--bg)));
}

.goal-type-option-title {
  font-weight: 600;
  color: var(--text);
}

.goal-type-option-hint {
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--text-muted, var(--muted));
}

/* Let a wrapper hide as one block without breaking form-grid layout when visible. */
#goals-phase-fields:not(.hidden) {
  display: contents;
}

#rest-day-card.rest-day-active {
  border-color: var(--accent-muted, var(--border));
  background: color-mix(in srgb, var(--accent, #3b82f6) 6%, var(--bg-elevated));
}

/* Preset grid */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.preset-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.preset-btn:active {
  transform: scale(0.98);
}

.preset-btn .name {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
}

.preset-btn .meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.preset-btn .macros {
  font-size: 0.72rem;
  color: var(--accent);
  margin-top: auto;
}

.preset-btn.favourite {
  border-color: rgba(245, 158, 11, 0.5);
}

.preset-btn .slot {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warning);
}

/* Item lists */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-list.compact {
  margin-top: 12px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.list-item-main {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.list-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.list-item-notes {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

.meal-library-item {
  align-items: flex-start;
}

.meal-fav-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.meal-fav-btn.active {
  border-color: rgba(245, 158, 11, 0.6);
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.meal-library-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Water view */
.water-hero {
  text-align: center;
}

.water-hero-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.water-hero-value {
  margin: 8px 0 4px;
  font-size: 3rem;
  font-weight: 800;
  color: var(--water);
  line-height: 1;
}

.water-hero-value small {
  font-size: 1.2rem;
  font-weight: 600;
  opacity: 0.7;
}

.water-hero-target {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.water-remaining {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--accent);
}

.water-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-add-habits-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-add-habits-label {
  margin: 0 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quick-add-habits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-habit-quick {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.btn-habit-quick:hover {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.14);
}

/* Workout */
.session-card {
  margin-bottom: 16px;
}

.session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.session-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #052e1a;
  font-weight: 800;
  font-size: 1rem;
}

.session-meta {
  flex: 1;
}

.session-meta h3 {
  margin: 0;
  font-size: 1rem;
}

.session-meta p {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.exercise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exercise-item {
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.exercise-item strong {
  display: block;
  font-size: 0.9rem;
}

.exercise-item span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.workout-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  min-height: var(--touch);
  cursor: pointer;
}

.checkbox-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

/* Forms */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-grid input {
  min-height: var(--touch);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-grid select {
  min-height: var(--touch);
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239ca3af' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-grid input::placeholder {
  color: rgba(156, 163, 175, 0.55);
}

.form-grid input:focus,
.form-grid select:focus {
  outline: none;
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Metrics chart */
.metrics-chart {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  height: auto;
  min-height: 100px;
  padding: 8px 0;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.chart-value {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

.chart-bar {
  width: 100%;
  max-width: 32px;
  min-height: 4px;
  background: linear-gradient(180deg, var(--accent), #22c55e);
  border-radius: 6px 6px 2px 2px;
  transition: height 0.3s ease;
}

.metrics-chart-secondary {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.metrics-chart-label {
  width: 100%;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.chart-bar-bf {
  background: linear-gradient(180deg, #f59e0b, #ef4444);
}

.metrics-tape-details {
  grid-column: 1 / -1;
}

.metrics-tape-details summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.metrics-tape-grid {
  margin-top: 8px;
}

.metrics-derived {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metrics-derived > span:first-child {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.metrics-derived-value {
  display: block;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--text-muted));
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.metrics-derived-value.is-set {
  color: var(--text);
  border-color: color-mix(in srgb, var(--border) 70%, var(--accent-glow));
}

.metrics-derived-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.daily-bia-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.chart-label {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Weekly review */
.weekly-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.weekly-stat {
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.weekly-stat .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.weekly-stat .value {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 4px;
}

.weekly-stat .value.positive { color: var(--accent); }
.weekly-stat .value.negative { color: var(--danger); }

.weekly-stat-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.weekly-daily {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.daily-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.daily-row:last-child {
  border-bottom: none;
}

.daily-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.daily-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
}

.mini-bar-row span:first-child {
  width: 48px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.mini-bar-row span:last-child {
  width: 86px;
  flex-shrink: 0;
  text-align: right;
}

.mini-bar {
  flex: 1;
  height: 8px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

/* Target marker line — shown above the fill */
.mini-bar-target {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.55);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}

.mini-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.mini-bar-fill.protein { background: var(--accent); }
.mini-bar-fill.water   { background: var(--water); }

/* When bar exceeds target: glow the fill and give it a brighter tone */
.mini-bar.over-target {
  background: rgba(148, 163, 184, 0.18);
}
.mini-bar-fill.protein.hit {
  background: linear-gradient(90deg, var(--accent), #86efac);
}
.mini-bar-fill.water.hit {
  background: linear-gradient(90deg, var(--water), #67e8f9);
}
.mini-bar-fill.calories.hit {
  background: linear-gradient(90deg, #ffb347, #ffd580);
}

/* Over-target label tints */
.bar-value-over {
  color: #fbbf24;
}
.bar-value-hit {
  color: #4ade80;
}

/* Profile */
.profile-hero {
  text-align: center;
  padding-top: 24px;
}

.avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #22c55e);
  color: #052e1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
}

.profile-hero h2 {
  margin: 0;
}

.goals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#subscription-card #subscription-details {
  margin-bottom: 16px;
}

.goal-item {
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.goal-item .label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.goal-item .value {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 4px;
}

.mood-picker {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.mood-btn {
  flex: 1;
  min-height: 56px;
  font-size: 1.8rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.mood-btn:hover {
  border-color: var(--accent);
}

.mood-btn.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: scale(1.05);
}

.mood-status {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Loading & error states */
.state-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}

.loading-panel {
  color: var(--text-muted);
}

.error-panel {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Bottom nav */
[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.06);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  width: 100%;
  max-width: 640px;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: var(--nav-height);
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-btn .nav-icon {
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-btn.active {
  color: var(--accent-glow);
}

.nav-btn.active .nav-icon {
  transform: translateY(-2px) scale(1.1);
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}

.nav-btn:active .nav-icon {
  transform: scale(0.9);
}

/* More menu */
.more-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.more-menu.hidden {
  display: none;
}

.more-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.more-menu-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 16px calc(16px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.more-menu-panel h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.paste-area.prompt-preview {
  font-size: 0.72rem;
  line-height: 1.35;
  max-height: min(50vh, 420px);
}

.compact-hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.more-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: var(--touch);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}

.more-item:last-child {
  margin-bottom: 0;
}

.more-icon {
  font-size: 1.3rem;
}

.terms-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

.terms-body p {
  margin: 0;
  color: var(--text-muted);
}

.terms-body h3 {
  margin: 4px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.terms-body ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
}

.terms-body li {
  margin: 0 0 6px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  padding: 0 12px 12px;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 0 8px;
  color: var(--text);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(90vw, 360px);
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  animation: toastIn 0.25s ease;
  pointer-events: auto;
}

.toast.success {
  border-color: rgba(61, 214, 140, 0.5);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tablet+ */
@media (min-width: 640px) {
  .toast-container {
    top: calc(var(--safe-top) + 20px);
  }

  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }
}

.journey-card .journey-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}

.journey-progress-row {
  margin-top: 4px;
}

.energy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.energy-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.energy-stat .label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.energy-stat .value {
  font-size: 0.95rem;
  font-weight: 600;
}

.progress-detail {
  margin: 2px 0 8px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.today-daily-bars {
  gap: 8px;
}

.today-daily-bars .mini-bar-row {
  font-size: 0.8rem;
}

.today-daily-bars .mini-bar {
  height: 10px;
}

.today-daily-bars .mini-bar-row span:first-child {
  width: 52px;
}

.today-bar-value {
  flex: 0 1 auto;
  min-width: 86px;
  max-width: 46%;
  text-align: right;
  font-weight: 600;
  color: var(--text);
}

.weight-assessment {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.weight-assessment strong {
  font-size: 0.92rem;
}

.weight-assessment span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.weight-assessment-note {
  display: block;
  margin-bottom: 6px;
  opacity: 0.95;
}

.weight-assessment-range {
  font-size: 0.72rem !important;
  color: var(--accent) !important;
}

.weight-assessment-healthy,
.weight-assessment-stable,
.weight-assessment-lean_gain {
  border-color: rgba(61, 214, 140, 0.35);
  background: rgba(61, 214, 140, 0.08);
}

.weight-assessment-too_fast,
.weight-assessment-drifting_up,
.weight-assessment-drifting_down {
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.08);
}

.weight-assessment-too_slow,
.weight-assessment-no_data,
.weight-assessment-maintained,
.weight-assessment-low_confidence {
  border-color: rgba(255, 193, 77, 0.25);
}

.weight-assessment-fast_lean_held {
  background: rgba(46, 160, 120, 0.12);
  border-color: rgba(46, 160, 120, 0.35);
}

.weekly-charts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.weekly-chart {
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
}

.weekly-chart:first-child {
  border-top: none;
  padding-top: 0;
}

.weekly-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.weekly-chart-header strong {
  font-size: 0.9rem;
}

.weekly-chart-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
}

.weekly-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.weekly-chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
  gap: 4px;
}

.weekly-chart-labels span {
  flex: 1;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weekly-chart-labels span:first-child {
  text-align: left;
}

.weekly-chart-labels span:last-child {
  text-align: right;
}

.weekly-chart-svg-tall {
  min-height: 120px;
}

.weekly-chart-line-planned {
  stroke: var(--accent, #3b82f6);
  stroke-dasharray: 7 5;
}

.weekly-chart-line-cone {
  stroke: var(--accent, #3b82f6);
  opacity: 0.45;
}

.weekly-chart-cone-fill {
  fill: var(--accent, #3b82f6);
  opacity: 0.08;
}

.weekly-chart-line-trend {
  stroke: var(--text-secondary, #94a3b8);
}

.weekly-chart-dot-actual {
  fill: var(--accent, #3b82f6);
}

.weekly-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 8px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.weekly-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 0;
  border-top-width: 2px;
  border-top-style: solid;
}

.legend-planned {
  border-top-color: var(--accent, #3b82f6);
  border-top-style: dashed;
}

.legend-cone {
  width: 14px;
  height: 10px;
  border: 0;
  border-radius: 2px;
  background: rgba(59, 130, 246, 0.18);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.legend-trend {
  border-top-color: var(--text-secondary, #94a3b8);
}

.legend-actual {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--accent, #3b82f6);
}

.weight-assessment-ahead {
  border-color: rgba(74, 222, 128, 0.35);
}

.weight-assessment-behind {
  border-color: rgba(255, 107, 107, 0.25);
}

.weight-assessment-gained {
  border-color: rgba(255, 107, 107, 0.25);
}

.mini-bar-fill.calories {
  background: linear-gradient(90deg, #ffb347, #ffcc80);
}
/* calories.hit overrides via the rule already above (.mini-bar-fill.calories.hit) */

.journey-card .label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.journey-card .value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  min-height: var(--touch);
  cursor: pointer;
}

.checklist-item.done {
  border-color: rgba(61, 214, 140, 0.35);
  background: rgba(61, 214, 140, 0.08);
}

.checklist-item input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checklist-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checklist-copy strong {
  font-size: 0.95rem;
}

.checklist-copy span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.checklist-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.scrub-banner {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scrub-banner strong {
  font-size: 0.88rem;
}

.scrub-banner span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.scrub-banner-due_today,
.scrub-banner-never.ready {
  border-color: rgba(61, 214, 140, 0.35);
  background: rgba(61, 214, 140, 0.08);
}

.scrub-banner-due_tomorrow {
  border-color: rgba(255, 193, 77, 0.35);
  background: rgba(255, 193, 77, 0.08);
}

.scrub-banner-wait,
.scrub-banner-done_today {
  border-color: rgba(255, 255, 255, 0.08);
}

.scrub-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: rgba(61, 214, 140, 0.12);
}

.checklist-item.scrub-due_today:not(.done) {
  border-color: rgba(61, 214, 140, 0.35);
}

.checklist-item.scrub-due_tomorrow:not(.done) {
  border-color: rgba(255, 193, 77, 0.35);
}

.checklist-item.scrub-wait:not(.done) {
  opacity: 0.92;
}

.scrub-item-hint {
  display: block;
  margin-top: 2px;
  font-size: 0.76rem;
  color: var(--accent);
}

.checklist-item.scrub-due_tomorrow:not(.done) .scrub-item-hint {
  color: #ffc14d;
}

.checklist-item.scrub-wait:not(.done) .scrub-item-hint {
  color: var(--text-muted);
}

/* Skincare product management */
.skincare-manage-card {
  margin-top: 8px;
}

.skincare-manage-card > summary.skincare-manage-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.skincare-manage-card[open] > summary.skincare-manage-summary {
  margin-bottom: 10px;
}

.skincare-manage-card > summary.skincare-manage-summary::after {
  content: '▸';
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.skincare-manage-card[open] > summary.skincare-manage-summary::after {
  transform: rotate(90deg);
}

.skincare-products-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.product-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
}

.product-manage-row.archived {
  opacity: 0.55;
  border-style: dashed;
}

.product-manage-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.product-manage-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.product-manage-notes {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

.product-manage-actions {
  flex-shrink: 0;
}

.product-manage-section-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 10px 0 4px;
}

.skincare-manage-sub {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 16px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.required-star {
  color: var(--danger);
}

.sub-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.app-version {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.app-header .header-main {
  flex: 1;
}

.hydration-table-wrap {
  overflow-x: auto;
}

.hydration-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.hydration-table th,
.hydration-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.hydration-table th {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.details-card {
  padding: 0;
  overflow: hidden;
}

.details-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  min-height: var(--touch);
}

.details-toggle .details-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.details-toggle .details-summary {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.details-toggle .details-chevron {
  color: var(--accent);
  transition: transform 0.2s ease;
  font-size: 1rem;
}

.details-toggle.open .details-chevron {
  transform: rotate(90deg);
}

.details-panel {
  padding: 0 16px 14px;
  border-top: 1px solid var(--border);
}

.details-panel.hidden {
  display: none;
}

.details-hint {
  margin: 10px 0;
}

.goal-deficit-hint {
  margin: -4px 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.goal-deficit-hint.is-recommended {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.goal-deficit-recommend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 6px;
  font-size: 0.85rem;
}

.goal-deficit-status {
  color: var(--accent);
  font-weight: 600;
}

.goal-deficit-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

.section-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 18px 0 10px;
  padding: 0 4px;
}

.activity-quick {
  margin-top: 8px;
}

.activity-quick-label {
  margin: 14px 0 0;
}

.card-muted {
  background: rgba(255, 255, 255, 0.02);
  border-style: dashed;
}

.card-muted strong {
  color: var(--accent);
}

.sub-nav-btn {
  min-height: var(--touch);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
}

.sub-nav-btn.active {
  border-color: rgba(61, 214, 140, 0.45);
  background: rgba(61, 214, 140, 0.12);
  color: var(--accent);
}

.paste-area {
  width: 100%;
  min-height: 160px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  resize: vertical;
}

.paste-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.checkbox-row.compact {
  margin-bottom: 0;
  min-height: auto;
}

.daylog-totals {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}

.daylog-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.daylog-block-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.daylog-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.daylog-row:last-child {
  border-bottom: none;
}

.daylog-row-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.daylog-row-main span,
.daylog-row-main em {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-sm {
  min-height: 36px;
  min-width: 36px;
  padding: 0 10px;
}

/* Auth gate */
.auth-gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at top, rgba(16, 185, 129, 0.12), transparent 55%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.auth-subtitle {
  margin: 0 0 24px;
  color: var(--text-muted);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 6px;
}

.auth-form label span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-form input {
  width: 100%;
  min-height: var(--touch);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
}

.auth-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.auth-success {
  margin: 0;
  color: var(--success, #3dd68c);
  font-size: 0.9rem;
  line-height: 1.4;
}

.auth-dev-link {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-all;
  color: var(--text-muted);
}

.auth-banner {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.9rem;
  line-height: 1.4;
}

.auth-banner--ok {
  border-color: rgba(61, 214, 140, 0.45);
  color: var(--success, #3dd68c);
}

.auth-banner--warn {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fbbf24;
}

.auth-switch {
  margin: 16px 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Onboarding wizard */
.onboarding-gate {
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
  overflow-y: auto;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.1), transparent 55%),
    var(--bg);
}

.onboarding-card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 32px;
  box-shadow: var(--shadow);
}

.onboarding-step-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.onboarding-title {
  margin: 0 0 8px;
  font-size: 1.55rem;
}

.onboarding-subtitle {
  margin: 0 0 20px;
  color: var(--text-muted);
  line-height: 1.45;
}

.onboarding-step.hidden {
  display: none;
}

.onboarding-terms {
  max-height: min(42vh, 340px);
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.dob-parts {
  display: grid;
  grid-template-columns: 1.15fr 1.35fr 0.9fr;
  gap: 8px;
}

.dob-parts select {
  min-width: 0;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-glow);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* ── Body Composition Profile selector ──────────────────────────────────── */

.bcp-profiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.bcp-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.bcp-card:hover {
  border-color: var(--accent-glow);
  background: color-mix(in srgb, var(--accent-glow) 6%, var(--surface));
}

.bcp-card-selected {
  border-color: var(--accent-glow);
  background: color-mix(in srgb, var(--accent-glow) 10%, var(--surface));
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.bcp-card-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.bcp-card-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Detail panel shown below the tabs */
.bcp-detail {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bcp-tagline {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-glow);
  margin: 0;
}

.bcp-bf-range {
  font-size: 0.88rem;
  margin: 0;
  color: var(--text);
}

.bcp-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.bcp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 4px 0 8px;
}

.bcp-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bcp-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.bcp-stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.bcp-no-bia {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 4px 0;
}

.bcp-my-target-hint {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
}

/* Preview mode banner */
.goals-preview-banner {
  background: color-mix(in srgb, var(--warning, #f59e0b) 12%, var(--surface-card));
  border: 1px solid color-mix(in srgb, var(--warning, #f59e0b) 40%, transparent);
  color: var(--text);
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 4px;
}

.goals-composition-warning {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface-card, #12161f));
  border: 1.5px solid var(--danger);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.45;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.goals-composition-warning strong {
  display: block;
  margin-bottom: 4px;
  color: var(--danger);
}

/* ── Manage plan ──────────────────────────────────────────────────────────── */

.manage-plan-details {
  margin-top: 16px;
}

.manage-plan-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  padding: 0 4px;
  user-select: none;
}

.manage-plan-summary::-webkit-details-marker { display: none; }

.manage-plan-summary::before {
  content: '▶';
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.manage-plan-details[open] > .manage-plan-summary::before {
  transform: rotate(90deg);
}

.summary-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.manage-plan-body {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.manage-plan-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manage-plan-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0;
}

/* Session management cards */
.manage-session-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.manage-session-card.archived {
  opacity: 0.55;
}

.manage-session-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.manage-session-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.manage-session-focus {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.manage-session-actions {
  flex-shrink: 0;
}

/* Exercise list inside a session */
.manage-exercise-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.manage-exercise-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: var(--surface);
  border-radius: 6px;
  font-size: 0.88rem;
}

.manage-ex-name {
  flex: 1;
  font-weight: 500;
}

.manage-ex-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.btn-remove-exercise {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.btn-remove-exercise:hover {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
}

/* Add-to-session inline form */
.add-to-session-details {
  margin-top: 6px;
}

.add-to-session-details > summary {
  font-size: 0.85rem;
  color: var(--accent-glow);
  cursor: pointer;
  list-style: none;
  padding: 2px 0;
}

.add-to-session-details > summary::-webkit-details-marker { display: none; }

/* Exercise library list */
.exercise-group {
  margin-bottom: 12px;
}

.exercise-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.exercise-library-row {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  background: var(--surface);
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.exercise-library-row.custom {
  border-color: color-mix(in srgb, var(--accent-glow) 30%, transparent);
}

.exercise-library-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exercise-library-name {
  font-weight: 500;
}

.exercise-library-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Add custom exercise sub-details */
.add-exercise-details {
  margin-top: 8px;
}

.add-exercise-summary {
  font-size: 0.85rem;
  color: var(--accent-glow);
  cursor: pointer;
  list-style: none;
  padding: 2px 0;
}

.add-exercise-summary::-webkit-details-marker { display: none; }

/* ── AI Chat (embedded in AI tab) ─────────────────────────────────────────── */

.ai-chat-panel {
  padding-bottom: 0;
  overflow: hidden;
}

.ai-chat-panel.is-locked {
  padding-bottom: 20px;
}

.ai-chat-locked {
  text-align: center;
  padding: 8px 4px 4px;
}

.ai-chat-locked-icon {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 10px;
}

.ai-chat-locked-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
}

.ai-chat-locked-copy {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.ai-chat-panel .chat-container {
  display: flex;
  flex-direction: column;
  height: min(52vh, 420px);
  min-height: 280px;
  max-width: 100%;
  margin: 0;
  width: 100%;
}

.ai-chat-panel .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-chat-panel .chat-input-area {
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  margin: 0 -16px;
  padding: 10px 16px 12px;
}

.chat-date-note {
  font-size: 0.82rem;
  color: var(--accent-glow);
  margin: -4px 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-glow) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-glow) 28%, transparent);
}

.chat-welcome {
  margin: auto;
  text-align: center;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.chat-welcome-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.chat-welcome-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.chat-welcome-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 280px;
}

/* Message bubbles */
.chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble-user {
  align-self: flex-end;
  background: var(--accent-glow);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble-model {
  align-self: flex-start;
  background: var(--surface-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: chat-bounce 1.2s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chat-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%            { transform: scale(1.0); opacity: 1; }
}

/* Input area */
.chat-input-area {
  padding: 8px 12px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  line-height: 1.4;
  overflow-y: auto;
  transition: border-color 0.15s;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent-glow);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.chat-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.chat-send-btn:not(:disabled):hover { opacity: 0.85; }

.chat-mic-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.chat-mic-btn:not(:disabled):hover {
  color: var(--text);
  border-color: var(--accent-glow);
}

.chat-mic-btn.is-listening {
  color: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent);
  animation: chat-mic-pulse 1.2s ease-in-out infinite;
}

.chat-mic-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@keyframes chat-mic-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

.chat-char-count {
  font-size: 0.75rem;
  color: var(--danger);
  text-align: right;
  margin: 0;
  min-height: 1em;
}

.chat-char-count:empty { display: none; }

/* TSV block inside bubble */
.chat-tsv-block {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  border-radius: 6px;
  padding: 6px 8px;
  margin: 6px 0 0;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.5;
  max-height: 220px;
  overflow-y: auto;
}

.chat-bubble-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-bubble-wrapper .chat-bubble-user { align-self: flex-end; }
.chat-bubble-wrapper .chat-bubble-model { align-self: flex-start; }

/* Import action bar below AI bubble */
.chat-import-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 4px;
}

.chat-import-btn {
  font-size: 0.8rem !important;
  padding: 5px 10px !important;
}

/* Admin user management */
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.admin-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.admin-user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-user-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.admin-user-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-danger-outline {
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}

