:root {
  --bg: #F6F3EE;
  --card: #FFFFFF;
  --ink: #1E1B18;
  --muted: #6E665E;
  --body: #4A433D;
  --line: #E4DDD2;
  --line-strong: #D9D1C6;
  --walk: #2F6FB0;
  --lift: #B4541E;
  --miss: #E4DDD2;
  --disabled: #EFEAE3;
  --display: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.app {
  max-width: 440px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
#main { display: flex; flex-direction: column; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.display { font-family: var(--display); font-weight: 600; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; }
#date-label { text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-size: 15px; font-weight: 700; }
.strong-ish { font-weight: 600; color: var(--body); }
.top { display: flex; justify-content: space-between; align-items: center; }

.signin { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 12px; }
.signin h1 { font-size: 56px; font-weight: 800; margin: 0; }
.signin p { margin: 0 0 8px; color: var(--body); }

.hero { display: flex; align-items: flex-end; gap: 14px; }
.streak-num { font-family: var(--display); font-size: 104px; font-weight: 800; line-height: 0.85; letter-spacing: -0.03em; }
.streak-side { display: flex; flex-direction: column; gap: 6px; padding-bottom: 6px; }
.streak-word { font-size: 22px; line-height: 1.1; }
#flame { color: #8A8178; }
#flame.lit { color: var(--lift); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.week { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; }
.week-left { display: flex; align-items: center; gap: 10px; }
.dots { display: flex; gap: 5px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #C9BFB2; }
.dot.on { background: var(--lift); border-color: var(--lift); }
#lift-weeks { font-weight: 600; white-space: nowrap; }
#week-label { white-space: nowrap; }

.day-head { display: flex; justify-content: space-between; align-items: baseline; }
.day-head h2 { font-size: 22px; margin: 0; }
.link { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--walk); font-size: 15px; font-weight: 700; cursor: pointer; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.big {
  min-height: 116px; border-radius: 18px; padding: 16px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px;
  background: var(--card); border: 2px solid var(--line-strong); color: var(--ink);
  transition: background-color 120ms, border-color 120ms, transform 80ms;
}
.big:active { transform: scale(0.98); }
.big-name { font-size: 20px; font-weight: 700; }
.big-state { font-size: 13px; font-weight: 600; opacity: 0.85; }
.big.walk.on { background: var(--walk); border-color: var(--walk); color: #fff; }
.big.lift.on { background: var(--lift); border-color: var(--lift); color: #fff; }
.message { font-size: 15px; font-weight: 500; color: var(--body); min-height: 20px; }

.mull-num { font-size: 36px; font-weight: 800; line-height: 1; }
.progress { height: 8px; border-radius: 4px; background: var(--disabled); overflow: hidden; }
#progress-bar { height: 100%; border-radius: 4px; background: var(--lift); width: 0; transition: width 200ms; }
.mull-btn { min-height: 44px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; background: var(--ink); color: #fff; border: 0; }
.mull-btn.covered { background: var(--card); color: var(--ink); border: 2px dashed var(--ink); }
.mull-btn:disabled { background: var(--disabled); color: var(--muted); border: 0; cursor: default; }

.month-nav { display: flex; align-items: center; justify-content: space-between; }
.month-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.month-title { font-size: 20px; }
.nav { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.nav:disabled { color: #C9BFB2; cursor: default; }

.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.dow { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.cell {
  height: 40px; border-radius: 10px; border: 0; padding: 0; background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.cell.walk { background: var(--walk); color: #fff; }
.cell.lift { background: var(--lift); color: #fff; }
.cell.both { background: linear-gradient(135deg, var(--walk) 50%, var(--lift) 50%); color: #fff; }
.cell.mull { border: 2px dashed var(--ink); }
.cell.miss { background: var(--miss); color: var(--muted); }
.cell.open { background: var(--card); border: 2px solid var(--ink); }
.cell.future { border: 1px solid var(--line); color: #8A8178; cursor: default; }
.cell.pad { visibility: hidden; }
.cell.sel { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; font-weight: 600; color: var(--body); }
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.walk { background: var(--walk); }
.sw.lift { background: var(--lift); }
.sw.both { background: linear-gradient(135deg, var(--walk) 50%, var(--lift) 50%); }
.sw.mull { border: 2px dashed var(--ink); }
.sw.miss { background: var(--miss); }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 408px; margin: 0 auto; padding: 14px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 15px; font-weight: 600;
}

.install-hint {
  position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 408px; margin: 0 auto; padding: 6px 6px 6px 16px; border-radius: 12px;
  display: flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; font-size: 15px; line-height: 1.35;
}
.install-hint[hidden] { display: none; }
.install-hint p { margin: 0; flex: 1; }
.install-hint button {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: transparent; color: #fff; font-size: 18px; cursor: pointer;
}

button:focus-visible { outline: 3px solid var(--walk); outline-offset: 2px; }
