/* =========================================
   YOUR OS — PHASE 1
   ========================================= */

/* =========================================
   1. RESET
   ========================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
p,
button,
input,
textarea {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  background: none;
  border: none;
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* =========================================
   2. THEME
   ========================================= */

:root {
  color-scheme: dark;

  --bg: #09090b;
  --bg-elevated: #111114;
  --bg-elevated-2: #151519;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text: #f5f5f7;
  --text-soft: rgba(245, 245, 247, 0.72);
  --text-faint: rgba(245, 245, 247, 0.5);
  --text-muted: rgba(245, 245, 247, 0.38);

  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.12);

  --success: #88d39a;
  --danger: #ff7d7d;

  --shadow-1: 0 8px 30px rgba(0, 0, 0, 0.22);
  --shadow-2: 0 18px 60px rgba(0, 0, 0, 0.32);

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-pill: 999px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.5rem;
  --space-10: 3rem;

  --font-xs: 0.72rem;
  --font-sm: 0.88rem;
  --font-md: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.4rem;
  --font-2xl: 2rem;
  --font-3xl: 2.6rem;

  --line-tight: 1.1;
  --line-normal: 1.45;
  --line-loose: 1.6;

  --max-width: 760px;

  --transition-fast: 140ms ease;
  --transition-base: 220ms ease;
}

/* =========================================
   3. BASE
   ========================================= */

body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #0b0b0f 0%, #09090b 100%);
  color: var(--text);
  line-height: var(--line-normal);
  padding:
    max(1rem, env(safe-area-inset-top))
    1rem
    max(1.25rem, env(safe-area-inset-bottom));
}

body.modal-open {
  overflow: hidden;
}

body.reorder-active {
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

/* =========================================
   4. APP SHELL
   ========================================= */

.app-shell {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  padding: var(--space-3) var(--space-3) calc(4.5rem + env(safe-area-inset-bottom));
}

.sections-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* =========================================
   5. TOPBAR
   ========================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-bottom: var(--space-4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(
    180deg,
    rgba(9, 9, 11, 0.88) 0%,
    rgba(9, 9, 11, 0.68) 72%,
    rgba(9, 9, 11, 0) 100%
  );
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-3);
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

.brand-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.section-kicker,
.hero-card__label,
.editor-sheet__eyebrow {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.app-title {
  font-size: var(--font-sm);
  font-weight: 600;
  letter-spacing: 0;
  padding: 0.55rem 0.9rem;
  background: #ffffff;
  color: #0a0a0a;
  border: none;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  cursor: pointer;
  line-height: inherit;
  transition: opacity 0.15s;
}

.app-title:active {
  opacity: 0.75;
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

.topbar-menu-wrap {
  position: relative;
}

.topbar-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--surface-2, #1c1c22);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 200;
}

.topbar-menu.is-open {
  display: block;
}

.topbar-menu__item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: var(--font-sm);
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s;
}

.topbar-menu__item:hover,
.topbar-menu__item:active {
  background: rgba(255, 255, 255, 0.06);
}

.topbar-menu__item--danger {
  color: rgba(248, 113, 113, 0.9);
}

.topbar-menu__item--danger:hover,
.topbar-menu__item--danger:active {
  background: rgba(248, 113, 113, 0.08);
}

.topbar__date {
  font-size: var(--font-sm);
  font-weight: 600;
  color: #0a0a0a;
  padding: 0.55rem 0.9rem;
  background: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* =========================================
   6. HERO CARD
   ========================================= */

.hero-card {
  position: relative;
  overflow: hidden;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-1);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03) 0%,
    transparent 45%
  );
}

.hero-card__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hero-card__title {
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 700;
  max-width: 12ch;
}

.hero-card__subtitle {
  font-size: var(--font-md);
  color: var(--text-soft);
  max-width: 36ch;
}

/* =========================================
   7. SECTION CARDS
   ========================================= */

.section-card {
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-elevated-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-1);
  animation: fadeInUp 0.35s ease;
}

.section-card--feature {
  border-color: var(--border-strong);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.04), transparent 32%),
    linear-gradient(180deg, #141419 0%, #101015 100%);
}

.section-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.section-drag-handle {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: transparent;
  border: none;
  font-size: 0.46rem;
  line-height: 1;
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0.65;
  transition: opacity var(--transition-base), color var(--transition-base);
}

.section-drag-handle:hover {
  opacity: 0.8;
  color: var(--text);
}

.section-drag-handle:active {
  cursor: grabbing;
}

.is-section-dragging {
  opacity: 0.35;
  pointer-events: none;
}

.section-drag-ghost {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-raised, #1e1e26);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.55rem 1.1rem;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text);
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

.section-drop-indicator {
  position: fixed;
  left: var(--page-gutter, 1rem);
  right: var(--page-gutter, 1rem);
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  pointer-events: none;
  z-index: 9998;
  box-shadow: 0 0 6px var(--accent);
}

.section-reorder-active * {
  user-select: none;
  -webkit-user-select: none;
}

.section-title {
  font-size: 1.35rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 650;
  margin-top: 0.5rem;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.vitamins-count-badge {
  font-size: var(--font-xs);
  color: var(--text-muted);
  font-weight: 500;
  padding-left: 0.1rem;
}

#vitamins-section.is-collapsed .vitamins-count-badge {
  display: none;
}

.section-badge-btn {
  font-size: var(--font-xs);
  color: var(--text-muted);
  font-weight: 500;
  padding: 0 0 0 0.1rem;
  background: transparent;
  border: none;
  font-family: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: color var(--transition-base);
}

.section-badge-btn.is-active {
  color: var(--text);
}

#tasklist-section.is-collapsed .section-badge-btn {
  display: none;
}

.section-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.section-card__body.is-reorder-target {
  transition: background-color var(--transition-fast);
}

.section-card__body.is-reorder-target .drag-placeholder {
  background: rgba(255, 255, 255, 0.035);
}

/* =========================================
   8. BUTTONS
   ========================================= */

.text-button,
.icon-button,
.primary-button,
.ghost-button,
.fab,
.item-row__main {
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    opacity var(--transition-fast);
}

.text-button:active,
.icon-button:active,
.primary-button:active,
.ghost-button:active,
.fab:active,
.item-row__main:active {
  transform: scale(0.98);
}

.text-button,
.ghost-button,
.primary-button {
  min-height: 44px;
  border-radius: var(--radius-pill);
}

.text-button {
  padding: 0.7rem 0.95rem;
  font-size: var(--font-sm);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.text-button:hover {
  background: var(--surface-hover);
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.icon-button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.section-drag-handle.icon-button {
  width: 36px;
  height: 36px;
  font-size: 0.54rem;
  background: transparent;
  border: none;
  border-radius: 0;
}

.primary-button {
  padding: 0.9rem 1.2rem;
  background: var(--text);
  color: #09090b;
  font-weight: 600;
}

.primary-button:hover {
  opacity: 0.92;
}

.ghost-button {
  padding: 0.9rem 1.2rem;
  color: var(--danger);
  background: transparent;
  border: 1px solid rgba(255, 125, 125, 0.25);
}

.ghost-button:hover {
  background: rgba(255, 125, 125, 0.08);
}

/* =========================================
   9. ITEM ROWS
   ========================================= */

   .drag-handle {
  width: 32px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.82rem;
  line-height: 1;
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.drag-handle:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.drag-handle:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.item-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 70px;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    transform var(--transition-base),
    opacity var(--transition-base);
  touch-action: pan-y;
}

.item-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  transform: translateY(-1px);
}

.item-row.is-draggable {
  cursor: grab;
}

.item-row.is-dragging {
  position: fixed;
  z-index: 120;
  margin: 0;
  pointer-events: none;
  transform: scale(1.02);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(28, 28, 34, 0.96), rgba(18, 18, 24, 0.96));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.item-row--task.is-complete .item-row__title {
  text-decoration: line-through;
  color: var(--text-faint);
}

.item-row--task.is-complete .item-row__notes {
  color: var(--text-muted);
}

.item-row__main {
  flex: 1;
  text-align: left;
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 0;
}

.item-row__content {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

.item-row__title {
  font-size: 1rem;
  font-weight: 560;
  color: var(--text);
  letter-spacing: -0.015em;
  word-break: break-word;
}

.item-row__notes {
  font-size: var(--font-sm);
  color: var(--text-faint);
  word-break: break-word;
}

.item-row__notes:empty {
  display: none;
}

.item-row__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* =========================================
   10. TASK CHECKBOX
   ========================================= */

.task-check {
  position: relative;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.task-check__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.task-check__box {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.task-check__input:checked + .task-check__box {
  background: var(--text);
  border-color: var(--text);
  transform: scale(0.96);
}

.task-check__input:checked + .task-check__box::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 8px;
  width: 5px;
  height: 9px;
  border: solid #09090b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.tasklist-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tasklist-filter {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
}

.tasklist-filter__button {
  min-height: 36px;
  padding: 0.45rem 0.5rem;
  font-size: var(--font-xs);
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.tasklist-filter__button.is-active {
  background: var(--text);
  color: #09090b;
  font-weight: 600;
}

.tasklist-filter__button:active {
  transform: scale(0.98);
}

.tasklist-filter__button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 2px;
}

/* ── Projects coming soon ── */
.coming-soon-state {
  padding: var(--space-6) var(--space-4);
  text-align: center;
}
.coming-soon-state__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}
.coming-soon-state__text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Principles sheet bucket list section ── */
.principles-bucket-section {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
.principles-bucket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4) var(--space-3);
}
.principles-bucket-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Calendar event badge pulse ── */
@keyframes calEventPulse {
  0%, 100% { transform: scale(0.88); opacity: 0.55; }
  50%       { transform: scale(1.15); opacity: 1; }
}

#open-calendar-fab-btn.has-event .bottom-nav__icon {
  stroke: #4ade80;
  animation: calEventPulse 1.2s ease-in-out infinite;
}

#open-calendar-fab-btn.has-event .bottom-nav__icon circle {
  fill: #4ade80;
}

.subtasks-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.subtasks-panel__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

#add-subtask-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 82%;
  margin: 0 auto;
  padding: 0.6rem var(--space-3);
  border-radius: var(--radius-sm);
  border: 1.5px dashed rgba(100, 160, 255, 0.85);
  background: rgba(100, 160, 255, 0.22);
  color: rgba(180, 215, 255, 1);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

#add-subtask-btn:hover {
  background: rgba(100, 160, 255, 0.30);
  border-color: rgba(100, 160, 255, 0.95);
  color: rgba(200, 225, 255, 1);
}

#add-subtask-btn:active {
  transform: scale(0.98);
}

.editor-sheet--editing #add-subtask-btn {
  position: sticky;
  bottom: var(--space-3);
  z-index: 2;
  background: rgba(100, 160, 255, 0.18);
  border-color: rgba(100, 160, 255, 0.72);
}

.subtasks-panel__eyebrow {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.subtasks-panel__meta {
  font-size: var(--font-sm);
  color: var(--text-soft);
}

.subtasks-editor-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.subtask-editor-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: var(--space-3);
}

.subtask-editor-row__check {
  margin-top: 0;
}

.subtask-editor-row__input {
  min-width: 0;
}

.subtask-editor-row__delete {
  min-height: 44px;
  padding: 0.75rem 0.95rem;
  white-space: nowrap;
}

