:root {
  --phi: 1.618;
  --bg-angle: calc(90deg / var(--phi));
  --bg-start: #5fb3a1;
  --bg-end: #000000;
  --ink: #edf7f4;
  --muted: rgba(237,247,244,0.62);
  --card: rgba(0,0,0,0.42);
  --line: rgba(237,247,244,0.14);
  --sage: #8bb88a;
  --sage-lt: #aed3ac;
  --gold: #e0a63a;
  --gold-lt: #f2c572;
  --accent: #5fb3a1;
  --s1: 8px; --s2: 13px; --s3: 21px; --s4: 34px;
  --r: 9px; --r-lg: 15px;
  --shadow: 0 3px 5px rgba(0,0,0,0.25), 0 10px 26px rgba(0,0,0,0.38);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--sans); color: var(--ink);
  background-image: linear-gradient(var(--bg-angle), var(--bg-start), var(--bg-end));
  background-attachment: fixed;
  padding: var(--s3) var(--s2) var(--s4);
  line-height: 1.45;
}
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--sage-lt); outline-offset: 2px; border-radius: 5px;
}
.mdl-home {
  position: fixed; top: 8px; left: 8px; z-index: 60;
  width: 32px; height: 32px; display: block;
  border-radius: 9px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.7), 0 0 0 2px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.35);
  transition: transform 0.2s var(--ease);
}
.mdl-home img { display: block; width: 100%; height: 100%; }
.mdl-home:hover { transform: scale(1.08); }

main { max-width: 920px; margin: 0 auto; }

/* ---- Cover ---- */
.view-cover { text-align: center; padding: var(--s4) var(--s2) var(--s3); }
.cover-card {
  background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: var(--s4) var(--s3); max-width: 560px; margin: 0 auto;
}
.cover-kicker { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-lt); margin: 0 0 8px; }
.cover-card h1 {
  font-size: clamp(1.6rem, 5vw, 2.1rem); font-weight: 750; margin: 0 0 6px;
  letter-spacing: 0.04em;
}
.cover-by { color: var(--muted); font-size: 0.95rem; margin: 0 0 var(--s3); }
.cover-blurb { font-size: 0.95rem; color: var(--ink); margin: 0 0 var(--s3); text-align: left; }
.cover-risk {
  font-size: 0.78rem; color: var(--gold-lt); margin: 0 0 var(--s3);
  padding: 10px 12px; border-radius: var(--r);
  background: rgba(224,166,58,0.12); border: 1px solid rgba(224,166,58,0.35);
  text-align: left;
}
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 1.05rem; font-weight: 700; padding: 14px 28px; min-height: 48px;
  border: none; border-radius: var(--r); cursor: pointer;
  background: var(--sage); color: #10210d;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn-primary:hover { background: var(--sage-lt); transform: translateY(-2px); }

