:root {
  --cream: #FAF2E3;
  --cream-2: #F3E6CF;
  --paper: #FFFBF3;
  --honey: #D69A4C;
  --honey-deep: #B6772E;
  --cocoa: #5A3A22;
  --cocoa-soft: #7A5638;
  --sage: #9CAE89;
  --blush: #E8B98F;
  --line: rgba(90, 58, 34, 0.14);
  --card-edge: rgba(182, 119, 46, 0.22);
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "Iowan Old Style", Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1040px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cocoa);
  font-family: var(--sans);
  line-height: 1.65;
  background:
    radial-gradient(95% 65% at 50% -8%, rgba(214, 154, 76, 0.30) 0%, rgba(214,154,76,0) 60%),
    linear-gradient(176deg, var(--paper) 0%, var(--cream) 40%, var(--cream-2) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* ---------- Pages + bottom tab bar ---------- */
.page[hidden] { display: none; }
.page:not([data-page="home"]) > .wrap { padding-top: max(22px, calc(env(safe-area-inset-top) + 16px)); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: stretch;
  background: rgba(255, 251, 243, 0.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer; padding: 9px 4px 8px;
  color: var(--cocoa-soft); font-family: var(--sans);
}
.tab-ico { font-size: 1.35rem; line-height: 1; filter: grayscale(0.4); opacity: 0.7; transition: all 0.15s ease; }
.tab-lab { font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.tab.is-active { color: var(--honey-deep); }
.tab.is-active .tab-ico { filter: none; opacity: 1; transform: translateY(-1px); }
.tab:focus-visible { outline: 3px solid var(--honey); outline-offset: -3px; border-radius: 10px; }

#field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.wrap {
  position: relative; z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 48px;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--honey-deep);
  margin: 0;
}

/* ---------- Teddy bear (interactive) ---------- */
.bear-stage {
  display: flex; justify-content: center;
  padding-top: max(56px, calc(env(safe-area-inset-top) + 28px));
  position: relative;
}
.bear-btn { background: none; border: none; padding: 0; cursor: pointer; border-radius: 50%; }
.bear-btn:focus-visible { outline: 3px solid var(--honey); outline-offset: 8px; }
.bear {
  position: relative;
  width: 150px; height: 138px;
  filter: drop-shadow(0 10px 18px rgba(90, 58, 34, 0.18));
  animation: bob 4.5s ease-in-out infinite;
  transform-origin: 50% 90%;
}
.bear.squish { animation: squish 0.45s ease; }
@keyframes bob { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-7px); } }
@keyframes squish {
  0%{ transform: scale(1,1); } 30%{ transform: scale(1.08, 0.92); }
  60%{ transform: scale(0.96, 1.05); } 100%{ transform: scale(1,1); }
}
.bear .ear { position: absolute; top: 0; width: 48px; height: 48px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #9C6A3F, #6F4626); }
.bear .ear.l { left: 8px; }
.bear .ear.r { right: 8px; }
.bear .ear::after { content: ""; position: absolute; top: 14px; left: 14px; width: 20px; height: 20px; border-radius: 50%; background: var(--blush); }
.bear .head { position: absolute; top: 22px; left: 14px; width: 122px; height: 108px; border-radius: 50% 50% 48% 48%; background: radial-gradient(circle at 42% 32%, #A9764A, #7A4F2C 78%); }
.bear .eye { position: absolute; top: 56px; width: 12px; height: 14px; border-radius: 50%; background: #2C1A0E; }
.bear .eye.l { left: 47px; }
.bear .eye.r { right: 47px; }
.bear .eye::after { content: ""; position: absolute; top: 2px; left: 2px; width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,0.85); }
.bear .snout { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); width: 54px; height: 42px; border-radius: 50%; background: radial-gradient(circle at 45% 35%, #F0DFC4, #E2C79E); }
.bear .nose { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); width: 19px; height: 14px; border-radius: 50%; background: #2C1A0E; }
.bear .nose::after { content: ""; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 1.5px; height: 10px; background: #2C1A0E; }
.tap-hint { text-align: center; margin: 12px 0 0; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--honey-deep); opacity: 0.7; }
.float-heart { position: fixed; z-index: 5; pointer-events: none; font-size: 1.2rem; will-change: transform, opacity; animation: floatup 1.6s ease-out forwards; }
@keyframes floatup {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-150px) scale(1.1); }
}

/* ---------- Hero / name ---------- */
.hero { text-align: center; padding: 18px 0 8px; }
.hero .eyebrow { margin-bottom: 14px; }
.hero .greet { font-family: var(--serif); font-style: italic; font-size: clamp(1.1rem, 2.6vw, 1.45rem); color: var(--cocoa-soft); margin: 0 0 6px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(3.4rem, 13vw, 7rem); line-height: 0.92; margin: 0; letter-spacing: 0.01em; color: var(--cocoa); text-wrap: balance; }
.hero h1 .first { display: block; color: var(--honey-deep); font-style: italic; }
.hero h1 .last { display: block; font-size: 0.42em; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cocoa); margin-top: 10px; font-family: var(--sans); font-weight: 600; }
.hero .tagline { font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 3vw, 1.65rem); color: var(--cocoa-soft); margin: 24px 0 0; }

