:root {
  --bg: #faf6ef;
  --card: #ffffff;
  --ink: #3b302a;
  --muted: #8a7f76;
  --line: #e8e0d4;
  --accent: #7f9572;
  --accent-ink: #ffffff;
  --gold: #c9a24a;
  --danger: #b5523f;
  --serif: "PT Serif", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
main { max-width: 980px; margin: 0 auto; padding: 16px 16px 80px; }

header.top { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
header.top h1 { font: 700 26px/1.2 var(--serif); margin: 0; flex: 1; }
header.top .sub { color: var(--muted); font-size: 14px; }
.back { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
        display: grid; place-items: center; font-size: 20px; flex: none; }
.nav { display: flex; gap: 8px; }
.nav a, .nav span { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
        background: var(--card); display: grid; place-items: center; font-size: 18px; }
.nav span { opacity: .3; }

.kids { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.kid { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.kid h2 { font: 700 24px var(--serif); margin: 0 0 2px; }
.kid .now { color: var(--muted); font-size: 14px; }
.status { display: flex; gap: 8px; margin: 12px 0 14px; flex-wrap: wrap; }
.pill { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: #f1ece3; }
.pill.ok { background: #e3ead9; color: #4d6340; }
.pill.no { background: #f6e3dc; color: #8e4433; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px;
       padding: 10px 16px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.years { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.years a { font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.week { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.week .ph { aspect-ratio: 1; background: #efe8dc center/cover no-repeat; }
.week .meta { padding: 8px 10px 10px; }
.week b { font-family: var(--serif); }
.week .d { color: var(--muted); font-size: 12px; }
.week p { margin: 4px 0 0; font-size: 13px; color: #5d524a; display: -webkit-box; -webkit-line-clamp: 2;
          -webkit-box-orient: vertical; overflow: hidden; }
.week.empty { opacity: .55; }
.week.empty .ph { display: grid; place-items: center; color: var(--muted); font-size: 13px; }

.gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-bottom: 18px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #efe8dc center/cover;
        border: 0; padding: 0; }
.tile .badges { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; }
.tile .badge { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--ink); }
.tile .badge.main { background: var(--gold); color: #fff; }
.tile .dur { position: absolute; right: 6px; bottom: 6px; font-size: 12px; color: #fff; background: rgba(0,0,0,.55);
             padding: 1px 6px; border-radius: 6px; }
.add { border: 2px dashed var(--line); background: transparent; color: var(--muted); display: grid; place-items: center;
       font-size: 14px; }
.add span { font-size: 30px; display: block; line-height: 1; }
.uploading { display: grid; place-items: center; font-size: 13px; color: var(--muted); background: #f1ece3; }

textarea { width: 100%; min-height: 220px; border: 1px solid var(--line); border-radius: 14px; padding: 14px;
           font: 17px/1.55 var(--serif); color: var(--ink); background: var(--card); resize: vertical; }
textarea:focus { outline: 2px solid #cfd9c6; }
.saved { color: var(--muted); font-size: 13px; height: 20px; margin-top: 6px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
h3 { font: 700 18px var(--serif); margin: 22px 0 10px; }

.lb { position: fixed; inset: 0; background: rgba(20,16,12,.94); display: flex; flex-direction: column; z-index: 10; }
.lb .stage { flex: 1; display: grid; place-items: center; min-height: 0; padding: 12px; }
.lb img, .lb video { max-width: 100%; max-height: 100%; border-radius: 6px; }
.lb .bar { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap;
           justify-content: center; }
.lb .bar button, .lb .bar a { border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff;
           border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.lb .bar .on { background: #fff; color: var(--ink); }
.lb .bar .del { color: #f3b2a4; }
.lb .close { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0;
             background: rgba(255,255,255,.15); color: #fff; font-size: 22px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff;
         padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 20; }
