/* Chore Garden look (Design's site flow + menus): paper cards on a soft sky, leaf-green buttons.
   Placeholder emoji art until the Art team's cut-paper pieces replace it. */
:root { --sky:#dcebe3; --paper:#fffaf0; --kraft:#e9dcc3; --ink:#2f3b2f; --leaf:#4f8a4b; --leaf-dk:#3a6b37;
  --petal:#e98a6b; --muted:#6f7a68; --line:#d6c9ad; --gold:#c9a227; --grass:#9ccc7a; --grass-dk:#7fb35f;
  --display:"Fredoka","Trebuchet MS","Segoe UI Rounded",sans-serif; --body:"Nunito","Segoe UI",system-ui,sans-serif; color-scheme:light; }
* { box-sizing:border-box; }
body { margin:0; background:var(--sky); color:var(--ink); font-family:var(--body); font-size:16px; }
h1, h2, h3, .logo b, .tile b { font-family:var(--display); font-weight:600; }
h2 { margin:0 0 8px; font-size:1.35rem; } h3 { margin:0 0 6px; }
[hidden] { display:none !important; }
input, select { font:inherit; padding:9px 12px; border-radius:12px; border:2px solid var(--line); background:#fff; min-width:0; }
form { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:8px 0; }
.btn { font:inherit; font-weight:700; border-radius:999px; padding:9px 16px; border:2px solid var(--leaf-dk); background:#fff; color:var(--leaf-dk); cursor:pointer; }
.btn.go { background:var(--leaf); color:#fff; }
.btn.ghost { border-color:var(--line); color:var(--ink); }
.btn.danger { border-color:#b4462f; color:#b4462f; }
.btn:focus-visible, .tile:focus-visible, .tabs button:focus-visible { outline:3px solid var(--petal); outline-offset:2px; }
.card { background:var(--paper); border:2px solid var(--line); border-radius:18px; padding:14px 16px; box-shadow:0 3px 0 var(--line); }
.row { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.mini { color:var(--muted); font-size:.88rem; }
.pill { font-size:.8rem; font-weight:700; border-radius:999px; padding:3px 10px; background:var(--kraft); white-space:nowrap; }
.pill.ok { background:#cfe6c7; }
.badge { align-self:flex-start; font-size:.7rem; font-weight:700; background:var(--gold); color:#fff; border-radius:10px; padding:2px 8px; }
.badge.grey { background:var(--muted); }
.check { display:flex; gap:8px; align-items:center; }

/* Top bar: logo, tabs, and a Log out button that is always visible. */
.top { position:sticky; top:0; z-index:5; display:flex; align-items:center; gap:12px; padding:10px max(16px, env(safe-area-inset-left));
  background:var(--paper); border-bottom:2px solid var(--line); }
.logo { font-size:1.25rem; white-space:nowrap; color:inherit; text-decoration:none; }
.tabs { display:flex; gap:4px; }
.planBtn { margin:0 auto; font:inherit; font-weight:700; border-radius:999px; padding:8px 16px; border:2px solid var(--gold); background:#fff6d6; color:var(--ink); cursor:pointer; white-space:nowrap; box-shadow:0 2px 0 var(--gold); }
.planBtn.on { background:var(--gold); color:#fff; }
.tabs button { font:inherit; background:none; border:0; border-radius:12px; padding:6px 12px; color:var(--muted); cursor:pointer; display:flex; gap:6px; align-items:center; }
.tabs button i { font-style:normal; font-weight:700; }
.tabs button.on { background:var(--kraft); color:var(--leaf-dk); }
main { max-width:1100px; margin:0 auto; padding:16px 16px 96px; display:flex; flex-direction:column; gap:14px; }
.view { display:flex; flex-direction:column; gap:14px; }

/* Family garden scene. Spots are placed in % so the same scene fits portrait and landscape. */
.scene { position:relative; height:min(46vh, 380px); min-height:220px; border-radius:22px; overflow:hidden; border:2px solid var(--line);
  background:linear-gradient(#bfe3f2 0 52%, var(--grass) 52% 100%); box-shadow:0 3px 0 var(--line); }
.scene::after { content:""; position:absolute; left:0; right:0; bottom:0; height:22%; background:var(--grass-dk); opacity:.45; }
.sun { position:absolute; right:6%; top:6%; font-size:2.4rem; }
.prop { position:absolute; transform:translateX(-50%); font-size:clamp(2rem, 6vw, 3.4rem); z-index:1; }
.pond { background:#7cc3d9; border-radius:50%; padding:4px 36px; font-size:1.6rem; }
.shed { background:none; border:0; cursor:pointer; padding:0; }

/* Kid cards */
.kids { display:grid; gap:14px; grid-template-columns:repeat(auto-fill, minmax(270px, 1fr)); }
.kid h2 { display:flex; gap:8px; align-items:center; }
.chore { display:flex; align-items:center; gap:12px; padding:10px 0; font-size:1.12rem; cursor:pointer; border-top:1px dashed var(--line); }
.chore input { width:30px; height:30px; accent-color:var(--leaf); flex:none; }
.chore span { flex:1; }
.chore.done span { text-decoration:line-through; color:var(--muted); }
.money { display:flex; gap:12px; color:var(--muted); font-size:.9rem; margin-top:8px; flex-wrap:wrap; }
.money b { color:var(--ink); }
.setup ol { margin:6px 0; padding-left:22px; } .setup li { margin:6px 0; } .setup li.done { color:var(--muted); text-decoration:line-through; }

/* Settings tiles behind the PIN */
.gate { max-width:460px; width:100%; margin-inline:auto; }
.tiles { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 190px)); justify-content:center; gap:12px; }
.tile { background:#fff; border:2px solid var(--line); border-radius:16px; padding:14px; text-align:left; font:inherit; color:inherit;
  display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:6px; box-shadow:0 3px 0 var(--line); cursor:pointer; min-height:100px; }
.tile .badge { align-self:center; }
.tile b { font-size:1.05rem; } .tile small { color:var(--muted); } .ico { font-size:1.7rem; line-height:1; }
.panel { max-width:640px; }
.back { margin-bottom:8px; }
#msg:empty { display:none; }
#msg { background:var(--paper); border:2px solid var(--petal); border-radius:14px; padding:10px 14px; margin:0; }

/* Narrow or portrait screens: tabs move to a bottom bar, Log out stays in the top bar. */
@media (max-width:760px), (orientation:portrait) and (max-width:900px) {
  .tabs { position:fixed; left:0; right:0; bottom:0; margin:0; justify-content:space-around; background:var(--paper);
    border-top:2px solid var(--line); padding:6px 0 max(6px, env(safe-area-inset-bottom)); }
  .tabs button { flex-direction:column; gap:0; font-size:.75rem; padding:4px 10px; }
  .tabs button span { font-size:1.35rem; }
  .planBtn .wide { display:none; }
  .top { gap:8px; } .logo { font-size:1.05rem; }
  .tiles { grid-template-columns:1fr 1fr; justify-content:stretch; }
  .view > .scene { height:min(34vh, 300px); }
}

/* Sign-in and website pages */
.site main { max-width:1000px; }
.split { display:grid; grid-template-columns:1.1fr 1fr; gap:18px; align-items:start; }
.hero { padding:22px; }
.hero .scene { height:200px; min-height:0; margin:10px 0; }
.hero ul { padding-left:20px; } .hero li { margin:6px 0; }
.auth form { flex-direction:column; align-items:stretch; }
.auth .links { display:flex; gap:6px 14px; flex-wrap:wrap; }
.link { background:none; border:0; padding:0; font:inherit; color:var(--leaf-dk); text-decoration:underline; cursor:pointer; font-weight:600; }
.switch { display:flex; gap:6px; margin-bottom:6px; }
.switch .btn { flex:1; }
footer { text-align:center; color:var(--muted); font-size:.85rem; padding:8px 16px 24px; }
footer a { color:var(--leaf-dk); }
@media (max-width:760px), (orientation:portrait) and (max-width:900px) { .split { grid-template-columns:1fr; } .split .auth { order:-1; } }

/* Orchard families see no upgrade prompts. Mark any tier badge or upsell note with class="upsell". */
body.orchard .upsell { display:none !important; }
.top .btn, .top .planBtn { white-space:nowrap; }
@media (max-width:430px) { .top .logo b { display:none; } .top .btn, .top .planBtn { padding:7px 12px; } }
.kidRow { border-top:1px dashed var(--line); padding:8px 0; }
.kidRow form { margin:0; }
/* Manage screens */
.list { display:flex; flex-direction:column; gap:10px; margin:8px 0; }
.item { background:#fff; border:2px solid var(--line); border-radius:14px; padding:10px 14px; display:flex; align-items:center; gap:12px; flex-wrap:wrap; font:inherit; color:inherit; text-align:left; }
button.item { cursor:pointer; width:100%; }
.item .grow { flex:1; min-width:140px; display:flex; flex-direction:column; gap:2px; }
.item .grow b { font-family:var(--display); font-size:1.05rem; }
.item .grow .mini { font-size:.84rem; }
.item.paused { opacity:.6; }
.item form { flex-basis:100%; }
.acts { display:flex; gap:6px; flex-wrap:wrap; }
.filters { display:flex; gap:6px; flex-wrap:wrap; }
.chip { font:inherit; font-size:.85rem; font-weight:700; border-radius:999px; padding:5px 12px; background:var(--kraft); border:0; cursor:pointer; }
.chip.on { background:var(--leaf); color:#fff; }
.field { display:flex; justify-content:space-between; align-items:center; gap:10px; background:#fff; border:2px solid var(--line); border-radius:12px; padding:10px 14px; flex-wrap:wrap; margin:8px 0; }
.field form { margin:0; }
.warn { background:#fdecdf; border:2px solid var(--petal); border-radius:12px; padding:10px 12px; margin:8px 0; }
.toast { position:fixed; left:50%; transform:translateX(-50%); bottom:90px; z-index:9; background:var(--ink); color:#fff; border-radius:999px;
  padding:8px 10px 8px 18px; display:flex; gap:10px; align-items:center; box-shadow:0 6px 20px #0003; max-width:calc(100% - 32px); }
.toast .btn { padding:5px 12px; }
#tiles { width:100%; margin:0 auto; }
main a, .card a { color:var(--leaf-dk); }

/* Art's V1 paper scenes (art/scenes.js): the family garden, kid pages and the opener. */
.scene.paper { background:#bfe3f2; height:min(72vh, 660px); }
.scene.paper::after { display:none; }
.scene.paper svg { position:absolute; inset:0; width:100%; height:100%; display:block; }
.scene.paper .gkid:focus-visible { outline:3px solid var(--petal); }
.ch { width:1.7em; height:2em; vertical-align:middle; overflow:visible; }
.ico .ch { width:1.5em; height:1.7em; }
@media (orientation:portrait) { .scene.paper, .view > .scene.paper { height:min(64vh, 640px); } }
@media (orientation:landscape) and (max-width:760px) { .view > .scene.paper { height:min(70vh, 420px); } }
.hero .scene.paper.hero-scene { height:220px; margin:10px 0; }
.scene.paper #shed:focus-visible { outline:3px solid var(--petal); }
#lockForm { display:flex; flex-direction:column; align-items:stretch; gap:8px; }
#lockForm h3 { margin:10px 0 0; } #lockForm .row { display:flex; gap:8px; } #lockForm .row input { flex:1; min-width:0; } #lockForm .btn.go { align-self:flex-start; }

/* Settings home fills the screen: big tiles that grow with it (3 x 2 landscape, 2 x 3 portrait or narrow). */
#settingsHome:not([hidden]) { display:flex; flex-direction:column; gap:12px; min-height:calc(100dvh - 64px - 48px); }
.setHead { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:8px; }
.setHead h2 { margin:0; text-align:center; font-size:clamp(1.4rem, 3.2vmin, 2rem); }
.setHead .btn { justify-self:end; }
#tiles.tiles { flex:1; grid-template-columns:repeat(3, 1fr); grid-auto-rows:1fr; justify-content:stretch; gap:clamp(10px, 2vmin, 18px); }
#tiles .tile { min-height:0; padding:clamp(10px, 2vmin, 20px); }
#tiles .ico { font-size:clamp(2.4rem, 7vmin, 4.5rem); }
#tiles .tile b { font-size:clamp(1.1rem, 2.6vmin, 1.6rem); }
@media (orientation:portrait), (max-width:700px) { #tiles.tiles { grid-template-columns:1fr 1fr; } }
@media (max-width:760px), (orientation:portrait) and (max-width:900px) { #settingsHome:not([hidden]) { min-height:calc(100dvh - 56px - 32px - 80px); } }
@media (max-width:520px) { .setHead { grid-template-columns:1fr; justify-items:center; } .setHead > span { display:none; } .setHead .btn { justify-self:center; } }
.awayHead { margin:10px 0 0; font-weight:700; color:var(--leaf-dk); }

/* Fill-the-screen rule (Design, 28 Nov) for the website pages: garden art edge to edge, text capped near 70 characters.
   Wide landscape: art on the left, the page on the right. Portrait or narrow: an art band on top, the page below. */
body.site { min-height:100dvh; display:flex; flex-direction:column; }
.artside { position:relative; flex:1 0 clamp(180px, 32vh, 340px); overflow:hidden; background:var(--sky); } /* grows to fill short pages */
.artside svg { position:absolute; inset:0; width:100%; height:100%; display:block; }
body.site > main { flex:none; width:100%; box-sizing:border-box; max-width:760px; padding-bottom:24px; }
body.site .card { max-width:70ch; }
body.site main > .card, body.site .split > .card { width:100%; box-sizing:border-box; margin-left:auto; margin-right:auto; }
.policy { line-height:1.55; }
@media (min-width:900px) and (orientation:landscape) {
  body.site { display:grid; grid-template-columns:minmax(0, 1fr) minmax(440px, 46%); grid-template-rows:auto 1fr auto; }
  body.site > header.top { grid-column:1 / -1; }
  body.site > .artside { flex:none; }
  body.site > .artside { grid-column:1; grid-row:2 / 4; position:sticky; top:var(--topH, 66px); height:calc(100dvh - var(--topH, 66px)); }
  body.site > main { grid-column:2; grid-row:2; max-width:none; padding:24px clamp(16px, 3vw, 48px); background:var(--paper); }
  body.site > footer { grid-column:2; background:var(--paper); }
  body.site .split { grid-template-columns:1fr; }
  body.site .split .auth { order:-1; }
}
.undoPin { display:inline-flex; gap:6px; align-items:center; } .undoPin input { width:7.5em; }
.allow { display:flex; flex-wrap:wrap; gap:8px; align-items:center; } .allow select { flex:1 1 100%; min-width:0; max-width:100%; }
.allow label { display:inline-flex; gap:6px; align-items:center; } .allow label input { width:6.5em; } .allow p { flex-basis:100%; margin:0; }
.warnText { color:#a5462f; font-weight:700; }
.allow label[hidden] { display:none; }
.linkish { background:none; border:0; padding:0; font:inherit; font-size:.8rem; color:var(--leaf-dk); text-decoration:underline; cursor:pointer; text-align:left; }

/* Fill-the-screen rule for the board's own tabs (History, Money, Settings panels, PIN gate): the same garden art as the
   website pages. Narrow or portrait: the art fills whatever height is left under the page. Wide landscape: see below. */
.appart { display:none; }
body:not(.site) { min-height:100dvh; display:flex; flex-direction:column; }
body:not(.site) > main { width:100%; box-sizing:border-box; }
body.showart > main { flex:none; padding-bottom:16px; }
body.showart > .appart { display:block; flex:1 0 clamp(140px, 24vh, 280px); }
body.showart .panel { max-width:none; }
@media (max-width:760px), (orientation:portrait) and (max-width:900px) { body.showart > .appart { margin-bottom:64px; } }
@media (min-width:900px) and (orientation:landscape) {
  /* Wide landscape: the garden fills the whole screen under the top bar and the page floats on it as a paper card,
     so any room the card doesn't need shows garden, never blank paper. */
  body.showart > .appart { position:fixed; left:0; right:0; top:var(--topH, 66px); bottom:0; z-index:0; }
  body.showart > main { position:relative; z-index:1; width:min(50%, 820px); max-width:none; margin:20px clamp(16px, 2.5vw, 40px) 20px auto;
    padding:16px clamp(16px, 2vw, 32px) 20px; background:var(--paper); border:2px solid var(--line); border-radius:18px; box-shadow:0 4px 0 var(--line); box-sizing:border-box; }
}
/* Phone held sideways and small laptops: the top bar keeps every button by dropping the tab words (icons stay, with labels for screen readers). */
@media (orientation:landscape) and (min-width:761px) and (max-width:1100px) {
  .tabs button i { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .tabs button span { font-size:1.4rem; } .planBtn .wide { display:none; } .logo b { display:none; }
}

/* Hedgerow Studios: the bush beside the copyright line on website pages, and the studio logo atop Terms and Privacy. */
.brandfoot img { height:1.35em; width:auto; vertical-align:-.3em; margin-right:2px; }
.brandfoot span { white-space:nowrap; }
.studioLogo { display:block; width:min(220px, 60%); height:auto; margin:4px auto 10px; }
.field > form.allow { flex:1 1 100%; min-width:0; max-width:100%; }