.paw-rule { display: flex; justify-content: center; gap: 14px; margin: 46px auto 8px; color: var(--honey); opacity: 0.7; }
.paw-rule span { font-size: 1.1rem; }
.paw-rule span:nth-child(2) { transform: translateY(-6px); }

/* ---------- Countdown ---------- */
.count { text-align: center; margin-top: 36px; }
.count h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 4.4vw, 2.5rem); margin: 14px 0 2px; text-wrap: balance; }
.count h2 .name { font-style: italic; color: var(--honey-deep); }
.count .target { color: var(--cocoa-soft); font-size: 1rem; font-family: var(--sans); letter-spacing: 0.04em; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 620px; margin: 32px auto 0; }
.tile { background: var(--paper); border: 1px solid var(--card-edge); border-radius: 18px; padding: 22px 8px 16px; position: relative; box-shadow: 0 8px 22px rgba(90, 58, 34, 0.08); }
.tile::before { content: ""; position: absolute; top: 10px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--honey); opacity: 0; }
.tile.pulse::before { animation: spark 0.9s ease-out; }
@keyframes spark { 0%{opacity:.9; transform:scale(1);} 100%{opacity:0; transform:scale(2.6);} }
.tile .num { font-family: var(--serif); font-size: clamp(2rem, 6vw, 3rem); line-height: 1; font-variant-numeric: tabular-nums; color: var(--cocoa); }
.tile .lab { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.62rem; color: var(--honey-deep); margin-top: 10px; font-weight: 600; }
.count .arrived { font-family: var(--serif); font-style: italic; font-size: 1.7rem; color: var(--honey-deep); }

/* ---------- Pregnancy week ---------- */
.pregweek { margin: 40px auto 0; max-width: 540px; text-align: center; background: var(--paper); border: 1px solid var(--card-edge); border-radius: 22px; padding: 26px 28px; box-shadow: 0 12px 30px rgba(90, 58, 34, 0.08); }
.pregweek[hidden] { display: none; }
.pw-emoji { font-size: 2.8rem; line-height: 1; }
.pw-line { font-family: var(--serif); font-size: 1.3rem; color: var(--cocoa); margin: 12px 0 6px; }
.pw-line strong { color: var(--honey-deep); font-style: italic; font-weight: 400; }
.pw-week { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--honey-deep); font-weight: 700; margin: 0; }

