:root {
  --ink: #15202b;
  --muted: #536072;
  --line: #e3e7ed;
  --ground: #f6f7f9;
  --card: #fff;
  --accent: #b4232c;
  --accent-tint: #fbeced;
  --good: #0e6b5c;
  --good-tint: #e6f2ef;
  --warn: #b45309;
  --warn-tint: #fef3c7;
  --danger: #b91c1c;
  font-family: 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic UI', system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); line-height: 1.7; font-size: 14px; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.5; margin: 0; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.plus { color: var(--good); font-weight: 700; }
.minus { color: var(--danger); font-weight: 700; }

.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--accent); white-space: nowrap; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13px; }
.nav a.on { background: var(--accent-tint); color: var(--accent); font-weight: 700; }
.who { font-size: 12px; color: var(--muted); }
main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 60px; display: flex; flex-direction: column; gap: 16px; }
body.member main { max-width: 720px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.notice { background: var(--good-tint); color: #0a3d35; padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.alert { background: #fef2f2; color: var(--danger); padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.caution { background: var(--warn-tint); color: #78350f; padding: 10px 14px; border-radius: 10px; font-size: 13px; }

form.stack, .stack { display: flex; flex-direction: column; gap: 10px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
input, select, textarea { font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid #cbd2dc; border-radius: 8px; background: #fff; min-height: 42px; width: 100%; }
label.check input { width: auto; min-height: 0; margin-top: 4px; }
textarea { min-height: 80px; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline > * { flex: 1 1 140px; }
.field-error { color: var(--danger); font-size: 12px; font-weight: 400; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid #cbd2dc; background: #fff; color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 34px; font-size: 12px; padding: 0 10px; }
form.inline-btn { display: inline; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare .side { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.compare .side.best { border-color: var(--good); box-shadow: 0 0 0 1px var(--good) inset; }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.kv.total { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; font-size: 15px; font-weight: 700; }
.big { font-size: 22px; font-weight: 700; }
.product { display: flex; gap: 12px; align-items: flex-start; }
.product img { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; background: var(--ground); color: var(--muted); }
.tag.applied, .tag.new { background: #dbeafe; color: #1e40af; }
.tag.approved { background: var(--warn-tint); color: #92400e; }
.tag.listed, .tag.shipped, .tag.paid { background: var(--good-tint); color: var(--good); }
.tag.rejected, .tag.cancelled, .tag.returned, .tag.late { background: #fef2f2; color: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.stat b { display: block; font-size: 22px; }
.copy { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--ground); padding: 8px; border-radius: 8px; word-break: break-all; }
ol.terms { margin: 0; padding-left: 20px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }

@media (max-width: 560px) {
  .compare { grid-template-columns: 1fr; }
  main { padding: 16px 12px 48px; }
}
@media print {
  .top, .noprint { display: none !important; }
  body { background: #fff; }
  .card { border: none; padding: 0; }
}

/* 日別の売上グラフ（1系列。格子と軸は控えめに） */
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--accent); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: #cbd2dc; stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(21, 32, 43, 0.06); }
.stat.kpi { border-top: 3px solid var(--accent); }
h3 { font-size: 13px; }

/* コピーできる欄 */
[data-copy] { cursor: copy; position: relative; }
[data-copy]:hover { outline: 1px dashed #cbd2dc; }
[data-copy].copied::after { content: 'コピーしました'; position: absolute; right: 6px; top: 4px; font-size: 11px; background: var(--good); color: #fff; padding: 0 6px; border-radius: 6px; font-family: inherit; }
.copy.pre { white-space: pre-wrap; }
.copyrow { align-items: flex-start; }
.copyrow > span:first-child { flex: 0 0 150px; color: var(--muted); font-size: 12px; padding-top: 8px; }
.copyrow .copy { flex: 1; white-space: pre-wrap; }
details > summary { cursor: pointer; font-weight: 700; font-size: 13px; }
details[open] > summary { margin-bottom: 8px; }
details.rms { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
fieldset.checks { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
fieldset.checks legend { font-size: 13px; font-weight: 700; padding: 0 4px; }

/* Amazon と楽天の比較 */
.verdict { border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.verdict b { font-size: 17px; }
.verdict.better { background: var(--good-tint); color: #0a3d35; }
.verdict.near { background: var(--warn-tint); color: #78350f; }
.verdict.worse { background: #fef2f2; color: var(--danger); }
.verdict.unknown { background: var(--ground); color: var(--muted); }
table.cmp th:first-child { white-space: normal; }
table.cmp td, table.cmp th { padding: 7px 8px; }
table.cmp tr.sub td, table.cmp tr.sub th { background: var(--ground); }
table.cmp tr.key td, table.cmp tr.key th { background: var(--accent-tint); font-size: 15px; }
table.cmp tr.total td, table.cmp tr.total th { border-top: 2px solid var(--line); }
.todo { border-left: 4px solid var(--accent); }
