@font-face {
  font-family: Nunito;
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0f1e36;
  --ink-soft: #4a5a72;
  --outline: #e2e8f0;
  --outline-strong: #7a8799;
  --accent: #00838f;
  --filled: #00838f;
  --brand: #00a8b5;
  --tonal: #ddf4f6;
  --pink: #ff8fa3;
  --yellow: #ffd45c;
  --blue: #8fc8ff;
  --green: #7fd8a4;
  --sky: #9edcf2;
  --navy: #24324d;
  --err: #b3261e;
  --ts: 1px;
  --bg: #fff;
  --surface: #fff;
  --surface-2: #fff;
  --accent-text: #00838f;
  --current-bg: #f4fbfc;
  --err-soft: #fdecea;
  --err-bg: #b3261e;
  --toast-bg: #0f1e36;
  --toast-ink: #fff;
  --dock-bg: rgba(255, 255, 255, 0.94);
  --desk: #eef2f7;
  --scrim: rgba(15, 30, 54, 0.45);
  color-scheme: light dark;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button, .tile, .srow, .lrow, .pick-main, .chip, .seg, .ghost-tile, .step, .menu, .hscroll, .saisle, .sheet-grab, .toast, .snack { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-touch-callout: default; -webkit-user-select: text; user-select: text; }
html.app body, html.app a { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.app input, html.app textarea, html.app [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  overscroll-behavior: none;
  font-family: Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: calc(16 * var(--ts));
  font-weight: 600;
  line-height: 1.35;
  touch-action: manipulation;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}
button, input, textarea { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 24px; height: 24px; fill: currentColor; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
textarea, input { font-weight: 600; }

/* App bar */
.appbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 8px) 16px 8px;
  max-width: 640px; margin: 0 auto;
}
.appbar-logo { width: 40px; height: 40px; }
.wordmark {
  margin: 0; font-size: calc(30 * var(--ts)); font-weight: 800; line-height: 1; letter-spacing: -0.5px;
  paint-order: stroke fill; -webkit-text-stroke: 3.5px var(--navy);
}
.wordmark .w1, .wordmark .w5 { color: var(--pink); }
.wordmark .w2 { color: var(--yellow); }
.wordmark .w3 { color: var(--blue); }
.wordmark .w4 { color: var(--green); }
.tagline { margin-left: auto; font-size: calc(13 * var(--ts)); font-weight: 700; color: var(--ink-soft); text-align: right; }
.lists-btn { margin-left: 8px; padding: 0 14px 0 12px; gap: 6px; font-size: calc(15 * var(--ts)); flex: none; }
.lists-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--surface); border: 1.5px solid var(--navy); font-size: calc(13 * var(--ts)); display: inline-flex; align-items: center; justify-content: center; }

.banner {
  display: flex; align-items: center; gap: 8px; max-width: 608px; margin: 2px 16px;
  padding: 0 0 0 12px; border-radius: 12px; background: var(--tonal); font-size: calc(13 * var(--ts)); font-weight: 700; min-height: 48px;
}
.banner .ic { width: 20px; height: 20px; }
@media (min-width: 640px) { .banner { margin-left: auto; margin-right: auto; } }
.banner span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

main { max-width: 640px; margin: 0 auto; }
#view-compose { padding: 4px 16px calc(104px + var(--safe-b)); }

/* Buttons */
.icon-btn {
  width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--ink);
}
.icon-btn:active { background: var(--tonal); }
.icon-btn.round { background: var(--tonal); }
.btn {
  min-height: 48px; padding: 0 20px; border: 0; border-radius: 24px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; font-size: calc(16 * var(--ts)); white-space: nowrap;
}
.btn.tonal { background: var(--tonal); color: var(--ink); }
.btn.filled { background: var(--filled); color: #fff; }
.btn.outlined { background: var(--surface); color: var(--ink); border: 1.5px solid var(--outline-strong); }
.btn.danger { background: var(--surface); color: var(--err); border: 1.5px solid var(--err); }
.btn.wide { width: 100%; margin-top: 16px; }
.btn:active { filter: brightness(0.94); }
.small-btn { min-height: 48px; padding: 0 18px; }
.text-btn { min-height: 48px; padding: 0 12px; border: 0; background: none; color: var(--accent-text); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.text-btn.small { min-height: 48px; font-size: calc(15 * var(--ts)); }

/* Compose: add buttons */
.add-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(120 * var(--ts)), 1fr)); gap: 10px; margin: 8px 0 4px; }
.add-btn { min-height: 52px; padding: 8px 14px; border-radius: 16px; white-space: normal; line-height: 1.15; text-align: start; }
.add-btn .ic { color: var(--accent-text); }