/* ---- Shelf (exhibition) ---- */
.shelf-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px; margin: 0 0 var(--s2); padding: 0 2px 0 46px;
}
.shelf-head h1 { font-size: 1.35rem; margin: 0; letter-spacing: 0.06em; }
.shelf-head .by { color: var(--muted); font-size: 0.85rem; }
.shelf-head .shelf-blurb { color: var(--ink); font-size: 0.85rem; margin: 4px 0 0; max-width: 46em; }
.btn-ghost {
  font-size: 0.88rem; font-weight: 600; padding: 10px 14px; min-height: 44px;
  border-radius: var(--r); border: 1px solid var(--line);
  background: rgba(255,255,255,0.06); color: var(--ink); cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.btn-ghost:hover { border-color: var(--sage); background: rgba(255,255,255,0.12); }
.btn-ghost.on { border-color: var(--gold); background: rgba(224,166,58,0.18); color: var(--gold-lt); }
.btn-mute {
  min-width: 52px; font-size: 0.82rem; letter-spacing: 0.04em;
}
.shelf-risk {
  font-size: 0.72rem; color: var(--muted); margin: 0 0 var(--s2); padding: 0 2px;
}
.shelf-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px; margin-bottom: var(--s3);
}
.routine-card {
  display: flex; flex-direction: column; gap: 0; text-align: left;
  background: rgba(0,0,0,0.36); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 0; overflow: hidden; cursor: pointer; color: var(--ink);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.routine-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--card-accent, var(--sage)) 70%, transparent);
  box-shadow: 0 6px 18px rgba(0,0,0,0.42);
}
.routine-card.hero-card {
  border-color: color-mix(in srgb, var(--card-accent, var(--gold)) 45%, var(--line));
}
.routine-card .thumb-wrap {
  position: relative; background: #f3ebe0;
  padding: 8px 8px 0;
}
.routine-card .thumb {
  aspect-ratio: 720 / 450; width: 100%; object-fit: cover; object-position: center 12%;
  background: #fffaf3; display: block; border-radius: 6px 6px 0 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.routine-card .meta { padding: 10px 12px 13px; }
.routine-card .title { font-size: 0.95rem; font-weight: 700; margin: 0; letter-spacing: 0.01em; }
.routine-card .blurb { font-size: 0.72rem; color: var(--muted); margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.routine-card .badge {
  display: inline-block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--gold-lt); margin-top: 6px;
}

/* ---- Player ---- */
.player-bar {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: var(--s2); padding-left: 46px;
}
.player-bar h2 {
  /* Board illustration already carries the title — keep chrome quiet */
  flex: 1 1 auto; font-size: 0.78rem; font-weight: 600; margin: 0; min-width: 0;
  color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase;
  opacity: 0.55;
}
.player-bar h2.visually-quiet {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.player-controls {
  display: flex; flex-wrap: wrap; gap: 8px; width: 100%;
}
.btn-play {
  flex: 1 1 0; min-width: 90px; min-height: 52px;
  font-size: 1.05rem; font-weight: 750; padding: 12px 16px;
  border: none; border-radius: var(--r); cursor: pointer;
  background: var(--accent); color: #101615;
  transition: filter 0.15s var(--ease), transform 0.15s var(--ease);
}
.btn-play:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-play.playing { background: var(--gold); }
.btn-step {
  flex: 1 1 0; min-width: 88px; min-height: 52px;
  font-size: 1rem; font-weight: 750; padding: 12px 12px;
  border-radius: var(--r);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, rgba(255,255,255,0.08));
  color: var(--ink); cursor: pointer;
}
.btn-reset, .btn-check, .btn-print {
  flex: 1 1 0; min-width: 72px; min-height: 52px;
  font-size: 0.95rem; font-weight: 700; padding: 12px 10px;
  border-radius: var(--r); border: 1px solid var(--line);
  background: rgba(255,255,255,0.08); color: var(--ink); cursor: pointer;
}
.btn-check.on { border-color: var(--gold); background: rgba(224,166,58,0.2); color: var(--gold-lt); }

.board-wrap {
  /* Quiet gallery mat — frame the illustration, never crush/clip it */
  position: relative; background: #e8dfd2; border-radius: calc(var(--r-lg) + 4px);
  overflow: visible; box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.18); margin-bottom: var(--s3);
  padding: 18px 18px 20px;
}
.board-stage {
  position: relative; background: #fffaf3; border-radius: 4px;
  overflow: visible;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.07), 0 1px 0 rgba(255,255,255,0.35);
}
.board-img {
  display: block; width: 100%; height: auto; vertical-align: top;
  /* Full board readable — title band must stay clear above cells */
  filter: none;
  opacity: 1;
}
.cell-grid {
  position: absolute; inset: 0; pointer-events: none;
}
.board-cell {
  position: absolute; overflow: hidden; border-radius: 3px;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  z-index: 1;
}
.board-cell canvas.cell-canvas {
  display: block; width: 100%; height: 100%;
  border-radius: 2px;
}
.board-cell.upcoming {
  /* Real board stays present — soft dim via canvas, not paper walls */
  background: transparent;
  box-shadow: none;
  opacity: 1;
}
.board-cell.upcoming canvas.cell-canvas { opacity: 1; }
.board-cell.prior {
  background: transparent;
  box-shadow: none;
  z-index: 2;
}
.board-cell.active {
  /* Active cue lives in the canvas drawing — no HTML outline */
  background: transparent;
  z-index: 4;
  box-shadow: none;
}
.board-cell .cell-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
  background: linear-gradient(to top, color-mix(in srgb, var(--accent) 18%, transparent), transparent);
  pointer-events: none; z-index: 5;
}
.side-card a.mdl-link {
  color: var(--sage-lt); text-decoration: none; font-weight: 650;
}
.side-card a.mdl-link:hover { text-decoration: underline; }

.step-panel {
  background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: var(--s2);
}
.step-label { font-size: 1.05rem; font-weight: 750; margin: 0 0 4px; color: var(--accent); }
.step-detail { font-size: 0.92rem; margin: 0; color: var(--ink); }
.step-progress { font-size: 0.75rem; color: var(--muted); margin: 8px 0 0; }
.timer-ui {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--r);
  background: rgba(133,169,208,0.15); border: 1px solid rgba(133,169,208,0.4);
}
.timer-ui .t-label { font-size: 0.8rem; color: var(--muted); margin: 0 0 4px; }
.timer-ui .t-val { font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; margin: 0; }
.timer-bar {
  height: 8px; border-radius: 999px; background: rgba(255,255,255,0.1); margin-top: 8px; overflow: hidden;
}
.timer-bar > i {
  display: block; height: 100%; width: 0%; background: var(--accent);
  transition: width 0.1s linear; border-radius: 999px;
}

