:root {
  --bg: #fff7ec;
  --card: #ffffff;
  --ink: #2b2118;
  --soft: #6b5a4a;
  --sun: #ff8c42;
  --sun-deep: #e8662a;
  --gold: #ffc96b;
  --sea: #2e628c;
  --line: #f0dcc4;
  --good: #2f8f5b;
  --fs: 20px;
  --tab-h: 78px;
}
:root[data-size="xl"] { --fs: 23px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #e8662a; }
html, body { margin: 0; color: var(--ink); }
body { background: transparent; }
body {
  font: var(--fs)/1.45 -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  padding: env(safe-area-inset-top) 0 calc(var(--tab-h) + env(safe-area-inset-bottom));
  -webkit-text-size-adjust: 100%;
}
/* Mom's sunrise photo behind everything. A fixed layer, since iPhone ignores background-attachment: fixed. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(30, 15, 0, .45) 0%, rgba(30, 15, 0, .1) 30%, rgba(30, 15, 0, .25) 100%),
    url("bg.jpg") center 62% / cover no-repeat, #e8662a;
}
main { max-width: 620px; margin: 0 auto; padding: 16px 16px 24px; }
main > h1, main > p.muted, main > .walk-title { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .55); }
h1 { font-size: 1.6em; line-height: 1.15; margin: 8px 0 4px; }
h2 { font-size: 1.2em; margin: 0 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--soft); }
.center { text-align: center; }

.card {
  background: var(--card); border-radius: 22px; padding: 18px;
  box-shadow: 0 2px 10px rgba(120, 70, 20, .08); margin: 14px 0;
}
.hero {
  background: rgba(45, 20, 0, .38); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .25);
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.hero .big { font-size: 2.6em; font-weight: 800; line-height: 1; margin: 6px 0; }
.hero .row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 68px; border: 0; border-radius: 20px;
  font: inherit; font-weight: 700; font-size: 1.1em; cursor: pointer;
  background: var(--sun); color: #fff; margin: 10px 0;
}
.btn:active { transform: scale(.98); }
.btn.alt { background: var(--sea); }
.btn.light { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn.good { background: var(--good); }
.btn.small { min-height: 52px; font-size: .95em; }
.btn .ico { font-size: 1.3em; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stats b { display: block; font-size: 1.5em; }
.stats span { color: var(--soft); font-size: .8em; }

.timer { font-size: 3.2em; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; display: block; }
.photos .ph { position: relative; }

textarea, input[type=text], input[type=number] {
  width: 100%; font: inherit; padding: 14px; border-radius: 16px;
  border: 2px solid var(--line); background: #fffdf9; color: var(--ink);
}
textarea { min-height: 150px; resize: vertical; }

.choices { display: flex; gap: 8px; justify-content: space-between; }
.choices button {
  flex: 1; min-height: 60px; font-size: 1.5em; border-radius: 16px;
  border: 2px solid var(--line); background: #fffdf9;
}
.choices button.on { border-color: var(--sun); background: #ffe9d4; }

.map { height: 280px; border-radius: 18px; overflow: hidden; margin: 10px 0; }

.toggle { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.toggle input { width: 30px; height: 30px; accent-color: var(--sun); flex: none; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head button { font-size: 1.4em; width: 56px; height: 56px; border-radius: 50%; border: 0; background: #fff; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; }
.cal .dow { text-align: center; font-size: .7em; color: var(--soft); font-weight: 700; }
.cal .d {
  position: relative; aspect-ratio: 1; border-radius: 12px; border: 0; padding: 0;
  background: #fff; font: inherit; font-size: .8em; font-weight: 700; color: var(--ink); overflow: hidden;
}
.cal .d.has { background: #ffe2c4; }
.cal .d.today { outline: 3px solid var(--sun); }
.cal .d img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cal .d span { position: relative; z-index: 1; }
.cal .d.pic span { color: #fff; text-shadow: 0 1px 3px #000; }

.list .item { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.list .item:first-child { border-top: 0; }
.list img { width: 74px; height: 74px; object-fit: cover; border-radius: 14px; flex: none; }

/* Photo viewer */
.viewer {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .94);
  display: flex; flex-direction: column; justify-content: center; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.viewer img { width: 100%; max-height: 72vh; object-fit: contain; }
.viewer .bar { display: flex; gap: 10px; padding: 14px 16px; }
.viewer .bar .btn { margin: 0; }
.viewer .cap { color: #ddd; text-align: center; font-size: .85em; padding: 8px 16px 0; }

nav#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex;
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav#tabs button {
  flex: 1; height: var(--tab-h); border: 0; background: none; font: inherit;
  font-size: .78em; font-weight: 700; color: var(--soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
nav#tabs button span { font-size: 1.6em; line-height: 1; }
nav#tabs button.on { color: var(--sun-deep); }
body.walking nav#tabs { display: none; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s;
  background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 30px;
  font-weight: 700; z-index: 60; pointer-events: none; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.install ol { padding-left: 1.3em; }
.install li { margin: 0 0 12px; }
.pill { display: inline-block; background: #ffe9d4; border-radius: 30px; padding: 4px 12px; font-size: .8em; font-weight: 700; color: var(--sun-deep); }
.choices[data-field="rating"] button:not(.on) { filter: grayscale(1); opacity: .45; }
.btn { box-shadow: 0 4px 14px rgba(60, 20, 0, .28); }
.btn.light { box-shadow: 0 2px 8px rgba(60, 20, 0, .15); }
