/* ============================================================
   Beek — Central Coast Mobile-First PWA Stylesheet
   Themes: a (Sunlit Journal), b (Eucalyptus Coast), c (Golden Hour)
   ============================================================ */

:root {
  --font-display: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Theme A: Sunlit Field Journal (Default) */
  --bg: #FBF5E8;
  --bg-outer: #EFE6D5;
  --surface: #FFFDF8;
  --surface-alt: #F4EAD6;
  --surface-tint: rgba(196, 87, 50, 0.08);
  --border: rgba(42, 27, 18, 0.12);
  --border-strong: rgba(42, 27, 18, 0.24);
  --text: #2A1B12;
  --text-soft: #5D493C;
  --text-muted: #866F60;

  --primary: #C45732;
  --primary-fg: #FFFDF8;
  --honey: #ECA41C;
  --honey-soft: rgba(236, 164, 28, 0.19);
  --honey-text: #855402;
  --sage: #265D54;
  --sage-soft: rgba(38, 93, 84, 0.12);
  --sage-text: #1E4E46;
  --warn: #B8422A;
  --warn-soft: rgba(184, 66, 42, 0.12);

  --hero-bg: linear-gradient(135deg, #C45732 0%, #D97936 58%, #E8A528 100%);
  --hero-fg: #FFFDF7;
  --hero-sub: rgba(255, 253, 247, 0.88);
  --hero-chip-bg: rgba(255, 253, 247, 0.19);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 2px 12px rgba(42, 27, 18, 0.06);
}

body[data-concept="b"] {
  --bg: #F3F0E7;
  --bg-outer: #E2EBE5;
  --surface: #FCFBF7;
  --surface-alt: #E6EFEA;
  --surface-tint: rgba(33, 78, 72, 0.08);
  --border: rgba(22, 51, 47, 0.13);
  --border-strong: rgba(22, 51, 47, 0.28);
  --text: #16332F;
  --text-soft: #3A5853;
  --text-muted: #607B76;

  --primary: #214E48;
  --primary-fg: #FAF9F4;
  --honey: #DF9918;
  --honey-soft: rgba(223, 153, 24, 0.20);
  --honey-text: #7A4E02;
  --sage: #2D6A5E;
  --sage-soft: rgba(45, 106, 94, 0.13);
  --sage-text: #1D4B42;
  --warn: #B84A2F;
  --warn-soft: rgba(184, 74, 47, 0.12);

  --hero-bg: linear-gradient(145deg, #1A433D 0%, #275E55 62%, #3B7769 100%);
  --hero-fg: #FAF9F4;
  --hero-sub: rgba(250, 249, 244, 0.86);
  --hero-chip-bg: rgba(250, 249, 244, 0.17);
  --shadow-card: 0 2px 10px rgba(22, 51, 47, 0.07);
}

body[data-concept="c"] {
  --bg: #1A130F;
  --bg-outer: #120D0A;
  --surface: #251C16;
  --surface-alt: #31251D;
  --surface-tint: rgba(244, 182, 50, 0.11);
  --border: rgba(248, 228, 194, 0.11);
  --border-strong: rgba(248, 228, 194, 0.24);
  --text: #F9F0E3;
  --text-soft: #CBB8A5;
  --text-muted: #9A8674;

  --primary: #F2B233;
  --primary-fg: #21160F;
  --honey: #F4B632;
  --honey-soft: rgba(244, 182, 50, 0.18);
  --honey-text: #F9CF72;
  --sage: #69A896;
  --sage-soft: rgba(105, 168, 150, 0.16);
  --sage-text: #8EC9B8;
  --warn: #E27752;
  --warn-soft: rgba(226, 119, 82, 0.16);

  --hero-bg: linear-gradient(145deg, #3A2518 0%, #5B331E 54%, #9E5924 100%);
  --hero-fg: #FFF6E8;
  --hero-sub: rgba(255, 246, 232, 0.85);
  --hero-chip-bg: rgba(244, 182, 50, 0.22);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-outer);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

button, input, textarea, select { font-family: inherit; }

.app-root {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

.boot-loader {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
}

.boot-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(42, 27, 18, 0.16);
}

.boot-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-soft);
}

/* ---------- Auth / Onboarding Screen ---------- */
.auth-shell {
  width: 100%;
  max-width: 440px;
  min-height: 100dvh;
  background: var(--bg);
  padding: 28px 20px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.auth-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.auth-icon {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  box-shadow: 0 10px 26px rgba(42, 27, 18, 0.18);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin: 2px 0 0;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
  max-width: 310px;
  line-height: 1.45;
}

.invite-banner {
  background: var(--honey-soft);
  border: 1.5px solid rgba(236, 164, 28, 0.45);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.45;
}

.invite-banner strong {
  color: var(--honey-text);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-alt);
}

.auth-tab {
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 9px;
  border-radius: 9px;
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.text-input, .journal-textarea, .select-input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 11px 12px;
  font-size: 0.92rem;
  line-height: 1.4;
  outline: none;
}

.text-input:focus, .journal-textarea:focus, .select-input:focus {
  border-color: var(--primary);
}

.auth-error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ---------- Main App Shell ---------- */
.app-shell {
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(42, 27, 18, 0.08);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-icon-sm {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
  flex-shrink: 0;
}

.app-apiary-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.15;
}

.app-apiary-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-menu-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-menu-btn svg { width: 20px; height: 20px; }

.offline-banner {
  background: var(--honey-soft);
  color: var(--honey-text);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 14px;
  text-align: center;
  border-bottom: 1px solid rgba(236, 164, 28, 0.35);
}

.app-main {
  flex: 1;
  padding: 14px 15px 96px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.app-main > * { flex-shrink: 0; }

.ui-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.ui-svg-lg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ---------- Hives Switcher ---------- */
.hive-switcher-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.hive-pill {
  flex: 1 0 144px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  min-height: 54px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.hive-pill.is-active {
  border-color: var(--primary);
  background: var(--surface-tint);
}

.hive-pill.add-hive-pill {
  flex: 0 0 auto;
  min-width: 64px;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.8rem;
}

.hive-pill-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
}

.hive-pill-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-text);
  white-space: nowrap;
}

