:root {
  --ink: #15202b;
  --muted: #4a5568;
  --line: #e3e7ed;
  --ground: #f6f7f9;
  --accent: #0e6b5c;
  --accent-tint: #e6f2ef;
  --warn: #b45309;
  --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; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.5; margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.warn { color: var(--warn); font-weight: 700; }
.alert { background: #fef2f2; color: var(--danger); padding: 12px; border-radius: 8px; font-size: 13px; }
.notice { background: var(--accent-tint); color: #0a3d35; padding: 12px 14px; border-radius: 10px; font-size: 13px; margin: 0; }
.field-error { color: var(--danger); font-size: 12px; margin: -6px 0 4px; }

/* 会員（スマホ） */
body.member { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--ground); }
body.top { background: #fff; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); min-height: 60px; }
body.top .bar { border-bottom: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--accent); }
.brand svg + * , .brand { color: var(--ink); }
.brand svg { color: var(--accent); }
.bar-title { font-weight: 700; font-size: 15px; }
.back { font-size: 28px; text-decoration: none; color: var(--ink); width: 44px; height: 44px; display: flex; align-items: center; }
.hero { flex: 1; padding: 0 24px; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.hero h1 { font-size: 26px; }
.hero p { margin: 0; }
.foot { padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid #cbd2dc; background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.primary, .btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 36px; font-size: 13px; padding: 0 12px; }
.btn[disabled] { opacity: .5; cursor: default; }
button.link { background: none; border: none; padding: 0; font: inherit; font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.stack { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tag { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-tint); padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.status-submitted, .status-arrived { color: #1e40af; background: #dbeafe; }
.status-inspected { color: #92400e; background: #fef3c7; }
.status-cancelled { color: var(--muted); background: var(--ground); }
.amount { font-size: 22px; font-weight: 700; margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; justify-content: space-between; padding: 6px 0 6px 26px; position: relative; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: 0; top: 10px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #cbd2dc; background: #fff; }
.timeline li.done::before { background: var(--accent); border-color: var(--accent); }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef1f5; }
.kv > div { display: flex; flex-direction: column; font-size: 13px; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.log li { display: flex; justify-content: space-between; gap: 12px; }
.address { background: var(--ground); padding: 12px; border-radius: 8px; font-size: 13px; white-space: pre-line; margin: 8px 0 0; }
details summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--accent); }
form.inline { display: flex; flex-wrap: wrap; gap: 8px; }
form.inline select { flex: 1 1 100%; }
form.inline input { flex: 1; min-width: 0; }
form.plain { padding: 0 4px; }
.prose { font-size: 14px; background: #fff; }
.prose h2 { margin-top: 12px; }

/* 申込フォーム */
.wizard { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.progress { display: grid; grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr)); gap: 6px; }
.progress span { height: 4px; border-radius: 2px; background: var(--line); }
.progress span.on { background: var(--accent); }
fieldset.step { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
fieldset.step legend { font-size: 18px; font-weight: 700; margin-bottom: 12px; padding: 0; }
.js fieldset.step:not(.current) { display: none; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); min-height: 44px; padding: 8px 12px; border: 1px solid #cbd2dc; border-radius: 8px; background: #fff; font-weight: 400; }
textarea { min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 10px; }
.campaign h2 { font-size: 15px; }
.campaign .price { margin: 0; }
.campaign .price strong { font-size: 22px; }
.qty { flex-direction: row; align-items: center; font-size: 13px; color: var(--ink); border-top: 1px solid var(--line); padding-top: 10px; }
.qty input { width: 96px; text-align: center; font-size: 18px; font-weight: 700; }
.total { text-align: right; margin: 0; font-size: 14px; }
.total strong { font-size: 20px; color: var(--accent); }
.choice { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font-size: 14px; }
.choice:has(input:checked) { border: 2px solid var(--accent); }
.choice input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
.choice > span { display: flex; flex-direction: column; }
.upload { align-items: center; justify-content: center; min-height: 56px; border: 2px dashed #9aa5b4; border-radius: 12px; background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; }
.upload input { display: none; }
.upload > span { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.upload.dragging { border-color: var(--accent); background: #eef7f5; }
@media (hover: none) { .drop-hint { display: none; } }
.pdf-tile { width: 96px; height: 64px; display: flex; align-items: center; justify-content: center; text-align: center; white-space: pre-line; overflow: hidden; font-size: 11px; border-radius: 6px; border: 1px solid var(--line); background: #fff; padding: 4px; word-break: break-all; }
.previews { display: flex; gap: 8px; flex-wrap: wrap; }
.previews img { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.terms { margin: 0; padding-left: 18px; color: var(--muted); }
.check { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
.step-nav { display: flex; gap: 10px; }
.step-nav .btn { flex: 1; height: 52px; }

/* 管理（PC） */
body.admin { background: var(--ground); font-size: 14px; }
.admin-nav { display: flex; gap: 20px; align-items: center; padding: 12px 24px; background: var(--ink); color: #fff; flex-wrap: wrap; }
.admin-nav a { color: #fff; text-decoration: none; }
.admin-main { padding: 24px; max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 8px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.tabs a.on { background: var(--ink); color: #fff; }
.tabs a span { font-weight: 700; margin-left: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }
.toolbar label { flex-direction: row; align-items: center; gap: 6px; }
table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: block; overflow-x: auto; }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.list th { font-size: 12px; color: var(--muted); background: var(--ground); }
td.num { text-align: right; }
td.clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.dl { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-all; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.form-grid .wide, .form-grid h2, .form-grid .field-error { grid-column: 1 / -1; }
.form-grid button { justify-self: start; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.stack-sm label { align-self: stretch; }
#id-images a.btn { display: inline-block; margin: 8px 8px 0 0; }
#id-images img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }

/* 申込書・請求書（印刷） */
body.print { background: #fff; max-width: none; }
.sheet { width: 190mm; margin: 0 auto 12mm; padding: 10mm 0; font-size: 11pt; page-break-after: always; }
.sheet h1 { text-align: center; font-size: 20pt; letter-spacing: .3em; margin-bottom: 6mm; }
.sheet h2 { font-size: 11pt; border-bottom: 1px solid var(--ink); margin: 4mm 0 2mm; }
.sheet .right { text-align: right; }
.sheet .big { font-size: 14pt; font-weight: 700; }
.sheet p { margin: 1mm 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; }
.form-table { width: 100%; border-collapse: collapse; margin: 4mm 0; }
.form-table th, .form-table td { border: 1px solid #333; padding: 2mm 3mm; text-align: left; }
.form-table th { background: #f1f3f5; white-space: nowrap; font-weight: 700; }
.form-table .num { text-align: right; }
.no-print { padding: 16px; justify-content: center; }
@media print {
  .no-print { display: none !important; }
  .sheet { margin: 0 auto; padding: 0; }
  @page { size: A4; margin: 12mm; }
}

/* 入力内容ファイル（CSV）の保存・読み込み */
.csv-box { border: 1px dashed var(--line, #d4d4d4); border-radius: 10px; padding: 12px; display: grid; gap: 8px; justify-items: start; }
.csv-box p { margin: 0; }
.csv-box[hidden] { display: none; }