.task-subtasks {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-left: 0.15rem;
}

.task-subtask {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-left: 1.65rem;
}

.task-subtask__check {
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.task-subtask__check-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.task-subtask__check-box {
  width: 20px;
  height: 20px;
  display: block;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.task-subtask__check-input:checked + .task-subtask__check-box {
  background: var(--text);
  border-color: var(--text);
  transform: scale(0.96);
}

.task-subtask__check-input:checked + .task-subtask__check-box::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 6px;
  width: 4px;
  height: 7px;
  border: solid #09090b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-subtask__label {
  font-size: var(--font-sm);
  color: var(--text-soft);
  word-break: break-word;
  flex: 1;
}

.task-subtask.is-complete .task-subtask__label {
  text-decoration: line-through;
  color: var(--text-muted);
}


/* =========================================
   11. GOAL CONTENT
   ========================================= */

.goal-notes {
  font-size: var(--font-sm);
  color: var(--text-soft);
  margin-top: var(--space-1);
}

#goal-section {
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

#goal-section:hover {
  border-color: rgba(255,255,255,0.18);
}

/* ---- Goal progress sheet ---- */

.goal-progress-notes {
  font-size: var(--font-sm);
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: var(--space-4);
  line-height: var(--line-loose);
}

.goal-progress-stats {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.goal-progress-stat {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-2);
  text-align: center;
}

.goal-progress-stat__val {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.goal-progress-stat__denom {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.goal-progress-stat__lbl {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.goal-heatmap {
  margin-bottom: var(--space-2);
}

.goal-cell--empty {
  background: rgba(255,255,255,0.05);
}

.goal-cell--yes {
  background: rgba(74,222,128,0.3);
  border-color: rgba(74,222,128,0.5);
}

.goal-cell--no {
  background: rgba(248,113,113,0.2);
  border-color: rgba(248,113,113,0.35);
}

.goal-cell__icon {
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: inherit;
}

.goal-cell--yes .goal-cell__icon { color: #4ade80; }
.goal-cell--no  .goal-cell__icon { color: #f87171; }

.goal-cell__plus {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.goal-progress-hint {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: var(--space-3);
  text-align: center;
}

/* Goal yes/no picker */
.goal-yn-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.goal-yn-btn {
  padding: 0.85rem 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: var(--font-base);
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}

.goal-yn-btn--yes.is-active,
.goal-yn-btn--yes:hover {
  background: rgba(74,222,128,0.25);
  border-color: rgba(74,222,128,0.5);
  color: #4ade80;
}

.goal-yn-btn--no.is-active,
.goal-yn-btn--no:hover {
  background: rgba(248,113,113,0.2);
  border-color: rgba(248,113,113,0.4);
  color: #f87171;
}

/* =========================================
   12. EMPTY STATE
   ========================================= */

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.022);
  padding: var(--space-4);
}

.empty-state__text {
  color: var(--text-muted);
  font-size: var(--font-sm);
  text-align: center;
}

.drag-placeholder {
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

/* =========================================
   13. FAB
   ========================================= */

.fab {
  position: fixed;
  right: 1rem;
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 0.5rem);
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: #09090b;
  font-size: 1.8rem;
  line-height: 1;
  box-shadow: var(--shadow-2);
  z-index: 40;
}

.fab:hover {
  opacity: 0.94;
}

.fab-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

/* =========================================
   14. MODAL / EDITOR SHEET
   ========================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.editor-sheet {
  width: 100%;
  max-width: var(--max-width);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 28%),
    linear-gradient(180deg, #17171c 0%, #101015 100%);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  box-shadow: var(--shadow-2);
  padding: var(--space-3) var(--space-4) 0;
  transition: transform 0.25s ease;
}

.editor-sheet__scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-bottom: var(--space-5);
}

.editor-sheet__footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0 calc(var(--space-3) + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.editor-sheet__footer .ghost-button,
.editor-sheet__footer .primary-button {
  flex: 1;
}

.editor-sheet__footer .ghost-button--danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

.editor-sheet__footer .ghost-button--danger:hover {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.5);
}

.editor-sheet__handle {
  width: 44px;
  height: 5px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
  cursor: grab;
  padding: 12px 40px;
  box-sizing: content-box;
  margin-left: auto;
  margin-right: auto;
  background-clip: content-box;
}

.editor-sheet__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.editor-sheet__title {
  margin-top: 0.22rem;
  font-size: 1.55rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field__label {
  font-size: var(--font-sm);
  color: var(--text-soft);
}

.field__input,
.field__textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  outline: none;
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast);
}

.field__input::placeholder,
.field__textarea::placeholder {
  color: var(--text-muted);
}

.field__input:focus,
.field__textarea:focus {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.field__textarea {
  min-height: 120px;
  resize: vertical;
}


/* =========================================
   15. UTILITIES
   ========================================= */

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

.is-hidden {
  display: none !important;
}

/* =========================================
   16. ANIMATIONS
   ========================================= */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) {
  .item-row.is-draggable:hover {
    cursor: grab;
  }

  .item-row:hover {
    background: rgba(255, 255, 255, 0.04);
  }

  .section-card:hover,
  .hero-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
  }

  .nav-badge ~ .bottom-nav__label,
  .bottom-nav__btn:hover .bottom-nav__label {
    color: var(--text);
  }

  .bottom-nav__btn:hover .bottom-nav__icon {
    opacity: 0.85;
  }

  .cal-day-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }
}

/* =========================================
   17. DESKTOP
   ========================================= */

@media (min-width: 768px) {
  body {
    padding:
      max(1.5rem, env(safe-area-inset-top))
      1.5rem
      max(2rem, env(safe-area-inset-bottom));
  }

  .app-main {
    gap: var(--space-6);
    padding-bottom: 4.5rem;
  }

  .sections-stack {
    gap: var(--space-5);
  }

  .hero-card,
  .section-card {
    padding: var(--space-6);
  }

  .topbar__inner {
    padding-top: var(--space-4);
  }

  .fab {
    right: max(1.5rem, calc((100vw - var(--max-width)) / 2 + 1.5rem));
    bottom: 1.5rem;
  }

  #editor-backdrop {
    align-items: center;
    justify-content: center;
  }

  .editor-sheet {
    position: relative;
    inset: auto;
    margin-bottom: 0;
    max-height: min(88vh, 860px);
    border-radius: var(--radius-lg);
    border-bottom: 1px solid var(--border-strong);
    padding: var(--space-4) var(--space-5) 0;
  }

  .editor-sheet__footer {
    padding-bottom: var(--space-3);
  }
}

/* =========================================
   14B. CALENDAR
   ========================================= */

.topbar__date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar__date-button {
  cursor: pointer;
}

/* Full-screen calendar — overrides the bottom-sheet defaults */
#calendar-backdrop,
#vitamin-insights-backdrop,
#bucket-list-backdrop,
#goal-progress-backdrop,
#finances-backdrop {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* These three show the persistent nav underneath */
#calendar-backdrop,
#vitamin-insights-backdrop,
#finances-backdrop {
  z-index: 35;
}

.calendar-sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: #0e0e12;
  display: flex;
  flex-direction: column;
  padding: max(var(--space-4), env(safe-area-inset-top)) var(--space-4) 0;
  overflow: hidden;
}

/* ---- Calendar redesign ---- */

.calendar-topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  justify-content: flex-end;
}

.calendar-back-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.calendar-back-btn:hover {
  color: var(--text);
}

.calendar-year-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.calendar-year-btn:hover {
  color: var(--text);
}

/* ---- Month scroll sections ---- */

.calendar-months-scroll {
  /* container; scrolling handled by .calendar-body */
}

.calendar-months-sentinel {
  height: 1px;
  width: 100%;
}

.calendar-month-section {
  margin-bottom: 2rem;
}

.calendar-month-section__header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0e0e12;
  padding: var(--space-2) 0;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.calendar-month-section__name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-soft);
  line-height: 1;
}

.calendar-month-section__year {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

.is-current-month .calendar-month-section__name {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
}

.is-current-month .calendar-month-section__year {
  color: var(--text-soft);
}


.calendar-heading {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: var(--space-4);
}

.calendar-heading__month {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

.calendar-heading__year {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
  letter-spacing: -0.02em;
}

.calendar-heading__year:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* ---- Year overview ---- */

.calendar-year-scroller {
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

.calendar-year-page {
  height: 100%;
  scroll-snap-align: start;
  overflow-y: auto;
  padding: 1rem 1rem 2rem;
  box-sizing: border-box;
}

.calendar-year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 0.75rem;
  padding-bottom: 0.5rem;
}

.calendar-mini-month {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.35rem;
  cursor: pointer;
  text-align: left;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast);
}

.calendar-mini-month:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.calendar-mini-month.is-current .calendar-mini-month__name {
  color: #f87171;
}

.calendar-mini-month__name {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-soft);
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.calendar-mini-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 0.2rem;
}

.calendar-mini-weekdays span {
  font-size: 0.48rem;
  text-align: center;
  color: var(--text-muted);
  text-transform: uppercase;
}

.calendar-mini-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.calendar-mini-day {
  font-size: 0.58rem;
  text-align: center;
  color: var(--text-soft);
  line-height: 1.6;
  border-radius: 50%;
}

.calendar-mini-day.is-empty {
  visibility: hidden;
}

.calendar-mini-day.is-today {
  background: var(--text);
  color: #09090b;
  font-weight: 700;
  border-radius: 50%;
}

.calendar-mini-day.is-selected {
  outline: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

.calendar-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(max(1.5rem, env(safe-area-inset-bottom)) + 1.5rem + 3.75rem);
}

.calendar-body--year {
  overflow: hidden;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

.calendar-body--year .calendar-year-scroller {
  flex: 1;
  height: 0; /* flex child needs explicit basis for height:100% children */
}

.calendar-grid--weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.calendar-weekday {
  text-align: center;
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0.35rem 0;
}

.calendar-grid--days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
}

.calendar-day {
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

.calendar-day:active {
  transform: scale(0.98);
}

.calendar-day__number {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 560;
  font-size: 0.9rem;
}

.calendar-day.is-outside-month {
  background: none;
  pointer-events: none;
  visibility: hidden;
}

.calendar-day.is-weekend:not(.is-today):not(.is-selected) .calendar-day__number {
  color: var(--text-muted);
}

.calendar-day__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  min-height: 5px;
}

.calendar-day__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

