/* DadMode Tracker v3 — swipe deck edition, compact */
:root, [data-theme="light"] {
  --bg: #e0e3e8;
  --card: #ffffff;
  --card2: #eef0f3;
  --text: #1c1c1c;
  --muted: #7a7e85;
  --line: #d5d8de;
  --navbg: #ffffff;
  --red: #e03131;
  --yellow: #ffc828;
  --blue: #2f81f7;
  --green: #2f9e44;
  --brown: #b07a3f;
  --dark: #1c1c1c;
  --shadow: 0 4px 14px rgba(0,0,0,.10);
  --font-head: 'Luckiest Guy', 'Arial Black', sans-serif;
  --font-body: 'Short Stack', 'Comic Sans MS', cursive, sans-serif;
}
[data-theme="dark"] {
  --bg: #141414;
  --card: #1f1f1f;
  --card2: #262626;
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --line: #333333;
  --navbg: #0d0d0d;
  --dark: #f5f5f5;
  --shadow: 0 4px 14px rgba(0,0,0,.45);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; overflow-x: clip; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 15px;
  min-height: 100vh; padding-bottom: 104px; overscroll-behavior-y: none;
  transition: background .2s, color .2s;
}
h1, h2, h3 { font-family: var(--font-head); letter-spacing: .5px; margin: 0; }
.hidden { display: none !important; }
.mt { margin-top: 10px; }
.rule { border: none; border-top: 1.5px solid var(--line); margin: 10px 0 14px; }

.screen { display: none; padding: 12px 16px 20px; max-width: 520px; margin: 0 auto; animation: fadein .18s ease; }
.screen.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; min-height: 40px; }
.topbar h1 { font-size: 19px; }
.back { background: none; border: none; color: var(--text); font-size: 30px; line-height: 1; padding: 0 10px 0 0; cursor: pointer; }
.spacer { width: 36px; }

/* yellow comic badge */
.brand-badge {
  font-family: var(--font-head); background: var(--yellow); color: #141414;
  padding: 6px 16px; border-radius: 999px; font-size: 18px; letter-spacing: 2px;
  text-shadow: 1px 1px 0 rgba(255,255,255,.55);
  box-shadow: 2px 3px 0 rgba(0,0,0,.22); display: inline-block;
  -webkit-text-stroke: .6px #141414;
}
.brand-badge.big { font-size: 24px; padding: 10px 24px; }

.headline { font-size: 37px; line-height: 1.05; margin: 4px 0 8px; }
.baby-chip-blue {
  display: inline-flex; align-items: center; gap: 7px; background: var(--blue); color: #fff;
  font-size: 15px; padding: 7px 16px; border-radius: 999px; margin-bottom: 4px;
  box-shadow: var(--shadow); font-family: var(--font-body);
}
.swipe-hint { color: var(--muted); font-size: 13px; margin: 8px 0 2px; }

/* card deck */
.deck { position: relative; height: 292px; margin: 24px 0 2px; touch-action: pan-y; }
.deck-card {
  position: absolute; left: 50%; top: 8px; width: 190px; height: 250px; margin-left: -95px;
  background: var(--card); border-radius: 20px; padding: 16px 14px 14px; text-align: center;
  box-shadow: 0 10px 26px rgba(0,0,0,.16); cursor: pointer;
  transition: transform .32s cubic-bezier(.3,1.4,.5,1);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.deck-emoji { font-size: 40px; }
.deck-card h3 { font-size: 26px; margin: 2px 0; }
.deck-desc { margin: 0; font-size: 13px; color: var(--text); }
.deck-last { margin: 2px 0 4px; font-size: 11px; color: var(--muted); min-height: 15px; }
.deck-log {
  font-family: var(--font-head); font-size: 14px; letter-spacing: .5px;
  background: var(--yellow); color: #141414; border: none; border-radius: 999px;
  padding: 9px 20px; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.15); margin-top: auto; margin-bottom: 4px;
  display: none;
}
.deck-card.is-front .deck-log { display: block; }
.deck-log:active { transform: translateY(2px); box-shadow: none; }

