* { box-sizing: border-box; }
:root {
  --main: #15803d; --main-dark: #166534; --bg: #f1f5f4; --card: #fff;
  --text: #1f2937; --muted: #6b7280; --line: #e5e7eb; --good: #15803d; --bad: #b91c1c;
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, label, input, select { touch-action: manipulation; -webkit-tap-highlight-color: rgba(21,128,61,.15); }
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-cancel-button { display: none; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 16px; line-height: 1.5; }
body { padding-bottom: env(safe-area-inset-bottom); }
.hidden { display: none !important; }
header { position: sticky; top: 0; z-index: 5; background: var(--main); color: #fff;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 0; }
header h1 { margin: 0 0 6px; font-size: 18px; }
nav { display: flex; gap: 4px; }
.tab { flex: 1; background: transparent; color: #dcfce7; border: 0; border-bottom: 3px solid transparent;
  padding: 8px 0; font-size: 15px; border-radius: 0; }
.tab.active { color: #fff; border-bottom-color: #fff; font-weight: bold; }
.screen { padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto;
  padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
.trialBanner { background: #fef3c7; color: #92400e; text-align: center; font-size: 12px; padding: 6px 10px; }
.offline { background: #7f1d1d; color: #fff; text-align: center; font-size: 13px; padding: 6px; }
.verdict { margin: 8px 0; padding: 10px; border-radius: 8px; font-weight: bold; text-align: center; }
.verdict.ok { background: #dcfce7; color: var(--good); }
.verdict.mid { background: #fef9c3; color: #a16207; }
.verdict.ng { background: #fee2e2; color: var(--bad); }
.prodcard.selected { outline: 3px solid var(--main); }
.shot input:disabled + span { opacity: .6; }
.grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 6px; }
.noimg { width: 52px; height: 52px; border-radius: 6px; background: #e5e7eb; flex-shrink: 0; }
#calc .row { margin-top: 8px; }
#shipSel { margin-top: 0; margin-bottom: 4px; font-size: 15px; }
.shipInfo { margin: 0 0 10px; }
#calc .row .wide { flex: 1; padding: 12px 6px; font-size: 15px; }
.card { background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.card.warn { background: #fef3c7; }
.card h2 { font-size: 16px; margin: 0 0 10px; }
.center { text-align: center; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
input, select { width: 100%; font-size: 16px; padding: 10px; border: 1px solid var(--line);
  border-radius: 8px; margin-top: 4px; background: #fff; color: var(--text); }
button { font-size: 15px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; }
button.primary { background: var(--main); color: #fff; border-color: var(--main); }
button.primary:active { background: var(--main-dark); }
button.danger { color: var(--bad); }
button.wide { width: 100%; padding: 14px; font-size: 16px; }
.small-btn { padding: 4px 10px; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.row input { margin-top: 0; }
.row.between { justify-content: space-between; }
.row.between h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
.shot { display: block; margin: 0; }
.shot input { display: none; }
.shot span { display: block; text-align: center; background: var(--main); color: #fff;
  padding: 18px; border-radius: 10px; font-size: 18px; font-weight: bold; }
.shotrow { display: flex; gap: 8px; }
.shotrow .shot { flex: 1; }
.scanbtn { flex: 0 0 auto; padding: 0 14px; font-size: 15px; font-weight: bold; border: 2px solid var(--main); color: var(--main); border-radius: 10px; }
.previewWrap { position: relative; margin-top: 10px; touch-action: none; user-select: none; -webkit-user-select: none;
  overflow: hidden; border-radius: 8px; }
.shot span { white-space: nowrap; }
#preview { display: block; width: 100%; max-height: 320px; object-fit: contain; border-radius: 8px; background: #000;
  -webkit-touch-callout: none; pointer-events: none; }
.previewWrap.cropping { outline: 3px dashed #fde68a; border-radius: 8px; }
.cropBox { position: absolute; border: 2px solid #fde68a; background: rgba(253,230,138,.18); box-shadow: 0 0 0 9999px rgba(0,0,0,.35); pointer-events: none; }
#cropBar, #cropActions { margin-top: 8px; }
#cropBar .wide { flex: 1; }
.addPhoto { flex: 1; margin: 0; }
.addPhoto input { display: none; }
.addPhoto span { display: block; text-align: center; padding: 10px 6px; border-radius: 8px; border: 2px solid var(--main);
  color: var(--main); font-weight: bold; font-size: 15px; background: #fff; white-space: nowrap; }
.addPhoto input:disabled + span { opacity: .5; }
.thumbs { display: flex; gap: 6px; margin-top: 6px; }
.thumb { position: relative; padding: 0; width: 56px; height: 56px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; }
.thumb.on { border-color: var(--main); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb span { position: absolute; right: 2px; bottom: 2px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 0 4px; border-radius: 4px; }
.cands { margin-top: 10px; }
.candTitle { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cand { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; text-align: left; margin-bottom: 6px;
  padding: 8px 10px; white-space: normal; border-radius: 8px; }
.cand.on { border: 2px solid var(--main); background: #f0fdfa; }
.candName { font-weight: bold; font-size: 14px; }
.candConf { font-weight: bold; color: var(--main); font-size: 14px; }
.candReason { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.verifyBtn { width: 100%; margin-top: 8px; border: 2px solid var(--main); color: var(--main); font-weight: bold; background: #fff; }
.candTip { font-size: 13px; background: #fef9c3; color: #713f12; border-radius: 8px; padding: 8px 10px; }
.scanner { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; align-items: center; justify-content: center; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanGuide { position: relative; width: 78%; max-width: 420px; aspect-ratio: 2 / 1; border: 3px solid #fde68a; border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.45); overflow: hidden; }
.scanLine { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: #ef4444; opacity: .8; }
.scanMsg { position: absolute; left: 12px; right: 12px; bottom: calc(90px + env(safe-area-inset-bottom)); color: #fff; text-align: center; font-size: 14px;
  background: rgba(0,0,0,.55); padding: 8px 10px; border-radius: 8px; }
.scanClose { position: absolute; bottom: calc(28px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: #fff; color: #111; font-weight: bold; padding: 12px 28px; border-radius: 99px; border: 0; }
.status { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; background: #e0f2fe; font-size: 14px; }
.status.err { background: #fee2e2; color: var(--bad); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid #0369a1; border-right-color: transparent;
  border-radius: 50%; animation: s 0.8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes s { to { transform: rotate(360deg); } }
.prod { display: flex; gap: 10px; }
.prod img { width: 72px; height: 72px; object-fit: contain; flex-shrink: 0; background: #fafafa; border-radius: 6px; }
.prod .title { font-size: 14px; font-weight: bold; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.stat { background: #f8fafc; border-radius: 8px; padding: 6px; text-align: center; }
.stat b { display: block; font-size: 16px; }
.stat span { font-size: 11px; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; font-weight: bold; }
.b-hot { background: #dcfce7; color: var(--good); }
.b-mid { background: #fef9c3; color: #a16207; }
.b-low { background: #fee2e2; color: var(--bad); }
.prod-actions { display: flex; gap: 6px; margin-top: 8px; }
.prod-actions button, .prod-actions a { font-size: 13px; padding: 6px 10px; }
a.btn { display: inline-block; border: 1px solid var(--line); border-radius: 8px; color: var(--text);
  text-decoration: none; background: #fff; white-space: nowrap; }
button:disabled { opacity: .5; }
.linkgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.linkgrid a { display: block; text-align: center; padding: 12px 6px; border-radius: 8px; background: #f0fdfa;
  color: var(--main-dark); text-decoration: none; font-weight: bold; font-size: 14px; border: 1px solid #99f6e4; }
table.profit { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 6px; }
table.profit th, table.profit td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
table.profit td:first-child, table.profit th:first-child { text-align: left; }
.plus { color: var(--good); font-weight: bold; }
.minus { color: var(--bad); font-weight: bold; }
.hist { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.hist .t { font-size: 14px; font-weight: bold; }
.hist .meta { font-size: 12px; color: var(--muted); }
.hist .col { margin-left: auto; align-self: center; }

/* 出品文（listing.js） */
.lsBtn { border: 2px solid var(--main); color: var(--main); font-weight: bold; background: #fff; }
.lsStatus { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #e0f2fe; }
.lsStatus.error { background: #fee2e2; color: var(--bad); }
.lsOut:not(:empty) { margin-top: 12px; }
.lsField { margin-bottom: 12px; }
.lsHead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.lsHead b { flex: 1; font-size: 14px; }
.lsCount { font-size: 12px; color: var(--muted); }
.lsCount.over { color: var(--bad); font-weight: bold; }
.lsField textarea { width: 100%; font-size: 15px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit;
  line-height: 1.5; background: #fff; color: var(--text); resize: vertical; }
.lsWarn { font-size: 12px; background: #fef3c7; color: #92400e; border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; }
.lsGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.lsGrid > div { background: #f8fafc; border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.lsList { font-size: 14px; margin: 8px 0; }
.lsList ul { margin: 4px 0 0; padding-left: 20px; }
.lsCopyAll { margin-top: 4px; }

/* ---- 撮るだけ献立 ---- */
.tab { font-size: 14px; }
.shotrow .shot.sub { flex: 0 0 38%; }
.shot.sub span { background: #fff; color: var(--main); border: 2px solid var(--main); font-size: 16px; padding: 16px 6px; }
.savingBox { display: block; width: 100%; text-align: left; margin-bottom: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px;
  padding: 10px 14px; font-size: 13px; color: #14532d; white-space: normal; }
.savingBox b { font-size: 20px; margin: 0 6px; }
.savingBox span { display: block; font-size: 11px; color: var(--muted); }
.tip { background: #fef9c3; border-radius: 8px; padding: 6px 8px; }
.revList { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.revItem { display: grid; grid-template-columns: 24px 1fr 90px; gap: 6px; align-items: center; }
.revItem input[type=checkbox] { width: 20px; height: 20px; margin: 0; }
.revItem input[type=text] { margin: 0; padding: 8px; font-size: 15px; }
.revMeta { grid-column: 2 / -1; font-size: 11px; color: var(--muted); margin-top: -4px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; margin: 8px 0; }
.check input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; }
.mt8 { margin-top: 8px; } .mt4 { margin-top: 4px; }
.expireNote { background: #fef2f2; color: #7f1d1d; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 10px; }
.plHead { font-size: 14px; margin: 14px 0 4px; color: var(--muted); }
.stItem { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.stItem.prepItem b::before { content: "🥡 "; }
.stBtns { display: flex; gap: 4px; width: 100%; justify-content: flex-end; }
.mini { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.mini.use { color: var(--main); border-color: #86efac; }
.mini.del { color: var(--muted); }
.dl { font-size: 12px; font-weight: bold; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.dl-ok { background: #dcfce7; color: #166534; } .dl-yel { background: #fef9c3; color: #854d0e; }
.dl-red { background: #fee2e2; color: #991b1b; } .dl-over { background: #374151; color: #fff; }
.addRow { display: flex; gap: 6px; margin-top: 10px; }
.addRow input { margin: 0; flex: 1; min-width: 0; }
.addRow select { margin: 0; width: auto; flex: 0 0 auto; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 8px; }
.useFirst { background: #fef2f2; color: #7f1d1d; font-size: 14px; }
.dayCard h2 { border-left: 4px solid var(--main); padding-left: 8px; }
.meal { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.meal.done { background: #f0fdf4; }
.mealHead { display: flex; align-items: center; gap: 8px; }
.mtype { font-weight: bold; font-size: 15px; flex: 1; }
.score { font-size: 20px; font-weight: bold; color: var(--main); }
.point { margin: 4px 0; color: #166534; }
.dish { border-top: 1px dashed var(--line); padding: 6px 0; }
.dish summary { cursor: pointer; font-size: 15px; list-style: none; }
.dish summary::-webkit-details-marker { display: none; }
.dish summary::before { content: "▸ "; color: var(--muted); }
.dish[open] summary::before { content: "▾ "; }
.role { font-size: 11px; background: #f1f5f9; color: #334155; padding: 1px 6px; border-radius: 4px; margin-right: 6px; }
.dishBody { padding: 6px 0 2px 14px; }
.steps { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }
.nutRow { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.nc { font-size: 11px; background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; padding: 1px 6px; border-radius: 99px; white-space: nowrap; }
.mealNut { margin-top: 8px; background: #f8fafc; border-radius: 8px; padding: 6px 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ck { font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.ck-ok { background: #dcfce7; color: #166534; } .ck-ng { background: #fef3c7; color: #92400e; display: inline-block; margin-top: 4px; }
.dayNut { background: #f0fdf4; border-radius: 8px; padding: 8px; }
.shopPrev { padding-left: 20px; margin: 0 0 10px; }
.prepDish { border-bottom: 1px solid var(--line); padding: 8px 0; }
.keep { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.kp { font-size: 12px; background: #e0f2fe; color: #075985; padding: 2px 8px; border-radius: 99px; }
.kp.no { background: #f3f4f6; color: #9ca3af; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tmin { flex: 0 0 52px; font-weight: bold; color: var(--main); }
.bento { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.shItem { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); font-size: 15px; margin: 0; }
.shItem input { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; }
.shItem.done span { text-decoration: line-through; color: var(--muted); }.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.modalBox { background: #fff; width: 100%; max-width: 560px; border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 80vh; overflow-y: auto; }
.modalBox h2 { font-size: 17px; margin: 0 0 6px; }
