/* Settings, Account and the Plus screens drawn as pictures (public/ui/more.js), and the picture helpers they share
   with Meal ideas (picSelect, picFlow, chip, picInOut, picRemind in public/ui/pics.js). */

/* ---------------------------------------------------------------- shared pieces */

/* A dropdown shown as picture buttons: the dropdown stays in the page, out of sight, and holds the choice. */
select.picsel-src { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; margin: 0; padding: 0; border: 0; }
.picsel { margin: .2rem 0 .7rem; }
.picsel .cat-tile { width: 92px; }
.picsel .cat-pic .pimg { height: 46px !important; width: auto; max-width: 64px; object-fit: contain; }
.picsel.two, .picsel.three, .picsel.purposes3 { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; overflow: visible; }
.picsel.two .cat-tile, .picsel.three .cat-tile, .picsel.purposes3 .cat-tile { width: auto; min-width: 0; }
.picsel.purposes3 .cat-pic { width: 100%; height: 62px; }
.picsel.purposes3 .cat-pic .pimg { height: 62px !important; max-width: 100%; }
.picsel.purposes3 .cat-n { font-size: .68rem; line-height: 1.25; text-align: center; }
.picic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--pa) 14%, var(--card)); color: var(--ink); }
.picic .ion-ic { width: 22px; height: 22px; }

/* Facts as small icon chips, on a row's second line and under a card's controls. */
.sfacts { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .35rem; margin: .25rem 0 0; }
.card > .sfacts { margin: .6rem 0 .2rem; }
.sfact { display: inline-flex; align-items: center; gap: .28rem; padding: .16rem .5rem .16rem .38rem; border-radius: 99px; background: color-mix(in srgb, var(--pa) 10%, var(--card));
  border: 1px solid var(--line); font-size: .76rem; font-weight: 600; color: var(--ink); line-height: 1.25; text-decoration: none; max-width: 100%; min-width: 0; }
.sfact .ion-ic { flex: none; width: 13px; height: 13px; color: var(--muted); }
.sfact .pimg { flex: none; height: 16px !important; width: auto; }
.sfact.good { background: var(--okbg); border-color: transparent; color: var(--ok); } .sfact.good .ion-ic { color: var(--ok); }
.sfact.need { background: var(--warnbg); border-color: transparent; color: var(--warn); } .sfact.need .ion-ic { color: var(--warn); }
.sfact.soon { background: var(--warnbg); border-color: transparent; color: var(--warn); font-weight: 500; } .sfact.soon .ion-ic { color: var(--warn); }
.sfacts > .small { font-weight: 600; margin-right: .1rem; }
.sfacts.keeps > .small:not(:first-child) { margin-left: .4rem; }

/* How something works, as steps with arrows in place of a paragraph. */
.pic.flow { display: flex; align-items: flex-start; justify-content: center; gap: .2rem; margin: .5rem 0 .7rem; padding: .7rem .5rem .6rem; border-radius: 16px;
  background: color-mix(in srgb, var(--pa) 7%, var(--card)); border: 1px dashed var(--line); }
.flow .fstep { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; }
.flow .fstep > .pimg { height: 46px !important; width: auto; max-width: 100%; object-fit: contain; }
.flow .fstep small { font-size: .74rem; line-height: 1.25; color: var(--muted); }
.flow .fstep small b { color: var(--ink); }
.flow .farrow { flex: none; align-self: flex-start; margin-top: 14px; color: var(--muted); opacity: .7; }
.flow .farrow .ion-ic { width: 16px; height: 16px; }
.flow .srcs { display: grid; grid-template-columns: repeat(2, 22px); gap: 2px; height: 46px; align-content: center; }
.flow .srcs .pimg { height: 22px !important; width: 22px; object-fit: contain; }
.fx-in .flow .fstep { animation: fx-pop .45s var(--spring) backwards; }
.fx-in .flow .fstep:nth-child(3) { animation-delay: 120ms; } .fx-in .flow .fstep:nth-child(5) { animation-delay: 240ms; }

