/* Qamryn tracker ideas — same warm, fun family, cleaner layout */
:root {
  --bg: #F3EDE4;
  --bg-2: #E9E0D4;
  --card: #FFFCF8;
  --ink: #2A211C;
  --muted: #5A4C43;
  --line: #E0D3C6;
  --accent: #8A4B46;
  --feed: #F4D2CB;
  --feed-ink: #5A2E2C;
  --feed-active: #E8B7AE;
  --wet: #D2E3F2;
  --wet-ink: #243E58;
  --dirty: #F1DEB0;
  --dirty-ink: #534116;
  --both: #E5D4EF;
  --both-ink: #432A54;
  --sleep: #D4E7DB;
  --sleep-ink: #244438;
  --bottle: #F4E3D2;
  --bottle-ink: #5A3E2A;
  --ok: #2C6A4E;
  --danger: #8A3830;
  --nav: #FFFCF8;
  --toast: #2A211C;
  --toast-ink: #FFFCF8;
  --shadow: 0 1px 2px rgba(42, 33, 28, 0.06), 0 8px 24px rgba(42, 33, 28, 0.07);
  --radius: 18px;
  --safe-nav: 72px;
}

[data-theme="night"] {
  --bg: #16110E;
  --bg-2: #1E1814;
  --card: #241C18;
  --ink: #F4E8DC;
  --muted: #CDBBA9;
  --line: #3C312A;
  --accent: #E8B6AA;
  --feed: #4A322E;
  --feed-ink: #F6D9D2;
  --feed-active: #5C3E38;
  --wet: #2A3C4C;
  --wet-ink: #D4E6F4;
  --dirty: #4A3C22;
  --dirty-ink: #F3E0B8;
  --both: #3C2E44;
  --both-ink: #E8D6F2;
  --sleep: #24382E;
  --sleep-ink: #D4E8DC;
  --bottle: #3C3028;
  --bottle-ink: #F4E3D2;
  --ok: #8FCBB0;
  --danger: #E8A39B;
  --nav: #1C1612;
  --toast: #F4E8DC;
  --toast-ink: #2A211C;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; }

.page {
  width: 390px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 14px 16px calc(var(--safe-nav) + 16px);
  position: relative;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(180deg, #E8C9B8, #C98B6E);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 -2px 0 rgba(42, 33, 28, 0.08);
  font-size: 22px;
}
.header-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.kicker {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.theme-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}
.pill {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  line-height: 1.2;
}

/* Who */
.who {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.who-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding: 0 8px;
  white-space: nowrap;
}
.who-btn {
  flex: 1;
  min-height: 48px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: default;
}
.who-btn.is-on {
  background: var(--both);
  color: var(--both-ink);
}

/* Cards */
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.card-link { display: block; }
.card-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.card-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.card-sub {
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
}
.hint { color: var(--accent); font-weight: 800; }

/* Sections */
.section { margin-bottom: 16px; }
.section-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px 2px;
}
.section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.section-link {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

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

.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 72px;
  border: 0;
  border-radius: 16px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow);
  cursor: default;
  text-align: center;
  padding: 10px 8px;
  line-height: 1.15;
}
.btn small {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
  letter-spacing: 0;
}
.btn-feed { background: var(--feed); color: var(--feed-ink); }
.btn-feed.is-next { box-shadow: 0 0 0 2px var(--feed-ink), var(--shadow); }
.btn-feed.is-on { background: var(--feed-active); box-shadow: 0 0 0 2px var(--feed-ink), var(--shadow); }
.btn-wet { background: var(--wet); color: var(--wet-ink); }
.btn-dirty { background: var(--dirty); color: var(--dirty-ink); }
.btn-both { background: var(--both); color: var(--both-ink); }
.btn-sleep { background: var(--sleep); color: var(--sleep-ink); }
.btn-bottle {
  background: var(--bottle);
  color: var(--bottle-ink);
  min-height: 52px;
  font-size: 16px;
  flex-direction: row;
  gap: 8px;
}
.btn-wide { width: 100%; }

