* { box-sizing: border-box; }
:root {
  --main: #b45309; --main-dark: #92400e; --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(180,83,9,.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: #fde68a; 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: #fff7ed; }
.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: #fff7ed;
  color: var(--main-dark); text-decoration: none; font-weight: bold; font-size: 14px; border: 1px solid #fed7aa; }
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; }

/* ---- まるごと査定 ---- */
.miniTotal { display: block; width: 100%; text-align: left; margin-bottom: 12px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px;
  padding: 10px 14px; font-size: 13px; color: #7c2d12; white-space: normal; }
.miniTotal b { font-size: 20px; margin: 0 8px; }
.miniTotal span { font-size: 12px; color: var(--muted); margin-right: 8px; }
.resCard h3 { font-size: 15px; margin: 16px 0 6px; }
.resHead { display: flex; gap: 12px; align-items: flex-start; }
.resHead img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.resName { font-size: 18px; font-weight: bold; line-height: 1.35; }
.route { margin-top: 12px; border-radius: 10px; padding: 10px 12px; }
.routeLabel { font-weight: bold; font-size: 17px; }
.routeWhy { font-size: 13px; margin-top: 2px; }
.r-sell { background: #dcfce7; color: #14532d; }
.r-shop { background: #e0f2fe; color: #0c4a6e; }
.r-expert { background: #ede9fe; color: #4c1d95; }
.r-give { background: #fef9c3; color: #713f12; }
.r-dispose { background: #f3f4f6; color: #374151; }
.expert { margin-top: 10px; background: #ede9fe; color: #4c1d95; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.moneyGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mBox { background: #f8fafc; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.mBox span { font-size: 12px; color: var(--muted); }
.mBox b { font-size: 16px; }
.mBox small { font-size: 11px; color: var(--muted); }
.mBox.main { grid-column: 1 / -1; background: #fff7ed; }
.mBox.main b { font-size: 24px; color: #9a3412; }
.mBox.main small { font-size: 12px; }
.gain { margin-top: 8px; text-align: center; font-size: 14px; background: #dcfce7; color: #14532d; border-radius: 8px; padding: 8px; }
.shipLabel { margin-top: 10px; }
.shipLabel select { font-size: 14px; }
.factors { list-style: none; padding: 0; margin: 0; }
.factors li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.factors li > span { flex: 0 0 22px; height: 22px; border-radius: 50%; text-align: center; font-weight: bold; line-height: 22px; font-size: 14px; }
.f-plus > span { background: #dcfce7; color: var(--good); }
.f-minus > span { background: #fee2e2; color: var(--bad); }
.f-neutral > span { background: #f3f4f6; color: var(--muted); }
.collector { margin-top: 10px; background: #fef9c3; color: #713f12; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.cautions { margin-top: 10px; background: #fee2e2; color: #7f1d1d; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.cautions ul { margin: 4px 0 0; padding-left: 20px; }
.basis { margin-top: 12px; }
.basis a { color: var(--main-dark); }
.cand { display: grid; grid-template-columns: 1fr auto; cursor: default; background: #fff; border: 1px solid var(--line); }
.row.wrap { flex-wrap: wrap; }
.row select { margin-top: 0; }
.soldInput { flex: 1 1 140px; }
#nextBtn { margin-bottom: 16px; }
.totalCard { background: linear-gradient(135deg, #b45309, #92400e); color: #fff; }
.totalCard .muted { color: #fde68a; }
.totMain span, .totSub span { display: block; font-size: 13px; opacity: .9; }
.totMain b { font-size: 32px; }
.totSub { margin: 6px 0; }
.totSub b { font-size: 20px; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.chip { flex: 0 0 auto; font-size: 13px; padding: 6px 12px; border-radius: 99px; background: #fff; }
.chip.on { background: var(--main); color: #fff; border-color: var(--main); }
.item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; background: transparent; white-space: normal; }
.item img, .item .noimg { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.item .t { font-size: 14px; font-weight: bold; }
.item .meta { font-size: 12px; color: var(--muted); }
.item .val { font-weight: bold; color: #9a3412; font-size: 15px; white-space: nowrap; }
.item.done { opacity: .55; }
.deleteAll { display: block; margin: 16px auto 0; }.item .val.cost { color: var(--muted); font-size: 12px; text-align: right; font-weight: normal; }
.shareBtn { margin-bottom: 8px; }