.deck-head { font-size: 24px; margin: 16px 0 10px; }

/* stats card */
.stats-card {
  background: var(--card); border-radius: 20px; padding: 16px 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; box-shadow: var(--shadow);
}
.stat2 { display: flex; gap: 10px; align-items: flex-start; }
.stat2-emoji { font-size: 28px; }
.stat2 > div { display: flex; flex-direction: column; }
.stat2-lbl { font-size: 13px; color: var(--text); }
.stat2-num { font-family: var(--font-head); font-size: 27px; line-height: 1.1; }
.stat2-sub { font-size: 11px; color: var(--muted); }

/* emergency — content vertically centered */
.emg-row { display: flex; gap: 10px; margin-bottom: 6px; }
.btn-emg {
  flex: 1; padding: 12px 6px; font-size: 18px; display: flex; align-items: center; justify-content: center;
  gap: 8px; border-radius: 999px; white-space: nowrap; line-height: 1.2; text-align: center;
}
.btn-emg .emg-ico { font-size: 20px; }
.btn-emg #emg-label { font-size: 18px; }

/* past-days log viewer */
#day-log { margin-top: 10px; }

/* optional marketing consent on onboarding */
.consent-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); margin: 4px 0 10px; cursor: pointer; text-align: left; line-height: 1.35; }
.consent-row input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--yellow); flex: none; cursor: pointer; }
.consent-row em { font-style: normal; opacity: .7; }