.calendar-day__dot--task      { background: rgba(255, 255, 255, 0.7); }
.calendar-day__dot--event     { background: #60a5fa; }
.calendar-day__dot--reminder  { background: #fb923c; }
.calendar-day__dot--adventure { background: #fbbf24; }
.calendar-day__dot--photo     { background: #e040fb; }

.calendar-day.is-selected .calendar-day__dot { opacity: 0.6; }

.calendar-day.is-today .calendar-day__number {
  border: 1.5px solid rgba(255, 255, 255, 0.45);
}

.calendar-day.is-selected .calendar-day__number {
  background: var(--text);
  color: #09090b;
  font-weight: 700;
}

.calendar-day.is-today.is-selected .calendar-day__number {
  background: var(--text);
  color: #09090b;
  border-color: transparent;
}

.calendar-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.calendar-picker-button {
  min-height: 64px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 560;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.calendar-picker-button:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-strong);
}

.calendar-picker-button:active {
  transform: scale(0.98);
}

.calendar-picker-button.is-selected {
  background: var(--text);
  color: #09090b;
  border-color: transparent;
  font-weight: 650;
}

.topbar__date-button:focus-visible,
.calendar-period-button:focus-visible,
.calendar-segment:focus-visible,
.calendar-day:focus-visible,
.calendar-picker-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  #calendar-backdrop {
    background: rgba(0, 0, 0, 0.54);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
  }

  .calendar-sheet {
    position: relative;
    inset: auto;
    max-width: 520px;
    max-height: 88vh;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
    padding: var(--space-5) var(--space-5) 0;
  }

  .calendar-month-section__header {
    background: #0e0e12;
  }

  .calendar-picker-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* =========================================
   17b. CALENDAR DAY VIEW
   ========================================= */

/* Topbar 3-col layout for day view */
.calendar-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 44px;
  margin-bottom: var(--space-3);
}

.calendar-topbar__left {
  display: flex;
  align-items: center;
}

.calendar-day-date-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
  white-space: nowrap;
}

@keyframes dateLabelPop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}

.calendar-day-date-label--pop {
  animation: dateLabelPop 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.calendar-day-back-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.calendar-day-back-btn:hover {
  color: var(--text);
}

/* ---- Crisp long-press areas ---- */

.calendar-hour-slot,
.calendar-day-untimed {
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* ---- Tracking panel ---- */

.calendar-tracking-panel {
  padding: var(--space-3) 0;
}

.calendar-tracking-panel__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  padding: 0 var(--space-1);
}

.calendar-tracking-panel__empty {
  font-size: var(--font-sm);
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-1);
}

.tracking-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.tracking-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  min-height: 60px;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.tracking-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.tracking-card:active {
  transform: scale(0.98);
}

.tracking-card.is-done {
  background: rgba(136, 211, 154, 0.12);
  border-color: rgba(136, 211, 154, 0.26);
}

.tracking-card.is-done:hover {
  background: rgba(136, 211, 154, 0.16);
  border-color: rgba(136, 211, 154, 0.34);
}

.tracking-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.tracking-card__title {
  font-size: 1rem;
  font-weight: 560;
  color: var(--text);
  letter-spacing: -0.015em;
  word-break: break-word;
}

.tracking-card.is-done .tracking-card__title {
  color: #dff7e5;
}

.tracking-card__notes {
  font-size: var(--font-sm);
  color: var(--text-faint);
  word-break: break-word;
}

.tracking-card.is-done .tracking-card__notes {
  color: rgba(223, 247, 229, 0.72);
}