.day-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.day-chip {
  font-size: 0.82rem; font-weight: 700; padding: 10px 12px; min-height: 44px;
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.06); color: var(--ink); cursor: pointer;
}
.day-chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 28%, transparent); }

.checklist {
  background: var(--card); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px;
  margin-bottom: var(--s2);
}
.checklist h3 { font-size: 0.85rem; margin: 0 0 8px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.check-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px;
  border-bottom: 1px solid var(--line); cursor: pointer; font-size: 0.92rem;
}
.check-item:last-child { border-bottom: none; }
.check-item input {
  width: 22px; height: 22px; margin-top: 1px; flex-shrink: 0; accent-color: var(--sage);
}
.check-item.done span { text-decoration: line-through; color: var(--muted); }

.tips-when {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: var(--s2);
}
@media (max-width: 560px) {
  .tips-when { grid-template-columns: 1fr; }
  body { padding: 12px 10px 28px; }
  .cover-card { padding: 22px 18px; }
  .cover-card h1 { font-size: 1.55rem; }
  .shelf-head h1 { font-size: 1.35rem; }
  .shelf-grid { grid-template-columns: 1fr; gap: 12px; }
  .player-bar { margin-bottom: 10px; }
  .player-controls {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 8px;
    margin-bottom: 4px;
  }
  .btn-play {
    grid-column: 1 / -1;
    min-height: 56px; font-size: 1.12rem; font-weight: 800;
    letter-spacing: 0.02em;
  }
  .btn-step {
    min-height: 52px; font-size: 1.02rem; font-weight: 750;
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    background: color-mix(in srgb, var(--accent) 16%, rgba(255,255,255,0.08));
  }
  .btn-reset, .btn-check, .btn-print, .btn-mute { min-height: 48px; font-size: 0.88rem; }
  .board-wrap { padding: 10px 10px 12px; margin-bottom: 14px; }
  .step-panel { padding: 12px 14px; }
  .step-label { font-size: 1.08rem; }
  .step-detail { font-size: 0.95rem; line-height: 1.35; }
  .day-chip { min-height: 44px; padding: 10px 14px; }
}
@media (max-width: 380px) {
  .player-controls { grid-template-columns: 1fr 1fr; }
  .btn-play { font-size: 1.05rem; }
}
.side-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; font-size: 0.82rem;
}
.side-card h3 { margin: 0 0 6px; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-lt); }
.side-card ul { margin: 0; padding-left: 1.1em; color: var(--muted); }

.player-risk {
  font-size: 0.72rem; color: var(--muted); margin: 0 0 var(--s2);
}

footer.site-footer {
  max-width: 920px; margin: var(--s4) auto 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  padding-top: var(--s2); border-top: 1px solid var(--line);
  font-size: 0.82rem; color: var(--muted);
}
.fund-btn {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--gold-lt); text-decoration: none; font-weight: 650;
}
.footer-link { color: var(--sage-lt); text-decoration: none; }
.footer-link:hover { text-decoration: underline; }
.footer-note { margin: 0; flex: 1 1 auto; }
.mdl-colophon { width: 100%; margin: 0; font-size: 0.78rem; }

/* Print */
@media print {
  body {
    background: #fff !important; color: #000 !important; padding: 0;
  }
  .mdl-home, .site-footer, .player-controls, .btn-ghost, .no-print,
  .day-row, .timer-ui { display: none !important; }
  .board-wrap { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; padding: 0; background: #fff !important; }
  .board-stage { box-shadow: none; }
  .board-img { opacity: 1 !important; filter: none !important; }
  .board-cell { box-shadow: 0 0 0 1px #000 !important; background: transparent !important; }
  .board-cell.upcoming { display: none !important; }
  .board-cell .cell-fill { display: none !important; }
  .step-panel, .checklist, .tips-when, .side-card {
    background: #fff !important; color: #000 !important; box-shadow: none; border-color: #ccc;
  }
  .step-label { color: #333 !important; }
  .view-cover, .view-shelf { display: none !important; }
  .view-player { display: block !important; }
}
a[href^="/feedback"]{position:relative}a[href^="/feedback"]::after{content:"";position:absolute;left:0;right:0;top:50%;height:44px;transform:translateY(-50%)}
