:root {
  --ground: #F6F3EA; --card: #FFFFFF; --ink: #1F2A24; --muted: #5B6660; --line: #E5E0D3; --line2: #F1EDE3;
  --green: #2E6B3B; --green-d: #1F4D29; --green-t: #E3EEDF; --green-b: #CFDCCB;
  --red: #A63A25; --peach: #F8E4DD; --yellow: #FFF4D6; --yellow-b: #EDD9A0;
  --purple: #5B4A9E; --purple-t: #ECE8F7; --soft: #EFEBE0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: var(--ink); font-family: 'Rubik', system-ui, sans-serif; font-size: 16px; -webkit-tap-highlight-color: transparent; }
#app { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
button, input, select { font: inherit; color: inherit; }
input, select { font-size: 16px; }
a { color: var(--green); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grow { flex: 1; min-width: 0; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

.top { display: flex; align-items: center; gap: 12px; padding: 20px 20px 12px; }
.top > div:first-child { flex: 1; }
h1 { margin: 0; font-size: 26px; font-weight: 700; }
h2 { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sub { font-size: 14px; color: var(--muted); margin-top: 3px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-btn.light { background: rgba(255,255,255,.15); border: none; color: #fff; }

.banner { margin: 0 20px 10px; padding: 10px 14px; min-height: 48px; border-radius: 16px; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 15px; }
.banner.peach { background: var(--peach); } .banner.peach b { color: var(--red); white-space: nowrap; }
.banner.green { background: var(--green-t); }
.banner.yellow { background: var(--yellow); border: 1px solid var(--yellow-b); margin-top: 14px; }
.banner.gray { background: var(--soft); color: var(--muted); }
.avs { display: flex; } .avs .av + .av { margin-inline-start: -8px; border: 2px solid var(--peach); }
.av { border-radius: 50%; color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; }

.addbar { display: flex; gap: 8px; margin: 0 20px; }
.addbar.inner { margin: 0; }
.addbar input, .stack input, .stack select, .kidform input, .reply { flex: 1; min-width: 0; height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); padding: 0 16px; }
.kidform input, .kidform .addbar input { background: var(--ground); }
.sq { width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; }
.primary { background: var(--green); color: #fff; border: none; }
.ghost { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.ghost.red, .red { color: var(--red); }
.green { color: var(--green-d); }
.dark { background: var(--ink); color: #fff; border: none; }
.purple { background: var(--purple); color: #fff; border: none; }
.purple-soft { background: var(--purple-t); color: var(--purple); border: none; }
.soft-green { background: var(--green-t); color: var(--green-d); border: 1px solid var(--green-b); }
.sq.ghost.voice { color: var(--green); }
.voice.rec { background: var(--red); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.no-voice .voice { display: none; }

.chips { display: flex; gap: 8px; padding: 12px 20px 4px; overflow-x: auto; scrollbar-width: none; }
.chips:empty { display: none; }
.chip { flex-shrink: 0; height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--green-b); background: var(--green-t); color: var(--green-d); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }

.scroll { flex: 1; padding: 10px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border: 1px solid #ECE7DB; border-radius: 18px; overflow: hidden; }
.card.pad { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.card.soft { background: var(--soft); border: none; padding: 8px 14px; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 14px; min-height: 54px; border-bottom: 1px solid var(--line2); }
.row:last-child { border-bottom: none; }
.row.big-row { min-height: 62px; } .row.big-row .nm { font-size: 18px; }
.row.fresh { background: #FFF9E8; }
.row.oos { opacity: .55; }
.tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #9AAAA0; background: #fff; flex-shrink: 0; cursor: pointer; padding: 0; }
.tick:active { background: var(--green-t); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: start; background: none; border: none; padding: 4px 0; cursor: pointer; }
.nm { font-size: 16px; font-weight: 500; } .nm.lg { font-size: 18px; font-weight: 700; }
.qty { color: var(--muted); font-weight: 400; }
.note { font-size: 13px; color: var(--muted); }
.mini { height: 36px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 13px; white-space: nowrap; cursor: pointer; }
.mini.on { background: var(--peach); color: var(--red); border-color: #EBC3B6; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; line-height: 1.6; }

.foot { position: sticky; bottom: 0; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); background: var(--ground); border-top: 1px solid var(--line); }
.foot:empty { display: none; }
.foot.center { display: flex; justify-content: center; border-top: none; }
.big { width: 100%; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; font-weight: 700; cursor: pointer; }
.mid { height: 44px; padding: 0 16px; border-radius: 14px; font-size: 16px; font-weight: 600; cursor: pointer; flex: 1; }
.btns { display: flex; gap: 8px; }

.shophead { background: var(--green); color: #fff; padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 12px; margin-top: calc(-1 * env(safe-area-inset-top)); padding-top: calc(20px + env(safe-area-inset-top)); }
.shophead .sub { color: #D6E6D2; }
.hrow { display: flex; align-items: center; gap: 12px; }
.prog { display: flex; align-items: center; gap: 12px; }
.prog .bar { flex: 1; height: 10px; border-radius: 5px; background: rgba(255,255,255,.22); overflow: hidden; }
.prog .bar div { height: 100%; background: #fff; border-radius: 5px; transition: width .3s; }
#fresh .banner { margin-bottom: 0; }
.card.done { background: var(--soft); border: none; padding: 4px 14px; }
.donerow { display: flex; align-items: center; gap: 12px; min-height: 40px; width: 100%; background: none; border: none; text-align: start; color: var(--muted); cursor: pointer; padding: 0; }
.ok { width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.ok svg { width: 14px; height: 14px; stroke-width: 3; }

.req { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.req-top { display: flex; gap: 12px; align-items: flex-start; }
.why { margin-top: 6px; background: var(--ground); border-radius: 10px; padding: 6px 10px; font-size: 14px; }
.reply { height: 44px; border-radius: 12px; }
.hrow2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; font-size: 14px; }

.kidtop h1 { font-size: 30px; }
.kidform { margin: 0 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; border-radius: 24px; }
.kidform label { font-weight: 500; }
.kidh { font-size: 18px; color: var(--ink); margin: 6px 0 0; }
.kidreq { padding: 10px 14px; }
.kidreq .nm { font-size: 18px; }
.pill { font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 12px; white-space: nowrap; }
.pill.wait { background: var(--yellow); color: #7A5A00; } .pill.ok { background: var(--green-t); color: var(--green-d); } .pill.no { background: var(--peach); color: var(--red); }

.linkrow { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 16px; border: none; border-bottom: 1px solid var(--line2); background: none; width: 100%; text-decoration: none; color: var(--ink); text-align: start; font-size: 16px; cursor: pointer; }
.linkrow.red { color: var(--red); }
.log ul { margin: 4px 0 0; padding-inline-start: 20px; font-size: 14px; }

.login { padding: 48px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { font-size: 34px; text-align: center; } .login > .sub { text-align: center; margin: 0 0 10px; }
.login h2 { font-size: 16px; color: var(--ink); margin-top: 14px; }
.google { background: #fff; border: 1px solid var(--line); }
details summary { cursor: pointer; color: var(--muted); padding: 8px 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack label { font-size: 14px; font-weight: 500; }
.kids { display: flex; gap: 12px; }
.kidbtn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border-radius: 20px; border: 2px solid var(--line); background: #fff; font-size: 18px; font-weight: 700; cursor: pointer; }
.kidbtn.sel { border-color: var(--c); }
.err { color: var(--red); text-align: center; font-weight: 500; }

dialog { border: none; border-radius: 22px; padding: 20px; width: min(92vw, 420px); }
dialog::backdrop { background: rgba(31,42,36,.4); }
dialog h2 { font-size: 20px; color: var(--ink); }
dialog .btns { margin-top: 8px; }

#toast { position: fixed; bottom: calc(96px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; display: flex; gap: 14px; align-items: center; width: max-content; max-width: 90vw; z-index: 50; font-size: 15px; }
#toast[hidden] { display: none; }
#toast button { background: none; border: none; color: #BFE0B8; font-weight: 700; cursor: pointer; min-height: 32px; }
.req .reply, .kidform > input { flex: none; }
