/* ---------------------------------------------------------------- colour

   Every colour in the app comes from these eight names, so a theme is eight
   values and nothing else needs to know. Changing one here changes it
   everywhere; a hard-coded colour anywhere else would survive a theme change
   and look like a bug.

     paper       the page behind everything
     card        the raised surfaces
     ink/muted   text, and text that matters less
     line        the hairline between rows
     clay        money, deadlines, anything wanting attention
     sage        times, and anything settled
     *-tint      the same colour at background strength

   Set on <html> as data-theme, written before the first paint so the app never
   flashes one theme on its way to another. The selectors deliberately do not
   say :root, so a theme also applies to any element carrying the attribute -
   which is what lets five of them be put side by side and looked at.        */

:root, [data-theme="warm"]{
  color-scheme: light only;
  --paper:#F5EFE6; --card:#FFFCF7; --ink:#2A2521; --muted:#6B625A;
  --line:#E6DCCF; --clay:#A34C29; --clay-tint:#F3E1D6; --sage:#4F6B4A; --sage-tint:#E1E9DC;
  --shadow:0 1px 2px rgba(42,37,33,.06);
  --faint:#655C53; --faint-when:#93A18E; --edge:#B3A597;
  --hero-a:#DCCBB5; --hero-b:#D3C0A7; --hero-sun:#EAD9C2;
}

/* Cool grey-blues and a deeper green. Quieter than warm in daylight. */
[data-theme="harbour"]{
  color-scheme: light only;
  --paper:#EFF2F4; --card:#FFFFFF; --ink:#1F2933; --muted:#5C6B7A;
  --line:#DCE3E8; --clay:#B4552F; --clay-tint:#F6E3D9; --sage:#2F6B62; --sage-tint:#DDEBE8;
  --shadow:0 1px 2px rgba(31,41,51,.07);
  --faint:#5A6874; --faint-when:#8D9EA9; --edge:#A8B6C0;
  --hero-a:#C6D3DC; --hero-b:#B4C4D0; --hero-sun:#DCE6EC;
}

/* Soft greens and a plum accent. */
[data-theme="garden"]{
  color-scheme: light only;
  --paper:#F1F3EC; --card:#FDFEFB; --ink:#252B22; --muted:#5E6A57;
  --line:#DDE3D5; --clay:#8A4368; --clay-tint:#F2E0EA; --sage:#41653C; --sage-tint:#DFEAD9;
  --shadow:0 1px 2px rgba(37,43,34,.07);
  --faint:#5B6555; --faint-when:#93A189; --edge:#AEBBA4;
  --hero-a:#CBD9C0; --hero-b:#BACBAE; --hero-sun:#E2EBD9;
}

/* Almost no colour at all, for anyone who wants the photograph to do the work. */
[data-theme="paper"]{
  color-scheme: light only;
  --paper:#F4F4F2; --card:#FFFFFF; --ink:#222222; --muted:#6A6A66;
  --line:#E2E2DE; --clay:#8C3B2E; --clay-tint:#F1E0DC; --sage:#4A5A55; --sage-tint:#E3E8E6;
  --shadow:0 1px 2px rgba(0,0,0,.06);
  --faint:#66665F; --faint-when:#9A9A93; --edge:#B5B5AE;
  --hero-a:#D8D8D4; --hero-b:#CACAC5; --hero-sun:#E8E8E4;
}


/* Quirkier than the rest: a pale lilac page, raspberry for anything wanting
   attention, and a sharp teal for times. Cheerful without being a toy. */
[data-theme="sherbet"]{
  color-scheme: light only;
  --paper:#F3EFF7; --card:#FFFDFF; --ink:#2C2436; --muted:#6C6280;
  --line:#E4DCEF; --clay:#C33C6B; --clay-tint:#FBE0EA; --sage:#1F7A78; --sage-tint:#DAEEEE;
  --shadow:0 1px 2px rgba(44,36,54,.08);
  --faint:#6A6080; --faint-when:#9A93AD; --edge:#B9AECD;
  --hero-a:#D6C8EA; --hero-b:#C4B2DF; --hero-sun:#F0E4F7;
}