/* Compose: picture area */
.pick-area { scroll-margin-top: var(--safe-t); }
.pick-area .section-title { margin: 16px 0 8px; }
.pick-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.pick-search #pickClear { margin-inline-end: -10px; }
.pick-head {
  position: sticky; top: var(--safe-t); z-index: 2; display: flex; align-items: center; gap: 10px;
  margin: 0 -16px 8px; padding: 6px 16px; background: var(--bg);
}
.pick-cat-title { flex: 1; min-width: 0; margin: 0; display: flex; align-items: center; gap: 10px; font-size: calc(20 * var(--ts)); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.pick-cat-title:focus:not(:focus-visible) { outline: none; }
html[dir="rtl"] .pick-back .ic { transform: scaleX(-1); }
.pick-cat-title .cat-pic { --pic: 44px; border-radius: 12px; background: #fff; }
.cat-grid, .pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(calc(40px + 60 * var(--ts)), calc(50% - 5px)), 1fr)); gap: 10px; }
.cat-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px;
  min-width: 0; min-height: calc(64px + 60 * var(--ts)); padding: 12px 6px 10px; border: 1px solid var(--outline); border-radius: 16px; background: #fff;
  color: var(--ink); text-align: center; font-weight: 800; font-size: calc(15 * var(--ts)); line-height: 1.15;
}
.cat-tile:active { background: var(--tonal); }
/* Category cards: two cards stacked behind (a group that opens); the "new item" card is an action and has no stack */
html { --sx: 1; }
html[dir="rtl"] { --sx: -1; }
.cat-grid { gap: 16px; padding-inline-end: 8px; padding-block-end: 8px; }
.cat-tile:not(.cat-new) {
  --layer: #fff; --edge: var(--outline-strong); border-color: var(--edge);
  --stack: calc(4px * var(--sx)) 4px 0 -1px var(--layer), calc(4px * var(--sx)) 4px 0 0 var(--edge),
    calc(8px * var(--sx)) 8px 0 -1px var(--layer), calc(8px * var(--sx)) 8px 0 0 var(--edge);
  box-shadow: var(--stack);
}
.cat-tile.has:not(.cat-new) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--stack); }
.cat-tile .badge { right: auto; inset-inline-end: 6px; }
.cat-tile .tname, .pick-main .tname { overflow-wrap: anywhere; hyphens: auto; }
.pick-grid .pick-main { height: 100%; }
.cat-tile .tname { white-space: normal; overflow: visible; }
.cat-pic { --pic: 64px; flex: none; width: var(--pic); height: var(--pic); display: flex; align-items: center; justify-content: center; }
.cat-pic .pic { width: var(--pic); height: var(--pic); justify-content: center; }
.cat-pic.collage { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.cat-pic.collage .pic { --pic: calc(var(--cp, 64px) / 2 - 1px); }
.cat-tile .cat-pic.collage { --cp: 64px; }
.pick-cat-title .cat-pic.collage { --cp: 44px; }
.cat-tile.cat-popular { --layer: #fff6d9; --edge: #b8923a; background: #fff6d9; }
.cat-tile.cat-mine { --layer: #ffeef2; --edge: #c06a82; background: #ffeef2; }
.cat-tile.cat-new { justify-content: center; border: 2px dashed var(--accent); background: #f4fbfc; }
.cat-pic.plus { --pic: 52px; border-radius: 50%; background: var(--filled); color: #fff; }
.cat-pic.plus .ic { width: 30px; height: 30px; }

/* Type/paste and photo sheets */
.text-help { margin: 0 4px 10px; }
#textSheet .sheet-body { display: flex; flex-direction: column; }
#textSheet .sheet-body > * { flex: none; }
#textSheet .field { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
#textSheet .field textarea {
  --lines: 5; flex: 0 1 auto; max-height: none; overflow-y: auto; padding: 14px;
  min-height: calc(var(--lines) * 1.4 * 17 * var(--ts) + 31px);
}
@media (max-height: 560px) { #textSheet .field textarea { --lines: 3; } }
.text-ghost {
  position: absolute; box-sizing: border-box; padding: 14px; overflow: hidden; pointer-events: none;
  font-size: calc(17 * var(--ts)); line-height: 1.4; font-weight: 600;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; color: transparent;
}
.text-ghost[hidden] { display: none; }
.text-ghost .ghost-rest { color: var(--ink-soft); opacity: 0.75; pointer-events: auto; cursor: pointer; }
.suggest { display: flex; gap: 8px; margin-top: 10px; min-height: 48px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest:empty { visibility: hidden; }
.suggest .chip { flex: none; min-height: 44px; padding: 0 14px 0 6px; font-size: calc(15 * var(--ts)); }
html.android .suggest, html.android .suggest .chip { min-height: 48px; }
.suggest .pic { width: 32px; height: 32px; }
.text-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.text-hist { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.text-hist button:disabled { opacity: 0.38; }
.text-hist .icon-btn:disabled:active { background: transparent; }
html[dir="rtl"] .rtl-flip { transform: scaleX(-1); }
.photo-opts { display: grid; gap: 10px; margin: 12px 0 4px; }
.photo-opt {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 10px 14px;
  border: 1px solid var(--outline); border-radius: 16px; background: var(--surface-2); color: var(--ink); text-align: start;
}
.photo-opt:active { background: var(--tonal); }
.photo-ic { flex: none; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--navy); }
.photo-ic.cam { background: var(--pink); }
.photo-ic.gal { background: var(--blue); }
.photo-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.photo-name { font-size: calc(17 * var(--ts)); font-weight: 800; }
.photo-sub { font-size: calc(14 * var(--ts)); font-weight: 600; color: var(--ink-soft); }
.fab-count {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 14px; background: #fff; color: #00636c;
  display: inline-flex; align-items: center; justify-content: center; font-size: calc(15 * var(--ts));
}
.fab-count:empty { display: none; }
#yourListTitle { scroll-margin-top: calc(var(--safe-t) + 8px); }

.field { position: relative; }
.field textarea {
  width: 100%; min-height: 96px; max-height: 40dvh; resize: none; display: block;
  border: 1.5px solid var(--outline-strong); border-radius: 12px; background: var(--surface-2);
  padding: 14px 56px 14px 14px; font-size: calc(17 * var(--ts)); line-height: 1.4;
}
.field textarea::placeholder { color: var(--ink-soft); opacity: 0.7; }
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.error { margin: 6px 4px 0; color: var(--err); font-weight: 700; font-size: calc(15 * var(--ts)); }
.hint-line { margin: 6px 4px 0; color: var(--ink-soft); font-size: calc(15 * var(--ts)); }
.hint-btn {
  display: inline-flex; align-items: center; min-height: 44px; margin: 0 0 2px; padding: 0 14px; border: 1.5px dashed var(--accent); border-radius: 22px;
  background: var(--surface); color: var(--accent-text); font-weight: 800; font-size: calc(15 * var(--ts));
}
.hint-btn:active { background: var(--tonal); }

.section-title { margin: 20px 0 8px; font-size: calc(14 * var(--ts)); font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { display: none; }

.tile, .ghost-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1px solid var(--outline); border-radius: 12px; background: #fff; padding: 8px 6px 8px;
  min-width: 0; text-align: center; font-weight: 800; font-size: calc(15 * var(--ts)); line-height: 1.15;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.tile:active { background: var(--tonal); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tiles .tile, .ghost-tile { --pic: 72px; min-height: 148px; }
.tile .pic, .ghost-tile .pic { width: var(--pic); height: var(--pic); }
.tname { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiles .tname { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.badge {
  position: absolute; top: 6px; right: 6px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px;
  background: var(--yellow); color: var(--ink); font-weight: 800; font-size: calc(15 * var(--ts));
  display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--navy);
}
.tile.unresolved { border-style: dashed; border-color: var(--outline-strong); }
.ltile.unresolved { border-style: solid; border-color: var(--accent); }
.pic.nopic {
  display: flex; align-items: center; justify-content: center; padding: 0; border: 2.5px dashed var(--accent); border-radius: 50%;
  background: #f4fbfc; color: var(--accent); width: calc(var(--pic) * 0.86); height: calc(var(--pic) * 0.86); margin: calc(var(--pic) * 0.07);
}
.pic.nopic .ic { width: 46%; height: 46%; }
.pic.nopic:active { background: var(--tonal); }
.ltile.new { animation: popin 0.3s ease-out; }
@keyframes popin { 0% { transform: scale(0.8); opacity: 0.4; } 70% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }
.tile .pic.none span { background: transparent; border: 2.5px dashed var(--outline-strong); color: var(--ink-soft); font-size: calc(28 * var(--ts)); }
.pic.loading { border-radius: 50%; background: #eef2f7; }
.ghosts { opacity: 0.3; cursor: pointer; }
.ghost-tile { min-height: 124px; }
.empty { margin-top: 4px; }
.empty-caption { text-align: center; margin: 12px 0 0; font-weight: 700; color: var(--ink-soft); }
.empty .btn { display: flex; max-width: 100%; margin: 12px auto 0; white-space: normal; text-align: center; }

.foot {
  max-width: 640px; margin: 0 auto; padding: 8px 16px calc(96px + var(--safe-b));
  display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: calc(13 * var(--ts)); color: var(--ink-soft);
}
.foot-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.credit { font-size: calc(13 * var(--ts)); font-weight: 700; color: var(--ink); }
.credit a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center;
  padding: 10px calc(16px + var(--safe-r)) calc(10px + var(--safe-b)) calc(16px + var(--safe-l));
  background: var(--dock-bg); border-top: 1px solid var(--outline);
}
.fab {
  width: 100%; max-width: 608px; height: 56px; padding: 0 20px; border: 0; border-radius: 28px; background: var(--filled); color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: calc(17 * var(--ts));
}
.fab:active { filter: brightness(0.94); }

/* List view */
.listhead { position: sticky; top: 0; z-index: 4; background: var(--bg); border-bottom: 1px solid var(--outline); }
.listbar { display: flex; align-items: center; gap: 2px; padding: calc(var(--safe-t) + 6px) 8px 2px; }
.listbar-title { margin: 0 auto 0 4px; font-size: calc(18 * var(--ts)); font-weight: 800; display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; }
.t-name { overflow: hidden; text-overflow: ellipsis; }
.t-prog { font-size: calc(18 * var(--ts)); font-weight: 800; color: var(--accent-text); }
.listbar-title { align-items: center; }
.print-btn { width: 48px; min-height: 48px; padding: 0; margin-left: 4px; border-radius: 50%; background: var(--tonal); color: var(--ink); }
#view-list.mode-sheet .print-btn { background: var(--filled); color: #fff; }
.seg-icons .ic { display: inline-block; }
.seg.seg-icons button { min-height: 48px; }
.pbar { height: 14px; margin: 0 16px 8px; border: 1.5px solid var(--navy); border-radius: 7px; background: var(--surface-2); }
.pbar i { position: relative; display: block; height: 100%; width: calc(var(--p, 0) * 1%); border-radius: 6px; background: var(--brand); transition: width 0.3s ease-out, background-color 0.3s; }
.pbar i::after {
  content: ""; position: absolute; right: -4px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--navy);
}
.pbar.zero i::after { display: none; }
.pbar.full { animation: pulse 0.5s ease-out; }
.pbar.full i { background: var(--green); }
.modebar { display: flex; justify-content: center; padding: 4px 8px 8px; }
.tickhint {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px auto 0; width: max-content; max-width: 90%;
  padding: 8px 16px; border-radius: 20px; background: var(--yellow); color: #0f1e36; font-weight: 700; font-size: calc(15 * var(--ts));
}
.tickhint .ic { animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.more-wrap { position: relative; }
.menu-scrim { position: fixed; inset: 0; z-index: 30; background: var(--scrim); }
.menu {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; display: flex; flex-direction: column; gap: 8px;
  max-width: 480px; margin: 0 auto; padding: 0 8px calc(8px + var(--safe-b)); animation: slideup 0.2s ease-out;
}
.menu-group { display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; background: var(--surface); }
.menu-item {
  min-height: 56px; border: 0; border-top: 1px solid var(--outline); background: none; padding: 0 16px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--accent-text); font-weight: 700; font-size: calc(18 * var(--ts));
}
.menu-item:first-child { border-top: 0; }
.menu-cancel { min-height: 56px; border: 0; border-radius: 14px; background: var(--surface); color: var(--accent-text); font-weight: 800; font-size: calc(18 * var(--ts)); }
.menu-item:active, .menu-cancel:active { background: var(--tonal); }
@media (min-width: 600px) {
  #menuScrim { display: none !important; }
  #overflowMenu { display: flex !important; position: static; flex-direction: row; gap: 0; max-width: none; margin: 0; padding: 0; animation: none; }
  .menu-group { flex-direction: row; overflow: visible; border-radius: 0; background: none; }
  .menu-cancel { display: none; }
  #moreBtn { display: none; }
  .menu-item span { display: none; }
  .menu-item { padding: 0; width: 48px; min-height: 48px; justify-content: center; border: 0; border-radius: 50%; color: var(--ink); }
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px;
  border: 1.5px solid var(--outline-strong); border-radius: 24px; background: var(--surface); font-weight: 800;
}
.chip.need { margin: 10px 16px 0; background: var(--yellow); border-color: var(--navy); }
.sheet-wrap { margin: 12px 0 calc(24px + var(--safe-b)) calc((100% - var(--sw, 100%)) / 2); width: var(--sw, 100%); height: var(--sh, auto); overflow: hidden; }
#sheet { transform-origin: top left; transform: scale(var(--scale, 1)); width: var(--page-w, 190mm); }
@media screen {
  #sheet { box-sizing: content-box; padding: 8mm; }
  #sheet .page {
    margin-bottom: 18mm;
    box-shadow: 0 0 0 6mm #fff, 0 0 0 calc(6mm + 1px) var(--outline), 0 0.6mm 1.6mm 6mm rgba(15, 30, 54, 0.14);
  }
  #sheet .page:last-child { margin-bottom: 0; }
  #sheet .row { cursor: pointer; }
  #sheet .row:focus-visible { outline: 0.8mm solid var(--accent); outline-offset: -0.8mm; }
  #sheet .pic { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
  #sheet .row.done { background: #f1faf5; }
  #sheet .row.done .qty, #sheet .row.done .txt { opacity: 0.6; transition: opacity 0.2s; }
  #sheet .row.done .box { background: var(--green); border-color: #1f9d63; }
  #sheet .row.done .box::after {
    content: ""; position: absolute; left: 28%; top: 6%; width: 28%; height: 56%;
    border: solid #14633f; border-width: 0 0.9mm 0.9mm 0; transform: rotate(45deg);
  }
  #sheet .row.pop .box { animation: pop 0.35s ease-out; }
  #sheet .box { position: relative; overflow: visible; }
  body.desk { background: var(--desk); }
  body.desk .listhead { border-bottom-color: #d5dde8; }
  #view-list.mode-store #sheetWrap { display: none; }
  #view-list.mode-sheet #storeList { display: none; }
}
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* Sheets (dialogs) */
dialog.sheet {
  margin: auto 0 0; padding: 0; border: 0; width: 100%; max-width: 100%;
  max-height: 92dvh; border-radius: 28px 28px 0 0; background: var(--surface); color: var(--ink);
  box-shadow: 0 -4px 24px rgba(15, 30, 54, 0.25); overflow: hidden;
}
dialog.sheet.tall { height: 92dvh; }
dialog.sheet[open] { display: flex; flex-direction: column; animation: slideup 0.25s ease-out; }
dialog.sheet::backdrop { background: var(--scrim); }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; max-width: 560px; border-radius: 28px; max-height: 88dvh; }
}
dialog.sheet.center { margin: auto; width: 200px; max-width: 80vw; border-radius: 28px; }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-body { padding: 8px 16px calc(16px + var(--safe-b)); overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.sheet-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--outline-strong); margin: 4px auto 8px; }
.sheet-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-height: 52px; }
.sheet-head h2 { margin: 0; font-size: calc(20 * var(--ts)); font-weight: 800; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.tip { display: flex; gap: 10px; align-items: flex-start; background: var(--tonal); border-radius: 12px; padding: 10px 12px; font-size: calc(15 * var(--ts)); font-weight: 600; }
.progress-body { display: flex; flex-direction: column; align-items: center; padding: 24px 16px; text-align: center; }
.ring { width: 72px; height: 72px; transform: rotate(-90deg); }
.ring-bg, .ring-fg { fill: none; stroke-width: 5; }
.ring-bg { stroke: var(--outline); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 5)); transition: stroke-dashoffset 0.2s; }

/* Picture area: item tiles */
.pick-search { margin: 0 0 12px; }
.pick-tile { position: relative; min-width: 0; }
.pick-main {
  width: 100%; min-height: 150px; border: 1px solid var(--outline); border-radius: 12px; background: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 40px;
  font-weight: 800; font-size: calc(15 * var(--ts)); line-height: 1.15; --pic: 68px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.pick-main:active { background: var(--tonal); }
.pick-main .pic { width: var(--pic); height: var(--pic); }
.pick-main .tname { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.pick-main { position: relative; }
.pick-tile:not(.has) .pick-main::after {
  content: "+"; position: absolute; bottom: 8px; left: 50%; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%;
  background: var(--tonal); color: var(--accent); font-weight: 800; font-size: calc(20 * var(--ts)); line-height: 28px; text-align: center;
}
.pick-tile.has .pick-main { background: var(--tonal); border-color: var(--accent); }
.pick-tile.bounce .pick-main { animation: pop 0.3s ease-out; }
.badge.pulse { animation: pulse 0.3s ease-out; }
.pick-minus {
  position: absolute; bottom: 0; left: 0; width: 48px; height: 48px; border: 0; background: none; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.pick-minus span { width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 1.5px solid var(--navy); display: flex; align-items: center; justify-content: center; }
.pick-minus .ic { width: 20px; height: 20px; }
.plus1 {
  position: absolute; left: 50%; top: 28%; z-index: 2; margin-left: -18px; padding: 2px 10px; border-radius: 12px;
  background: var(--yellow); border: 1.5px solid var(--navy); font-weight: 800; font-size: calc(15 * var(--ts)); pointer-events: none;
  animation: floatup 0.5s ease-out forwards;
}
@keyframes floatup { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-26px); opacity: 0; } }
@keyframes pulse { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* Item sheet */
.item-top { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.item-pic { flex: none; width: 128px; height: 128px; border: 1px solid var(--outline); border-radius: 12px; display: flex; align-items: center; justify-content: center; --pic: 112px; }
.item-pic .pic { width: var(--pic); height: var(--pic); }
.item-controls { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper output { min-width: 48px; text-align: center; font-size: calc(28 * var(--ts)); font-weight: 800; }
.alt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.alt { min-height: 96px; border: 1px solid var(--outline); border-radius: 12px; background: #fff; padding: 6px; display: flex; align-items: center; justify-content: center; --pic: 80px; }
.alt .pic { width: var(--pic); height: var(--pic); }
.alt.sel { border-color: var(--accent); background: var(--tonal); box-shadow: 0 0 0 1px var(--accent); }
.alt-note { grid-column: 1 / -1; color: var(--ink-soft); font-size: calc(15 * var(--ts)); margin: 0; }
.search-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; border: 1.5px solid var(--outline-strong); border-radius: 12px; padding: 0 12px; min-height: 52px; }
.search-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.search-row input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: calc(17 * var(--ts)); min-height: 48px; }
.emoji-row { padding-bottom: 4px; }
.emoji-btn { flex: none; width: 56px; height: 56px; border: 1px solid var(--outline); border-radius: 12px; background: #fff; font-size: calc(30 * var(--ts)); line-height: 1; display: flex; align-items: center; justify-content: center; }
.item-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* Settings */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--outline); }
.setting-label { font-weight: 700; }
.group-title { margin: 16px 0 0; font-size: calc(14 * var(--ts)); font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.group-title:first-of-type { margin-top: 4px; }
.seg { display: inline-flex; border-radius: 20px; }
.seg button {
  position: relative; min-width: 56px; min-height: 40px; border: 1.5px solid var(--outline-strong); background: var(--surface-2);
  font-weight: 700; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.seg button::before { content: ""; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
.seg button:first-child { border-radius: 20px 0 0 20px; }
.seg button:last-child { border-radius: 0 20px 20px 0; }
.seg button + button { border-left-width: 0; }
.seg .ic { width: 18px; height: 18px; display: none; }
.seg button[aria-checked="true"] { background: var(--filled); border-color: var(--filled); color: #fff; }
.seg button[aria-checked="true"] .ic { display: inline-block; }
.seg button[aria-checked="true"] + button { border-left-width: 1.5px; border-left-color: var(--filled); }
.switch input {
  -webkit-appearance: none; appearance: none; flex: none; width: 51px; height: 31px; border-radius: 16px;
  background: var(--outline-strong); position: relative; margin: 0; transition: background 0.2s;
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); transition: transform 0.2s;
}
.switch input:checked { background: var(--filled); }
.switch input:checked::after { transform: translateX(20px); }
.switch input:focus-visible { outline-offset: 3px; }

/* Store list */
.store { list-style: none; max-width: 640px; margin: 0 auto; padding: 10px 16px calc(96px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.srow {
  --pic: 68px; position: relative; display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 8px 12px 8px 14px;
  border: 1px solid var(--outline); border-radius: 20px; background: #fff; cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.srow:active { background: var(--tonal); }
.srow:focus-visible { outline-offset: 2px; }
.srow .sbox {
  position: relative; flex: none; width: 44px; height: 44px; border: 3px solid var(--navy); border-radius: 12px; background: #fff;
}
.srow .sbox .tick {
  position: absolute; left: -12px; top: -14px; width: 68px; height: 68px; fill: #1f9d63; stroke: #1f9d63; stroke-width: 60px;
  stroke-linejoin: round; transform: scale(0); transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1); pointer-events: none;
}
.srow.done .sbox .tick { transform: scale(1); }
.srow.done { border-color: #1f9d63; background: #f1faf5; }
.srow.done .sbox { border-color: #1f9d63; }
.srow .pic { position: relative; width: var(--pic); height: var(--pic); justify-content: center; }
.srow.pop .pic { animation: hop 0.35s ease-out; }
.star {
  position: absolute; left: 50%; top: 8px; z-index: 3; width: 34px; height: 34px; margin-left: -17px; pointer-events: none;
  fill: var(--yellow); stroke: var(--navy); stroke-width: 1.4px; stroke-linejoin: round; animation: starpop 0.5s ease-out forwards;
}
.star .ic { width: 100%; height: 100%; fill: inherit; stroke: inherit; stroke-width: inherit; stroke-linejoin: round; }
@keyframes starpop { 0% { transform: translateY(0) scale(0); opacity: 0; } 40% { transform: translateY(-10px) scale(1.3); opacity: 1; } 100% { transform: translateY(-18px) scale(1); opacity: 0; } }
.srow .stxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.srow .sname { font-size: calc(21 * var(--ts)); font-weight: 800; line-height: 1.15; overflow-wrap: break-word; hyphens: auto; }
.srow .sorig { font-size: calc(15 * var(--ts)); font-weight: 600; line-height: 1.2; color: var(--ink-soft); overflow-wrap: anywhere; }
.saisle { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: calc(14 * var(--ts)); font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--outline); padding-bottom: 4px; }
.saisle .pic { width: 24px; height: 24px; flex: none; }
.saisle:first-child { margin-top: 0; }
.srow .sqty { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 44px; }
.srow .pill {
  box-sizing: border-box; min-width: 40px; height: 34px; padding: 0 4px; border: 0; background: none;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: calc(30 * var(--ts)); line-height: 1;
}
.srow .dots { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; max-width: 72px; gap: 3px; }
.srow .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--navy); }
.srow.done .stxt, .srow.done .sqty { opacity: 0.6; }
.srow.pop .sbox { animation: pop 0.35s ease-out; }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.burst i { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--navy); background: var(--c, var(--pink)); animation: burst 0.6s ease-out forwards; }
@keyframes burst { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(0.6); opacity: 0; } }

/* Mascot */
.mascot { flex: none; display: inline-block; width: 40px; height: 40px; cursor: pointer; }
.mascot svg { display: block; width: 40px; height: 40px; }
.mascot .eye-closed { display: none; }
.mascot.happy .eye-open { display: none; }
.mascot.happy .eye-closed { display: inline; }
.mascot .eye-open { transform-box: fill-box; transform-origin: center; animation: blink 6s infinite; }
.mascot.hop, .appbar-logo.hop { animation: hop 0.35s ease-out; }
.mascot.jump { animation: jump 0.6s ease-out; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97.5% { transform: scaleY(0.1); } }
@keyframes hop { 0%, 100% { transform: translateY(0) scaleY(1); } 40% { transform: translateY(-8px) scaleY(1.05); } 85% { transform: translateY(0) scaleY(0.9); } }
@keyframes jump { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-14px) rotate(-8deg); } 65% { transform: translateY(-7px) rotate(8deg); } }

/* Toast, snackbar, cheer, confetti */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translate(-50%, 12px); z-index: 50;
  max-width: min(90vw, 480px); padding: 12px 18px; border-radius: 12px; background: var(--toast-bg); color: var(--toast-ink);
  font-weight: 700; font-size: calc(15 * var(--ts)); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.snack {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 60; max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 0 4px 0 18px;
  border-radius: 12px; background: var(--toast-bg); color: var(--toast-ink); font-weight: 700; font-size: calc(15 * var(--ts));
}
.snack-undo { min-height: 48px; padding: 0 16px; border: 0; background: none; color: var(--yellow); font-weight: 800; font-size: calc(15 * var(--ts)); text-transform: uppercase; letter-spacing: 0.04em; }
dialog .snack { position: absolute; }
.cheer { position: fixed; inset: 0; z-index: 40; pointer-events: none; display: flex; align-items: center; justify-content: center; background: var(--cheer-bg, rgba(255, 255, 255, 0.35)); }
.cheer-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 24px; border-radius: 28px; background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 24px rgba(15, 30, 54, 0.2); font-weight: 800; font-size: calc(26 * var(--ts)); white-space: nowrap; color: var(--ink);
  animation: cheer 1.6s ease-out forwards;
}
.cheer-pics { display: flex; justify-content: center; gap: 6px; }
.cheer-pics:empty { display: none; }
.cheer-pics .pic { --pic: 44px; width: var(--pic); height: var(--pic); justify-content: center; animation: hop 0.45s ease-out both; animation-delay: calc(0.25s + var(--i, 0) * 0.12s); }
@keyframes cheer { 0% { transform: scale(0.5); opacity: 0; } 20% { transform: scale(1.1); opacity: 1; } 35% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.05) rotate(3deg); } 85% { opacity: 1; transform: scale(1); } 100% { transform: scale(1); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 41; overflow: hidden; }
.confetti i {
  position: absolute; top: -16px; left: var(--x, 50%); width: 10px; height: 14px; border-radius: 3px;
  background: var(--c, var(--pink)); animation: fall 1.5s ease-in forwards; animation-delay: var(--d, 0s);
}
@keyframes fall { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(var(--dx, 0px), 105dvh) rotate(var(--r, 540deg)); opacity: 0.9; } }

/* Crop sheet */
.crop-body { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.crop-tip { margin: 0; }
.crop-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #eef2f7; border-radius: 12px; padding: 22px; touch-action: none; }
.crop-box { position: relative; line-height: 0; }
.crop-box img { display: block; max-width: calc(100vw - 32px - 44px); max-height: calc(92dvh - 250px); -webkit-user-select: none; user-select: none; pointer-events: none; }
.crop-dim { position: absolute; background: rgba(15, 30, 54, 0.55); pointer-events: none; }
.crop-dim-t { left: 0; right: 0; top: 0; height: calc(var(--cy0, 0) * 100%); }
.crop-dim-b { left: 0; right: 0; bottom: 0; height: calc((1 - var(--cy1, 1)) * 100%); }
.crop-dim-l { left: 0; width: calc(var(--cx0, 0) * 100%); top: calc(var(--cy0, 0) * 100%); bottom: calc((1 - var(--cy1, 1)) * 100%); }
.crop-dim-r { right: 0; width: calc((1 - var(--cx1, 1)) * 100%); top: calc(var(--cy0, 0) * 100%); bottom: calc((1 - var(--cy1, 1)) * 100%); }
.crop-rect {
  position: absolute; left: calc(var(--cx0, 0) * 100%); right: calc((1 - var(--cx1, 1)) * 100%);
  top: calc(var(--cy0, 0) * 100%); bottom: calc((1 - var(--cy1, 1)) * 100%); border: 2px solid var(--yellow); pointer-events: none;
}
.crop-h { position: absolute; padding: 0; border: 0; background: none; pointer-events: auto; touch-action: none; display: flex; align-items: center; justify-content: center; }
.crop-h i { display: block; background: var(--yellow); border: 2px solid var(--navy); border-radius: 6px; }
.crop-h-t, .crop-h-b { left: 50%; width: 72px; height: 44px; margin-left: -36px; }
.crop-h-t { top: -22px; }
.crop-h-b { bottom: -22px; }
.crop-h-t i, .crop-h-b i { width: 44px; height: 12px; }
.crop-h-l, .crop-h-r { top: 50%; width: 44px; height: 72px; margin-top: -36px; }
.crop-h-l { left: -22px; }
.crop-h-r { right: -22px; }
.crop-h-l i, .crop-h-r i { width: 12px; height: 44px; }
.crop-actions { margin-top: 0; }
.crop-actions .btn { flex: 1; min-height: 56px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti, .burst, .plus1, .star { display: none; }
}

@media print {
  html, body { background: #fff; padding: 0; margin: 0; min-height: 0; }
  .appbar, #view-compose, .listhead, .listbar, .modebar, .tickhint, .store, #needChip, .foot, .fab, .dock, .banner, dialog, .toast, .snack, .cheer, .confetti, .mascot, .burst, .sprite, .sr-only { display: none !important; }
  #view-list { display: block !important; }
  main { max-width: none; margin: 0; }
  .sheet-wrap { width: auto !important; height: auto !important; margin: 0; overflow: visible; display: block !important; }
  #sheet { transform: none !important; width: auto; padding: 0; }
  #sheet .page { margin: 0; outline: 0; box-shadow: none; }
}

@media (max-width: 440px) { .t-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .listbar .more-wrap { margin-left: 0; } }
@media (max-width: 399px) { .tagline { display: none; } .lists-btn { margin-left: auto; } }

/* Compose list tiles: stepper and edit button */
.tiles .ltile, .ltile.ghost { padding: 10px 2px 2px; min-height: 0; gap: 2px; --pic: 72px; }
.ltile.ghost {
  position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center;
  border: 1px solid var(--outline); border-radius: 12px; background: #fff; font-weight: 800; font-size: calc(15 * var(--ts)); line-height: 1.15;
}
.ltile:active { background: #fff; }
.ltile .pic { width: var(--pic); height: var(--pic); }
.ltile .tname { min-height: 2.3em; padding: 0 4px; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.lstep { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.lminus, .lplus, .ltile-edit { width: 44px; height: 44px; border: 0; background: none; padding: 0; display: flex; align-items: center; justify-content: center; flex: none; }
.lminus > span, .lplus > span { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--navy); background: #fff; display: flex; align-items: center; justify-content: center; }
.lplus > span { background: var(--yellow); }
.lminus:active > span, .lplus:active > span { transform: scale(0.9); }
.lstep .ic { width: 20px; height: 20px; }
.lqty { flex: 1; min-width: 0; text-align: center; font-size: calc(24 * var(--ts)); font-weight: 800; line-height: 1; }
.lqty.pulse { animation: pulse 0.3s ease-out; }
@media (max-width: 400px) { .lminus { margin-right: -8px; } .lplus { margin-left: -8px; } .lminus > span, .lplus > span { width: 30px; height: 30px; } .lqty { font-size: calc(22 * var(--ts)); } }
.ltile-edit { position: absolute; top: 0; right: 0; }
.ltile-edit > span { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 1.5px solid var(--outline-strong); display: flex; align-items: center; justify-content: center; }
.ltile-edit .ic { width: 18px; height: 18px; }

/* Lists sheet */
.new-list { width: 100%; margin: 4px 0 8px; }
.lists-note { margin: 4px 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--err-soft); color: var(--err); font-size: calc(15 * var(--ts)); font-weight: 700; }
.saved-lists { list-style: none; margin: 0; padding: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.lrow { position: relative; overflow: hidden; border: 1px solid var(--outline); border-radius: 16px; background: var(--surface); }
.lfront { position: relative; z-index: 1; display: flex; align-items: center; padding: 4px 2px 4px 4px; background: inherit; touch-action: pan-y; }
.lswipe {
  position: absolute; top: 0; right: 0; bottom: 0; width: 88px; border: 0; padding: 0; background: var(--err-bg); color: #fff;
  font-weight: 800; font-size: calc(15 * var(--ts)); visibility: hidden;
}
.lrow.peek .lswipe { visibility: visible; }
.lrow :focus-visible { outline-offset: -3px; }
.lrow.is-current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--current-bg); }
.lopen { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 4px 6px; border: 0; border-radius: 12px; background: none; text-align: left; }
.lopen:active { background: var(--tonal); }
.lpics { flex: none; width: 56px; height: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; --pic: 27px; }
.lpics .pic { width: var(--pic); height: var(--pic); }
.ltext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lname { font-size: calc(16 * var(--ts)); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.lname-input { flex: 1; min-width: 0; height: 44px; margin: 0 4px; padding: 0 10px; border: 1.5px solid var(--accent); border-radius: 10px; font-size: calc(16 * var(--ts)); font-weight: 800; outline: none; }
.lmeta { font-size: calc(13 * var(--ts)); color: var(--ink-soft); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lcur { padding: 1px 8px; border-radius: 10px; background: var(--filled); color: #fff; font-size: calc(13 * var(--ts)); font-weight: 800; }
.lact { width: 44px; height: 44px; flex: none; color: var(--ink-soft); }
.lact[data-act="delete"] { color: var(--err); margin-left: 12px; }

/* Custom items */
.pick-grid.has-tools { padding-bottom: 12px; }
.pick-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.pick-tools .btn { flex: 1 1 0; min-width: 0; padding: 0 10px; gap: 6px; font-size: calc(15 * var(--ts)); }
.pick-tools .btn .ic { width: 20px; height: 20px; }
.lists-tools { padding-bottom: 8px; }
.pick-add, .pick-create { grid-column: 1 / -1; }
.pick-new {
  min-height: 150px; border: 2px dashed var(--accent); border-radius: 12px; background: #f4fbfc; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px 6px;
  font-weight: 800; font-size: calc(15 * var(--ts)); line-height: 1.15;
}
.pick-new:active { background: var(--tonal); }
.pick-new .plus { width: 56px; height: 56px; border-radius: 50%; background: var(--filled); color: #fff; display: flex; align-items: center; justify-content: center; }
.pick-new .plus .ic { width: 32px; height: 32px; }
.pick-edit { position: absolute; bottom: 0; right: 0; width: 44px; height: 44px; border: 0; background: none; padding: 0; display: flex; align-items: center; justify-content: center; }
.pick-edit > span { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 1.5px solid var(--outline-strong); display: flex; align-items: center; justify-content: center; }
.pick-edit .ic { width: 18px; height: 18px; }
.form-label { display: block; margin: 14px 0 6px; font-size: calc(15 * var(--ts)); font-weight: 800; color: var(--ink-soft); }
.form-input {
  width: 100%; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--outline-strong); border-radius: 12px;
  background: var(--surface-2); color: var(--ink); font-size: calc(17 * var(--ts)); font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.custom-top { display: flex; gap: 14px; align-items: center; }
.custom-top-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.custom-alts { margin-top: 10px; }
#customSheet .section-title { text-transform: none; letter-spacing: 0; margin: 14px 0 6px; font-size: calc(15 * var(--ts)); }
.form-input[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 1.5px var(--err); }
.custom-actions .error { flex: 0 0 100%; margin: 0 0 2px; }
.custom-actions { border-top: 1px solid var(--outline); flex-wrap: wrap; margin-top: 20px; position: sticky; bottom: calc(-16px - var(--safe-b)); padding: 10px 0 calc(16px + var(--safe-b)); background: var(--surface); }
.custom-actions .btn { flex: 1 1 110px; min-height: 52px; }

/* iOS: probe, links, about sheet, app-only tweaks */
.ts-probe { position: absolute; left: -9999px; top: 0; visibility: hidden; pointer-events: none; }
.setting-link { width: 100%; padding: 0; border: 0; border-bottom: 1px solid var(--outline); background: none; color: inherit; text-align: left; }
.setting-link .ic { color: var(--ink-soft); }
.lname-input { -webkit-user-select: text; user-select: text; }
.about-hero { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 4px 0 8px; text-align: center; }
.about-name { margin: 6px 0 0; font-size: calc(26 * var(--ts)); font-weight: 800; }
.about-version { margin: 0; color: var(--ink-soft); font-size: calc(15 * var(--ts)); }
.about-privacy-line { margin: 8px 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--tonal); font-weight: 700; text-align: center; }
.about-list { list-style: none; margin: 0; padding: 0; }
.about-list li { padding: 12px 0; border-bottom: 1px solid var(--outline); font-size: calc(15 * var(--ts)); }
.about-list a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-text); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.about-link { display: flex; text-decoration: none; }
html.app .credit { display: none; }
html.app body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--safe-t); background: var(--bg); z-index: 30; pointer-events: none; }

@media print {
  :root { color-scheme: light; }
  body.desk { background: #fff; }
  html.app body::before { display: none; }
}

/* Data warning in the text reader dialog */
.data-warn { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line, currentColor); font-size: calc(15 * var(--ts)); font-weight: 700; }
.data-warn.strong { background: var(--tonal); border-color: var(--accent, currentColor); }

/* Adult gate */
.gate-lock { margin: 8px 0 0; font-weight: 800; }
#gateDialog h2 { margin: 4px 0 8px; font-size: calc(20 * var(--ts)); font-weight: 800; }
#gateDialog p { margin: 4px 0; }

/* Dark mode: chrome only; picture surfaces and the paper stay light */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1f5fb; --ink-soft: #a9b6c9; --outline: #2c3a55; --outline-strong: #7f8da5;
    --accent: #4fd1dc; --accent-text: #4fd1dc; --tonal: #17363d; --err: #ff8a80;
    --bg: #0f1724; --surface: #18233a; --surface-2: #1f2b44; --current-bg: #132f3a; --err-soft: #3a1d1d;
    --toast-bg: #2d3b58; --toast-ink: #ffffff; --dock-bg: rgba(15, 23, 36, 0.94); --desk: #0a101b;
    --scrim: rgba(0, 0, 0, 0.6); --cheer-bg: rgba(15, 23, 36, 0.45);
  }
  .tile, .ghost-tile, .ltile, .srow, .pick-main, .pick-new, .pick-edit, .pick-minus, .alt, .emoji-btn, .item-pic, .cheer-card,
  .badge, .plus1, .tickhint, .chip.need, .cat-tile, .crop-stage {
    --ink: #0f1e36; --ink-soft: #4a5a72; --outline: #e2e8f0; --outline-strong: #7a8799;
    --accent: #00838f; --accent-text: #00838f; --tonal: #ddf4f6; --surface: #fff; --surface-2: #fff;
    color: var(--ink);
  }
  .pbar, .lists-count { border-color: var(--outline-strong); }
  body.desk .listhead { border-bottom-color: var(--outline); }
  .lpics, .saisle .pic { background: #fff; border-radius: 10px; }
  .saisle .pic { border-radius: 50%; }
}

/* LEGACY (replaced rules, kept for reference)
.hint li:not(.arrow) { width: 76px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fab {
  position: fixed; right: calc(16px + var(--safe-r)); bottom: calc(16px + var(--safe-b)); z-index: 5;
  height: 56px; padding: 0 20px 0 16px; border: 0; border-radius: 16px; background: var(--filled); color: #fff;
  display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px;
  box-shadow: 0 1px 3px rgba(15, 30, 54, 0.3), 0 4px 8px 3px rgba(15, 30, 54, 0.15);
}
.print-btn .ic { margin-left: -2px; }
#view-list.mode-store .print-btn { width: 48px; padding: 0; background: var(--tonal); color: var(--ink); border-radius: 50%; }
#view-list.mode-store .print-btn span { display: none; }
.seg-icons .ic { display: inline-block; }
.print-btn { min-height: 48px; padding: 0 18px; margin-left: 4px; }

.pbar { height: 14px; margin: 0 16px 8px; border: 1.5px solid var(--navy); border-radius: 7px; background: #fff; overflow: hidden; }
.pbar i { display: block; height: 100%; width: calc(var(--p, 0) * 1%); border-radius: 0 6px 6px 0; background: var(--brand); transition: width 0.3s ease-out, background-color 0.3s; }
.pbar.full { animation: pulse 0.5s ease-out; }
.pbar.full i { background: var(--green); border-radius: 0; }
padding: 10px 12px calc(96px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.srow .dots { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; width: 58px; gap: 3px; }
.srow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--navy); }
.srow .dot:nth-child(5n + 3):not(:last-child) { margin-right: 4px; }
.lname { font-size: 16px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-tools .btn { flex: 1 1 150px; }

Action menu (popover), saved-list row and switch before the iOS pass:
.menu {
  position: absolute; right: 0; top: 52px; min-width: 230px; background: #fff; border: 1px solid var(--outline);
  border-radius: 12px; padding: 6px; z-index: 6; display: flex; flex-direction: column;
}
.menu-item { min-height: 48px; border: 0; background: none; border-radius: 8px; display: flex; align-items: center; gap: 12px; padding: 0 12px; font-weight: 700; text-align: left; }
.menu-item:active { background: var(--tonal); }
@media (min-width: 600px) {
  #overflowMenu { display: flex !important; position: static; flex-direction: row; border: 0; padding: 0; min-width: 0; }
  #moreBtn { display: none; }
  .menu-item span { display: none; }
  .menu-item { padding: 0; width: 48px; justify-content: center; border-radius: 50%; }
}
.lrow { display: flex; align-items: center; gap: 0; border: 1px solid var(--outline); border-radius: 16px; padding: 4px 2px 4px 4px; background: #fff; }
.switch input {
  -webkit-appearance: none; appearance: none; flex: none; width: 52px; height: 32px; border-radius: 16px;
  background: var(--outline-strong); position: relative; margin: 0; transition: background 0.15s;
}
.switch input::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked { background: var(--filled); }
.switch input:checked::after { transform: translateX(20px); }

Compose step hint, inline textarea button, action row and "Mais usados" row
before the picture area:
.hint { display: flex; align-items: flex-start; justify-content: center; gap: 6px; list-style: none; margin: 8px 0 16px; padding: 0; }
.hint li { display: flex; }
.hint .step { width: 76px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; padding: 0; color: inherit; }
.hint .step:active .hc { transform: scale(0.94); }
.hint .step[aria-disabled="true"] { opacity: 0.45; }
.hint .hc { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.hint li:nth-child(1) .hc { background: var(--pink); }
.hint li:nth-child(3) .hc { background: var(--yellow); }
.hint li:nth-child(5) .hc { background: var(--blue); }
.hint .cap { font-size: calc(13 * var(--ts)); font-weight: 700; color: var(--ink-soft); }
.hint .arrow { color: #94a3b8; display: flex; margin-top: 12px; }
.field-btn { position: absolute; right: 4px; top: 4px; }
.actions { display: flex; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 140px; }
#popular .tile { flex: none; width: 88px; min-height: 104px; --pic: 56px; }
#popular .tile .tname { font-size: calc(13 * var(--ts)); }

Picker sheet chips and grid:
.chips { margin: 4px -16px 8px; padding: 2px 16px 6px; }
.chips .chip { flex: none; padding: 0 14px 0 8px; }
.chips .chip[aria-selected="true"] { background: var(--tonal); border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.chip-ic { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: calc(22 * var(--ts)); }
.chip-ic img { width: 28px; height: 28px; object-fit: contain; }
.chip[data-cat="mine"] .chip-ic .ic { width: 24px; height: 24px; color: var(--pink); fill: var(--pink); stroke: var(--navy); stroke-width: 1.5px; stroke-linejoin: round; }
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-bottom: 72px; }
.pick-search { margin: 4px 0 8px; }
.pick-tools { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 72px; }
Dark mode: .hint .hc in the light-surface list;
  .lpics, .saisle .pic, .chip-ic { background: #fff; border-radius: 10px; }
  .saisle .pic, .chip-ic { border-radius: 50%; }
Category cards before the stacked-card cue (single card, faint border):
.cat-tile.has { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cat-tile.cat-popular { background: #fff6d9; border-color: #f2d27a; }
.cat-tile.cat-mine { background: #ffeef2; border-color: #f5b8c6; }
.cat-tile.cat-popular.has, .cat-tile.cat-mine.has { border-color: var(--accent); }

  Adult gate hold button and its divider:
    .gate-hold {
      position: relative; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 64px; margin-top: 12px;
      border: 2px solid var(--accent); border-radius: 32px; background: var(--surface); overflow: hidden; touch-action: none;
      font-weight: 800; font-size: calc(17 * var(--ts));
    }
    .gate-hold.holding { border-color: var(--brand); }
    .gate-fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--g, 0) * 100%); background: var(--brand); opacity: 0.35; }
    .gate-label { position: relative; padding: 0 16px; text-align: center; }
    .gate-or { margin: 16px 0 0; color: var(--ink-soft); font-weight: 700; font-size: calc(15 * var(--ts)); }
*/

/* Storage-full banner */
.save-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; padding: 10px 16px; background: var(--yellow); color: var(--navy); font-weight: 800; font-size: calc(15 * var(--ts)); border-bottom: 1.5px solid var(--navy); }
.save-banner span { flex: 1 1 220px; }

/* Privacy sheet */
.privacy-body h3 { margin: 16px 0 4px; font-size: calc(17 * var(--ts)); font-weight: 800; }
.privacy-body p, .privacy-body li { margin: 6px 0; font-size: calc(15 * var(--ts)); }
.privacy-body ul { padding-left: 20px; margin: 6px 0; }
.privacy-body a { color: var(--accent-text); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* Sheet drag-to-dismiss */
dialog.sheet .sheet-grab, dialog.sheet .sheet-head { touch-action: none; }
dialog.sheet.dragging { animation: none; transition: none; }
dialog.sheet.settling { transition: transform 0.2s ease-out; }
@media (prefers-reduced-motion: reduce) { dialog.sheet.settling { transition: none; } }
html.ios .seg button { min-height: 44px; }