/* What is shared and what is not. */
.inout { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .6rem 0 .2rem; }
.inout > div { display: flex; flex-direction: column; gap: .3rem; padding: .6rem .7rem; border-radius: 14px; font-size: .84rem; }
.inout b { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.inout span { display: flex; align-items: center; gap: .35rem; }
.inout .ion-ic { flex: none; width: 16px; height: 16px; }
.inout .in { background: var(--okbg); color: var(--ok); } .inout .in span { color: var(--ink); } .inout .in .ion-ic { color: var(--ok); }
.inout .out { background: var(--badbg); color: var(--bad); } .inout .out span { color: var(--ink); } .inout .out .ion-ic { color: var(--bad); }

/* When a reminder comes: the bell, a dot for each day, the date. */
.pic.remind { display: flex; align-items: center; gap: .4rem; margin: .7rem 0 .2rem; padding: .6rem .7rem; border-radius: 16px; background: color-mix(in srgb, var(--pa) 7%, var(--card)); border: 1px solid var(--line); }
.remind .rend { flex: none; display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center; width: 76px; }
.remind .rend .pimg { height: 40px !important; }
.remind .rend small { font-size: .7rem; line-height: 1.2; color: var(--muted); } .remind .rend small b { display: block; color: var(--ink); font-size: .76rem; }
.remind .rdays { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 2px; min-width: 0; padding-bottom: 1.2rem; position: relative; }
.remind .rdays::before { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - .6rem); border-top: 2px dotted var(--line); }
.remind .rdays i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.remind .rdays em { position: relative; font-style: normal; font-size: .7rem; font-weight: 700; color: var(--muted); background: var(--card); padding: 0 .2rem; }
.remind.go .rdays i { animation: pic-pop .4s var(--spring) backwards; animation-delay: calc(var(--i) * 40ms); }
.remind.off { opacity: .5; filter: grayscale(1); }

/* ---------------------------------------------------------------- Settings */

/* The list: each section's painting, its name, and what it is set to now. */
.srow { align-items: center; }
.srow-art { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--pa) 9%, var(--card)); }
.srow-art .pimg { height: 38px !important; width: auto; max-width: 42px; object-fit: contain; }
.srow-art .picic { width: 46px; height: 46px; background: none; }
.srow .grow { min-width: 0; }
.srow b { display: block; }
.srow .sfacts { margin-top: .3rem; }
.srow .sfacts .sfact { font-weight: 500; }
.sfigs { display: inline-flex; }
.sfigs .pic.people { margin: 0; min-height: 0; gap: 1px; flex-wrap: nowrap; }
.sfigs .pic.people .fig { animation: none !important; }

/* Household. */
button.hhpic { display: flex; align-items: flex-end; gap: .8rem; width: 100%; text-align: left; justify-content: space-between; flex-wrap: wrap; padding: .6rem .7rem; margin: 0 0 .6rem;
  border-radius: 16px; background: color-mix(in srgb, var(--pa) 7%, var(--card)); border: 1px solid var(--line); box-shadow: none; color: var(--ink); min-height: 0; font-weight: 400; }
.hhpic .pic.people { margin: 0; flex: 1 1 auto; }
.hhpic-cap { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; margin-left: auto; }
.hhpic-cap b { font-size: .95rem; }
#goalspan .pic.span { margin: .2rem 0 .8rem; }

/* Places. */
.locset .lochead { display: flex; align-items: flex-end; gap: .7rem; margin-bottom: .4rem; }
.locset .lochead .locart { height: 54px !important; width: auto; flex: none; }
.locset > label { margin-top: .4rem; }
.locset label .ion-ic { width: 13px; height: 13px; vertical-align: -2px; }
.locflow { margin-top: .9rem; }
#newloc .row { margin-top: .2rem; }

/* Barcode lookups. */
.srclist { list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .5rem; }
.srclist li { display: flex; align-items: center; gap: .6rem; }
.srclist .pimg { flex: none; height: 26px !important; width: 30px; object-fit: contain; }
.srclist span { display: flex; flex-direction: column; font-size: .9rem; line-height: 1.25; }
.srclist small { color: var(--muted); font-size: .76rem; }