/* ---------- Labor: contraction timer + Baby's coming ---------- */
.laborcard { margin: 40px auto 0; max-width: 540px; background: var(--paper); border: 1px solid var(--card-edge); border-radius: 22px; padding: 28px 26px; box-shadow: 0 12px 30px rgba(90, 58, 34, 0.08); text-align: center; }
.lc-h { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; color: var(--cocoa); margin: 8px 0 4px; }
.lc-h .name { font-style: italic; color: var(--honey-deep); }
.ctimer { margin-top: 18px; }
.ct-toggle { width: 100%; font-family: var(--sans); font-weight: 700; font-size: 1.05rem; color: var(--paper); background: linear-gradient(var(--honey), var(--honey-deep)); border: none; border-radius: 14px; padding: 18px; cursor: pointer; box-shadow: 0 6px 18px rgba(182, 119, 46, 0.26); }
.ct-toggle.on { background: linear-gradient(#C66, #B24A3C); box-shadow: 0 6px 18px rgba(178, 74, 60, 0.3); }
.ct-toggle:focus-visible { outline: 3px solid var(--cocoa); outline-offset: 2px; }
.ct-live { margin-top: 12px; font-family: var(--serif); font-style: italic; color: var(--honey-deep); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ct-live[hidden] { display: none; }
.ct-stats { margin-top: 12px; color: var(--cocoa-soft); font-size: 0.92rem; }
.ct-stats strong { color: var(--cocoa); font-variant-numeric: tabular-nums; }
.ct-list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.ct-row { display: grid; grid-template-columns: 1fr auto auto 30px; align-items: center; gap: 10px; background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 0.85rem; }
.ct-time { color: var(--cocoa); font-variant-numeric: tabular-nums; text-align: left; }
.ct-dur { color: var(--honey-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
.ct-gap { color: var(--cocoa-soft); font-variant-numeric: tabular-nums; }
.ct-row .del { width: 26px; height: 26px; border: none; background: none; color: #B49B7E; font-size: 1.1rem; line-height: 1; cursor: pointer; border-radius: 50%; }
.ct-row .del:hover { color: var(--honey-deep); }
.ct-note { font-size: 0.74rem; color: #B49B7E; margin: 14px 0 0; font-style: italic; }

.bc-wrap { margin-top: 24px; }
.bc-btn { position: relative; overflow: hidden; width: 100%; border: none; border-radius: 16px; padding: 20px; cursor: pointer; background: linear-gradient(#E2A0A0, #C9695C); color: var(--paper); touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 8px 22px rgba(201, 105, 92, 0.32); }
.bc-btn.done { background: linear-gradient(var(--sage), #7E9468); }
.bc-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, 0.28); }
.bc-label { position: relative; font-family: var(--sans); font-weight: 800; font-size: 1.2rem; letter-spacing: 0.02em; }
.bc-btn:focus-visible { outline: 3px solid var(--cocoa); outline-offset: 2px; }
.bc-hint { font-size: 0.78rem; color: var(--cocoa-soft); margin: 10px 0 0; }
.ct-status { display: flex; justify-content: center; margin-top: 18px; }

/* ---------- Name meaning ---------- */
.meaning { margin: 84px auto 0; max-width: 540px; background: var(--paper); border: 1px solid var(--card-edge); border-radius: 22px; padding: 32px 30px; text-align: center; box-shadow: 0 12px 30px rgba(90, 58, 34, 0.08); }
.meaning .word { font-family: var(--serif); font-size: 2.1rem; color: var(--honey-deep); font-style: italic; }
.meaning .def { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.24em; color: var(--cocoa); margin: 10px 0 14px; font-weight: 700; }
.meaning p { margin: 0; color: var(--cocoa-soft); font-size: 1.02rem; }

/* ---------- Care log ---------- */
.care-who { display: flex; align-items: center; gap: 16px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.care-who .field-label { margin: 0; }
.care-who .who-pick { width: 220px; }

.glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.g-tile { background: var(--paper); border: 1px solid var(--card-edge); border-radius: 16px; padding: 16px 8px; text-align: center; box-shadow: 0 6px 16px rgba(90, 58, 34, 0.06); }
.g-tile.active { border-color: var(--sage); background: linear-gradient(var(--paper), #F1F4EC); }
.g-ico { font-size: 1.4rem; }
.g-lab { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--honey-deep); margin-top: 6px; font-weight: 700; }
.g-val { font-family: var(--serif); font-size: 1.05rem; color: var(--cocoa); margin-top: 4px; font-variant-numeric: tabular-nums; }

.quick { margin-top: 26px; display: grid; gap: 16px; }
.quick-group { background: var(--paper); border: 1px solid var(--card-edge); border-radius: 18px; padding: 16px 16px 18px; box-shadow: 0 6px 16px rgba(90, 58, 34, 0.06); }
.quick-title { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--honey-deep); font-weight: 700; }
.quick-btns { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.qbtn { flex: 1; min-width: 92px; padding: 16px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--cream); color: var(--cocoa); font-family: var(--sans); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: transform 0.1s ease, background 0.15s ease; }
.qbtn:hover { background: #F6ECD9; }
.qbtn:active { transform: scale(0.97); }
.qbtn.wide { flex-basis: 100%; }
.qbtn:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }
.qbtn.on { background: linear-gradient(var(--sage), #7E9468); color: var(--paper); border-color: #7E9468; }

.care-status { display: flex; justify-content: center; margin-top: 20px; }

.timeline { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.tl-row { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: 0 4px 12px rgba(90, 58, 34, 0.05); }
.tl-row.tl-open { border-color: var(--sage); }
.tl-ico { font-size: 1.3rem; flex: none; width: 30px; text-align: center; }
.tl-body { flex: 1; min-width: 0; }
.tl-label { font-family: var(--serif); font-size: 1.05rem; color: var(--cocoa); }
.tl-meta { font-size: 0.74rem; color: var(--cocoa-soft); letter-spacing: 0.02em; margin-top: 2px; }
.tl-meta .pending { color: var(--honey-deep); font-style: italic; }
.tl-row .del { flex: none; width: 30px; height: 30px; border-radius: 50%; border: none; background: none; color: #B49B7E; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.tl-row .del:hover { color: var(--honey-deep); background: var(--cream); }

/* ---------- Photo album ---------- */
.album { margin-top: 90px; }
.album .head { text-align: center; }
.album h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 5vw, 3rem); margin: 14px 0 6px; text-wrap: balance; color: var(--cocoa); }
.album h2 .name { font-style: italic; color: var(--honey-deep); }
.album .head p { color: var(--cocoa-soft); max-width: 46ch; margin: 0 auto; }
.gallery { margin-top: 32px; display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.gallery button { padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--cream); aspect-ratio: 1 / 1; box-shadow: 0 5px 14px rgba(90, 58, 34, 0.07); }
.gallery button:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.gallery button:hover img { transform: scale(1.05); }
.album-msg { text-align: center; color: var(--cocoa-soft); font-style: italic; font-family: var(--serif); margin-top: 28px; }
.album-msg[hidden] { display: none; }
.count-chip { display: inline-block; font-family: var(--sans); font-size: 0.8rem; font-weight: 700; color: var(--paper); background: var(--honey); border-radius: 999px; padding: 2px 11px; vertical-align: middle; margin-left: 6px; }
.count-chip[hidden] { display: none; }
.gallery-groups[hidden], .gallery[hidden] { display: none; }
.gallery-group { margin-top: 26px; }
.group-head { font-family: var(--sans); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--honey-deep); font-weight: 700; margin: 0 0 12px; }
.gallery-group .gallery { margin-top: 0; }
.album-toggle { display: block; margin: 22px auto 0; background: none; border: 1px solid var(--card-edge); color: var(--honey-deep); font-family: var(--sans); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; border-radius: 999px; padding: 10px 22px; cursor: pointer; }
.album-toggle:hover { background: var(--paper); }
.album-toggle[hidden] { display: none; }
.album-toggle:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }

/* ---------- Journey: appointments + milestones ---------- */
.sched-row { display: flex; gap: 14px; }
.sched-row .grow { flex: 1; }
#schedDate { width: auto; }
.sched-block { margin-top: 36px; }
.sched-h { font-family: var(--serif); font-weight: 400; font-size: 1.4rem; color: var(--cocoa); margin: 0 0 14px; }
.sched-item { display: flex; align-items: center; gap: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 4px 12px rgba(90, 58, 34, 0.05); }
.si-date { flex: none; width: 50px; text-align: center; background: var(--cream); border: 1px solid var(--card-edge); border-radius: 12px; padding: 8px 0; }
.si-d { display: block; font-family: var(--serif); font-size: 1.4rem; line-height: 1; color: var(--honey-deep); font-variant-numeric: tabular-nums; }
.si-m { display: block; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--cocoa-soft); font-weight: 700; margin-top: 3px; }
.si-body { flex: 1; min-width: 0; }
.si-title { font-family: var(--serif); font-size: 1.1rem; color: var(--cocoa); }
.si-note { font-size: 0.85rem; color: var(--cocoa-soft); margin-top: 2px; }
.si-meta { font-size: 0.72rem; color: var(--honey-deep); letter-spacing: 0.02em; margin-top: 3px; }
.si-meta .pending { color: var(--honey-deep); font-style: italic; }
.sched-item .del { flex: none; width: 30px; height: 30px; border-radius: 50%; border: none; background: none; color: #B49B7E; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.sched-item .del:hover { color: var(--honey-deep); background: var(--cream); }

.lightbox { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; background: rgba(44, 26, 14, 0.92); padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); object-fit: contain; }
.lb-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 18px; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(251, 243, 231, 0.15); color: var(--cream); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: none; background: rgba(251, 243, 231, 0.15); color: var(--cream); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-close:focus-visible, .lb-nav:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }
.lb-cap { color: var(--cream); font-family: var(--serif); font-style: italic; text-align: center; max-width: 40ch; margin: 0; min-height: 1.2em; }

/* ---------- Letters ---------- */
.book { margin-top: 90px; }
.book .head { text-align: center; }
.book h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 5vw, 3rem); margin: 14px 0 6px; text-wrap: balance; color: var(--cocoa); }
.book h2 .name { font-style: italic; color: var(--honey-deep); }
.book .head p { color: var(--cocoa-soft); max-width: 46ch; margin: 0 auto; }

form { margin: 38px auto 0; max-width: 580px; background: var(--paper); border: 1px solid var(--card-edge); border-radius: 22px; padding: 26px; display: grid; gap: 18px; box-shadow: 0 12px 30px rgba(90, 58, 34, 0.08); }
.who-pick { display: flex; gap: 10px; }
.who-pick label { flex: 1; margin: 0; text-align: center; cursor: pointer; border: 1px solid var(--line); border-radius: 12px; padding: 11px 0; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 700; color: var(--cocoa-soft); background: var(--cream); transition: all 0.15s ease; }
.who-pick input { position: absolute; opacity: 0; pointer-events: none; }
.who-pick input:checked + label { background: linear-gradient(var(--honey), var(--honey-deep)); color: var(--paper); border-color: var(--honey-deep); }
.who-pick input:focus-visible + label { outline: 3px solid var(--cocoa); outline-offset: 2px; }
.field-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--honey-deep); margin-bottom: 8px; font-weight: 700; }
textarea { width: 100%; background: var(--cream); border: 1px solid var(--line); border-radius: 12px; color: var(--cocoa); font-family: var(--serif); font-size: 1.05rem; padding: 14px; resize: vertical; min-height: 110px; line-height: 1.55; }
textarea::placeholder { color: #B49B7E; font-style: italic; }
textarea:focus { outline: none; border-color: var(--honey); box-shadow: 0 0 0 3px rgba(214, 154, 76, 0.25); }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
button.send { font-family: var(--sans); font-weight: 700; letter-spacing: 0.03em; font-size: 0.95rem; color: var(--paper); background: linear-gradient(var(--honey), var(--honey-deep)); border: none; border-radius: 999px; padding: 13px 26px; cursor: pointer; transition: transform 0.12s ease, box-shadow 0.2s ease; box-shadow: 0 6px 18px rgba(182, 119, 46, 0.28); }
button.send:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(182, 119, 46, 0.38); }
button.send:focus-visible { outline: 3px solid var(--cocoa); outline-offset: 2px; }
button.send:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

/* sync status pill */
.sync { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; color: var(--cocoa-soft); }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); flex: none; }
.sync[data-state="saving"] .dot { background: var(--honey); animation: blink 1s ease-in-out infinite; }
.sync[data-state="offline"] .dot { background: #C98B5C; }
.sync[data-state="error"] .dot { background: #C0563E; }
@keyframes blink { 0%,100%{ opacity: 1; } 50%{ opacity: 0.3; } }

.letters { margin-top: 44px; columns: 2 280px; column-gap: 18px; }
.letter { break-inside: avoid; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 16px; margin-bottom: 18px; box-shadow: 0 6px 16px rgba(90, 58, 34, 0.06); }
.letter .chip { display: inline-block; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 700; color: var(--paper); background: var(--honey); border-radius: 999px; padding: 4px 12px; }
.letter .chip.mom { background: var(--sage); }
.letter p { margin: 12px 0 10px; font-family: var(--serif); font-size: 1.08rem; line-height: 1.55; color: var(--cocoa); white-space: pre-wrap; }
.letter .meta { font-size: 0.72rem; color: var(--cocoa-soft); letter-spacing: 0.04em; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.letter .meta .pending { color: var(--honey-deep); font-style: italic; }
.letter .del { background: none; border: none; color: #B49B7E; cursor: pointer; font-size: 0.72rem; padding: 2px 4px; text-decoration: underline; }
.letter .del:hover { color: var(--honey-deep); }
.empty { text-align: center; color: var(--cocoa-soft); font-style: italic; font-family: var(--serif); margin-top: 30px; }

footer { text-align: center; margin-top: 90px; color: var(--cocoa-soft); padding-bottom: env(safe-area-inset-bottom); }
footer .sig { font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--cocoa); }
footer .small { font-size: 0.8rem; color: #B49B7E; margin-top: 8px; }

/* ---------- Passcode gate ---------- */
.gate { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 28px; background: linear-gradient(176deg, var(--paper), var(--cream-2)); }
.gate[hidden] { display: none; }
.gate-card { width: 100%; max-width: 380px; text-align: center; background: var(--paper); border: 1px solid var(--card-edge); border-radius: 24px; padding: 38px 30px; box-shadow: 0 16px 40px rgba(90, 58, 34, 0.14); }
.gate-card .mini-bear { font-size: 2.4rem; }
.gate-card h2 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; margin: 10px 0 4px; color: var(--cocoa); }
.gate-card p { color: var(--cocoa-soft); font-size: 0.95rem; margin: 0 0 22px; }
.gate-card input { width: 100%; text-align: center; background: var(--cream); border: 1px solid var(--line); border-radius: 12px; color: var(--cocoa); font-family: var(--sans); font-size: 1.1rem; letter-spacing: 0.08em; padding: 13px 14px; margin-bottom: 14px; }
.gate-card input:focus { outline: none; border-color: var(--honey); box-shadow: 0 0 0 3px rgba(214, 154, 76, 0.25); }
.gate-card button { width: 100%; font-family: var(--sans); font-weight: 700; font-size: 1rem; color: var(--paper); background: linear-gradient(var(--honey), var(--honey-deep)); border: none; border-radius: 999px; padding: 14px; cursor: pointer; }
.gate-err { color: #C0563E; font-size: 0.85rem; min-height: 1.2em; margin: 12px 0 0; }

@media (max-width: 540px) {
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .letters { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .bear { animation: none; }
  .bear.squish { animation: none; }
  .tile.pulse::before { animation: none; }
  .float-heart { animation: none; display: none; }
  .sync[data-state="saving"] .dot { animation: none; }
  button.send { transition: none; }
}