.status-badge.honey {
  background: var(--honey-soft);
  color: var(--honey-text);
}

.status-badge.muted {
  background: var(--surface-alt);
  color: var(--text-muted);
}

/* ---------- Hero Pulse Card ---------- */
.hero-card {
  background: var(--hero-bg);
  color: var(--hero-fg);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(42, 27, 18, 0.15);
}

.hero-card::after {
  content: '';
  position: absolute;
  right: -24px;
  top: -24px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 245, 215, 0.22) 0%, rgba(255, 245, 215, 0) 70%);
  pointer-events: none;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hero-sub);
}

.hero-stat {
  font-family: var(--font-display);
  font-size: 1.66rem;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 4px;
}

.hero-stat .unit {
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0.92;
}

.nowrap { white-space: nowrap; }

.hero-sub {
  font-size: 0.78rem;
  color: var(--hero-sub);
  margin-top: 4px;
}

.hero-weather-chip {
  background: var(--hero-chip-bg);
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: right;
  backdrop-filter: blur(6px);
  flex-shrink: 0;
}

.hero-weather-chip strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-metric-val { font-weight: 700; font-size: 0.9rem; }
.hero-metric-lbl { font-size: 0.68rem; color: var(--hero-sub); }

/* ---------- Reminder Pin ---------- */
.reminder-pin {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: var(--honey-soft);
  border: 1px solid rgba(236, 164, 28, 0.38);
  font-size: 0.82rem;
  line-height: 1.42;
}

.reminder-pin-left {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.reminder-star {
  color: var(--honey-text);
  font-weight: 700;
  font-size: 0.95rem;
}

.reminder-pin strong {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--honey-text);
  margin-bottom: 1px;
}

.reminder-done-btn {
  border: 1px solid rgba(133, 84, 2, 0.28);
  background: var(--surface);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

/* ---------- Cards & Section Heads ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.section-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.text-link-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

/* ---------- Interactive Box Stack ---------- */
.hive-stack-wrap {
  display: grid;
  grid-template-columns: 122px 1fr;
  gap: 12px;
  align-items: center;
}

.hive-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hive-lid {
  height: 11px;
  border-radius: 6px 6px 2px 2px;
  background: var(--primary);
  opacity: 0.9;
}

.hive-excluder {
  height: 4px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--text-muted) 0 4px, transparent 4px 7px);
  margin: 1px 4px;
}

.hive-box-btn {
  border: 1.5px solid var(--border-strong);
  border-radius: 7px;
  padding: 6px 7px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.hive-box-btn.is-super {
  background: var(--honey-soft);
  border-color: var(--honey);
  color: var(--honey-text);
}

.hive-box-btn.is-selected {
  outline: 2.5px solid var(--primary);
  outline-offset: 1px;
  transform: translateX(3px);
}

.hive-base {
  height: 8px;
  border-radius: 2px 2px 5px 5px;
  background: var(--text-muted);
  opacity: 0.45;
}

.hive-box-detail h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.hive-box-detail p {
  margin: 0 0 8px;
  font-size: 0.79rem;
  line-height: 1.42;
  color: var(--text-soft);
}

/* ---------- Journal Entries ---------- */
.search-bar {
  position: relative;
}

.search-input {
  width: 100%;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 14px;
  font-size: 0.85rem;
  outline: none;
}

.search-input:focus { border-color: var(--primary); }

.entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.entry-date { font-weight: 700; font-size: 0.9rem; }
.entry-author { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

.entry-weather {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-soft);
  white-space: nowrap;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  font-size: 0.71rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-text);
}