.tracking-card__check {
  flex-shrink: 0;
  order: -1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.tracking-card.is-done .tracking-card__check {
  background: #4ade80;
  border-color: #4ade80;
}

.tracking-card__check-icon {
  font-size: 0.8rem;
  font-weight: 700;
  color: transparent;
  line-height: 1;
  transition: color var(--transition-fast);
}

.tracking-card.is-done .tracking-card__check-icon {
  color: #0e0e12;
}

/* ---- Untimed section ---- */

.calendar-day-view {
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  padding-top: 1rem;
}

@keyframes slideFromRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideFromLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

.calendar-day-view--slide-next {
  animation: slideFromRight 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.calendar-day-view--slide-prev {
  animation: slideFromLeft 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.calendar-day-untimed {
  padding: var(--space-2) 0 var(--space-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}


.calendar-day-untimed__empty {
  font-size: var(--font-sm);
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-2) 0;
}

.calendar-day-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-1);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.calendar-day-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.calendar-day-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.calendar-day-item__dot.event     { background: #60a5fa; }
.calendar-day-item__dot.reminder  { background: #fb923c; }
.calendar-day-item__dot.adventure { background: #fbbf24; }

.calendar-day-item--adventure {
  border-left: 2px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.04);
}

.calendar-day-item--adventure:hover {
  background: rgba(251, 191, 36, 0.08);
}

.calendar-day-item__title {
  font-size: var(--font-sm);
  color: var(--text);
  flex: 1;
  text-align: left;
}

.calendar-day-item.is-complete .calendar-day-item__title {
  text-decoration: line-through;
  opacity: 0.45;
}

/* ---- Timeline ---- */

.calendar-timeline {
  position: relative;
  flex: 1;
}

.calendar-timeline__grid {
  /* stacks hour rows */
}

.calendar-hour-slot {
  display: flex;
  align-items: flex-start;
  height: 64px;
  position: relative;
}

.calendar-hour-label {
  width: 52px;
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  padding-top: 0;
  text-align: right;
  padding-right: 10px;
  transform: translateY(-0.5em);
  letter-spacing: 0.01em;
}

.calendar-hour-slot:first-child .calendar-hour-label {
  visibility: visible;
}

.calendar-hour-line {
  flex: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* Items layer (absolutely positioned over the grid) */
.calendar-timeline__items {
  position: absolute;
  inset: 0;
  left: 52px;
  pointer-events: none;
}

.calendar-timed-item {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 8px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.09);
  border-left: 3px solid rgba(255, 255, 255, 0.4);
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  pointer-events: auto;
  overflow: hidden;
  text-align: left;
  transition: background-color var(--transition-fast);
}

.calendar-timed-item:hover {
  background: rgba(255, 255, 255, 0.13);
}

.calendar-timed-item--event {
  background: rgba(96, 165, 250, 0.14);
  border-left-color: #60a5fa;
}

.calendar-timed-item--reminder {
  background: rgba(251, 146, 60, 0.14);
  border-left-color: #fb923c;
}

.calendar-timed-item.is-complete {
  opacity: 0.38;
}

.calendar-ghost-block {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 64px;
  background: rgba(255, 255, 255, 0.13);
  border-left: 3px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  pointer-events: none;
  z-index: 6;
  transition: top 60ms cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 8px;
  gap: 2px;
}

.calendar-ghost-block__title {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.2;
}

.calendar-ghost-block__time {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1;
}



/* ---- Ghost source dim ---- */

.calendar-timed-item.is-ghost-source {
  opacity: 0.2;
  pointer-events: none;
}

.calendar-timed-item__title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.calendar-timed-item__time {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1;
}

/* Current time indicator */
.calendar-time-indicator {
  position: absolute;
  left: 52px;
  right: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 3;
  transform: translateY(-50%);
}

.calendar-time-indicator__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  margin-left: -5px;
}

.calendar-time-indicator__line {
  flex: 1;
  height: 2px;
  background: #ef4444;
}

/* ---- Item creation / edit sheet ---- */

.cal-item-sheet {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.cal-item-sheet__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.cal-item-sheet__panel {
  position: relative;
  z-index: 1;
  background: #17171c;
  border-top: 1px solid var(--border-strong);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: var(--space-4);
  padding-bottom: calc(4.25rem + env(safe-area-inset-bottom) + var(--space-4));
}

.cal-item-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.cal-item-sheet__title {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.cal-item-sheet__save {
  font-size: var(--font-sm);
  font-weight: 650;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  transition: background-color var(--transition-fast);
}

.cal-item-sheet__save:hover {
  background: rgba(255, 255, 255, 0.18);
}

.cal-item-type-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-bottom: var(--space-4);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-pill);
  padding: 3px;
  border: 1px solid var(--border);
}

.cal-item-type-tab {
  border-radius: var(--radius-pill);
  padding: 0.4rem;
  font-size: var(--font-sm);
  color: var(--text-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.cal-item-type-tab.is-active {
  background: var(--text);
  color: #09090b;
  font-weight: 650;
}

.cal-item-title-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  padding: 0.75rem;
  margin-bottom: var(--space-3);
  outline: none;
  box-sizing: border-box;
}

.cal-item-title-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.cal-item-timed-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--font-sm);
  color: var(--text-soft);
  margin-bottom: var(--space-3);
  user-select: none;
}

.cal-item-time-inputs {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.cal-item-time-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cal-item-time-field span {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cal-item-time-field input[type="time"] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  outline: none;
}

.cal-item-time-field input[type="time"]:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.cal-item-delete-btn {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #f87171;
  cursor: pointer;
  font-size: var(--font-sm);
  font-weight: 600;
  transition: background-color var(--transition-fast);
  margin-top: var(--space-2);
}

.cal-item-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.cal-item-delete-btn--soft {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-soft);
}

.cal-item-delete-btn--soft:hover {
  background: rgba(255, 255, 255, 0.12);
}

.cal-item-rec-delete {
  margin-top: var(--space-2);
}

.cal-item-rec-delete__prompt {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cal-item-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.cal-item-date-row__label {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.cal-item-date-row__input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  outline: none;
  flex: 1;
}

.cal-item-date-row__input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

/* =========================================
   18. LARGE DESKTOP POLISH
   ========================================= */

@media (min-width: 1024px) {
  .section-title {
    font-size: 1.45rem;
  }
}

.item-row--vitamin-taken {
  background: rgba(136, 211, 154, 0.12);
  border-color: rgba(136, 211, 154, 0.26);
}

.item-row--vitamin-taken:hover {
  background: rgba(136, 211, 154, 0.16);
  border-color: rgba(136, 211, 154, 0.34);
}

.item-row--vitamin-taken .item-row__title {
  color: #dff7e5;
}

.item-row--vitamin-taken .item-row__notes {
  color: rgba(223, 247, 229, 0.72);
}

.editor-sheet--vitamin .field__textarea {
  min-height: 148px;
}

/* ── Adventure status pill ───────────────────────── */
.adventure-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  margin-bottom: 0.25rem;
  border-radius: 20px;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.adventure-status-pill--planning {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.22);
  color: rgba(251, 191, 36, 0.85);
}

.adventure-status-pill--planned {
  background: rgba(100, 160, 255, 0.1);
  border: 1px solid rgba(100, 160, 255, 0.22);
  color: rgba(160, 200, 255, 0.9);
}

.adventure-status-pill--done {
  background: rgba(136, 211, 154, 0.08);
  border: 1px solid rgba(136, 211, 154, 0.2);
  color: rgba(136, 211, 154, 0.8);
}

.task-adventure-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  margin-bottom: 0.25rem;
  border-radius: 20px;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(100, 160, 255, 0.1);
  border: 1px solid rgba(100, 160, 255, 0.22);
  color: rgba(160, 200, 255, 0.9);
}

/* ── Done adventure card ─────────────────────────── */
.item-row--adventure-done {
  opacity: 0.45;
  transition: opacity 0.15s;
}

.item-row--adventure-done:hover {
  opacity: 0.75;
}

/* ── Adventure completion panel ─────────────────── */
.adventure-done-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.adventure-done-panel.is-complete {
  border-color: rgba(136, 211, 154, 0.3);
  background: rgba(136, 211, 154, 0.07);
}

.adventure-done-panel__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.adventure-done-panel__eyebrow {
  font-size: var(--font-xs);
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.adventure-done-panel__status {
  font-size: var(--font-md);
  color: var(--text);
  font-weight: 500;
}

.adventure-done-panel__meta {
  margin-top: 0.35rem;
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.adventure-done-panel__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: var(--font-xs);
  font-weight: 600;
  background: rgba(136, 211, 154, 0.12);
  border: 1px solid rgba(136, 211, 154, 0.28);
  color: rgba(136, 211, 154, 0.9);
  white-space: nowrap;
  flex-shrink: 0;
}

.adventure-done-panel__button {
  min-height: 48px;
  width: 100%;
  padding: 0.65rem var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(136, 211, 154, 0.2);
  background: rgba(136, 211, 154, 0.08);
  color: rgba(136, 211, 154, 0.9);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.adventure-done-panel__button:hover {
  background: rgba(136, 211, 154, 0.13);
  border-color: rgba(136, 211, 154, 0.32);
}

.adventure-done-panel__button:active {
  transform: scale(0.98);
}

.adventure-done-panel.is-complete .adventure-done-panel__button {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* ── Adventure plan panel ────────────────────────── */
.adventure-plan-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.adventure-plan-panel__eyebrow {
  font-size: var(--font-xs);
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.adventure-plan-panel__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.adventure-plan-panel__sub-label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.adventure-plan-panel__date-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.adventure-plan-panel__date-btn {
  min-height: 40px;
  font-size: var(--font-sm);
}

.adventure-plan-panel__hint {
  font-size: var(--font-sm);
  color: var(--text-muted);
  font-style: italic;
  padding: 0.1rem 0;
}

/* ── Adventure task tree (detail view) ───────────── */
.adventure-tasks-tree {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.adventure-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  user-select: none;
}


.adventure-step__check-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.adventure-step__box {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}

.adventure-step__check-input:checked + .adventure-step__box {
  background: rgba(136, 211, 154, 0.8);
  border-color: rgba(136, 211, 154, 0.9);
}

.adventure-step__check-input:checked + .adventure-step__box::after {
  content: "";
  display: block;
  width: 4px;
  height: 7px;
  border: 1.5px solid #0b0b0f;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.adventure-step__label {
  font-size: var(--font-sm);
  color: var(--text);
  flex: 1;
  line-height: 1.35;
}

.adventure-step.is-done .adventure-step__label {
  color: var(--text-muted);
  text-decoration: line-through;
}


.adventure-plan-panel__add-step {
  display: inline-flex;
  align-items: center;
  margin-top: 0.25rem;
  padding: 0.3rem 0;
  font-size: var(--font-xs);
  color: rgba(100, 160, 255, 0.75);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}

.adventure-plan-panel__add-step:hover {
  color: rgba(100, 160, 255, 1);
}

.adventure-step-add {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3rem 0;
  margin-top: 0.1rem;
}

.adventure-step-add__input {
  flex: 1;
  padding: 0.35rem 0.6rem;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
}

.adventure-step-add__input:focus {
  border-color: rgba(100, 160, 255, 0.4);
  background: rgba(100, 160, 255, 0.05);
}

.adventure-step-add__btn {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  font-size: var(--font-xs);
  font-weight: 600;
  color: rgba(100, 160, 255, 0.9);
  background: rgba(100, 160, 255, 0.1);
  border: 1px solid rgba(100, 160, 255, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.adventure-step-add__btn:hover {
  background: rgba(100, 160, 255, 0.18);
}

/* ── Linked tasks strip on adventure cards ────────── */
.adventure-linked-tasks {
  padding: var(--space-2) var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: var(--space-2);
}

.adventure-linked-task {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-sm);
  color: var(--text-soft);
}

.adventure-linked-task--done .adventure-linked-task__title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.adventure-linked-task__icon {
  font-size: 0.62rem;
  color: var(--text-muted);
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}

.adventure-linked-task--done .adventure-linked-task__icon {
  color: rgba(136, 211, 154, 0.7);
}

.adventure-linked-task__title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adventure-linked-task__sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Adventure delete confirm ───────────────────── */
.adventure-delete-confirm {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 100, 100, 0.18);
  background: rgba(255, 100, 100, 0.05);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.adventure-delete-confirm__text {
  font-size: var(--font-sm);
  color: var(--text-soft);
}

.adventure-delete-confirm__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.adventure-delete-confirm__actions .ghost-button {
  flex: 1;
  min-width: 0;
  font-size: var(--font-xs);
}

.adventure-delete-confirm__danger {
  color: rgba(255, 120, 120, 0.9);
  border-color: rgba(255, 100, 100, 0.25);
}

.adventure-delete-confirm__danger:hover {
  background: rgba(255, 100, 100, 0.08);
  border-color: rgba(255, 100, 100, 0.4);
}

.tracker-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.tracker-panel.is-complete {
  border-color: rgba(136, 211, 154, 0.3);
  background: rgba(136, 211, 154, 0.1);
}

.tracker-panel__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.tracker-panel__eyebrow {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.tracker-panel__status {
  font-size: var(--font-md);
  color: var(--text);
  font-weight: 560;
}

.tracker-panel__meta {
  margin-top: 0.35rem;
  font-size: var(--font-sm);
  color: var(--text-soft);
}

.tracker-panel__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(136, 211, 154, 0.18);
  border: 1px solid rgba(136, 211, 154, 0.26);
  color: #dff7e5;
  font-size: var(--font-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tracker-panel__button {
  min-height: 48px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: #09090b;
  font-weight: 650;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    opacity var(--transition-fast),
    background-color var(--transition-fast);
}

.tracker-panel__button:active {
  transform: scale(0.98);
}

.tracker-panel.is-complete .tracker-panel__button:not(.tracker-panel__button--ghost) {
  background: #dff7e5;
}

.tracker-panel__button--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 500;
  margin-top: 8px;
}

.tracker-panel__button--ghost:active {
  opacity: 0.6;
}

.schedule-panel__picker-wrap {
  position: relative;
  flex: 1;
}

.schedule-panel__picker-wrap .schedule-panel__button {
  width: 100%;
}

.schedule-panel__native-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.schedule-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.schedule-panel__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.schedule-panel__eyebrow {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.schedule-panel__status {
  font-size: var(--font-md);
  color: var(--text);
  font-weight: 560;
}

.schedule-panel__meta {
  margin-top: 0.35rem;
  font-size: var(--font-sm);
  color: var(--text-soft);
}

.schedule-panel__actions {
  display: flex;
  gap: var(--space-3);
}

.schedule-panel__button {
  flex: 1;
  min-height: 48px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: #09090b;
  font-weight: 650;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    opacity var(--transition-fast),
    background-color var(--transition-fast);
}

.schedule-panel__button:active {
  transform: scale(0.98);
}

.schedule-panel__clear {
  flex: 1;
}

.schedule-panel__recurrence {
  margin-top: var(--space-4);
}

.schedule-panel__rec-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* ---- Cal item sheet recurrence ---- */

.cal-item-recurrence {
  margin-bottom: var(--space-3);
}

.cal-item-recurrence-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.cal-item-rec-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-soft);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cal-item-rec-btn.is-active {
  background: var(--text);
  border-color: var(--text);
  color: #09090b;
  font-weight: 600;
}


/* =========================================
   19. VITAMIN INSIGHTS
   ========================================= */

.fab--secondary {
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 0.5rem);
  width: 58px;
  height: 58px;
  background: var(--text);
  color: #09090b;
  border: none;
  box-shadow: var(--shadow-2);
}

.insights-fab__bars {
  height: 18px;
  display: flex;
  align-items: end;
  gap: 3px;
}

.insights-fab__bars span {
  display: block;
  width: 4px;
  border-radius: 999px;
  background: currentColor;
}

.insights-fab__bars span:nth-child(1) {
  height: 8px;
}

.insights-fab__bars span:nth-child(2) {
  height: 13px;
}

.insights-fab__bars span:nth-child(3) {
  height: 17px;
}

.insights-sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: #0e0e12;
  display: flex;
  flex-direction: column;
  padding: max(var(--space-4), env(safe-area-inset-top)) 1.75rem 0;
  overflow: hidden;
}

.insights-sheet__header {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-3);
}

.insights-sheet__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.insights-sheet__title {
  font-size: 1.55rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.insights-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.insights-tab {
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: transparent;
  color: var(--text-soft);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.insights-tab.is-active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text);
}

/* ---- Daily / Weekly review card ---- */

.review-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(74, 222, 128, 0.18);
  background: rgba(74, 222, 128, 0.04);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

.review-card__save {
  display: block;
  width: 100%;
  margin-top: var(--space-6);
  padding: 0.75rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.review-card__save:active {
  background: rgba(74, 222, 128, 0.2);
  border-color: rgba(74, 222, 128, 0.55);
}

.review-card__eyebrow {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(74, 222, 128, 0.7);
  margin-bottom: 0.25rem;
  padding-right: 2rem;
}

.review-card__headline {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-3);
}

.review-card__section {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.review-card__section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.review-card__section-title {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.review-vitamins-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.review-vitamins-header .review-card__section-title {
  margin-bottom: 0;
}

.review-vitamins-tabs {
  display: flex;
  gap: 4px;
}

.review-vitamins-tab {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-xs);
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}

.review-vitamins-tab.is-active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text);
}

.review-vitamins-panel--hidden {
  display: none;
}

.review-card__item {
  font-size: var(--font-sm);
  line-height: 1.7;
  color: var(--text-soft);
}

.review-card__item--done {
  color: var(--text);
}

.review-card__item--skipped {
  color: var(--text-muted);
}

.review-card__item--warn {
  color: rgba(250, 204, 21, 0.85);
}

.review-card__goal {
  font-size: var(--font-sm);
  color: var(--text-muted);
  font-style: italic;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  padding-bottom: var(--space-3);
}

.review-rating {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.review-rating__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  min-width: 2ch;
}

.review-rating__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

.review-rating__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #4ade80;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

.review-rating__slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #4ade80;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

.review-rating__ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.review-goal-btns {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-style: normal;
}

.review-goal-btn {
  flex: 1;
  padding: 0.65rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.review-goal-btn.is-active {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}

.review-week-bar {
  display: flex;
  gap: 3px;
  margin: var(--space-2) 0 var(--space-3);
}

.review-week-bar__cell {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.review-week-bar__cell--on {
  background: rgba(74, 222, 128, 0.55);
}

.review-week-bar__day {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 3px;
}

.insights-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: min(72vh, 680px);
  overflow-y: auto;
  padding-right: 0.1rem;
}

.insights-empty {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  padding: var(--space-5);
}

.insights-empty__title {
  font-size: 1.1rem;
  font-weight: 600;
}

.insights-empty__text {
  color: var(--text-soft);
  max-width: 28ch;
}

.insights-section {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
}

.insights-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.insights-section__title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.insights-section__meta {
  color: var(--text-muted);
  font-size: var(--font-xs);
  letter-spacing: 0.02em;
}

/* ── Period navigation (mood / trend / heatmap) ── */
.insights-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.insights-nav__btn {
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius-xs);
  min-width: 26px;
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.insights-nav__btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.insights-nav__btn.is-disabled {
  opacity: 0.22;
  cursor: default;
  pointer-events: none;
}

.insights-nav__range {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
  min-width: 96px;
  text-align: center;
}

.insights-section--past {
  opacity: 0.88;
}

.insights-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  align-items: end;
}

.insights-bars__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.insights-bars__track {
  width: 100%;
  max-width: 18px;
  height: 96px;
  display: flex;
  align-items: end;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.insights-bars__fill {
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(223, 247, 229, 0.9) 0%, rgba(136, 211, 154, 0.65) 100%);
  min-height: 4px;
  transition: height var(--transition-base);
}

.insights-bars__count {
  font-size: 0.62rem;
  color: var(--text-soft);
}

.insights-bars__label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  min-height: 1em;
  text-align: center;
}

.insights-bars__item--today .insights-bars__label {
  color: var(--text);
  font-weight: 600;
  font-size: 0.58rem;
}

.insights-bars-wrap {
  position: relative;
}

.insights-bars__mood-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 96px;
  pointer-events: none;
  overflow: visible;
}

.mood-line {
  stroke: rgba(255, 255, 255, 0.3);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mood-dot        { }
.mood-dot--high  { fill: #4ade80; }
.mood-dot--mid   { fill: rgba(250, 204, 21, 0.85); }
.mood-dot--low   { fill: rgba(248, 113, 113, 0.7); }

.insights-bars__item--today .insights-bars__track {
  background: rgba(255, 255, 255, 0.07);
  outline: 1.5px solid rgba(255, 255, 255, 0.22);
  outline-offset: 1px;
}

.insights-bars__item--today .insights-bars__fill {
  background: linear-gradient(180deg, #dff7e5 0%, rgba(136, 211, 154, 0.9) 100%);
}

.insights-trend-insight {
  margin-top: var(--space-3);
  font-size: var(--font-sm);
  color: var(--text-soft);
  text-align: center;
  font-style: italic;
}

/* ---- 30-day heatmap ---- */

.insights-heatmap-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.insights-heatmap-dow span {
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.insights-heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.insights-heatmap__cell {
  aspect-ratio: 1;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.insights-heatmap__rating {
  font-size: 0.52rem;
  font-weight: 600;
  line-height: 1;
  color: rgba(255, 255, 255, 0.65);
  pointer-events: none;
  user-select: none;
}

.insights-heatmap__cell:active {
  transform: scale(0.88);
  opacity: 0.8;
}

.insights-heatmap__cell--pad {
  background: transparent;
  cursor: default;
  pointer-events: none;
}

.insights-heatmap__cell--heat-0 {
  background: rgba(255, 255, 255, 0.05);
}

.insights-heatmap__cell--heat-1 {
  background: rgba(136, 211, 154, 0.18);
}

.insights-heatmap__cell--heat-2 {
  background: rgba(136, 211, 154, 0.38);
}

.insights-heatmap__cell--heat-3 {
  background: rgba(136, 211, 154, 0.62);
}

.insights-heatmap__cell--heat-4 {
  background: rgba(136, 211, 154, 0.88);
}

.insights-heatmap__cell--today {
  outline: 2px solid rgba(223, 247, 229, 0.55);
  outline-offset: -2px;
}

.insights-heatmap__status {
  min-height: 1.5em;
  margin-top: var(--space-3);
  font-size: var(--font-sm);
  color: var(--text-soft);
  text-align: center;
}

/* ---- Mood heatmap ---- */

.mood-heat--0 { background: rgba(255, 255, 255, 0.06); }
.mood-heat--1 { background: rgba(248, 113, 113, 0.35); }
.mood-heat--2 { background: rgba(250, 204, 21,  0.40); }
.mood-heat--3 { background: rgba(74,  222, 128, 0.45); }
.mood-heat--4 { background: rgba(74,  222, 128, 0.80); }

.insights-mood-goal {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-top: var(--space-2);
  padding: 0 2px;
}

/* ---- Heatmap mood borders ---- */

.mood-border--high { box-shadow: inset 0 0 0 2px rgba(74,  222, 128, 0.6); }
.mood-border--mid  { box-shadow: inset 0 0 0 2px rgba(250, 204, 21,  0.5); }
.mood-border--low  { box-shadow: inset 0 0 0 2px rgba(248, 113, 113, 0.5); }

/* ---- Heatmap pattern summary ---- */

.insights-heatmap-pattern {
  margin-top: var(--space-3);
  font-size: var(--font-sm);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.insights-heatmap-pattern__diff {
  color: var(--text);
  font-weight: 600;
  margin-top: 2px;
}

/* ---- Scatter plot ---- */

.insights-scatter {
  width: 100%;
  display: block;
  overflow: visible;
  margin: var(--space-2) 0;
}

.scatter-axis       { stroke: rgba(255, 255, 255, 0.12); stroke-width: 1; }
.scatter-axis-label { font-size: 11px; fill: rgba(255, 255, 255, 0.35); }
.scatter-axis-title { font-size: 10px; fill: rgba(255, 255, 255, 0.25); letter-spacing: 0.05em; }
.scatter-dot        { opacity: 0.8; }
.scatter-trend {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  fill: none;
}

.insights-scatter-insight {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.insights-scatter-placeholder {
  font-size: var(--font-sm);
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-2) 0 var(--space-1);
  font-style: italic;
}

/* ---- Mood unrated cell hint ---- */

.mood-cell--unrated {
  cursor: pointer;
}

.mood-cell--unrated::after {
  content: "+";
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.2);
  line-height: 1;
}

/* ---- Mood day rating popup ---- */

.mood-day-popup {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: var(--space-4);
}

.mood-day-popup__card {
  width: 100%;
  max-width: 340px;
  background: #1c1c24;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-4) var(--space-3);
}

.mood-day-popup__date {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.mood-day-popup__label {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.mood-chip-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: var(--space-3);
}

.mood-chip {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: var(--font-base);
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms, transform 80ms;
}

.mood-chip:active { transform: scale(0.92); }

.mood-chip--active.mood-chip--low  { background: rgba(248,113,113,0.35); border-color: rgba(248,113,113,0.6); color: #f87171; }
.mood-chip--active.mood-chip--mid  { background: rgba(250,204,21,0.3);   border-color: rgba(250,204,21,0.55); color: #facc15; }
.mood-chip--active.mood-chip--high { background: rgba(74,222,128,0.3);   border-color: rgba(74,222,128,0.55); color: #4ade80; }

.mood-chip--low:hover  { border-color: rgba(248,113,113,0.4); color: #f87171; }
.mood-chip--mid:hover  { border-color: rgba(250,204,21,0.4);  color: #facc15; }
.mood-chip--high:hover { border-color: rgba(74,222,128,0.4);  color: #4ade80; }

.mood-day-popup__cancel {
  display: block;
  width: 100%;
  padding: 0.4rem 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--font-sm);
  cursor: pointer;
  text-align: center;
}

/* ---- Priority highlights 2×2 ---- */

.insights-priority-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.insights-priority-card {
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.insights-priority-card--accent {
  background: rgba(136, 211, 154, 0.06);
  border-color: rgba(136, 211, 154, 0.18);
}

.insights-priority-card--accent .insights-priority-card__value {
  color: #dff7e5;
}

.insights-priority-card__label {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.4rem;
}

.insights-priority-card__value {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  word-break: break-word;
}

.insights-priority-card__value--empty {
  color: var(--text-muted);
  font-weight: 400;
}

.insights-priority-card__stat {
  margin-top: 0.25rem;
  font-size: var(--font-xs);
  color: var(--text-soft);
}

/* ---- Detailed breakdown rows ---- */

.insights-detail-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.insights-detail-row {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s;
}

.insights-detail-row[data-vitamin-id] {
  cursor: pointer;
}

.insights-detail-row[data-vitamin-id]:hover,
.insights-detail-row[data-vitamin-id]:active {
  background: rgba(255, 255, 255, 0.055);
}

.insights-detail-row__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.insights-detail-row__title {
  font-weight: 600;
  letter-spacing: -0.02em;
  word-break: break-word;
  flex: 1;
}

.insights-detail-row__streak-side {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  flex-shrink: 0;
}

.insights-detail-row__streak-val {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: rgba(223, 247, 229, 0.9);
}

.insights-detail-row__streak-lbl {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.insights-detail-row__middle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: 0.25rem;
}

.insights-detail-row__meta {
  color: var(--text-soft);
  font-size: var(--font-sm);
  flex: 1;
}

/* ---- 7-dot mini strip ---- */

.insights-dot-strip {
  display: flex;
  gap: 5px;
  margin-top: var(--space-2);
}

.insights-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: background 0.1s;
}

.insights-dot--on {
  background: rgba(136, 211, 154, 0.75);
}

.insights-dot--off {
  background: rgba(255, 255, 255, 0.08);
}

.insights-dot--today.insights-dot--on {
  background: #dff7e5;
  box-shadow: 0 0 0 1.5px rgba(136, 211, 154, 0.4);
}

.insights-dot--today.insights-dot--off {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.15);
}

/* ── Recommendation card (step 8) ─────────────────── */
.insights-recommendation {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: rgba(136, 211, 154, 0.055);
  border: 1px solid rgba(136, 211, 154, 0.15);
  border-left: 2px solid rgba(136, 211, 154, 0.45);
}

.insights-recommendation__text {
  margin: 0;
  font-size: var(--font-sm);
  color: rgba(223, 247, 229, 0.85);
  line-height: 1.55;
}

/* ── Expand button (step 9) ────────────────────────── */
.insights-expand-btn {
  display: block;
  width: 100%;
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}

.insights-expand-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.insights-streak-row__badge {
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(136, 211, 154, 0.16);
  border: 1px solid rgba(136, 211, 154, 0.24);
  color: #dff7e5;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (min-width: 768px) {
  .fab--secondary {
    right: max(1.5rem, calc((100vw - var(--max-width)) / 2 + 1.5rem));
    bottom: 1.5rem;
  }

  .fab--calendar {
    right: max(1.5rem, calc((100vw - var(--max-width)) / 2 + 1.5rem));
    bottom: 5.5rem;
  }

  .fab--tertiary {
    right: max(1.5rem, calc((100vw - var(--max-width)) / 2 + 1.5rem));
    bottom: 9.5rem;
  }

  #vitamin-insights-backdrop {
    background: rgba(0, 0, 0, 0.54);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
  }

  .insights-sheet {
    position: relative;
    inset: auto;
    max-width: 680px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
    padding: var(--space-5) var(--space-5) 0;
  }

  .insights-facts {
    grid-template-columns: repeat(2, 1fr);
  }

  .insights-bars__track {
    max-width: 34px;
  }
}

@media (min-width: 768px) {
  #goal-progress-backdrop,
  #principles-backdrop,
  #bucket-list-backdrop {
    background: rgba(0, 0, 0, 0.54);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
  }
}

/* =========================================
   20. DATE MODE
   ========================================= */

.date-focus-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(136, 211, 154, 0.18);
  background:
    radial-gradient(circle at top right, rgba(136, 211, 154, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(136, 211, 154, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-1);
}

.date-focus-card__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.date-focus-card__title {
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.date-focus-card__subtitle {
  color: var(--text-soft);
  max-width: 34ch;
}

@media (min-width: 768px) {
  .date-focus-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .date-focus-card__content {
    gap: var(--space-3);
  }
}

.item-row__actions {
  margin-left: auto;
}

.section-card__header[data-collapsible-header] {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.section-card__header[data-collapsible-header]:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 4px;
  border-radius: 12px;
}

.section-card.is-collapsed .section-card__header {
  margin-bottom: 0;
}

.section-card.is-collapsed .section-card__body {
  display: none;
}

@media (max-width: 560px) {
  .subtask-editor-row {
    grid-template-columns: 24px 1fr;
  }

  .subtask-editor-row__delete {
    grid-column: 2;
    justify-self: start;
  }
}

.item-row--task-with-subtasks {
  flex-direction: column;
  align-items: stretch;
}

.task-item-main {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}

.task-item-main .item-row__main {
  min-width: 0;
}

.task-item-main .item-row__actions {
  margin-left: auto;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(1.5rem, env(safe-area-inset-top))
    1.5rem
    max(1.5rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 28%),
    linear-gradient(180deg, #0b0b0f 0%, #09090b 100%);
  opacity: 1;
  visibility: visible;
  transition:
    opacity 420ms ease,
    visibility 420ms ease;
}

.splash-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-screen__bars {
  height: 56px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.splash-screen__bars span {
  display: block;
  width: 14px;
  border-radius: 999px;
  background: #4ade80;
  opacity: 0.9;
  transform-origin: bottom center;
}

.splash-screen__bars span:nth-child(1) {
  height: 26px;
  animation: splashBarOne 0.9s ease-in-out infinite;
}

.splash-screen__bars span:nth-child(2) {
  height: 40px;
  animation: splashBarTwo 0.9s ease-in-out infinite;
}

.splash-screen__bars span:nth-child(3) {
  height: 56px;
  animation: splashBarThree 0.9s ease-in-out infinite;
}

@keyframes splashBarOne {
  0%,
  100% {
    transform: scaleY(0.72);
    opacity: 0.55;
  }
  50% {
    transform: scaleY(1.08);
    opacity: 1;
  }
}

@keyframes splashBarTwo {
  0%,
  100% {
    transform: scaleY(0.82);
    opacity: 0.7;
  }
  50% {
    transform: scaleY(1.18);
    opacity: 1;
  }
}

@keyframes splashBarThree {
  0%,
  100% {
    transform: scaleY(0.9);
    opacity: 0.82;
  }
  50% {
    transform: scaleY(1.24);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-screen,
  .splash-screen__bars span {
    animation: none !important;
    transition: none !important;
  }
}

#onboarding-backdrop {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  z-index: 220;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 28%),
    linear-gradient(180deg, #0b0b0f 0%, #09090b 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.onboarding-card {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.onboarding-card__inner {
  width: 100%;
  max-width: 640px;
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 9rem 1fr auto;
  overflow: hidden;
  padding:
    max(1.25rem, env(safe-area-inset-top))
    1.25rem
    max(1.25rem, env(safe-area-inset-bottom));
}

.onboarding-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 44px;
  position: relative;
}

.onboarding-card__step {
  font-size: var(--font-sm);
  color: var(--text-muted);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.onboarding-card__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  text-align: center;
  padding-bottom: 0.5rem;
  overflow: visible;
}

.onboarding-card__title {
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 720;
}

.onboarding-card__subtitle {
  max-width: 32ch;
  color: var(--text-soft);
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  min-height: 2.7em;
}

.onboarding-card__content {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.1rem;
  padding-top: var(--space-5);
  padding-bottom: var(--space-3);
}

.onboarding-card__actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-5);
  padding-top: var(--space-6);
  background: linear-gradient(
    180deg,
    rgba(9, 9, 11, 0) 0%,
    rgba(9, 9, 11, 0.92) 26%,
    rgba(9, 9, 11, 1) 100%
  );
}

.onboarding-card__actions .primary-button {
  width: 100%;
}

/* Intro — canvas animation */
.ob-canvas {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: block;
}

.ob-intro-copy {
  flex-shrink: 0;
  text-align: center;
  padding: var(--space-3) 0.25rem var(--space-2);
}

.ob-intro-title {
  font-size: clamp(1.7rem, 5.5vw, 2.4rem);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.07;
  margin-bottom: var(--space-5);
  color: var(--text);
}

.ob-intro-body {
  font-size: clamp(0.875rem, 2.2vw, 0.95rem);
  color: var(--text-soft);
  line-height: var(--line-relaxed);
  max-width: 34ch;
  margin: 0 auto;
}

/* Auth form */
.ob-auth {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding-top: 0;
}

/* Mini bar-chart icon */
.ob-auth__icon {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 44px;
}

.ob-auth__icon-bar {
  width: 7px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.55);
  display: block;
}

.ob-auth__headline {
  font-size: 1.5rem;
  font-weight: 720;
  letter-spacing: -0.04em;
  color: var(--text);
  text-align: center;
  line-height: 1.1;
  margin-top: -0.25rem;
}

.ob-auth__toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
}

.ob-auth__tab {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: calc(var(--radius-pill) - 4px);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
  line-height: 1.3;
}

.ob-auth__tab.is-active {
  background: rgba(255, 255, 255, 0.9);
  color: #0a0a0f;
  font-weight: 600;
}

.ob-auth__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ob-auth__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ob-auth__label {
  font-size: var(--font-xs);
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-left: 0.1rem;
}

.ob-auth__input {
  font-size: 1rem;
}

.ob-auth__input:focus {
  border-color: rgba(255, 255, 255, 0.28) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
}

.ob-auth__error {
  font-size: var(--font-sm);
  color: #f87171;
  text-align: center;
  min-height: 1.25em;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.ob-auth__error.is-visible {
  opacity: 1;
}

/* Install step */
.ob-install {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-1);
}

.ob-install__heading {
  font-size: 1.2rem;
  font-weight: 680;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.ob-install__sub {
  font-size: var(--font-sm);
  color: var(--text-soft);
  line-height: var(--line-relaxed);
  margin-top: -0.5rem;
}

.ob-install__details {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ob-install__summary {
  padding: var(--space-4);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  user-select: none;
  -webkit-user-select: none;
}

.ob-install__summary::-webkit-details-marker { display: none; }

.ob-install__summary::after {
  content: "›";
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  display: inline-block;
  flex-shrink: 0;
}

details[open] .ob-install__summary::after {
  transform: rotate(90deg);
}

.ob-install__steps {
  padding: 0 var(--space-4) var(--space-4);
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
  counter-reset: ob-steps;
}

.ob-install__steps li {
  font-size: var(--font-sm);
  color: var(--text-muted);
  line-height: var(--line-relaxed);
  padding-left: 1.6rem;
  position: relative;
  counter-increment: ob-steps;
}

.ob-install__steps li::before {
  content: counter(ob-steps);
  position: absolute;
  left: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0.45;
  top: 0.2em;
}

.ob-install__note {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-align: center;
  padding-top: var(--space-1);
}

@media (max-width: 560px) {
.onboarding-card__inner {
  grid-template-rows: auto 8rem 1fr auto;
  padding:
    max(1rem, env(safe-area-inset-top))
    1rem
    max(1rem, env(safe-area-inset-bottom));
}
}

.onboarding-card__top-back.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.onboarding-card__top-back {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    opacity var(--transition-fast);
}

.onboarding-card__top-back:hover {
  background: var(--surface);
  border-color: var(--border);
}

.onboarding-card__top-back:active {
  transform: scale(0.98);
}

.onboarding-card__top-back.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.onboarding-card__skip {
  align-self: center;
  min-height: auto;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--font-sm);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    opacity var(--transition-fast);
}

.onboarding-card__skip:hover {
  color: var(--text-soft);
  background: transparent;
}

.onboarding-card__skip:active {
  transform: none;
  opacity: 0.8;
}

body.modal-open #onboarding-backdrop:not(.hidden) ~ .app-shell,
body.modal-open #onboarding-backdrop:not(.hidden) ~ .bottom-nav {
  visibility: hidden;
}

/* All screens: collapse the copy area (title/subtitle rendered inside content instead) */
[data-step-type="intro"] .onboarding-card__inner,
[data-step-type="auth"] .onboarding-card__inner,
[data-step-type="install"] .onboarding-card__inner {
  grid-template-rows: auto 0 1fr auto;
}

[data-step-type="intro"] .onboarding-card__copy,
[data-step-type="auth"] .onboarding-card__copy,
[data-step-type="install"] .onboarding-card__copy {
  overflow: hidden;
  padding: 0;
  margin: 0;
  gap: 0;
}

/* Intro: content is canvas + text stacked, no padding-top, no scroll */
[data-step-type="intro"] .onboarding-card__content {
  padding-top: 0;
  overflow: hidden;
  gap: var(--space-4);
}


.fab--calendar {
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 5.45rem);
  width: 58px;
  height: 58px;
  background: var(--text);
  color: #09090b;
  border: none;
  box-shadow: var(--shadow-2);
}

.calendar-fab__icon {
  display: block;
  width: 18px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
  position: relative;
}

.calendar-fab__icon::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 3px;
  right: 3px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.calendar-fab__icon::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 2px;
  right: 2px;
  height: 1.5px;
  background: currentColor;
  border-radius: 999px;
  box-shadow: 0 4px 0 currentColor;
}

.fab--tertiary {
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 10.4rem);
  width: 58px;
  height: 58px;
  background: var(--text);
  color: #09090b;
  border: none;
  box-shadow: var(--shadow-2);
}

.fab--cal-add {
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  right: calc(100vw / 6 - 32px);
  border: none;
  width: 64px;
  height: 64px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
  display: grid;
  place-items: center;
}

.fab--cal-tracking {
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 5.45rem);
  border: none;
  font-size: 1.3rem;
}

.principles-fab__icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}

.principles-fab__icon span {
  position: absolute;
  display: block;
  width: 10px;
  height: 10px;
  background: currentColor;
  border-radius: 3px;
  transform: rotate(45deg);
}

.principles-fab__icon span:nth-child(1) {
  top: 0;
  left: 4px;
}

.principles-fab__icon span:nth-child(2) {
  top: 6px;
  left: 0;
  opacity: 0.82;
}

.principles-fab__icon span:nth-child(3) {
  top: 6px;
  left: 8px;
  opacity: 0.82;
}

/* Shared header action group (Add + close side by side) */
.sheet-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Principles: centered dialog (not bottom sheet) */
#principles-backdrop {
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

#principles-backdrop .principles-sheet {
  /* Override the full-screen .insights-sheet rules */
  position: relative;
  inset: auto;
  width: calc(100% - 2rem);
  max-width: 420px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  overflow: hidden;
}

#principles-backdrop .principles-body {
  flex: 1;
  overflow-y: auto;
  max-height: none;
  padding-bottom: var(--space-3);
}

#principles-backdrop .editor-sheet__handle,
#vitamin-insights-backdrop .editor-sheet__handle,
#bucket-list-backdrop .editor-sheet__handle {
  display: none;
}


.insights-body {
  flex: 1;
  max-height: none;
  padding-bottom: calc(3.75rem + env(safe-area-inset-bottom) + 1rem);
}

.principles-body {
  flex: 1;
  max-height: none;
  padding-bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 1rem);
}

