:root {
  --bg: #f4f6f5; --card: #fff; --ink: #1d2422; --muted: #66716d; --line: #dfe5e2;
  --pri: #1f6f5c; --pri-ink: #fff; --ok: #1d7a3e; --ok-bg: #e3f4e8; --ng: #b3261e; --ng-bg: #fbe7e5;
  --hold: #8a5a00; --hold-bg: #fff2d6; --demo: #6b3fa0; --demo-bg: #efe6fa;
  --r: 14px; --tap: 52px;
  font-size: 17px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--pri); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--pri); color: #fff; }
.topbar h1 { font-size: 1.05rem; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: 0; color: #fff; font-size: 2rem; line-height: 1; min-width: 44px; min-height: 44px; }
.net { background: #b3261e; padding: 2px 8px; border-radius: 99px; font-size: .8rem; }
main { padding: 12px; max-width: 720px; margin: 0 auto; }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.bottomnav a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: var(--tap); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; }
.bottomnav a.primary { flex: 2; background: var(--pri); color: #fff; }
.bottomnav a.active { background: #e6efec; }
.card { background: var(--card); border-radius: var(--r); padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.card h2 { font-size: 1.05rem; margin: 0 0 10px; }
.card h3 { font-size: .98rem; margin: 14px 0 6px; }
.card h4 { font-size: .92rem; margin: 12px 0 4px; }
.small { font-size: .85rem; } .muted { color: var(--muted); } .center { text-align: center; }
.pre { white-space: pre-wrap; }
.warn { color: var(--hold); } .ok { color: var(--ok); font-weight: 700; } .neg { color: var(--ng); }
.note { background: #eef5f2; border-left: 4px solid var(--pri); padding: 8px 10px; border-radius: 8px; }
.nodata { font-size: 1.3rem; font-weight: 800; color: var(--muted); margin: 4px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 1rem; font-weight: 600; cursor: pointer; text-align: center; width: 100%; font-family: inherit; }
.btn.primary { background: var(--pri); color: #fff; border-color: var(--pri); }
.btn.danger { color: var(--ng); border-color: #f0c9c5; }
.btn.big { min-height: 60px; font-size: 1.05rem; }
.btn.small { min-height: 40px; width: auto; padding: 0 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; }
.btn.file { position: relative; }
.linkbtn { background: none; border: 0; color: var(--pri); text-decoration: underline; padding: 10px 0; font-size: .9rem; font-family: inherit; }
.mini { min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: .85rem; font-family: inherit; }
.mini.danger { color: var(--ng); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 8px 0; }
.row3 .btn { padding: 0 6px; font-size: .9rem; }
.col { display: grid; gap: 8px; }
.field { display: block; margin: 10px 0; }
.field > span { display: block; font-size: .88rem; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; min-height: var(--tap); font-size: 17px; padding: 10px 12px; border-radius: 10px; border: 1px solid #c9d2ce; background: #fff; color: var(--ink); font-family: inherit; }
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 3px solid #9fd3c3; border-color: var(--pri); }
.yen-in { display: flex; align-items: center; gap: 6px; } .yen-in i { font-style: normal; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); }
.check input { width: 26px; height: 26px; min-height: 0; flex: none; }
.check.big { font-size: 1.05rem; background: #f3f7f5; padding: 6px 10px; border-radius: 10px; }
.search { margin-bottom: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.small-chips { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-size: .9rem; font-family: inherit; color: var(--ink); }
.chip.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg.wrap { grid-template-columns: repeat(2, 1fr); }
.seg-b { min-height: var(--tap); border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: .95rem; font-weight: 600; font-family: inherit; color: var(--ink); }
.seg-b.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.tabs { display: flex; gap: 4px; overflow-x: auto; position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 10; background: var(--bg); padding: 4px 0 8px; margin: 0 -2px; }
.tab { flex: none; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: .9rem; font-weight: 600; font-family: inherit; color: var(--ink); }
.tab.on { background: var(--ink); color: #fff; }
.badge { display: inline-block; font-size: .75rem; padding: 2px 7px; border-radius: 99px; background: #eef1f0; color: var(--ink); vertical-align: middle; font-weight: 600; }
.badge.demo, .demo-t { background: var(--demo-bg); color: var(--demo); }
.demo-banner { background: var(--demo-bg); color: var(--demo); font-weight: 700; padding: 10px; border-radius: 10px; margin-bottom: 10px; text-align: center; }
.b-read { background: #dff1ea; color: #11583f; } .b-inferred { background: var(--hold-bg); color: var(--hold); } .b-manual { background: #e7ecf8; color: #2a4a8a; }
.conf-high { background: #dff1ea; } .conf-medium { background: var(--hold-bg); } .conf-low { background: var(--ng-bg); }
.lv-none { background: #e9ecea; color: var(--muted); } .lv-low { background: var(--hold-bg); color: var(--hold); } .lv-ok { background: var(--ok-bg); color: var(--ok); }
.s-confirmed_sale { background: var(--ok-bg); color: var(--ok); } .s-soldout_display { background: #e7ecf8; color: #2a4a8a; } .s-listing { background: #f1f1f1; color: var(--muted); }
.st-candidate { background: #e7ecf8; } .st-purchased { background: var(--ok-bg); } .st-skipped { background: #eee; } .st-sold { background: #ffe9c7; }
.v-meets { background: var(--ok-bg); color: var(--ok); } .v-fails, .v-fails_hold { background: var(--ng-bg); color: var(--ng); } .v-hold { background: var(--hold-bg); color: var(--hold); }
.list { display: grid; gap: 8px; }
.item-card { display: flex; gap: 10px; background: #fff; border-radius: var(--r); padding: 10px; text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.item-card img, .noimg { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; flex: none; background: #e9ecea; }
.noimg { display: flex; align-items: center; justify-content: center; font-size: .75rem; color: var(--muted); }
.ic-body { min-width: 0; flex: 1; }
.ic-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-sub { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-meta { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.ic-nums { font-size: .85rem; }
.empty { text-align: center; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.photos figure { margin: 0; background: #f3f5f4; border-radius: 10px; overflow: hidden; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photos figcaption { display: flex; gap: 4px; padding: 4px; }
.photos figcaption select { min-height: 36px; font-size: .85rem; padding: 4px; }
.zoom { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto 10px; }
.ai-result { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.cand { display: block; width: 100%; text-align: left; background: #f8faf9; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 6px 0; font-family: inherit; color: var(--ink); font-size: 1rem; }
.cand-h { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.ocr { padding-left: 0; list-style: none; } .ocr li { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px dashed var(--line); word-break: break-all; }
.kw { border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 8px; }
.kw-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.kw code { font-size: 1rem; word-break: break-all; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lnk { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 99px; background: #eef5f2; text-decoration: none; font-size: .9rem; }
.stat-grid { display: grid; gap: 8px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.stat.basis { border: 2px solid var(--pri); }
.stat-h { font-weight: 700; margin-bottom: 4px; }
.stat-m { font-size: 1.1rem; }
.comps { list-style: none; padding: 0; margin: 10px 0 0; }
.comp { border-bottom: 1px solid var(--line); padding: 8px 0; }
.comp-h { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.comp-a { display: flex; gap: 6px; margin-top: 6px; }
.scen { border-top: 1px solid var(--line); margin-top: 6px; }
.ptable { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .9rem; }
.ptable th, .ptable td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.ptable th:first-child { text-align: left; font-weight: 500; color: var(--muted); }
.ptable tr.hl td { font-size: 1rem; }
.kv { width: 100%; border-collapse: collapse; font-size: .9rem; }
.kv th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 6px 6px 0; vertical-align: top; width: 38%; }
.kv td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.verdict { font-size: 1.35rem; font-weight: 800; padding: 16px; border-radius: 12px; text-align: center; }
.checks li { color: var(--hold); margin: 4px 0; } .reasons li { color: var(--ng); margin: 4px 0; font-weight: 600; }
.spacer { height: 70px; }
.summary { position: fixed; left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 25; border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.15); max-width: 704px; margin: 0 auto; }
.sum-btn { display: block; width: 100%; background: none; border: 0; padding: 8px 12px; text-align: left; color: inherit; font-family: inherit; }
.sum-v { display: block; font-weight: 800; font-size: 1rem; }
.sum-n { display: block; font-size: .88rem; color: var(--ink); }
#toast { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: 90vw; font-size: .92rem; }
#toast.show { opacity: .95; transform: translateX(-50%); }
dialog { border: 0; border-radius: 16px; padding: 16px; width: min(560px, 94vw); max-height: 88vh; overflow: auto; }
dialog::backdrop { background: rgba(0,0,0,.45); }
details summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; color: var(--muted); }
@media (min-width: 600px) { .seg.wrap { grid-template-columns: repeat(4, 1fr); } }
.notice { background: #fffaf0; border: 1px solid #f0dfb8; }
.notice ul { padding-left: 1.2em; margin: 0; }
.notice li { margin: 4px 0; }
.scan-pick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; }
.pick { flex: none; width: 76px; border: 2px solid var(--line); border-radius: 10px; background: #fff; padding: 2px; font-size: .7rem; font-family: inherit; color: var(--ink); }
.pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; display: block; }
.pick.on { border-color: var(--pri); box-shadow: 0 0 0 2px #9fd3c3; }
.ocr-text { white-space: pre-wrap; word-break: break-all; background: #f6f8f7; padding: 8px; border-radius: 8px; font-size: .85rem; max-height: 240px; overflow: auto; }
.fallback { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 6px; }
.b-barcode { background: #e7ecf8; color: #2a4a8a; }
.bottomnav a { font-size: .92rem; }
.big-in input { font-size: 28px; font-weight: 700; min-height: 64px; }
.sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.size { min-height: 54px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-family: inherit; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.size b { font-size: 1rem; } .size small { font-size: .72rem; color: var(--muted); }
.size.on { background: var(--pri); border-color: var(--pri); color: #fff; } .size.on small { color: #e6f3ef; }
.q-res { display: flex; align-items: center; gap: 12px; border-radius: 14px; padding: 14px; margin: 12px 0 6px; }
.q-mark { font-size: 3rem; font-weight: 900; line-height: 1; min-width: 56px; text-align: center; }
.q-text { font-size: 1.4rem; font-weight: 800; }
.q-sub { font-size: 1rem; margin-top: 2px; }
.q-max { font-size: 1.05rem; margin-top: 4px; } .q-max b { font-size: 1.35rem; }
.q-buy { background: var(--ok-bg); color: var(--ok); } .q-maybe { background: var(--hold-bg); color: var(--hold); }
.q-skip { background: var(--ng-bg); color: var(--ng); } .q-limit { background: #e7ecf8; color: #2a4a8a; } .q-need { background: #eef1f0; color: var(--muted); }
.badge.q-buy { background: var(--ok-bg); color: var(--ok); } .badge.q-maybe { background: var(--hold-bg); color: var(--hold); } .badge.q-skip { background: var(--ng-bg); color: var(--ng); } .badge.q-limit, .badge.q-need { background: #e7ecf8; }
.bottomnav a.primary.active { background: var(--pri); color: #fff; box-shadow: inset 0 -3px 0 #0f4a3c; }
