/* Simple layout (Nick) and the shared Projects screens. Everything is in rem, so the person's text size scales the whole thing. */
:root { --me: var(--accent); --meal: #ff8a4c; }
@media (prefers-color-scheme: light) { :root { --meal: #c94c14; } }

html.simple { font-size: 17px; }
html.simple.ts-large { font-size: 19px; }
html.simple.ts-xl { font-size: 22px; }
html.simple body { font-size: 1rem; line-height: 1.5; }
html.simple #app { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); max-width: 44rem; width: auto; min-width: 0; }
html.simple main { padding: calc(env(safe-area-inset-top) + .75rem) .9rem .5rem; }
html.simple #view.narrow { max-width: 44rem; }
html.simple .toast { bottom: calc(6.8rem + env(safe-area-inset-bottom)); font-size: 1rem; }
html.simple.ts-large dialog#editor, html.simple.ts-large dialog#ideas { zoom: 1.15; }
html.simple.ts-xl dialog#editor, html.simple.ts-xl dialog#ideas { zoom: 1.3; }

/* ---------- bottom bar with the Dump button in the middle ---------- */
.stabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: 1fr 1fr 1.1fr 1fr; align-items: end;
  background: var(--panel); border-top: 1px solid var(--line); padding: .35rem .5rem calc(.4rem + env(safe-area-inset-bottom)); }
.stabs button { border: 0; background: none; color: var(--dim); font-size: .82rem; font-weight: 700; padding: .35rem 0 .2rem; display: flex; flex-direction: column; align-items: center; gap: .1rem; border-radius: .8rem; }
.stabs .si { font-size: 1.45rem; line-height: 1.2; filter: grayscale(1); opacity: .7; }
.stabs button.on { color: var(--text); }
.stabs button.on .si { filter: none; opacity: 1; }
.stabs .sdump { justify-self: center; width: 4.2rem; height: 4.2rem; border-radius: 50%; background: var(--me); color: #fff; font-size: 2.6rem; font-weight: 400; line-height: 1;
  justify-content: center; transform: translateY(-1rem); box-shadow: 0 .4rem 1.2rem rgba(0,0,0,.35); padding: 0; }
.stabs .sdump:active { transform: translateY(-1rem) scale(.94); }

/* ---------- building blocks ---------- */
.sv { padding: 0 .1rem 1rem; }
.sv-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin: .2rem .15rem .6rem; }
.sv-hello { font-size: 1.6rem; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.sv-date { font-size: .95rem; color: var(--dim); margin-top: .15rem; }
.sv-h { font-size: 1.05rem; font-weight: 750; color: var(--dim); text-transform: none; letter-spacing: 0; margin: 1.5rem .2rem .55rem; display: flex; align-items: center; gap: .5rem; }
.sv-count { background: var(--me); color: #fff; font-size: .8rem; border-radius: 99px; padding: .05rem .55rem; }
.sv-dim { color: var(--dim); }
.sv-pad { padding: .5rem .2rem; }
.sv-tip { margin: 1.6rem .2rem 0; font-size: .9rem; }
.sv-gear { flex: 0 0 auto; width: 2.9rem; height: 2.9rem; border-radius: .9rem; border: 1px solid var(--line); background: var(--panel); font-size: 1.35rem; color: var(--dim); }
.sv-btn { border: 1px solid var(--line); background: var(--panel2); color: var(--text); border-radius: .85rem; padding: .7rem 1.1rem; font-size: 1rem; font-weight: 650; min-height: 3rem; cursor: pointer; }
.sv-btn.on { background: var(--me); border-color: var(--me); color: #fff; }
.sv-btn.danger, .sv-link.danger { color: var(--bad); }
.sv-btns { display: flex; flex-wrap: wrap; gap: .55rem; margin: .5rem 0; }
.sv-link { background: none; border: 0; color: var(--me); font-size: 1rem; font-weight: 700; padding: .7rem .2rem; cursor: pointer; }
.sv-back { background: none; border: 0; color: var(--me); font-size: 1.05rem; font-weight: 700; padding: .4rem 0 .6rem; cursor: pointer; }
.sv-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .5rem; margin: .3rem 0 .6rem; }
.sv-seg button { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: .85rem; padding: .75rem .5rem; font-size: 1rem; font-weight: 700; min-height: 3.1rem; cursor: pointer; }
.sv-seg button.on { background: var(--me); border-color: var(--me); color: #fff; }
.sv-seg5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sv-seg5 button { font-size: .95rem; padding: .7rem .3rem; }
.sv-seg button { min-width: 0; overflow-wrap: break-word; }
.sv-bday .sv-time { display: none; }
.sv-seg .a1 { font-size: .85em; } .sv-seg .a2 { font-size: 1.1em; } .sv-seg .a3 { font-size: 1.35em; }

/* ---------- cards ---------- */
.sv-card { display: flex; align-items: center; gap: .9rem; background: var(--panel); border: 1px solid var(--line); border-radius: 1.05rem; padding: .85rem 1rem; margin-bottom: .6rem; min-height: 4.1rem; cursor: pointer; transition: opacity .35s, transform .35s; }
.sv-card:active { transform: scale(.99); }
.sv-body { flex: 1; min-width: 0; }
.sv-title { font-size: 1.12rem; font-weight: 650; line-height: 1.3; overflow-wrap: break-word; }
.sv-sub { font-size: .88rem; color: var(--dim); margin-top: .15rem; }
.sv-late { color: var(--warn); font-weight: 700; }
.sv-time { flex: 0 0 4.4rem; font-size: .92rem; font-weight: 750; color: var(--dim); font-variant-numeric: tabular-nums; line-height: 1.2; }
.sv-check { flex: 0 0 auto; width: 2.8rem; height: 2.8rem; border-radius: .85rem; border: .18rem solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .2s, border-color .2s, transform .2s; }
.sv-check.on, .sv-pop .sv-check { background: var(--ok); border-color: var(--ok); }
.sv-check.on::after, .sv-pop .sv-check::after { content: "\2713"; color: #fff; font-size: 1.4rem; font-weight: 800; }
.sv-pop .sv-check { transform: scale(1.15); }
.sv-pop { opacity: .35; transform: translateX(.6rem); }
.sv-pop .sv-title, .is-done .sv-title { text-decoration: line-through; color: var(--dim); }
.sv-bday { border-left: .4rem solid #ff6fae; background: linear-gradient(90deg, rgba(255,59,59,.08), rgba(255,214,10,.08), rgba(58,134,255,.08)); }
.sv-txt { flex: 0 0 auto; text-decoration: none; font-weight: 800; font-size: .95rem; padding: .6rem .9rem; border-radius: .8rem; color: #fff; background: linear-gradient(90deg, #ff3b3b, #ff9f1c, #38b000, #3a86ff, #8338ec); }
.sv-meal { border-left: .4rem solid var(--meal); }
.sv-meal .sv-time { font-size: 1.5rem; flex-basis: 2.8rem; text-align: center; }
.sv-ghost { border-style: dashed; border-left-style: solid; background: transparent; }
.sv-ghost .sv-title { color: var(--dim); }
.sv-clear { text-align: center; padding: 1.4rem 1rem; font-size: 1.15rem; font-weight: 700; display: grid; justify-items: center; gap: .5rem; }
.sv-clear-big { width: 3.6rem; height: 3.6rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; color: var(--ok); background: color-mix(in srgb, var(--ok) 18%, transparent); }
.sv-clear .sv-dim { font-size: .95rem; font-weight: 400; }
.sv-minis { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: .2rem 1rem; }
.sv-mini { display: flex; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: 1.02rem; cursor: pointer; }
.sv-mini:last-child { border-bottom: 0; }
.sv-mt { flex: 0 0 4.4rem; color: var(--dim); font-size: .9rem; font-weight: 700; }
.sv-more { color: var(--dim); padding: .6rem 0; font-size: .9rem; }
.sv-radar { display: block; width: 100%; text-align: left; margin: 1.4rem 0 .5rem; background: transparent; color: var(--dim); border: 1px dashed var(--line); border-radius: 1rem; padding: .85rem 1rem; font-size: 1rem; font-weight: 650; cursor: pointer; }
.sv-ask { display: block; width: 100%; text-align: left; margin: .3rem 0 .4rem; background: color-mix(in srgb, var(--warn) 16%, var(--panel)); color: var(--text); border: 1px solid var(--warn); border-radius: 1rem; padding: .95rem 1rem; font-size: 1.05rem; font-weight: 700; cursor: pointer; }

/* ---------- shopping ---------- */
.sv-bar2 { margin: .3rem 0 .2rem; }
.sv-bar2 .sv-btn { width: 100%; }
.sv-add { display: flex; gap: .5rem; margin: .8rem 0; align-items: stretch; }
.sv-add input, .sv-add textarea { font-size: 1.05rem; padding: .75rem 1rem; border-radius: .85rem; min-height: 3.1rem; flex: 1; min-width: 0; background: var(--panel); }
.sv-add button { flex: 0 0 auto; border: 0; background: var(--me); color: #fff; border-radius: .85rem; padding: 0 1.2rem; font-size: 1rem; font-weight: 750; cursor: pointer; }
.sv-rows { background: var(--panel); border: 1px solid var(--line); border-radius: 1.05rem; overflow: hidden; }
.sv-row { display: flex; align-items: center; gap: .9rem; padding: .7rem 1rem; min-height: 3.6rem; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 1.06rem; user-select: none; }
.sv-row:last-child { border-bottom: 0; }
.sv-box { flex: 0 0 auto; width: 2.1rem; height: 2.1rem; border-radius: .6rem; border: .18rem solid var(--line); display: grid; place-items: center; transition: background .15s; }
.sv-row.is-done .sv-box { background: var(--ok); border-color: var(--ok); }
.sv-row.is-done .sv-box::after { content: "\2713"; color: #fff; font-weight: 800; }
.sv-row.is-done .sv-rt { text-decoration: line-through; color: var(--dim); }
.sv-rt { flex: 1; min-width: 0; overflow-wrap: break-word; }
.sv-for { flex: 0 1 auto; color: var(--dim); font-size: .8rem; text-align: right; max-width: 40%; }
.sv-store .sv-row { min-height: 4.4rem; font-size: 1.2rem; }
.sv-store .sv-box { width: 2.6rem; height: 2.6rem; }
.sv-list { background: var(--panel); border: 1px solid var(--line); border-radius: 1.05rem; margin-bottom: .6rem; padding: 0 .6rem; }
.sv-list > summary { list-style: none; cursor: pointer; padding: .9rem .4rem; font-size: 1.05rem; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; }
.sv-list > summary::-webkit-details-marker { display: none; }
.sv-list .sv-rows { border: 0; }

/* ---------- this week's meals ---------- */
.sv-day { display: flex; gap: .8rem; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 1.05rem; padding: .8rem 1rem; margin-bottom: .55rem; min-height: 4rem; }
.sv-tonight { border: 2px solid var(--me); }
.sv-dl { flex: 0 0 6.2rem; font-weight: 800; font-size: 1rem; }
.sv-dm { flex: 1; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.sv-dish { border: 1px solid color-mix(in srgb, var(--meal) 40%, transparent); background: color-mix(in srgb, var(--meal) 15%, transparent); color: var(--text); border-radius: 99px; padding: .5rem .95rem; font-size: 1.02rem; font-weight: 700; cursor: pointer; }
.sv-dish small { color: var(--dim); font-size: .75rem; text-transform: capitalize; }
.sv-dish.is-done { opacity: .5; text-decoration: line-through; }
.sv-plan { border: 1px dashed var(--line); background: transparent; color: var(--dim); border-radius: 99px; padding: .5rem .95rem; font-size: 1rem; font-weight: 700; cursor: pointer; }

/* ---------- projects ---------- */
.sv-proj { align-items: flex-start; }
.sv-ptop { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.sv-st { flex: 0 0 auto; font-size: .78rem; font-weight: 800; border-radius: 99px; padding: .15rem .65rem; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.st-active { --c: #4cc38a; } .st-planned { --c: #7c9cff; } .st-researching { --c: #f2a541; } .st-idea { --c: #b388ff; } .st-done { --c: #9aa1b2; }
@media (prefers-color-scheme: light) { .st-active { --c: #1a8150; } .st-planned { --c: #3050d8; } .st-researching { --c: #a85f00; } .st-idea { --c: #7d36c8; } .st-done { --c: #5d6474; } }
.sv-next { font-size: 1rem; margin-top: .35rem; }
.sv-wait { display: flex; align-items: center; gap: .7rem; margin: .5rem .2rem; font-size: 1rem; color: var(--dim); }
.sv-wait select { flex: 1; font-size: 1rem; padding: .6rem .8rem; min-height: 2.9rem; }
.sv-note { color: var(--warn); font-size: .92rem; margin: .3rem .2rem; }
.sv-addnote textarea { resize: vertical; }
.sv-log { display: flex; gap: .8rem; background: var(--panel); border: 1px solid var(--line); border-radius: .95rem; padding: .75rem 1rem; margin-bottom: .5rem; cursor: pointer; }
.sv-ld { flex: 0 0 4rem; color: var(--dim); font-size: .85rem; font-weight: 700; }
.sv-lt { font-weight: 650; overflow-wrap: break-word; }
.sv-ldet { color: var(--dim); font-size: .92rem; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sv-thumbs { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.sv-thumbs img { width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: .6rem; border: 1px solid var(--line); }

/* ---------- settings ---------- */
.sv-swatches { display: flex; flex-wrap: wrap; gap: .75rem; margin: .4rem .2rem; }
.sv-sw { width: 2.9rem; height: 2.9rem; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; }
.sv-sw.on { outline: .2rem solid var(--text); outline-offset: .15rem; }
html.simple #keys .card, html.simple #devices .card { font-size: .95rem; }

/* ---------- sheets (bottom on phones) ---------- */
dialog.sv-sheet { width: min(40rem, 100vw); max-width: 100vw; padding: 0; border-radius: 1.4rem; }
@media (max-width: 640px) { dialog.sv-sheet { margin: auto 0 0; width: 100vw; border-radius: 1.4rem 1.4rem 0 0; max-height: 92vh; } }
.sv-sh { padding: 1.3rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); font-size: 1rem; }
.sv-sh-title { font-size: 1.35rem; font-weight: 800; line-height: 1.25; overflow-wrap: break-word; }
.sv-sh-when { color: var(--dim); margin-top: .3rem; font-size: 1rem; }
.sv-sh-det { white-space: pre-wrap; background: var(--panel2); border-radius: .85rem; padding: .8rem 1rem; margin-top: .9rem; max-height: 40vh; overflow: auto; font-size: 1rem; overflow-wrap: break-word; }
.sv-sh-sub { color: var(--dim); font-weight: 700; margin: .8rem .1rem .2rem; }
.sv-sh-btns { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.1rem; }
.sv-sh-btns .sv-btn { flex: 1 1 auto; }
.sv-picks { display: flex; flex-direction: column; gap: .5rem; margin-top: .9rem; max-height: 55vh; overflow: auto; }
.sv-pick { text-align: left; border: 1px solid var(--line); background: var(--panel2); color: var(--text); border-radius: .85rem; padding: .85rem 1rem; font-size: 1.05rem; font-weight: 650; cursor: pointer; }
.sv-pick-hi { border-color: var(--meal); background: color-mix(in srgb, var(--meal) 14%, var(--panel2)); }
#svDumpText { font-size: 1.2rem; padding: 1rem; min-height: 8rem; border-radius: .95rem; margin: .8rem 0 .4rem; resize: vertical; }
.sv-send { flex: 2 1 auto !important; }
.sv-sh label.sv-btn { display: inline-flex; align-items: center; justify-content: center; }

/* ---------- done, with undo ---------- */
.sv-undo { position: fixed; left: 50%; bottom: calc(5.6rem + env(safe-area-inset-bottom)); transform: translate(-50%, .8rem); z-index: 21; display: flex; align-items: center; gap: 1.2rem;
  background: var(--text); color: var(--bg); padding: .75rem .9rem .75rem 1.2rem; border-radius: 1rem; font-size: 1rem; font-weight: 700; box-shadow: 0 .5rem 1.8rem rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
html.simple .sv-undo { bottom: calc(6.8rem + env(safe-area-inset-bottom)); }
.sv-undo.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.sv-undo button { border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; padding: .3rem .5rem; cursor: pointer; }

/* Katie's Home: the Projects row */
.k-proj { --c: #c9a227; }
@media (prefers-color-scheme: light) { .k-proj { --c: #8a6d00; } }