.subtask-drag-handle {
  width: 40px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.9rem;
  line-height: 1;
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.subtask-drag-handle:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.subtask-drag-handle:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.task-subtask {
  touch-action: pan-y;
}

/* =========================================
   Inline vitamin check button
   ========================================= */

.item-check-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease;
}

.item-check-btn:active {
  transform: scale(0.88);
}

.item-check-btn__ring {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.item-check-btn.is-done .item-check-btn__ring {
  background: var(--text);
  border-color: var(--text);
}

.item-check-btn.is-done .item-check-btn__ring::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #09090b;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.item-streak-badge {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1;
  margin-top: 2px;
}

/* =========================================
   Bottom navigation bar
   ========================================= */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: #0e0e12;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 3px;
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: opacity 0.15s;
  position: relative;
}

.bottom-nav__btn:active {
  opacity: 0.6;
}

.bottom-nav__icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.bottom-nav__icon--finances {
  width: 26px;
  height: 26px;
}

.bottom-nav__label {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

/* Review badge on Insights nav icon */
#open-vitamin-insights-btn {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: 8px;
  right: calc(50% - 16px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  border: 1.5px solid #0b0b0f;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.nav-badge.is-visible {
  opacity: 1;
}

@keyframes reviewIconPulse {
  0%, 100% { transform: scaleY(0.82); opacity: 0.6; }
  50%       { transform: scaleY(1.18); opacity: 1; }
}

#open-vitamin-insights-btn.has-review .bottom-nav__icon {
  stroke: #4ade80;
  transform-origin: center bottom;
  animation: reviewIconPulse 0.9s ease-in-out infinite;
}