/* theme switch — grey pill track, yellow sun knob left, grey moon right (matches reference) */
.theme-switch { position: relative; display: inline-block; width: 66px; height: 36px; flex: none; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; cursor: pointer; background: #d3d6db; border: 1.5px solid #bcc0c7; border-radius: 999px; transition: .2s; }
[data-theme="dark"] .slider { background: #2b2b2b; border-color: #2b2b2b; }
.track-moon { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 16px; opacity: .65; }
.slider .knob {
  position: absolute; height: 30px; width: 30px; left: 2px; top: 1.5px;
  background: var(--yellow); border-radius: 50%; transition: .2s;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  box-shadow: 0 2px 5px rgba(0,0,0,.25);
}
.knob .ki-moon { display: none; }
.theme-switch input:checked + .slider .knob { transform: translateX(30px); background: #333; }
.theme-switch input:checked + .slider .knob .ki-sun { display: none; }
.theme-switch input:checked + .slider .knob .ki-moon { display: inline; }
.theme-row { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 15px; margin-bottom: 12px; box-shadow: var(--shadow); }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 10px 0 0; }
.lbl { display: block; font-size: 11px; color: var(--muted); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 1px; }
.chart-head { font-size: 14px; margin-bottom: 10px; }

.btn {
  font-family: var(--font-head); border: none; border-radius: 14px; cursor: pointer;
  letter-spacing: 1px; color: #141414; box-shadow: var(--shadow);
  transition: transform .06s ease; text-decoration: none; text-align: center;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.btn-big { display: block; width: 100%; padding: 15px; font-size: 17px; margin-top: 12px; }
.btn-huge { display: block; width: 100%; padding: 20px; font-size: 21px; }
.btn-red { background: var(--red); color: #fff; }
.btn-yellow { background: var(--yellow); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-dark { background: var(--dark); color: var(--bg); }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: transparent; color: var(--red); border: 2px solid var(--red); box-shadow: none; }
.btn-round { width: 56px; height: 56px; border-radius: 50%; font-size: 26px; padding: 0; flex: none; }
.btn-add { padding: 13px 16px; font-size: 15px; flex: none; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; overflow-x: auto; }
.seg-btn {
  flex: 1; background: transparent; border: none; color: var(--muted); font-family: var(--font-head);
  font-size: 13px; letter-spacing: 1px; padding: 11px 6px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.seg-btn.active { background: var(--yellow); color: #141414; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.chip {
  background: var(--card2); border: 2px solid var(--line); color: var(--text);
  border-radius: 24px; padding: 9px 14px; font-family: var(--font-body); font-size: 13px; cursor: pointer;
}
.chip.active { border-color: var(--yellow); background: #fff3d1; }
[data-theme="dark"] .chip.active { background: #3a2f10; }

.big-timer { font-family: var(--font-head); font-size: 52px; letter-spacing: 2px; margin: 8px 0 4px; }
.oz-row { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 10px 0 6px; }
.oz-val { min-width: 96px; text-align: center; }
.oz-val #oz-num { font-family: var(--font-head); font-size: 58px; color: var(--brown); }
.oz-unit { font-size: 16px; color: var(--muted); margin-left: 6px; }

.text-input, .code-input {
  width: 100%; max-width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-family: var(--font-body); font-size: 16px; padding: 13px; outline: none;
  min-width: 0; display: block;
}
.text-input:focus, .code-input:focus { border-color: var(--yellow); }
.code-input { text-align: center; letter-spacing: 2px; font-size: 14px; }
/* iOS renders date inputs with an intrinsic min-width that overflows the card — flatten it */
input[type="date"].text-input {
  -webkit-appearance: none; appearance: none;
}
.title-input { font-family: var(--font-head); font-size: 16px; letter-spacing: .5px; margin-bottom: 10px; }

.lock-wrap { max-width: 400px; margin: 4vh auto 0; padding: 0 8px 30px; text-align: center; }
.lock-wrap .lbl { text-align: left; }
.app-title { font-size: 38px; margin: 10px 0 4px; }
.lock-sub { color: var(--muted); margin-bottom: 6px; font-size: 14px; }
.lock-error { color: var(--red); font-size: 13px; }

.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-list.pad { padding-bottom: 8px; }
.log-row {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; align-items: center; gap: 10px; font-size: 13px; box-shadow: var(--shadow);
}
.log-row .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot-feed { background: var(--yellow); } .dot-diaper { background: var(--brown); }
.dot-sleep { background: var(--blue); } .dot-med { background: var(--red); }
.log-row .grow { flex: 1; }
.log-row .time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.log-del { background: none; border: none; color: var(--muted); font-size: 17px; cursor: pointer; padding: 4px; }
.empty-note { color: var(--muted); text-align: center; padding: 20px; font-size: 13px; }

.add-row { display: flex; gap: 10px; margin-bottom: 12px; }
.groc-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.groc-row {
  display: flex; align-items: center; gap: 10px; background: var(--card2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px;
}
.groc-row.done span.txt { text-decoration: line-through; color: var(--muted); }
.groc-check {
  width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--muted);
  background: transparent; flex: none; cursor: pointer; font-size: 15px; color: #fff; line-height: 1;
}
.groc-row.done .groc-check { background: var(--green); border-color: var(--green); }
.groc-row .grow { flex: 1; }
.groc-del { background: none; border: none; color: var(--muted); font-size: 17px; cursor: pointer; }

.chart { width: 100%; display: block; }

/* bottom nav */
.navbar {
  position: fixed; bottom: 10px; left: 14px; right: 14px; z-index: 50;
  display: flex; background: var(--navbg); border: 1px solid var(--line); border-radius: 24px;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); box-shadow: var(--shadow);
  max-width: 492px; margin: 0 auto;
}
.nav-btn {
  flex: 1; background: none; border: none; color: var(--muted); font-family: var(--font-body);
  font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; cursor: pointer;
}
.nav-btn.active { color: var(--blue); }
.nav-btn.active span:last-child { border-bottom: 3px solid var(--blue); padding-bottom: 1px; }
.nav-btn > :first-child { font-size: 21px; }

.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: var(--yellow); color: #141414; font-family: var(--font-head); letter-spacing: 1px;
  padding: 12px 22px; border-radius: 30px; font-size: 15px; z-index: 99;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); animation: fadein .2s ease; white-space: nowrap;
}