.tag-chip.honey { background: var(--honey-soft); color: var(--honey-text); }
.tag-chip.warn { background: var(--warn-soft); color: var(--warn); }

.entry-note {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.48;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.entry-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.entry-photo-thumb {
  width: 100%;
  height: 104px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.entry-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

/* ---------- Log Form ---------- */
.field-lbl {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.backdate-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.date-chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}

.date-chip.is-active {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: transparent;
}

.weather-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.weather-main { display: flex; align-items: center; gap: 9px; }
.weather-icon { display: inline-flex; color: var(--primary); flex-shrink: 0; }
.weather-nums { font-family: var(--font-mono); font-weight: 600; font-size: 0.8rem; }
.weather-desc { font-size: 0.73rem; color: var(--text-soft); }

.weather-badge {
  font-size: 0.67rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-text);
  white-space: nowrap;
}

.toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.toggle-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-height: 48px;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.toggle-tile.is-on { border-color: var(--sage); background: var(--sage-soft); color: var(--sage-text); }
.toggle-tile.is-on.is-warn { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.toggle-tile.is-on.is-honey { border-color: var(--honey); background: var(--honey-soft); color: var(--honey-text); }

.toggle-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
}

.toggle-tile.is-on .toggle-check { background: var(--sage); border-color: var(--sage); color: #FFFDF8; }
.toggle-tile.is-on.is-warn .toggle-check { background: var(--warn); border-color: var(--warn); color: #FFFDF8; }
.toggle-tile.is-on.is-honey .toggle-check { background: var(--honey); border-color: var(--honey); color: #21160F; }
body[data-concept="c"] .toggle-tile.is-on .toggle-check { color: #1A130F; }

.stepper-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stepper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stepper-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.step-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.step-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
}

.gear-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gear-chip {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.77rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.gear-chip.is-on {
  border-color: var(--primary);
  background: var(--surface-tint);
  color: var(--primary);
}

.journal-textarea { min-height: 92px; resize: vertical; }

.photo-picker-lbl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.pending-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pending-photo-wrap {
  position: relative;
}

.pending-photo-img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 11px;
  border: 1px solid var(--border);
}

.pending-photo-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--warn);
  color: #FFFDF8;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.save-cta {
  width: 100%;
  min-height: 50px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

.save-cta:disabled { opacity: 0.6; cursor: wait; }

/* ---------- Stats ---------- */
.chart-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 10px;
  height: 136px;
  padding: 14px 4px 4px;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.bar-val { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; }

.bar-rect {
  width: 100%;
  max-width: 48px;
  border-radius: 10px 10px 5px 5px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.bar-rect.is-current {
  background: linear-gradient(180deg, var(--honey) 0%, var(--primary) 100%);
  border-color: transparent;
}

.bar-year { font-size: 0.73rem; font-weight: 600; color: var(--text-muted); }

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 8px;
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.82rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child { border-bottom: none; padding-bottom: 0; }
.timeline-date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.outline-btn {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.outline-btn.danger { color: var(--warn); border-color: rgba(184, 66, 42, 0.35); }

/* ---------- Modals / Sheets / Lightbox ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 10, 0.56);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
  padding: 12px;
}

.sheet-card {
  width: 100%;
  max-width: 480px;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-head h3 { margin: 0; font-family: var(--font-display); font-size: 1.12rem; }

.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.theme-opt {
  padding: 9px 6px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.theme-opt.is-active {
  border-color: var(--primary);
  background: var(--surface-tint);
  color: var(--primary);
}

.code-box {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--text-soft);
  word-break: break-all;
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 9, 7, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  z-index: 60;
}

.lightbox-img {
  max-width: 100%;
  max-height: 78dvh;
  border-radius: 14px;
}

.lightbox-caption {
  color: #FBF5E8;
  font-size: 0.88rem;
}

/* ---------- Bottom Tab Bar ---------- */
.app-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  z-index: 25;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
}

.tab-btn svg { width: 22px; height: 22px; }
.tab-btn.is-active { color: var(--primary); }

.tab-log-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: -18px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
}

.tab-log-circle svg { width: 20px; height: 20px; }

/* ---------- Toast ---------- */
.app-toast {
  position: fixed;
  left: 50%;
  transform: translate(-50%, 14px);
  bottom: 84px;
  width: calc(100% - 32px);
  max-width: 440px;
  padding: 11px 15px;
  border-radius: 13px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 50;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