@media (min-width: 768px) {
  .bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
  }
}
/* ─── Vitamin history calendar ──────────────────────────────────────────────── */

.vhist-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.vhist-sheet {
  width: 100%;
  max-width: var(--max-width);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #17171c;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.vhist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.vhist-title {
  font-size: 1rem;
  font-weight: 650;
  color: var(--text);
  margin: 0;
}

.vhist-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-4);
}

.vhist-month {
  margin-bottom: 2rem;
}

.vhist-month__heading {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.vhist-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px 0;
}

.vhist-weekday {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  padding-bottom: 6px;
  font-weight: 500;
}

.vhist-day-filler {
  aspect-ratio: 1;
}

.vhist-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 50%;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}

.vhist-day:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.vhist-day.is-today {
  background: var(--text);
  color: #09090b;
  font-weight: 700;
}

.vhist-day.is-today .vhist-day__dot {
  background: #09090b;
}

.vhist-day.is-future {
  opacity: 0.25;
  pointer-events: none;
}

.vhist-day__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

/* ─── Vitamin history confirm dialog ────────────────────────────────────────── */

.vhist-confirm {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(0, 0, 0, 0.6);
}

.vhist-confirm__card {
  width: 100%;
  max-width: 320px;
  background: #1e1e24;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  padding: var(--space-4);
  box-shadow: var(--shadow-2);
}

