/* A warm kitchen: limewash wall, wooden shelves, glass jars, brass and leaf green. */
:root {
  --wall: #f7eddc;
  --wall-2: #efdfc4;
  --card: #fffaf0;
  --card-2: #f6ead4;
  --ink: #3a281a;
  --muted: #86705a;
  --line: #e3cfae;
  --wood: #bd8450;
  --wood-d: #8a5a31;
  --leaf: #2f7448;
  --leaf-ink: #ffffff;
  --terra: #bf5634;
  --amber: #e8a229;
  --red: #bd3526;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-edge: #a9bcb6;
  --sky: linear-gradient(135deg, #ffd9a0, #fbeed2);
  --shadow: 0 6px 18px rgba(92, 56, 24, 0.16);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  /* Evening, with one lamp on. */
  :root {
    --wall: #201710;
    --wall-2: #170f0a;
    --card: #32251a;
    --card-2: #3d2d1f;
    --ink: #f6e8d4;
    --muted: #bfa88c;
    --line: #50392a;
    --wood: #8d5f37;
    --wood-d: #5d3c20;
    --leaf: #3f9460;
    --terra: #e07a55;
    --red: #ec6a58;
    --glass: rgba(255, 244, 222, 0.14);
    --glass-edge: #7f8c86;
    --shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  color: var(--ink);
  background: radial-gradient(120% 60% at 15% 0%, rgba(255, 196, 110, 0.28), transparent 60%), linear-gradient(var(--wall), var(--wall-2)) var(--wall-2);
  background-attachment: fixed;
}
body[data-sky='day'] { --sky: linear-gradient(135deg, #bfe2f2, #fbeed2); }
body[data-sky='evening'] { --sky: linear-gradient(135deg, #f3a56a, #f8d9a6); }
body[data-sky='night'] { --sky: linear-gradient(135deg, #2c3a63, #6b5a7d); }
body.locked { overflow: hidden; }
#app { max-width: 620px; margin: 0 auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
h1 { font-size: 1.35rem; margin: 0.4rem 0; }
h2 { font-size: 1.05rem; margin: 1rem 0 0.2rem; display: flex; gap: 0.4rem; align-items: center; }
h3 { font-size: 0.98rem; margin: 1.1rem 0 0.5rem; }
h4 { font-size: 0.82rem; color: var(--muted); margin: 0.9rem 0 0.3rem; }

/* ---------- frame ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
  padding: calc(0.6rem + env(safe-area-inset-top)) 16px 0.6rem;
  background: var(--card);
  border-bottom: 6px solid var(--wood);
  box-shadow: var(--shadow);
}
.where { flex: 1; min-width: 0; min-height: 52px; padding: 0; text-align: left; }
.where b { display: flex; align-items: center; gap: 0.35rem; font-size: 1.15rem; }
.where b span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.where b i { font-style: normal; color: var(--terra); }
.where small { color: var(--muted); }
.kitchens { flex: 0 0 100%; min-width: 0; display: flex; gap: 0.5rem; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.kitchens::-webkit-scrollbar { display: none; }
.kit { flex: 0 0 auto; display: flex; align-items: center; gap: 0.4rem; min-height: 48px; max-width: 78%; padding: 0.2rem 0.8rem; border-radius: 24px; background: var(--card-2); border: 3px solid transparent; }
.kit.on { border-color: var(--terra); background: var(--wall); }
.kit span { font-size: 1.5rem; }
.kit b { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kit i { flex: 0 0 auto; font: 700 0.72rem/1 system-ui; padding: 5px 8px; border-radius: 12px; background: var(--red); color: #fff; }
.kit.new { width: 48px; justify-content: center; padding: 0; font-size: 1.5rem; border: 2px dashed var(--wood); background: none; }
.kitcard { display: flex; align-items: center; gap: 0.9rem; width: 100%; margin-top: 0.7rem; padding: 0.8rem 1rem; border-radius: 24px; background: var(--card); border: 3px solid transparent; box-shadow: var(--shadow); text-align: left; }
.kitcard.on { border-color: var(--terra); }
.kitcard > span { font-size: 2.8rem; }
.kitcard div { flex: 1; min-width: 0; }
.kitcard b { display: block; font-size: 1.1rem; overflow-wrap: anywhere; }
.kitcard small { color: var(--muted); }
.kitcard p { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.35rem 0 0; }
.kitcard p i { font-style: normal; font-weight: 700; font-size: 0.8rem; padding: 2px 10px; border-radius: 12px; background: var(--card-2); }
.kitcard p i.need { background: var(--red); color: #fff; }
.kitcard em { font-style: normal; font-size: 1.6rem; font-weight: 800; color: var(--terra); }
.sky { width: 52px; height: 52px; border-radius: 26px 26px 8px 8px; display: grid; place-items: center; font-size: 1.5rem; background: var(--sky); border: 4px solid var(--wood-d); }
.top .face { font-size: 2rem; width: 52px; height: 52px; border-radius: 50%; background: var(--card-2); }
main { padding: 0.5rem 12px calc(120px + env(safe-area-inset-bottom)); }
main.tab-buy { padding-bottom: calc(200px + env(safe-area-inset-bottom)); }
main.has-fab { padding-bottom: calc(180px + env(safe-area-inset-bottom)); }
main.tab-buy.has-fab { padding-bottom: calc(250px + env(safe-area-inset-bottom)); }
.fab { position: fixed; z-index: 5; right: max(12px, calc(50% - 298px)); bottom: calc(100px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 0.35rem; min-height: 60px; padding: 0 1.2rem 0 1rem; border-radius: 30px; background: var(--leaf); color: var(--leaf-ink); border: 3px solid var(--card); box-shadow: 0 8px 20px rgba(30, 60, 35, 0.4); }
.fab.raised { bottom: calc(166px + env(safe-area-inset-bottom)); }
.fab span { font-size: 2rem; line-height: 1; }
.fab b { font-size: 0.95rem; }
.fab:active { transform: scale(0.95); }

.bottom {
  position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 620px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 0.3rem 4px calc(0.3rem + env(safe-area-inset-bottom));
  background: var(--card); border-top: 5px solid var(--wood); box-shadow: 0 -6px 18px rgba(60, 35, 12, 0.18);
}
.nav, .mic { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; padding: 0.3rem 0; border-radius: 16px; }
.nav span { position: relative; font-size: 1.65rem; line-height: 1.2; filter: grayscale(0.25); opacity: 0.85; }
.nav.on { background: var(--card-2); }
.nav.on span { filter: none; opacity: 1; }
.nav b, .mic b { font-size: 0.68rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav i { position: absolute; top: -4px; right: -12px; min-width: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font: 700 0.72rem/20px system-ui; font-style: normal; }
.mic span { width: 74px; height: 74px; margin-top: -40px; border-radius: 50%; display: grid; place-items: center; font-size: 2.2rem; background: radial-gradient(circle at 35% 28%, #ee8a62, var(--terra)); border: 5px solid var(--card); box-shadow: 0 8px 18px rgba(150, 60, 30, 0.45); }
.mic:active span { transform: scale(0.94); }

/* ---------- category chips ---------- */
.chips { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.5rem 2px 0.6rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; width: 70px; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.chip span { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 1.75rem; background: var(--card); box-shadow: var(--shadow); border: 3px solid transparent; }
.chip.on span { border-color: var(--terra); background: var(--card-2); }
.chip small { font-size: 0.68rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- the shelf ---------- */
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 0.9rem; }
@media (min-width: 520px) { .shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  min-width: 0; padding: 0.35rem 6px 0;
  /* the plank under every item joins into one long shelf */
  border-bottom: 12px solid var(--wood);
  box-shadow: 0 7px 0 -2px var(--wood-d), 0 14px 12px -6px rgba(70, 40, 10, 0.35);
}
.tile .art { width: 100%; max-width: 96px; height: auto; aspect-ratio: 100 / 112; transition: transform 0.12s; }
.tile:active:not(:disabled) .art { transform: scale(0.93); }
.tile b { font-size: 0.82rem; line-height: 1.2; text-align: center; min-height: 2.4em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tile em { font-style: normal; font-weight: 700; font-size: 0.8rem; background: var(--card); border-radius: 10px; padding: 0 8px; margin-bottom: 5px; box-shadow: 0 1px 4px rgba(60, 35, 12, 0.18); white-space: nowrap; }
.meter { width: 62%; height: 6px; margin: 3px 0 2px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--leaf); }
.tile.low .meter i { background: var(--amber); }
.tile.low em { background: var(--amber); color: #3a2400; }
.tile.out em { background: var(--red); color: #fff; }
.tile.out .art:not(.art-photo) .glass-edge { stroke: var(--red); stroke-width: 3; stroke-dasharray: 6 4; }
.tile.out .art-photo { filter: grayscale(1) opacity(0.6); }
.tile.ticked { background: linear-gradient(transparent 10%, rgba(47, 116, 72, 0.2)); border-radius: 16px 16px 0 0; }
.tile.have .art { opacity: 0.45; }
.tick, .who { position: absolute; top: 2px; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.tick { right: 4px; background: var(--leaf); color: var(--leaf-ink); font-weight: 800; box-shadow: var(--shadow); }
.who { left: 2px; background: var(--card); font-size: 1.15rem; box-shadow: var(--shadow); }
.tile.add .plus { width: 76px; height: 76px; margin-bottom: 14px; border-radius: 22px; display: grid; place-items: center; font-size: 2.3rem; background: var(--glass); border: 3px dashed var(--wood); }
.tile.add b { margin-bottom: 20px; min-height: 0; }
.shelf.demo { pointer-events: none; width: 100%; max-width: 360px; margin: 0.5rem auto; }
.shelf.demo .tile { padding-bottom: 2px; }

.art { display: block; flex: 0 0 auto; }
.art .glass { fill: var(--glass); }
.art .glass-edge { stroke: var(--glass-edge); stroke-width: 2; }
.art .shine { stroke: #fff; stroke-width: 4; stroke-linecap: round; opacity: 0.55; fill: none; }
.art .faded { filter: grayscale(1); opacity: 0.3; }
.art text { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.art-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 22px; border: 4px solid var(--card); box-shadow: var(--shadow); display: block; }

/* ---------- buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 54px; padding: 0.6rem 1.1rem; border-radius: 18px; font-weight: 700; text-align: center; text-decoration: none; background: var(--leaf); color: var(--leaf-ink); box-shadow: var(--shadow); }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: 0.45; box-shadow: none; }
.btn.ghost { background: var(--card); color: var(--ink); border: 2px solid var(--line); }
.btn.amber { background: var(--amber); color: #3a2400; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-text { color: var(--red); }
.btn.whatsapp { background: #1f8a4c; color: #fff; }
.btn.wide { display: flex; width: 100%; margin-top: 0.8rem; }
.btn.huge-btn { min-height: 66px; font-size: 1.15rem; }
.btn.sticky { position: sticky; bottom: 4px; z-index: 3; }
.btn.file { position: relative; cursor: pointer; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.row { display: flex; gap: 0.6rem; margin-top: 0.8rem; }
.row .btn { flex: 1; min-width: 0; }
.round { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); }
.round:disabled { opacity: 0.35; }
.field { display: block; margin-top: 0.9rem; }
.field > span:first-child { display: block; margin-bottom: 0.35rem; font-weight: 600; }
input:not([type='file']) { width: 100%; min-height: 54px; padding: 0.5rem 0.9rem; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font-size: 1.1rem; }
input:focus { outline: none; border-color: var(--terra); }
input.pin { letter-spacing: 0.5em; font-size: 1.6rem; text-align: center; }
input.huge-input { font-size: 2rem; text-align: center; font-weight: 700; }
.with-mic { display: flex; gap: 0.5rem; align-items: center; }
.mic-mini.hot, .bigmic.hot { animation: pulse 1.1s infinite; }
.stepper { display: flex; align-items: center; gap: 0.5rem; }
.stepper .round { background: var(--card-2); font-size: 1.9rem; }
.stepper label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.3rem; padding-right: 0.6rem; border: 2px solid var(--line); border-radius: 16px; background: var(--card); }
.stepper input:not([type='file']) { border: 0; background: none; text-align: right; font-size: 1.4rem; font-weight: 700; min-width: 0; padding-right: 0; appearance: textfield; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { appearance: none; }
.stepper small { color: var(--muted); white-space: nowrap; }
.money { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; font-weight: 700; font-size: 1.2rem; }
.money input:not([type='file']) { min-height: 46px; min-width: 0; }

.picks { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.6rem 2px; }
.pick { flex: 0 0 auto; width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 1.9rem; background: var(--card); border: 3px solid transparent; box-shadow: var(--shadow); }
.pick.on { border-color: var(--terra); background: var(--card-2); }
.pick .art { width: 44px; height: 49px; }
.art-picks .pick { height: 66px; }
.langs, .units, .speechlang { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin: 0.6rem 0; }
.lang { min-height: 44px; padding: 0.35rem 0.9rem; border-radius: 22px; background: var(--card); border: 2px solid var(--line); font-weight: 600; }
.lang.on { background: var(--terra); border-color: var(--terra); color: #fff; }

/* ---------- screens ---------- */
.empty { text-align: center; color: var(--muted); padding: 1.5rem 0.5rem; }
.huge { font-size: 4.5rem; line-height: 1.2; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.4rem 0; }
.hint.warn, .status.warn { color: var(--terra); font-weight: 600; }
.banner { display: flex; align-items: center; gap: 0.7rem; width: 100%; margin: 0.4rem 0; padding: 0.8rem 1rem; border-radius: 20px; background: var(--amber); color: #3a2400; text-align: left; box-shadow: var(--shadow); }
.banner span { font-size: 2rem; }
.banner b { flex: 1; }
.banner i { font-style: normal; font-size: 2rem; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0.4rem 0; }
.pagehead h1 { min-width: 0; overflow-wrap: anywhere; }
.count { display: inline-block; min-width: 30px; padding: 0 8px; border-radius: 15px; background: var(--red); color: #fff; font-size: 1rem; text-align: center; vertical-align: middle; }
.actionbar { position: fixed; z-index: 4; left: 0; right: 0; bottom: calc(88px + env(safe-area-inset-bottom)); max-width: 620px; margin: 0 auto; display: flex; gap: 0.6rem; padding: 0.5rem 12px; }
.actionbar .btn:last-child { flex: 1; }
.actionbar .btn:disabled { opacity: 1; background: var(--card-2); color: var(--muted); border: 2px solid var(--line); box-shadow: var(--shadow); }

.welcome { padding: calc(1rem + env(safe-area-inset-top)) 16px 2rem; max-width: 460px; margin: 0 auto; }
.welcome.wide-page { max-width: 620px; }
.welcome .foot { position: sticky; bottom: 8px; z-index: 3; margin-top: 1.4rem; }
.brand { font-size: 2.1rem; margin: 1rem 0 0; font-family: Georgia, 'Noto Serif', serif; }
.tagline { color: var(--muted); margin: 0.2rem 0 0.6rem; }
.face.xl { display: inline-grid; place-items: center; width: 108px; height: 108px; border-radius: 50%; font-size: 3.8rem; background: var(--card); border: 6px solid var(--wood); box-shadow: var(--shadow); }

.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 0.7rem; }
.person { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.8rem 0.3rem; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); min-width: 0; }
.person.mine { outline: 3px solid var(--amber); }
.person .face { font-size: 2.8rem; line-height: 1.15; }
.person b { max-width: 100%; overflow-wrap: anywhere; }
.person.new { background: var(--glass); border: 3px dashed var(--wood); box-shadow: none; justify-content: center; }
.tags { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tag { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 1px 8px; border-radius: 10px; background: var(--card-2); }
.tag.head { background: #f4d47a; color: #4a3200; }
.tag.key { background: var(--leaf); color: var(--leaf-ink); }
.tag.low { background: var(--amber); color: #3a2400; }

.spend { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.7rem; margin-bottom: 0.4rem; border-radius: 18px; background: var(--card); box-shadow: 0 2px 8px rgba(60, 35, 12, 0.1); }
.spend .art { width: 46px; height: 52px; }
.spend .art-photo { height: 46px; }
.spend > div { flex: 1; min-width: 0; }
.spend b { display: block; overflow-wrap: anywhere; line-height: 1.25; }
.spend small { color: var(--muted); }
.spend .money { flex: 0 0 120px; margin: 0; }
.spend .round { width: 44px; height: 44px; font-size: 1.2rem; }
.spend.undone { opacity: 0.45; text-decoration: line-through; }
.face.sm { font-size: 1.6rem; }
.delta { font-weight: 800; white-space: nowrap; font-size: 0.9rem; }
.delta.up { color: var(--leaf); }
.delta.down { color: var(--terra); }
.price { font-weight: 800; white-space: nowrap; }
button.price { min-height: 44px; padding: 0 0.8rem; border-radius: 14px; border: 2px solid var(--line); background: var(--card-2); }
button.price.missing { border-style: dashed; border-color: var(--terra); color: var(--terra); font-size: 0.85rem; }

.month { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0.5rem 0; }
.month h2 { margin: 0; text-align: center; }
.total { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1.2rem; border-radius: 26px; background: linear-gradient(140deg, var(--wood), var(--wood-d)); color: #fff8ea; box-shadow: var(--shadow); }
.total span { font-size: 3rem; }
.total small { display: block; opacity: 0.85; }
.total b { font-size: 2.3rem; line-height: 1.1; }
.bar { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.bar > span { font-size: 1.8rem; width: 42px; text-align: center; }
.bar > div { flex: 1; min-width: 0; }
.bar p { display: flex; justify-content: space-between; margin: 0 0 3px; }
.bar i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--amber), var(--terra)); }
.trend { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 6px; margin-top: 1rem; padding: 0.7rem 0.5rem; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.trend div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-width: 0; }
.trend small { font-size: 0.62rem; color: var(--muted); white-space: nowrap; }
.trend i { width: 70%; border-radius: 8px 8px 3px 3px; background: var(--wood); opacity: 0.6; }
.trend .on i { background: var(--terra); opacity: 1; }
.trend b { font-size: 0.72rem; }

/* ---------- install on the home screen ---------- */
.installbar { display: flex; align-items: stretch; gap: 4px; margin: 0.4rem 0; border-radius: 20px; background: var(--card); border: 2px solid var(--leaf); box-shadow: var(--shadow); }
.installbar button { display: flex; align-items: center; gap: 0.7rem; flex: 1; min-width: 0; min-height: 60px; padding: 0.5rem 0.7rem; text-align: left; }
.installbar img { width: 42px; height: 42px; border-radius: 10px; }
.installbar b { flex: 1; min-width: 0; }
.installbar span { font-size: 1.8rem; }
.installbar .no { flex: 0 0 48px; justify-content: center; color: var(--muted); }
.appicon { width: 96px; height: 96px; border-radius: 24px; box-shadow: var(--shadow); }
.steps { list-style: none; margin: 0.8rem 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.6rem; padding: 0.8rem; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.steps i { flex: 0 0 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; font: 800 0.95rem system-ui; background: var(--terra); color: #fff; }
.steps span { flex: 0 0 48px; display: grid; place-items: center; font-size: 2rem; font-weight: 800; }
.steps svg { width: 38px; height: 38px; color: #1c74d8; }
.steps b { min-width: 0; }

/* ---------- bottom sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(30, 16, 4, 0.5); }
.sheet { position: relative; width: 100%; max-width: 620px; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px calc(1.2rem + env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; background: var(--wall); border-top: 8px solid var(--wood); animation: rise 0.22s ease-out; }
.grab { display: block; width: 100%; height: 30px; position: sticky; top: 0; z-index: 4; background: var(--wall); }
.grab::after { content: ''; display: block; width: 56px; height: 6px; margin: 0 auto; border-radius: 3px; background: var(--line); }
.ask { font-size: 1.15rem; font-weight: 600; }
.hero { display: flex; align-items: center; gap: 1rem; }
.hero .art { width: 120px; height: 134px; }
.hero .art-photo { height: 120px; }
.hero h1 { margin: 0; overflow-wrap: anywhere; }
.hero .qty { font-size: 2rem; font-weight: 800; margin: 0.1rem 0; }
.hero.out .qty { color: var(--red); }
.hero div { min-width: 0; }
.hero .tag { margin-right: 4px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 0.6rem; }
.big { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 92px; border-radius: 24px; background: var(--card); border: 3px solid var(--terra); box-shadow: var(--shadow); }
.big:active { transform: scale(0.95); }
.big span { font-size: 1.8rem; line-height: 1.1; color: var(--terra); font-weight: 800; }
.big.s1 span { font-size: 2.3rem; }
.big.s2 span { font-size: 2.8rem; }
.big b { max-width: 100%; font-size: 0.95rem; text-align: center; overflow-wrap: anywhere; }
.big.finish { border-color: var(--red); }
.wantbox { margin-top: 1rem; padding: 0.8rem; border-radius: 22px; background: var(--card-2); }
.wantbox p { margin: 0 0 0.5rem; font-weight: 700; }
.boss { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 3px dashed var(--line); }
.boss button { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; min-height: 84px; padding: 0.6rem 0.2rem; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.boss span { font-size: 2rem; }
.boss b { max-width: 100%; font-size: 0.8rem; text-align: center; overflow-wrap: anywhere; }
@media (max-width: 360px) {
  .nav b, .mic b { font-size: 0.6rem; }
  .big b { font-size: 0.82rem; }
}
.loadrow { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.7rem; margin-top: 0.6rem; border-radius: 22px; background: var(--card-2); }
.loadrow > .art { width: 64px; height: 72px; }
.loadrow > .art-photo { height: 64px; }
.loadrow > div { flex: 1; min-width: 0; }
.loadrow h3 { display: flex; justify-content: space-between; gap: 0.5rem; margin: 0 0 0.4rem; }
.loadrow.off { opacity: 0.55; }
.x { min-width: 36px; min-height: 32px; }
.countrow { margin-top: 0.4rem; padding-bottom: 0.9rem; border-bottom: 3px dashed var(--line); }
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.3rem; margin-bottom: 0.6rem; }
.level { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 0.3rem 0; border-radius: 16px; border: 3px solid transparent; background: var(--card); }
.level .art { width: 100%; max-width: 58px; height: auto; aspect-ratio: 100 / 112; }
.level.on { border-color: var(--leaf); background: var(--card-2); }
.level small { font-size: 0.7rem; font-weight: 700; white-space: nowrap; }
.switch { display: flex; align-items: center; gap: 0.8rem; width: 100%; margin-top: 0.9rem; padding: 0.8rem; border-radius: 20px; background: var(--card); text-align: left; box-shadow: var(--shadow); }
.switch > span { font-size: 1.8rem; }
.switch div { flex: 1; min-width: 0; }
.switch small { display: block; color: var(--muted); }
.switch i { position: relative; flex: 0 0 auto; width: 58px; height: 32px; border-radius: 16px; background: var(--line); transition: background 0.15s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.switch.on i { background: var(--leaf); }
.switch.on i::after { left: 29px; }
.linkbox { margin-top: 0.8rem; font-size: 0.85rem !important; }

/* ---------- voice ---------- */
.modes { display: flex; gap: 0.6rem; }
.mode { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 0.6rem 0.2rem; border-radius: 22px; background: var(--card); border: 3px solid transparent; box-shadow: var(--shadow); }
.mode span { font-size: 2rem; }
.mode b { font-size: 0.8rem; text-align: center; }
.mode.on.use { border-color: var(--terra); background: var(--card-2); }
.mode.on.want { border-color: var(--amber); background: var(--card-2); }
.mode.on.load { border-color: var(--leaf); background: var(--card-2); }
.bigmic { display: grid; place-items: center; width: 150px; height: 150px; margin: 1.4rem auto 0.6rem; border-radius: 50%; font-size: 4.5rem; background: radial-gradient(circle at 35% 28%, #ee8a62, var(--terra)); box-shadow: 0 10px 26px rgba(150, 60, 30, 0.45); }
.bigmic.small { width: 90px; height: 90px; font-size: 2.6rem; margin-top: 1rem; }
.status { text-align: center; font-weight: 600; margin: 0.4rem 0; }
.partial { text-align: center; color: var(--muted); min-height: 1.4em; margin: 0; overflow-wrap: anywhere; }
.example { text-align: center; font-size: 1.15rem; padding: 0.4rem 1rem; color: var(--muted); }
.typed { display: flex; gap: 0.5rem; align-items: center; }

.toast { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(104px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1rem; border-radius: 20px; background: #2f2015; color: #fff4e2; font-weight: 600; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4); visibility: hidden; opacity: 0; transform: translateY(12px); transition: 0.2s; }
.toast.show { visibility: visible; opacity: 1; transform: none; }
.toast.bad { background: #8f2418; }
.toast span { flex: 1; }
.toast button { min-height: 44px; padding: 0 0.9rem; border-radius: 14px; background: var(--amber); color: #3a2400; font-weight: 800; white-space: nowrap; }

.spin { animation: spin 1.4s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { transform: translateY(60px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(191, 86, 52, 0.6); } 100% { box-shadow: 0 0 0 28px rgba(191, 86, 52, 0); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