/* Backup: three picture buttons. */
.bkpics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .7rem 0 .2rem; }
.bkpics .cat-tile { width: auto; min-height: 96px; margin: 0; justify-content: center; cursor: pointer; font: inherit; color: var(--ink); }
.bkpics .cat-name { font-size: .78rem; font-weight: 600; text-align: center; }
.bkpics .cat-pic .pimg { height: 46px !important; width: auto; max-width: 56px; object-fit: contain; }

/* ---------------------------------------------------------------- Account */

.acct { display: flex; align-items: center; gap: .7rem; margin: 0 0 .4rem; }
.acct .pimg { flex: none; height: 46px !important; }
.acct b { display: block; overflow-wrap: anywhere; }
.acct .sfact { font-weight: 500; white-space: normal; }
.hcode { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 16px; background: color-mix(in srgb, var(--gold) 16%, var(--card)); margin: .3rem 0 0; }
.hcode .pimg { flex: none; height: 40px !important; }
.hcode .grow { display: flex; flex-direction: column; }
.hcode #hcode { font-family: var(--display); font-size: 1.25rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
#hhfigs { justify-content: flex-start; margin: .3rem 0 .4rem; }
#hhfigs .figcol.me small { color: var(--ink); }
.plushas { flex: none; display: grid; place-items: center; }
.plushas .pimg { height: 40px !important; }

/* ---------------------------------------------------------------- Plus */

/* The top: the account's cloud over the household's own phones and people, and their real numbers. */
.plushero:has(.plusstage) { padding-bottom: .6rem; }
.plusstage { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: .2rem; }
.plusstage .pcloud { height: 74px !important; position: relative; z-index: 1; }
.plusstage .plink { width: 2px; height: 16px; border-left: 2px dotted color-mix(in srgb, var(--ink) 30%, transparent); margin: -2px 0 0; }
.plusstage .pground { display: flex; align-items: flex-end; justify-content: center; gap: .5rem; padding: 0 .5rem; border-bottom: 3px solid color-mix(in srgb, var(--gold) 60%, transparent); }
.plusstage .pphone { height: 62px !important; }
.plusstage .pfigs .pic.people { margin: 0; flex-wrap: nowrap; gap: 2px; }
.pluscount { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; margin-top: .55rem; }
.pluscount .sfact { background: var(--card); }
@media (max-height: 700px) { .plusstage .pcloud { height: 56px !important; } .plusstage .pphone { height: 48px !important; } .plusstage .pfigs .pimg { max-height: 50px; width: auto; } }
html:not([data-motion="off"]) .plusstage .pcloud { animation: plus-float 5s ease-in-out infinite; }
@keyframes plus-float { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .plusstage .pcloud { animation: none !important; } }