.vhist-confirm__text {
  font-size: 0.9rem;
  color: var(--text);
  text-align: center;
  margin: 0 0 var(--space-4);
  line-height: 1.5;
}

.vhist-confirm__actions {
  display: flex;
  gap: var(--space-2);
}

.vhist-confirm__btn {
  flex: 1;
  min-height: 44px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.12s;
  border: none;
}

.vhist-confirm__btn:active {
  opacity: 0.7;
}

.vhist-confirm__btn--no {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.vhist-confirm__btn--yes {
  background: #4ade80;
  color: #09090b;
}

/* =========================================
   FINANCES
   ========================================= */

/* Sheet */
.finances-sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: #0e0e12;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: max(var(--space-4), env(safe-area-inset-top)) 1.75rem 0;
}

@media (min-width: 768px) {
  #finances-backdrop {
    background: rgba(0, 0, 0, 0.54);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
  }

  .finances-sheet {
    position: relative;
    inset: auto;
    max-width: 760px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
    padding: var(--space-4) var(--space-4) 0;
  }

  .finances-fab-group {
    bottom: calc(max(1.25rem, env(safe-area-inset-bottom)));
  }
}

/* Topbar — close button only, right-aligned */
.finances-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: var(--space-2);
  flex-shrink: 0;
}

/* Tabs row — tabs on left, year select on right */
.finances-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding-bottom: var(--space-3);
  flex-shrink: 0;
}