/* Dark, for a bedside table. Tints become deepened shades rather than washes,
   or "attention" would glow brighter than the thing it is attached to. */
[data-theme="dusk"]{
  color-scheme: dark;
  --paper:#1B1A18; --card:#252321; --ink:#F0EAE1; --muted:#A39A8E;
  --line:#37342F; --clay:#E08A63; --clay-tint:#402A20; --sage:#8FB484; --sage-tint:#24301F;
  --shadow:0 1px 3px rgba(0,0,0,.4);
  --faint:#B6ABA0; --faint-when:#7E8C78; --edge:#4A453E;
  --hero-a:#332F2A; --hero-b:#28241F; --hero-sun:#3E382F;
}

*{box-sizing:border-box}
html,body{margin:0;background:var(--paper);color:var(--ink)}
body{font-family:'Nunito Sans',system-ui,-apple-system,sans-serif;font-size:16px;line-height:1.45;
     padding-bottom:calc(84px + env(safe-area-inset-bottom))}
.screen{max-width:560px;margin-inline:auto;padding:0 18px}
h1{font-family:Fraunces,Georgia,serif;font-weight:500;font-size:30px;line-height:1.15;margin:0}
h2{font-family:Fraunces,Georgia,serif;font-weight:500;font-size:19px;margin:0}
.sectionHead{margin:22px 0 8px}
.muted{color:var(--muted);font-size:14px}
.date{font-size:13px;font-weight:600;color:var(--muted);letter-spacing:.02em}
.hidden{display:none !important}

/* hero */
#hero{margin:0 -18px 18px}
.heroArt{height:170px;background:
  radial-gradient(circle at 78% 34%, var(--hero-sun) 0 34px, transparent 35px),
  linear-gradient(var(--hero-a), var(--hero-b));
  background-size:cover;background-position:center;transition:background-image .2s}
/* A photograph replaces the drawing entirely, rather than sitting on top of
   it - the sun showing through somebody's kitchen window looked like a fault. */
.heroArt.hasPhoto{background-image:var(--hero-photo);background-color:var(--hero-b)}
.heroText{padding:16px 18px 0}

.stale{font-size:12px;color:var(--muted);padding:2px 0 6px}
/* the ingester has gone quiet. Clay, because it wants noticing. */
.ingestNote{font-size:13px;color:var(--clay);font-weight:600;
            background:var(--clay-tint);border-radius:12px;padding:9px 12px;margin:6px 0}
/* Only the title is struck out. A descendant cannot undo an ancestor's
   line-through, so striking the whole line took the reason with it - and the
   reason is the part you want to read. */
.line.cancelled{opacity:.6}
.line.cancelled .t{text-decoration:line-through}

/* cards */
.card{background:var(--card);border-radius:18px;padding:16px;margin-bottom:14px;box-shadow:var(--shadow)}
.cardHead{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:10px}
.line{display:flex;gap:12px;align-items:baseline;padding:7px 0}
.line + .line{border-top:1px solid var(--line)}
.when{width:62px;flex-shrink:0;font-size:13px;font-weight:700;color:var(--sage)}
.when.deadline{color:var(--clay)}
.dayHead{display:flex;align-items:center;justify-content:space-between;
         font-size:12px;font-weight:700;letter-spacing:.05em;color:var(--muted);margin:14px 0 4px}
.dayHead:first-child{margin-top:0}

/* add straight into a day */
.dayAdd{width:30px;height:30px;margin:-6px -6px -6px 0;padding:0;border:0;background:none;
        border-radius:50%;cursor:pointer;font-size:22px;line-height:1;color:var(--clay);opacity:.55}
.dayAdd:active{background:var(--clay-tint);opacity:1}
@media (hover:hover){ .dayAdd:hover{opacity:1;background:var(--clay-tint)} }