.quiet-link {
  display: inline-block;
  margin: 8px 2px 0;
  font-size: 15px;
  font-weight: 750;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 15px;
  font-weight: 750;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chip.is-on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
[data-theme="night"] .chip.is-on {
  background: var(--ink);
  color: var(--bg);
}

.snapshot {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.snapshot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 16px;
  font-weight: 750;
}
.snapshot-row span { white-space: nowrap; }
.snapshot .card-label { margin-bottom: 8px; }

/* Timeline */
.log-list { display: flex; flex-direction: column; gap: 0; }
.log-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
  min-height: 52px;
}
.log-row:first-child { border-top: 0; }
.log-time {
  font-size: 14px;
  font-weight: 800;
  padding-top: 2px;
}
.log-main { min-width: 0; }
.log-title { font-size: 16px; font-weight: 800; }
.log-meta {
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.log-action {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  padding: 8px;
}

/* Timer */
.timer {
  background: var(--feed);
  color: var(--feed-ink);
  border-radius: 22px;
  padding: 20px 16px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.timer.sleep {
  background: var(--sleep);
  color: var(--sleep-ink);
}
.timer-label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}
.timer-clock {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.timer-sub {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}
.timer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.timer-actions .btn { min-height: 56px; font-size: 17px; background: var(--card); color: var(--ink); }
.timer .cancel {
  margin-top: 10px;
  background: none;
  border: 0;
  font-size: 15px;
  font-weight: 750;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 44px;
}

/* Stretches */
.stretch {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  align-items: center;
}
.stretch:first-of-type { border-top: 0; }
.stretch-gap {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.stretch.is-long .stretch-gap { color: var(--accent); }

.note {
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.45;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  margin: -4px 0 8px;
}

/* Day nav */
.day-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.day-nav .arrow {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}
.day-nav .when {
  flex: 1;
  text-align: center;
}
.day-nav .when strong { display: block; font-size: 18px; }
.day-nav .when span { font-size: 14px; color: var(--muted); font-weight: 700; }

.counts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.counts.four { grid-template-columns: repeat(4, 1fr); }
.count-box { text-align: center; padding: 12px 6px; }
.count-box .num { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.count-box .lbl { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

/* Confirm */
.confirm {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 16px 16px;
  box-shadow: var(--shadow);
  margin-top: 8px;
}
.confirm h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
}
.confirm p {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 650;
  color: var(--muted);
}
.confirm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-keep {
  background: var(--bg-2);
  color: var(--ink);
  min-height: 52px;
  font-size: 16px;
}
.btn-remove {
  background: #E8C4BE;
  color: #5A221C;
  min-height: 52px;
  font-size: 16px;
}
[data-theme="night"] .btn-remove { background: #5A2E28; color: #F6D9D2; }

/* Toast sits in the page flow, near the action, never over buttons */
.toast {
  position: static;
  width: 100%;
  background: var(--toast);
  color: var(--toast-ink);
  border-radius: 16px;
  padding: 12px 12px 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow);
  margin: 0 0 16px;
}
.toast p {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.3;
}
.toast button {
  min-height: 44px;
  min-width: 64px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font-size: 16px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Bottom nav — slim, never a giant action bar */
.nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 390px;
  max-width: 100%;
  height: var(--safe-nav);
  background: var(--nav);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 10;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  min-height: 56px;
}
.nav a.is-on { color: var(--ink); }
.nav .ico { font-size: 18px; line-height: 1; }

/* Play items */
.play {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.play:first-of-type { border-top: 0; }
.check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
  margin-top: 2px;
  display: grid;
  place-items: center;
  font-size: 14px;
}
.check.on {
  background: var(--sleep);
  border-color: var(--sleep-ink);
  color: var(--sleep-ink);
}
.play h3 { margin: 0; font-size: 16px; font-weight: 800; }
.play p { margin: 2px 0 0; font-size: 14px; font-weight: 650; color: var(--muted); }

.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.team-box { text-align: center; padding: 16px 10px; }
.team-box .who-name { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.team-box .big { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; margin: 4px 0; }
.details-box {
  margin-top: 12px;
  background: var(--bg-2);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
}

/* Landscape: two columns, slim nav in the grid so nothing is covered */
body.landscape {
  width: 844px;
  height: 390px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.landscape .page {
  width: 844px;
  flex: 1;
  min-height: 0;
  height: auto;
  padding: 8px 16px 8px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  grid-template-rows: auto auto 1fr;
  gap: 0 18px;
  column-gap: 18px;
}
body.landscape .header,
body.landscape .pills { grid-column: 1 / -1; }
body.landscape .header { margin-bottom: 4px; }
body.landscape .pills { margin-bottom: 8px; }
body.landscape .col-left,
body.landscape .col-right {
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}
body.landscape .section { margin-bottom: 8px; }
body.landscape .kicker { display: none; }
body.landscape .name { font-size: 20px; }
body.landscape .avatar, body.landscape .theme-btn { width: 36px; height: 36px; }
body.landscape .section { margin-bottom: 4px; }
body.landscape .section-hd { margin-bottom: 4px; }
body.landscape .btn { min-height: 40px; font-size: 15px; }
body.landscape .btn-bottle,
body.landscape .btn-blowout { min-height: 34px; font-size: 15px; }
body.landscape .nav { height: 52px; }
body.landscape .card { padding: 8px 10px; }
body.landscape .who-btn { min-height: 40px; }
body.landscape .chip { min-height: 40px; padding: 6px 12px; }
body.landscape .who { margin-bottom: 8px; }
body.landscape .pair { margin-bottom: 8px; }
body.landscape .snapshot { margin-bottom: 0; padding: 10px 12px; }
body.landscape .nav {
  position: static;
  transform: none;
  left: auto;
  width: 100%;
  grid-column: 1 / -1;
  height: 56px;
}

/* Overview site */
body.overview {
  width: auto;
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px 80px;
  background: #F3EDE4;
  color: #2A211C;
}
.overview h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 8px;
}
.overview .lead {
  font-size: 18px;
  font-weight: 650;
  color: #5A4C43;
  max-width: 640px;
  margin: 0 0 12px;
  line-height: 1.5;
}
.overview .ia {
  background: #FFFCF8;
  border: 1px solid #E0D3C6;
  border-radius: 16px;
  padding: 16px 18px;
  margin: 20px 0 32px;
  max-width: 720px;
}
.overview .ia h2 { margin: 0 0 8px; font-size: 16px; }
.overview .ia ul { margin: 0; padding-left: 18px; }
.overview .ia li { margin: 4px 0; font-weight: 650; }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px 20px;
}
.shot figcaption {
  margin-top: 12px;
}
.shot figcaption strong { display: block; font-size: 17px; margin-bottom: 4px; }
.shot figcaption p { margin: 0 0 8px; font-size: 14px; font-weight: 650; color: #5A4C43; line-height: 1.45; }
.shot figcaption a { color: #8A4B46; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.phone {
  width: 100%;
  max-width: 260px;
  border-radius: 28px;
  border: 8px solid #2A211C;
  box-shadow: 0 16px 40px rgba(42, 33, 28, 0.16);
  display: block;
  background: #fff;
}
.phone.wide {
  max-width: 100%;
  border-radius: 16px;
  border-width: 6px;
}

/* Compact one-screen logging */
.page.compact { padding: 8px 14px calc(var(--safe-nav) + 6px); }
.page.compact .header { margin-bottom: 4px; }
.page.compact .pills { margin-bottom: 6px; }
.page.compact .who { margin-bottom: 6px; }
.page.compact .pair { margin-bottom: 6px; }
.page.compact .section { margin-bottom: 6px; }
.page.compact .btn { min-height: 58px; }
.page.compact .tabs-mini { margin-bottom: 6px; }
.page.compact .tabs-mini a, .page.compact .tabs-mini span { min-height: 32px; }
.page.compact .btn-bottle,
.page.compact .btn-blowout { min-height: 48px; font-size: 16px; }
.page.compact .snapshot { margin-bottom: 0; padding: 10px 12px; }
.page.compact .card { padding: 10px 12px; }

.btn-blowout {
  background: linear-gradient(180deg, #F8E4A4, #E8B84A);
  color: #4A3408;
  min-height: 52px;
  font-size: 17px;
  font-weight: 800;
  flex-direction: row;
  gap: 8px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow);
}
[data-theme="night"] .btn-blowout {
  background: linear-gradient(180deg, #6A5420, #4A3A12);
  color: #F8E4A4;
}
.toast.fun {
  background: #3A2A10;
  color: #F8E4A4;
}
[data-theme="night"] .toast.fun {
  background: #F8E4A4;
  color: #3A2A10;
}

.act-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.mini-badge {
  width: 64px;
  text-align: center;
  background: var(--bg-2);
  border-radius: 14px;
  padding: 8px 4px 6px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  color: var(--muted);
}
.mini-badge .emo { font-size: 22px; display: block; margin-bottom: 2px; }
.mini-badge strong { display: block; color: var(--ink); font-size: 11px; font-weight: 800; }

.tabs-mini {
  display: flex;
  gap: 6px;
  overflow: auto;
  margin-bottom: 10px;
  padding-bottom: 2px;
}
.tabs-mini a, .tabs-mini span {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 4px;
  text-align: center;
  white-space: nowrap;
}
.tabs-mini .is-on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