.finances-tab {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.finances-tab.is-active {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.finances-year-select {
  margin-left: auto;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--font-xs);
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* Scrollable body */
.finances-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(8.75rem + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

/* FAB */
.finances-fab-group {
  position: absolute;
  bottom: calc(4.75rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-2);
  z-index: 2;
}

.finances-fab {
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.75rem 0;
  width: 7.5rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.finances-fab--out {
  background: rgba(248,113,113,0.55);
  color: #fca5a5;
  border: 1px solid rgba(248,113,113,0.7);
}

.finances-fab--in {
  background: rgba(74,222,128,0.55);
  color: #86efac;
  border: 1px solid rgba(74,222,128,0.7);
}

/* Setup banners */
.finances-banner {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.finances-banner__text {
  font-size: var(--font-sm);
  color: var(--text-soft);
  margin-bottom: var(--space-3);
}

.finances-banner__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.finances-banner__prefix {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.finances-banner__input {
  flex: 1;
  min-width: 100px;
}

.finances-banner__input--num {
  max-width: 120px;
  flex: 0 0 120px;
}

.finances-banner__btn {
  flex-shrink: 0;
}

/* Charts */
.finances-charts-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.finances-chart-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.finances-chart-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.finances-chart-label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0;
}

.finances-nw-edit-btn {
  background: none;
  border: none;
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.finances-nw-edit-btn:hover {
  color: var(--text-soft);
}

.finances-nw-edit-form {
  padding: var(--space-2) 0 var(--space-3);
}

.finances-chart-canvas-wrap {
  position: relative;
  height: 220px;
}


.chart-zoom-reset,
.chart-zoom-save {
  position: absolute;
  top: var(--space-2);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  z-index: 2;
}

.chart-zoom-reset {
  top: calc(var(--space-2) + 2.1rem);
  right: var(--space-2);
}

.chart-zoom-save {
  top: var(--space-2);
  right: var(--space-2);
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.35);
  color: #93c5fd;
}

.chart-zoom-reset:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.chart-zoom-save:hover {
  background: rgba(96, 165, 250, 0.25);
  border-color: rgba(96, 165, 250, 0.5);
}

.chart-zoom-reset:active,
.chart-zoom-save:active {
  transform: scale(0.95);
}

.chart-zoom-reset__icon {
  font-size: 0.85rem;
  line-height: 1;
}

.chart-zoom-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-1);
  letter-spacing: 0.04em;
  opacity: 0.55;
}

/* Summary table */
.finances-table-section {
  margin-bottom: var(--space-5);
}

.finances-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.finances-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.72rem;
}

.finances-table th {
  text-align: right;
  padding: 0.45rem 0.5rem;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  white-space: nowrap;
}

.finances-table__label-col {
  text-align: left !important;
  width: 110px;
  min-width: 110px;
}

.finances-table__month-col {
  width: 52px;
  min-width: 52px;
}

.finances-table__label {
  padding: 0.4rem 0.5rem;
  color: var(--text-soft);
  white-space: nowrap;
  text-align: left;
}

.finances-table__cell {
  padding: 0.4rem 0.5rem;
  text-align: right;
  color: var(--text-muted);
  white-space: nowrap;
}

.finances-table__row--in .finances-table__label,
.finances-table__row--in .finances-table__cell {
  color: #4ade80;
  font-weight: 600;
  border-top: 1px solid var(--border);
}

.finances-table__row--out .finances-table__label,
.finances-table__row--out .finances-table__cell {
  color: #f87171;
  font-weight: 600;
  border-top: 1px solid var(--border);
}

.finances-table__row--balance .finances-table__label {
  color: var(--text-soft);
  font-weight: 600;
}

.finances-table__row--balance .finances-table__cell { font-weight: 600; }
.finances-table__row--balance .is-positive { color: #4ade80; }
.finances-table__row--balance .is-negative { color: #f87171; }

.finances-table__row--cat .finances-table__label {
  color: var(--text-soft);
  padding-left: 0.75rem;
}

.finances-table__row--subcat .finances-table__label {
  color: var(--text-muted);
  padding-left: 1.4rem;
  font-style: italic;
}

.finances-table__cat-toggle {
  display: inline-block;
  width: 1em;
  font-style: normal;
  opacity: 0.5;
  transition: transform 0.15s;
}

.finances-table__row--collapsible:hover .finances-table__label {
  color: var(--text);
}

/* History */
.finances-empty {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  color: var(--text-soft);
  font-size: var(--font-sm);
}

.finances-empty__hint {
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.finances-month-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.finances-month-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: rgba(255,255,255,0.03);
  border: none;
  cursor: pointer;
  text-align: left;
}

.finances-month-header__label {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.finances-month-header__bal {
  font-size: var(--font-sm);
  font-weight: 600;
}

.finances-month-header__bal.is-positive { color: #4ade80; }
.finances-month-header__bal.is-negative { color: #f87171; }

.finances-month-header__chevron {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.finances-tx-rows {
  border-top: 1px solid var(--border);
}

.finances-tx-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.finances-tx-row:last-child { border-bottom: none; }
.finances-tx-row:hover { background: rgba(255,255,255,0.04); }

.finances-tx-row__date {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 44px;
}

.finances-tx-row__cat {
  flex: 1;
  font-size: var(--font-sm);
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finances-tx-row__notes {
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}

.finances-tx-row__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.finances-tx-row__amount {
  font-size: var(--font-sm);
  font-weight: 600;
  white-space: nowrap;
}

.finances-tx-row__amount.is-in  { color: #4ade80; }
.finances-tx-row__amount.is-out { color: var(--text-soft); }

/* Form panel */
.finances-form-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 210;
}

.finances-form-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-sheet, #131317);
  border-radius: 18px 18px 0 0;
  z-index: 211;
  display: flex;
  flex-direction: column;
  max-height: 88%;
  padding-top: var(--space-3);
  transition: transform 0.28s ease;
}

@media (min-width: 768px) {
  .finances-form-panel {
    left: 50%;
    right: auto;
    width: min(760px, 100vw);
    margin-left: calc(min(760px, 100vw) / -2);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

.finances-form-panel__handle {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  padding: 12px 40px;
  box-sizing: content-box;
  background-clip: content-box;
  margin: 0 auto var(--space-4);
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
}

.finances-form-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4) var(--space-2);
  flex-shrink: 0;
}

.finances-form-panel__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.finances-form-inner {
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-2) var(--space-4) calc(3.75rem + env(safe-area-inset-bottom) + var(--space-4));
  -webkit-overflow-scrolling: touch;
}


/* Form internals */
.finances-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  min-width: 0;
}

.finances-form .field {
  min-width: 0;
  width: 100%;
}

.finances-form input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.finances-form__type-row {
  display: flex;
  gap: var(--space-2);
}

.finances-type-btn {
  flex: 1;
  padding: 0.55rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.finances-type-btn[data-form-type="in"].is-active {
  background: rgba(74,222,128,0.18);
  border-color: rgba(74,222,128,0.3);
  color: #86efac;
}

.finances-type-btn[data-form-type="out"].is-active {
  background: rgba(248,113,113,0.18);
  border-color: rgba(248,113,113,0.3);
  color: #fca5a5;
}

.finances-amount-row {
  display: flex;
}

.finances-amount-input {
  flex: 1;
}

.finances-new-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.finances-new-row__btn {
  flex-shrink: 0;
}

.finances-form__actions {
  display: flex;
  gap: var(--space-3);
  padding-top: var(--space-2);
  justify-content: center;
}

.finances-form__save {
  flex: 1;
  max-width: 280px;
}

.finances-form__delete {
  flex-shrink: 0;
}

.field__label--optional {
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Finances: Categories tab ──────────────────────────────────────────────── */

.finances-cat-section-label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-4) 0 var(--space-2);
}

.finances-cats-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.finances-cat-block {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.finances-cat-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
}

.finances-cat-header__name {
  flex: 1;
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text);
}

.finances-drag-handle {
  color: rgba(255,255,255,0.2);
  font-size: 1rem;
  cursor: grab;
  padding: 0 var(--space-2) 0 0;
  user-select: none;
  touch-action: none;
  flex-shrink: 0;
}

.finances-drag-handle:active {
  cursor: grabbing;
}

.finances-cat-block.is-cat-dragging,
.finances-sub-row.is-cat-dragging {
  opacity: 0.5;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.finances-cat-del-btn,
.finances-sub-del-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.finances-cat-del-btn:hover,
.finances-sub-del-btn:hover {
  color: #f87171;
  background: rgba(248,113,113,0.1);
}

.finances-cat-subs {
  display: flex;
  flex-direction: column;
}

.finances-sub-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.finances-sub-row__name {
  flex: 1;
  font-size: var(--font-sm);
  color: var(--text-muted);
  padding-left: var(--space-3);
}

.finances-add-sub-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
}

.finances-add-sub-input {
  flex: 1;
  font-size: 16px;
  padding: 0.3rem 0.6rem;
}

.finances-add-sub-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--font-sm);
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.finances-add-sub-btn:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.25);
}

.finances-add-cat-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.finances-add-cat-input {
  flex: 1;
  font-size: 16px;
}

.finances-add-cat-btn {
  flex-shrink: 0;
}

/* =========================================
   PHOTOS
   ========================================= */

/* ── Adventure photos panel ──────────────── */
.adventure-photos-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.adventure-photos-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.adventure-photos-panel__eyebrow {
  font-size: var(--font-xs);
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.adventure-photos-panel__add {
  font-size: var(--font-xs);
  font-weight: 600;
  color: rgba(100, 160, 255, 0.75);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.adventure-photos-panel__add:hover {
  color: rgba(100, 160, 255, 1);
}

.adventure-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.adv-photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.adv-photo-thumb:active {
  transform: scale(0.93);
}

.adv-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.adv-photos-empty {
  grid-column: 1 / -1;
  font-size: var(--font-sm);
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-3) 0;
  font-style: italic;
}

/* ── Photo lightbox ──────────────────────── */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.photo-lightbox__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  max-width: 100vw;
  max-height: 100dvh;
}

.photo-lightbox__close {
  position: fixed;
  top: max(var(--space-4), env(safe-area-inset-top));
  right: var(--space-4);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s;
}

.photo-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.photo-lightbox__img {
  max-width: min(92vw, 640px);
  max-height: 72dvh;
  border-radius: var(--radius-md);
  object-fit: contain;
  display: block;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.photo-lightbox__delete {
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.photo-lightbox__delete:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
}

/* ── Calendar day add menu ───────────────── */
.cal-add-menu {
  position: fixed;
  bottom: calc(5.5rem + env(safe-area-inset-bottom) + 0.6rem);
  right: calc(100vw / 6 - 32px);
  background: #1e1e28;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  z-index: 40;
  min-width: 190px;
  animation: calMenuAppear 0.15s ease;
}

@keyframes calMenuAppear {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

.cal-add-menu__btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 0.85rem var(--space-4);
  background: transparent;
  border: none;
  color: var(--text);
  font-size: var(--font-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.cal-add-menu__btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cal-add-menu__btn + .cal-add-menu__btn {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cal-add-menu__icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Calendar day photos strip ───────────── */
#cal-day-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3) var(--space-4);
}

#cal-day-photos-grid.hidden {
  display: none;
}

.cal-day-photo {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.cal-day-photo:active {
  transform: scale(0.94);
}

.cal-day-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Review card photos ──────────────────── */
.review-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.review-photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  object-fit: cover;
  width: 100%;
  cursor: pointer;
  transition: transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.review-photo-thumb:active {
  transform: scale(0.94);
}

/* ── Main page quick-add FAB ─────────────── */
.fab--main-add {
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  right: calc(100vw / 6 - 32px);
  border: none;
  width: 64px;
  height: 64px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
  display: grid;
  place-items: center;
}

body.modal-open .fab--main-add,
body.modal-open .main-add-menu {
  display: none;
}

.main-add-menu {
  position: fixed;
  bottom: calc(5.5rem + env(safe-area-inset-bottom) + 0.6rem);
  right: calc(100vw / 6 - 32px);
  background: #1e1e28;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  z-index: 45;
  min-width: 190px;
  animation: calMenuAppear 0.15s ease;
}

.main-add-menu__btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 0.85rem var(--space-4);
  background: transparent;
  border: none;
  color: var(--text);
  font-size: var(--font-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.main-add-menu__btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.main-add-menu__btn + .main-add-menu__btn {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.main-add-menu__icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* =========================================
   OVERLAY TOPBAR (insights / calendar / finances)
   ========================================= */

/* Hamburger ↔ × swap */
.topbar-hamburger-icon {
  display: block;
}

.topbar-close-icon {
  display: none;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 300;
}

body.overlay-topbar .topbar-hamburger-icon {
  display: none;
}

body.overlay-topbar .topbar-close-icon {
  display: flex;
  align-items: center;
}

/* Lift the topbar above the overlay backdrops (z-index 35) — mobile only.
   On desktop the modals are centered windows; a full-width floating bar looks off. */
@media (max-width: 767px) {
  body.overlay-topbar .topbar-hamburger-icon {
    display: none;
  }

  body.overlay-topbar .topbar-close-icon {
    display: flex;
    align-items: center;
  }

  body.overlay-topbar .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 38;
    /* Mirror body's own padding so the fixed topbar lands at the same coordinates
       as the sticky topbar, which sits inside that body padding naturally. */
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-left: 1rem;
    padding-right: 1rem;
  }

  body.overlay-topbar .topbar__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    /* padding-top/left/right all inherit from base .topbar__inner (0.75rem each),
       stacking on top of the outer padding above — same net offset as normal mode */
  }

  body.overlay-topbar .topbar-menu {
    display: none !important;
  }

  /* Push modal sheet content below the fixed topbar */
  body.overlay-topbar .calendar-sheet,
  body.overlay-topbar .insights-sheet,
  body.overlay-topbar .finances-sheet {
    padding-top: max(5.5rem, calc(3.75rem + env(safe-area-inset-top)));
  }

  /* Hide the modal's own close button — the topbar × replaces it */
  body.overlay-topbar #close-vitamin-insights-btn,
  body.overlay-topbar #close-calendar-btn,
  body.overlay-topbar #close-finances-btn {
    display: none;
  }
}

/* On desktop keep existing modal close buttons — topbar stays sticky */
@media (min-width: 768px) {
  body.overlay-topbar .topbar-hamburger-icon {
    display: block;
  }
  body.overlay-topbar .topbar-close-icon {
    display: none;
  }
}

/* On desktop the nav is capped at --max-width and centered, so recalculate
   the FAB position to stay over the calendar button in that constrained nav. */
@media (min-width: 768px) {
  .fab--main-add,
  .fab--cal-add,
  .main-add-menu,
  .cal-add-menu {
    right: calc(50vw - var(--max-width) / 3 - 32px);
  }
}

/* ── App tour ─────────────────────────────────────────────────────────────── */

#tour-blocker {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
}

#tour-spotlight {
  display: none;
  position: fixed;
  z-index: 9001;
  pointer-events: none;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72);
  transition: top 0.28s ease, left 0.28s ease, width 0.28s ease, height 0.28s ease;
}

#tour-card {
  display: none;
  position: fixed;
  z-index: 9002;
  background: #1a1a22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 18px 18px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

body.tour-active #tour-blocker,
body.tour-active #tour-spotlight,
body.tour-active #tour-card {
  display: block;
}

.tour-card__step {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin: 0 0 6px;
}

.tour-card__title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  line-height: 1.3;
}

.tour-card__body {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin: 0 0 14px;
}

.tour-card__dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-bottom: 14px;
}

.tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.2s;
}

.tour-dot.is-active {
  background: rgba(255, 255, 255, 0.75);
}

.tour-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tour-nav {
  display: flex;
  gap: 8px;
}

.tour-skip {
  background: none;
  border: none;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 4px 2px;
}

.tour-skip:hover {
  color: rgba(255, 255, 255, 0.6);
}

.tour-btn {
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 7px 16px;
  cursor: pointer;
  border: none;
}

.tour-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}

.tour-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.13);
}

.tour-btn--primary {
  background: #7c3aed;
  color: #fff;
}

.tour-btn--primary:hover {
  background: #6d28d9;
}

/* ===========================================================================
   Auth modal
   =========================================================================== */

#auth-backdrop {
  align-items: stretch;
  justify-content: stretch;
  background: #0b0b0f;
}

.auth-sheet {
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
  padding:
    max(1.25rem, env(safe-area-inset-top))
    1.25rem
    max(1.25rem, env(safe-area-inset-bottom));
  overflow-y: auto;
}

.auth-sheet__header {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 0;
}

.auth-sheet__back {
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 8px 4px;
  line-height: 1;
}

.auth-sheet__inner {
  flex: 1;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 2rem;
}

.auth-sheet__bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-sheet__bars span {
  display: block;
  width: 10px;
  border-radius: 5px;
  background: linear-gradient(to top, #6d28d9, #a855f7);
  box-shadow: 0 0 12px rgba(124,58,237,0.5);
}

.auth-sheet__title {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  text-align: center;
  letter-spacing: -0.03em;
}

.auth-sheet__sub {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.42);
  margin: 0 0 28px;
  text-align: center;
  line-height: 1.5;
}

.auth-sheet__providers {
  width: 100%;
  margin-bottom: 20px;
}

.auth-provider-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 20px;
  border-radius: 14px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
}

.auth-provider-btn:active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.18);
}

.auth-sheet__divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-sheet__divider::before,
.auth-sheet__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.07);
}

.auth-sheet__divider span {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.28);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
  width: 100%;
  gap: 0;
}

.auth-tab {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(255,255,255,0.38);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.auth-tab.is-active {
  background: rgba(255,255,255,0.11);
  color: #fff;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.auth-form__input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.05) !important;
  border: 1.5px solid rgba(255,255,255,0.09) !important;
  border-radius: 14px !important;
  padding: 15px 16px !important;
  font-size: 1rem !important;
  color: #fff !important;
}

.auth-form__input:focus {
  border-color: rgba(124,58,237,0.6) !important;
  background: rgba(124,58,237,0.07) !important;
  outline: none !important;
}

.auth-form__error {
  font-size: 0.82rem;
  color: #f87171;
  margin: 0;
  padding: 0 2px;
  display: none;
  line-height: 1.4;
}

.auth-form__error.is-visible {
  display: block;
}

.auth-form__submit {
  width: 100%;
  margin-top: 6px;
  padding: 15px !important;
  font-size: 1rem !important;
  border-radius: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

.auth-sheet__guest-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 12px 0 0;
  transition: color 0.15s;
  letter-spacing: 0.01em;
}

.auth-sheet__guest-btn:active {
  color: rgba(255,255,255,0.6);
}

.auth-form__name-field {
  display: none;
}

.auth-form.is-register .auth-form__name-field {
  display: block;
}

.topbar-menu__item--email {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  padding: 10px 16px;
  display: block;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