/* What Plus does, two by two, each with a painting and this household's own facts. */
.plustiles { list-style: none; margin: .3rem 0 1rem; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.plustiles li, .plustiles li > a { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .65rem .55rem; border-radius: 18px; background: var(--plus-wash); border: 1px solid var(--line); min-width: 0; }
.plustiles li > a { padding: 0; border: 0; background: none; color: inherit; text-decoration: none; }
.plustiles li:has(> a) { padding: .7rem .7rem .65rem; }
.plustiles .ptart { position: relative; height: 46px; display: flex; align-items: flex-end; margin-bottom: .15rem; }
.plustiles .ptart .pimg { height: 46px !important; width: auto; max-width: 80px; object-fit: contain; }
.plustiles .ptart em { position: absolute; left: 40px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; }
.plustiles .ptart em .ion-ic { width: 14px; height: 14px; }
.plustiles b { font-size: .9rem; line-height: 1.2; }
.plustiles small { font-size: .76rem; line-height: 1.3; color: var(--muted); }
.plustiles .ptfigs .pic.people { margin: .3rem 0 0; min-height: 0; gap: 1px; flex-wrap: nowrap; }
.plustiles .ptmonths { display: flex; gap: 3px; margin-top: .35rem; }
.plustiles .ptcode { font-family: var(--display); font-size: 1.05rem; letter-spacing: .05em; color: var(--ink); }
.plustiles.next { grid-template-columns: 1fr; }
.plustiles.next li, .plustiles.next li > a { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto; column-gap: .7rem; align-items: center; }
.plustiles.next .ptart { grid-row: 1 / 3; margin: 0; justify-content: center; }
.plustiles.next li:has(> a) { padding: .7rem; }
.plustiles.next li > a { grid-column: 1 / -1; }
.fx-in .plustiles li, dialog[open] .plustiles li { animation: fx-rise-y .45s var(--out) backwards; animation-delay: calc(120ms + var(--i, 0) * 70ms); }
.plusflow { margin-top: -.3rem; }

/* The free days as a line in time: today, a mark for each free day, the first payment. */
ol.plustime { list-style: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: .4rem; margin: 0 0 .9rem; padding: .7rem .7rem .6rem; border-radius: 16px; background: var(--plus-wash); }
.plustime .pt { display: flex; flex-direction: column; gap: .1rem; font-size: .8rem; line-height: 1.3; }
.plustime .pt.then { text-align: right; align-items: flex-end; }
.plustime .pt i { width: 14px; height: 14px; border-radius: 50%; background: var(--ok); margin-bottom: .15rem; }
.plustime .pt.then i { background: var(--card); border: 2px solid var(--muted); box-sizing: border-box; }
.plustime .pt b { font-size: .92rem; }
.plustime .pt span { color: var(--muted); }
.plustime .ptdays { display: grid; grid-template-columns: repeat(7, 7px); gap: 3px; padding-top: 3px; }
.plustime .ptdays i { width: 7px; height: 7px; border-radius: 2px; background: color-mix(in srgb, var(--ok) 55%, transparent); }
dialog[open] .plustime .ptdays i { animation: pic-pop .35s var(--spring) backwards; animation-delay: calc(var(--i) * 25ms); }
@media (prefers-reduced-motion: reduce) { .plustiles li, .plustime .ptdays i, .flow .fstep, .remind .rdays i { animation: none !important; } }
html[data-motion="off"] .plustiles li, html[data-motion="off"] .plustime .ptdays i { animation: none !important; }

/* Rows of small item pictures: packed/on in colour, missing/off faded. */
.pthings { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px; vertical-align: middle; }
.pthings .pth { display: inline-grid; place-items: center; min-width: 22px; }
.pthings .pth .pimg { width: auto; object-fit: contain; }
.pthings .pth.off { opacity: .35; filter: grayscale(1); }
.pthings .pth .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: block; }
.pthings em { font-style: normal; font-size: .75rem; color: var(--muted); margin-left: 2px; }
.fx-in .pthings .pth { animation: pic-pop .35s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 30ms); }

/* How far through a repeating cycle: a thin bar. */
.pcycle { display: block; margin: .35rem 0 .1rem; }
.pcycle > span { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pcycle i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.pcycle.pc-soon i { background: var(--warn, #d89b2b); }
.pcycle.pc-late i { background: var(--bad, #c0453a); }

.rotli { align-items: center; }
.rotart, .packart, .spart { flex: none; object-fit: contain; }
.rotart { width: 40px; }
.rchecks li { flex-wrap: wrap; align-items: center; }
.rchecks .grow .pill { margin-top: .2rem; display: inline-block; }
.rcheckmore { flex-basis: 100%; }
.rtips { margin-top: .4rem; }
.spend-nums .spart { display: block; margin: 0 auto .25rem; height: 40px; width: auto; }
.tlpics .tl-row { align-items: center; }
.tlpics .tl-items { flex: 1; min-width: 0; overflow: hidden; }
.packlist .packart { width: 26px; height: 26px; margin-right: .1rem; }
.bagcard .pthings { margin-top: .3rem; }

/* Setup on phones: the screen has its own heading, so the brand bar only takes room. */
@media (max-width: 899px), (hover: none) { body.bare header.top { display: none; } }
