:root{
  --broth:#e8741f; --broth-ink:#fff; --nori:#1f3d2f; --stat-ink:#fff8ec; --cream:#fff8ec; --card:#fff;
  --ink:#2a2118; --muted:#7a6a58; --line:#ecdcc4; --chip:#fbead0; --danger:#c0392b; --star:#f2a900; --ok:#2e7d4f;
  --font-display:'Avenir Next','Trebuchet MS',system-ui,sans-serif;
  --font-body:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  color-scheme:light dark;
}
@media (prefers-color-scheme:dark){:root{
  --broth:#f08a3a; --broth-ink:#1a120a; --nori:#8fc7a6; --stat-ink:#14110d; --cream:#14110d; --card:#201b15;
  --ink:#f4ead9; --muted:#b3a38e; --line:#3a3128; --chip:#2e261d; --danger:#ff7b6b; --star:#ffc233; --ok:#7fd1a0}}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--cream);color:var(--ink);font:400 16px/1.45 var(--font-body);min-height:100vh;padding-bottom:120px;-webkit-tap-highlight-color:transparent}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:3px solid var(--broth);outline-offset:2px}
h1,h2,h3{font-family:var(--font-display);margin:0;text-wrap:balance}
.wrap{max-width:720px;margin:0 auto;padding:0 16px}
header{padding:max(20px,env(safe-area-inset-top)) 0 4px}
.head-row{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
header h1{font-size:2rem;font-weight:800;color:var(--nori);letter-spacing:-.01em}
header p{margin:2px 0 0;color:var(--muted)}
.head-btns{display:flex;gap:6px}
.iconbtn{width:46px;height:46px;border-radius:14px;border:2px solid var(--line);background:var(--card);font-size:1.3rem;line-height:1;padding:0}
.status{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;font-size:.82rem;color:var(--muted);min-height:20px;margin:6px 0}
.badge{border:0;border-radius:999px;background:var(--broth);color:var(--broth-ink);font-weight:800;padding:6px 12px;min-height:36px}
.badge.err{background:var(--danger);color:#fff}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0}
.stat{background:var(--nori);color:var(--stat-ink);border-radius:16px;padding:10px 12px;min-width:0}
.stat b{display:block;font:800 1.4rem var(--font-display);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.stat span{font-size:.78rem;opacity:.85}
.tools{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.row{display:flex;gap:8px}
.input,select{width:100%;min-height:46px;padding:8px 12px;border-radius:14px;border:2px solid var(--line);background:var(--card)}
textarea.input{min-height:80px}
.btn{min-height:46px;padding:8px 16px;border-radius:14px;border:2px solid var(--line);background:var(--card);font-weight:700}
.btn.primary{background:var(--broth);color:var(--broth-ink);border-color:var(--broth)}
.btn.danger{background:var(--danger);border-color:var(--danger);color:#fff}
.btn.ghost{background:transparent}
.btn.warn{color:var(--danger)}
.btn[disabled]{opacity:.5;cursor:default}
.filters{display:none;grid-template-columns:1fr 1fr;gap:8px;background:var(--chip);padding:12px;border-radius:16px}
.filters.open{display:grid}
.filters label{display:flex;flex-direction:column;gap:4px;font-size:.8rem;font-weight:700;color:var(--muted);min-width:0}
.span2{grid-column:1/-1}
.list{display:flex;flex-direction:column;gap:12px;padding:0;margin:0;list-style:none}
.card{display:flex;gap:12px;width:100%;text-align:left;background:var(--card);border:2px solid var(--line);border-radius:20px;padding:10px;align-items:stretch}
.card.top1{border-color:#e0b100;box-shadow:0 0 0 2px #e0b10040}
.card.top2{border-color:#a9b2bb}.card.top3{border-color:#c07a3c}
.card.pending{border-style:dashed;border-color:var(--broth)}
.thumb{width:92px;height:92px;flex:none;border-radius:14px;background:var(--chip);display:grid;place-items:center;font-size:2.2rem;overflow:hidden}
.thumb img,.hero img,.photo-prev img{width:100%;height:100%;object-fit:cover;display:block}
.info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.brand{font-size:.78rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--broth)}
.name{font:800 1.08rem/1.2 var(--font-display);overflow-wrap:anywhere}
.meta{font-size:.85rem;color:var(--muted)}
.tag{display:inline-block;align-self:flex-start;font-size:.72rem;font-weight:800;background:var(--broth);color:var(--broth-ink);border-radius:8px;padding:1px 8px}
.mini{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:.82rem;font-variant-numeric:tabular-nums}
.rank{display:flex;flex-direction:column;align-items:center;justify-content:space-between;min-width:56px}
.rank .pos{font:800 1.3rem var(--font-display)}
.score{background:var(--broth);color:var(--broth-ink);border-radius:12px;padding:2px 8px;font:800 1.1rem var(--font-display);font-variant-numeric:tabular-nums}
.empty{text-align:center;padding:32px 16px;background:var(--card);border:2px dashed var(--line);border-radius:20px}
.empty .big{font-size:3rem}
.empty ol{text-align:left;margin:12px auto;max-width:420px;padding-left:22px}
.empty .btn{margin-top:8px}
.fab{position:fixed;right:max(16px,calc(50% - 344px));bottom:calc(20px + env(safe-area-inset-bottom));width:64px;height:64px;border-radius:50%;border:0;background:var(--broth);color:var(--broth-ink);font-size:2.2rem;line-height:1;box-shadow:0 6px 18px #0004;z-index:5}
.overlay{position:fixed;inset:0;background:#0009;z-index:20;display:flex;align-items:flex-end;justify-content:center}
.overlay.center{align-items:center;padding:16px}
.sheet{background:var(--cream);width:100%;max-width:720px;max-height:94%;overflow-y:auto;border-radius:24px 24px 0 0;padding:16px 16px calc(20px + env(safe-area-inset-bottom))}
.overlay.center .sheet{border-radius:24px;max-width:420px}
.sheet h2{font-size:1.5rem;color:var(--nori);margin-bottom:12px}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.field>label,.field>.lbl{font-weight:800;font-size:.9rem}
.stack{display:flex;flex-direction:column;gap:8px}
.stars{display:flex;gap:2px}
.star{width:48px;height:48px;border:0;background:none;font-size:2rem;line-height:1;padding:0;color:var(--line)}
.star.on{color:var(--star)}
.chilis{display:flex;flex-wrap:wrap;gap:2px;align-items:center}
.chili{width:46px;height:46px;border:0;background:none;font-size:1.7rem;padding:0;opacity:.28;filter:grayscale(1)}
.chili.on{opacity:1;filter:none}
.chili0{min-height:46px;padding:0 12px;border-radius:14px;border:2px solid var(--line);background:var(--card);font-weight:700}
.chili0.on{background:var(--nori);color:var(--stat-ink);border-color:var(--nori)}
.photo-prev,.hero{width:100%;aspect-ratio:4/3;border-radius:16px;background:var(--chip);display:grid;place-items:center;overflow:hidden;color:var(--muted)}
.hero{font-size:5rem;margin-bottom:12px;border-radius:18px}
.drow{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid var(--line);gap:12px}
.drow .stars,.drow .chilis{pointer-events:none}
.drow .star,.drow .chili{width:26px;height:26px;font-size:1.3rem}
.actions{display:flex;gap:8px;margin-top:16px}
.actions .btn{flex:1}
.full{width:100%;margin-top:8px}
.hint{font-size:.8rem;color:var(--muted)}
.err{color:var(--danger);font-weight:700;font-size:.9rem;margin:0 0 8px}
.okmsg{color:var(--ok);font-weight:700;font-size:.9rem}
.qitem{padding:10px 0;border-bottom:1px solid var(--line)}
.qitem .actions{margin-top:6px}
.toasts{position:fixed;left:0;right:0;top:max(10px,env(safe-area-inset-top));z-index:40;display:flex;flex-direction:column;gap:8px;align-items:center;padding:0 12px;pointer-events:none}
.toast{pointer-events:auto;max-width:560px;width:100%;display:flex;gap:12px;align-items:center;justify-content:space-between;background:var(--nori);color:var(--stat-ink);padding:10px 14px;border-radius:14px;font-weight:700;box-shadow:0 6px 18px #0004}
.toast.err{background:var(--danger);color:#fff}
.toast button{background:#fff3;border:0;color:inherit;border-radius:10px;min-width:44px;min-height:36px}
@media (prefers-reduced-motion:no-preference){.card{transition:transform .12s}.card:active{transform:scale(.985)}}
.photo-inner{width:100%;height:100%;display:grid;place-items:center;font-size:3rem}