/* which week you're looking at */
.weekNav{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.weekRange{flex:1;text-align:center;font-size:13px;font-weight:600;color:var(--muted);
           letter-spacing:.02em}
.navBtn{width:38px;height:38px;flex-shrink:0;padding:0;border:1px solid var(--line);
        background:var(--paper);border-radius:50%;cursor:pointer;
        font-size:20px;line-height:1;color:var(--ink)}
.navBtn:active{background:var(--clay-tint)}

.seg{display:inline-flex;background:var(--paper);border:1px solid var(--line);border-radius:999px;
     padding:3px;margin-bottom:12px}
.segBtn{border:0;background:transparent;border-radius:999px;height:34px;padding:0 14px;
        font-size:13px;font-weight:600;color:var(--muted);cursor:pointer}
.segBtn[aria-pressed="true"]{background:var(--card);color:var(--ink);font-weight:700;
                             box-shadow:var(--shadow)}
#quickCard textarea{border:0;padding:4px 2px;font-size:17px;background:transparent}
#quickCard{padding:14px 16px}

.answer{background:var(--sage-tint);border-radius:14px;padding:12px 14px;margin-top:12px;font-size:15px}
.answer .q{color:var(--muted);font-size:13px;font-style:italic;margin-bottom:6px}

/* items needing action */
.item{display:flex;align-items:center;gap:6px;background:var(--card);border-radius:14px;
      padding:6px 12px 6px 4px;margin-bottom:8px;box-shadow:var(--shadow)}
.tick{width:44px;height:44px;border:0;background:none;display:flex;align-items:center;
      justify-content:center;flex-shrink:0;cursor:pointer}
.tick span{width:22px;height:22px;border-radius:50%;border:2px solid var(--edge);display:block}
.item.doneNow{opacity:.45}
.item.doneNow .tick span{background:var(--sage);border-color:var(--sage)}
.itemBody{flex:1;min-width:0}
.itemTitle{font-size:15px;font-weight:600}
.itemMeta{font-size:13px;color:var(--muted)}
.avatar{width:30px;height:30px;border-radius:50%;color:#fff;font-size:13px;font-weight:700;
        display:flex;align-items:center;justify-content:center;flex-shrink:0;background:#3F5E73}
.avatar.a2{background:#8A4F6B}
.avatar.shared{background:#6B7A8F;font-size:11px}
.claim{border:1.5px solid var(--clay);background:transparent;color:var(--clay);border-radius:999px;
       padding:0 12px;height:36px;font-size:13px;font-weight:700;flex-shrink:0;cursor:pointer}

.item.pinned{border-left:3px solid var(--clay)}
.item.overdue{border-left:3px solid var(--clay);background:var(--clay-tint)}
.item.missed{opacity:.7}
.overdueAge{font-size:12px;font-weight:700;color:var(--clay)}
.pinMark{color:var(--clay);font-weight:700;margin-right:4px}
.confirmBtn{border:1.5px solid var(--sage);background:transparent;color:var(--sage);border-radius:999px;
            padding:0 12px;height:36px;font-size:13px;font-weight:700;flex-shrink:0;cursor:pointer}

/* waiting, done, banner */
.doneStrip{display:flex;gap:10px;align-items:center;padding:4px 4px 0;margin-bottom:10px;font-size:14px;color:var(--muted)}
.doneDot{width:30px;height:30px;border-radius:50%;background:var(--sage-tint);display:flex;
         align-items:center;justify-content:center;color:var(--sage);font-weight:700;flex-shrink:0}
.banner{background:var(--clay-tint);border-radius:14px;padding:12px 14px;font-size:14px;margin-bottom:14px}
.note{background:var(--clay-tint);border-radius:12px;padding:10px 12px;font-size:14px;margin:10px 0}

/* buttons, fields */
button{font:inherit}
.primary{background:var(--clay);color:#fff;font-weight:700;border:0;border-radius:999px;
         min-height:48px;padding:0 20px;flex:1;cursor:pointer}
.primary:disabled{opacity:.55}
/* inline-flex, not just min-height: a <button> centres its own label, a
   <label> does not, so "Choose a photo" sat against the top of its pill. */
.ghost{background:transparent;border:1.5px solid var(--clay);color:var(--clay);font-weight:700;
       border-radius:999px;min-height:48px;padding:0 18px;cursor:pointer;
       display:inline-flex;align-items:center;justify-content:center;
       font-family:inherit;font-size:inherit;text-align:center}
.linky{background:none;border:0;color:var(--clay);font-weight:600;font-size:14px;
       min-height:36px;padding:6px 0;cursor:pointer}
.row{display:flex;gap:10px;margin-top:14px}
input[type=url],input[type=date],textarea{width:100%;border:1px solid var(--line);border-radius:16px;
  background:var(--card);padding:13px 15px;font:inherit;color:var(--ink);resize:none}
input[type=date]{width:auto;border-radius:999px;padding:9px 13px;background:var(--paper)}
textarea:focus,input:focus{outline:2px solid var(--clay);outline-offset:1px}
.field-label{display:block;font-size:12px;font-weight:700;letter-spacing:.04em;color:var(--muted);
             text-transform:uppercase;margin:14px 0 6px}
.chip{display:inline-flex;align-items:center;height:38px;padding:0 13px;margin:0 6px 6px 0;
      border-radius:999px;border:1px solid var(--line);background:var(--paper);font-size:14px;
      color:var(--ink);cursor:pointer}
.chip[aria-pressed="true"]{background:var(--sage-tint);border-color:var(--sage);font-weight:700}

.iconBtn{width:48px;height:48px;border-radius:50%;border:1px solid var(--line);background:var(--paper);
         color:var(--ink);display:flex;align-items:center;justify-content:center;cursor:pointer;
         flex-shrink:0}
.iconBtn.listening{background:var(--clay);color:#fff;border-color:var(--clay)}
.photoChip{display:inline-flex;align-items:center;gap:8px;margin-top:10px;padding:6px 12px;
           border-radius:999px;background:var(--sage-tint);color:var(--ink);font-size:13px}
.noteRow{border-top:1px solid var(--line);padding:10px 0;font-size:15px}
.noteRow:first-child{border-top:0}
.noteText{white-space:pre-wrap;word-break:break-word}
.noteText a{color:var(--clay)}
.noteWho{font-size:12px;color:var(--muted)}
.noteFoot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px}
.noteTools{display:flex;gap:2px;flex-shrink:0}
.noteTool{width:34px;height:34px;border:0;background:none;border-radius:50%;color:var(--muted);
          display:flex;align-items:center;justify-content:center;cursor:pointer}
.noteTool:active{background:var(--line)}
.noteTool.armed{background:var(--clay);color:#fff}
.notePhoto{display:inline-flex;align-items:center;gap:7px;margin-top:8px;padding:7px 12px;
           border:1px solid var(--line);background:var(--card);border-radius:12px;
           font-size:13px;color:var(--ink);cursor:pointer;max-width:100%}
.notePhotoIcon{color:var(--clay)}
.noteEdit{width:100%;border:1px solid var(--line);border-radius:12px;background:var(--card);
          padding:10px 12px;font:inherit;color:var(--ink);resize:none}
.composer{margin-top:14px;padding-top:12px;border-top:1px dashed var(--line)}

/* money */
.moneyStrip{display:flex;gap:10px;align-items:center;width:100%;text-align:left;border:0;
            background:none;padding:4px 4px 0;margin-bottom:10px;font-size:14px;
            color:var(--muted);cursor:pointer}
.moneyDot{width:30px;height:30px;border-radius:50%;background:var(--sage-tint);display:flex;
          align-items:center;justify-content:center;color:var(--sage);font-weight:700;flex-shrink:0}
.moneyDot.owing{background:var(--clay-tint);color:var(--clay)}
.balanceRow{display:flex;align-items:center;justify-content:space-between;gap:12px;
            background:var(--card);border-radius:14px;padding:14px 16px;margin-bottom:10px;
            box-shadow:var(--shadow)}
.balanceWho{font-size:14px;color:var(--muted)}
.balanceSum{font-family:Fraunces,Georgia,serif;font-size:26px;color:var(--ink)}
.amountTag{font-weight:700;font-size:15px;flex-shrink:0;margin-left:8px}
.catRow{display:flex;align-items:center;gap:10px;padding:6px 0;font-size:14px}
.catName{width:34%;flex-shrink:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.catBar{flex:1;height:8px;border-radius:999px;background:var(--line);overflow:hidden}
.catBar span{display:block;height:100%;background:var(--sage);border-radius:999px}
.catSum{width:64px;text-align:right;flex-shrink:0;font-weight:600}
.item.allocate{align-items:flex-start;padding:12px 12px 8px}
.whoChips{margin-top:8px}
.whoChips .chip{height:34px;font-size:13px}
.docWrap{display:inline-flex;align-items:center;gap:2px}
#addSpend{margin-top:18px;border-top:1px solid var(--line);padding-top:12px}
#addSpend summary{color:var(--clay);font-weight:600;font-size:14px;cursor:pointer;padding:6px 0}
#addSpend input[type=text],#addSpend input[type=number]{width:100%;border:1px solid var(--line);
  border-radius:16px;background:var(--card);padding:13px 15px;font:inherit;color:var(--ink)}
.docs{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.docChip{border:1px solid var(--line);background:var(--card);border-radius:12px;padding:8px 12px;
         font-size:13px;cursor:pointer}

/* capture bar */
#bar{position:fixed;left:0;right:0;bottom:0;background:var(--card);border-top:1px solid var(--line);
     padding:12px 16px calc(12px + env(safe-area-inset-bottom));z-index:20}
.barInner{display:flex;gap:8px;align-items:center;max-width:528px;margin-inline:auto}
.captureBtn{flex:1;height:50px;border-radius:999px;background:var(--paper);border:1px solid var(--line);
            color:var(--muted);font-size:15px;text-align:left;padding:0 18px;cursor:pointer}
/* The height is reserved from the moment the sheet opens. A sheet is anchored
   to the bottom of the screen, so anything arriving late grows it upwards and
   moves everything you were about to tap. */
.sourceBox{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:10px 12px;
           margin-top:14px;font-size:13px;color:var(--muted);min-height:74px}
.offerRow{border-top:1px solid var(--line);padding:10px 0}
.offerHead{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.offerLinks{display:flex;gap:14px;flex-wrap:wrap;margin-top:6px}
.offerLinks a{font-size:13px;color:var(--clay)}
.offerRow:first-child{border-top:0}
button.doneStrip{width:100%;text-align:left;border:0;background:none;cursor:pointer}

/* add sheet */
.sheet{position:fixed;inset:0;background:rgba(42,37,33,.35);z-index:30;display:flex;align-items:flex-end}
/* --keyboard is the height of the on-screen keyboard, measured by the app.
   Without it the Add button sits underneath the keys. */
.sheetInner{background:var(--paper);width:100%;max-width:560px;margin-inline:auto;
            border-radius:22px 22px 0 0;
            padding:10px 18px calc(22px + env(safe-area-inset-bottom));
            margin-bottom:var(--keyboard, 0px);
            max-height:calc(92vh - var(--keyboard, 0px));overflow-y:auto}
.sheetHandle{width:44px;height:4px;border-radius:2px;background:var(--line);margin:4px auto 14px}
.fromRow{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.eyebrow{font-size:12px;font-weight:700;letter-spacing:.06em;color:var(--muted);margin-bottom:8px}
.summary{font-family:Fraunces,Georgia,serif;font-size:20px;margin-bottom:14px}
.propItem{border-top:1px solid var(--line);padding-top:16px;margin-top:16px}
.propItem:first-of-type{border-top:0;padding-top:0;margin-top:0}
.propEvent{border-top:1px solid var(--line);padding-top:16px;margin-top:16px}
.stackField{flex:1;min-width:0}
.stackField input{width:100%}
.allDayRow{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:14px;color:var(--muted)}
.allDayRow input{width:18px;height:18px;accent-color:var(--clay)}

/* a line you can open reads as one */
.line.tappable{cursor:pointer;border-radius:10px;margin:0 -8px;padding-inline:8px}
.line.tappable:active{background:var(--clay-tint)}
.line.disagrees{border-left:3px solid var(--clay);padding-left:8px}

/* Routine, or not.
   Most of the week is the same as last week. Those lines are drawn quietly so
   the one-off things - a trip, an appointment, a birthday - are what the eye
   lands on, rather than having to be found by reading everything. */
.what{flex:1;min-width:0}
/* the line under a title stays quiet whatever the title is doing */
.what .muted{font-weight:400}

.line.routine .t{font-weight:400;color:var(--faint)}
.line.routine .when{font-weight:600;color:var(--faint-when)}

/* A one-off gets the weight and a marker. A deadline is already announced by
   the clay "due" in the time column, so it doesn't need a second flag. */
.line.event .t,
.line.item .t{font-weight:700}
.line.event .t::before{
  content:'';display:inline-block;width:7px;height:7px;border-radius:50%;
  background:var(--clay);margin-right:8px;vertical-align:middle;position:relative;top:-1px}

/* Several things off for one reason: half term, an inset day. Not crossed out —
   nothing here is cancelled so much as the day being different. */
.line.flag .t{font-weight:700;color:var(--clay)}
.line.flag .when{color:var(--clay);opacity:.6}

/* a way into the budget, which lives in its own spreadsheet */
.budgetLink{display:block;width:100%;text-align:left;border:0;font:inherit;color:var(--ink);
            background:var(--sage-tint);border-radius:14px;padding:12px 14px;margin-top:12px;
            cursor:pointer}
.budgetLink span:first-child{font-weight:700}
.budgetLink .muted{display:block;margin-top:2px}
.budgetLink:active{opacity:.7}

/* what a commitment costs, on the right where the eye adds them up */
.budgetAmount{flex-shrink:0;text-align:right;font-size:14px;font-weight:600}
.budgetAmount .muted{font-weight:400;font-size:12px}

/* a change, before it happens */
.proposedChange{background:var(--card);border:1px solid var(--line);border-radius:14px;
                padding:12px 14px;margin-bottom:10px}
.proposedWhat{font-weight:700}
.proposedWas{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;margin-top:4px;
             font-size:15px;color:var(--muted)}
.proposedWas .arrow{color:var(--clay);font-weight:700}
.proposedWas .now{color:var(--ink);font-weight:700}
.proposedNeeds{margin-top:10px;border-top:1px solid var(--line);padding-top:8px}
.budgetEffect{background:var(--sage-tint);border-radius:12px;padding:11px 14px;
              margin:12px 0 2px;font-size:15px}

/* one week off, from the line itself */
.lineX{flex-shrink:0;align-self:center;width:32px;height:32px;
       margin:-4px -6px -4px 4px;padding:0;
       border:0;background:none;border-radius:50%;cursor:pointer;
       font-size:19px;line-height:1;color:var(--muted);opacity:.5}
.lineX:active{background:var(--clay-tint);opacity:1}
.lineX:disabled{opacity:.4;cursor:default}
.lineX.back{font-size:16px;opacity:.85;color:var(--sage)}
.line.cancelled .lineX{text-decoration:none;opacity:.85}
@media (hover:hover){ .lineX:hover{opacity:1;background:var(--clay-tint)} }

/* changed in two places at once */
.conflictBox{background:var(--clay-tint);border:1px solid var(--clay);border-radius:12px;
             padding:12px 14px;margin-top:14px;font-size:14px}
.conflictSide{margin-top:8px}
.conflictWho{display:block;font-size:11px;font-weight:700;letter-spacing:.05em;
             text-transform:uppercase;color:var(--muted)}

/* what the letter actually said, on the item it produced */
.detailBox{margin-top:10px;padding:10px 12px;background:var(--card);border:1px solid var(--line);
           border-radius:12px;font-size:15px;white-space:pre-wrap}

/* a word to confirm a tap landed, then out of the way */
.toast{position:fixed;left:50%;bottom:calc(96px + env(safe-area-inset-bottom));
       transform:translate(-50%,8px);background:var(--ink);color:var(--paper);
       padding:9px 16px;border-radius:999px;font-size:14px;z-index:60;
       opacity:0;pointer-events:none;transition:opacity .18s,transform .18s}
.toast.on{opacity:1;transform:translate(-50%,0)}
.titleInput{width:100%;border:0;border-bottom:1px dashed var(--line);background:transparent;
            font:inherit;font-size:17px;font-weight:600;padding:4px 0}
.titleInput:focus{outline:none;border-bottom-color:var(--clay)}
.pill{display:inline-block;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:700;
      background:var(--clay-tint);color:var(--clay);margin-left:6px}
.thinking{display:flex;align-items:center;gap:10px;font-size:15px;padding:6px 0}
.echo{font-style:italic;color:var(--muted);font-size:14px}
.spin{width:16px;height:16px;border:2px solid var(--line);border-top-color:var(--clay);
      border-radius:50%;animation:s .8s linear infinite;display:inline-block}
@keyframes s{to{transform:rotate(360deg)}}

/* ---------------------------------------------------------------- settings */

.photoPreview{height:120px;border-radius:14px;margin-bottom:10px;
  background:linear-gradient(var(--hero-a), var(--hero-b));
  background-size:cover;background-position:center;
  border:1px solid var(--line)}

.themes{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:10px}
.theme{border:2px solid var(--line);background:var(--card);border-radius:14px;
       padding:10px;cursor:pointer;text-align:left;font:inherit;color:var(--ink)}
.theme[aria-pressed="true"]{border-color:var(--clay)}
.theme .swatches{display:flex;gap:4px;margin-bottom:6px}
.theme .swatches i{width:16px;height:16px;border-radius:50%;display:block;
                   border:1px solid rgba(0,0,0,.08)}
.theme .name{font-size:13px;font-weight:700}

/* ---------------------------------------------------- framing the photo

   The strip at the top is much wider than it is tall, so a photograph taken
   on a phone loses most of itself to the crop, and which part it keeps is
   pure luck. The slider moves the picture up and down inside the frame, and
   the preview is the same shape as the real thing, so what you line up is
   what you get.                                                           */

.photoFrame{position:relative;height:120px;border-radius:14px;overflow:hidden;
            border:1px solid var(--line);margin-bottom:10px;
            background:linear-gradient(var(--hero-a), var(--hero-b))}
.photoFrame .shot{position:absolute;inset:0;background-size:cover;
                  background-position:center var(--pos, 50%)}
.photoFrame .guide{position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(rgba(0,0,0,.18), transparent 30%, transparent 70%, rgba(0,0,0,.18))}

.posRow{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.posRow input[type=range]{flex:1;accent-color:var(--clay)}
.posRow .field-label{margin:0}

/* ------------------------------------------------------------------ settings

   A small round button in the corner under the photograph, rather than three
   links across the top. What is behind it — the picture, the colours, the
   household link, and the two checks for when something looks wrong — is all
   occasional, and the home screen is looked at every morning.              */

#hero{position:relative}
.gearBtn{
  position:absolute; top:calc(170px + 10px); right:18px;
  width:38px; height:38px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:var(--card); color:var(--muted);
  border:1px solid var(--line); box-shadow:var(--shadow);
  cursor:pointer; padding:0;
}
.gearBtn:active{ color:var(--ink) }
