:root {
  --accent: #C1121F;      /* 主な色（仮）。買取大吉の正確な色は未確認 */
  --ink: #1F1A17;
  --sub: #5E5650;
  --line: #8A817A;
  --soft-line: #DDD7D1;
  --ground: #F6F4F1;
  --card: #FFFFFF;
  --warn-bg: #FFF7E0;
  --warn-ink: #5C4400;
  --warn-strong: #FFD866;
  --warn-line: #B88A00;
  --error: #A4161A;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: #E9E5E0;
  -webkit-text-size-adjust: 100%;
}
.app {
  max-width: 480px; min-height: 100%; margin: 0 auto;
  display: flex; flex-direction: column; background: var(--ground);
}
button, input, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #1F5FBF; outline-offset: 2px; }

/* 上の帯 */
.bar { background: var(--accent); color: #fff; padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.bar--home { padding: 20px; }
.bar__title { font-size: 18px; font-weight: 700; }
.bar__shop { margin-left: auto; font-size: 13px; font-weight: 500; }
.bar__back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: #fff; background: none; border: 0; border-radius: 8px; }
.proto { background: #1F1A17; color: #fff; font-size: 12px; text-align: center; padding: 4px 8px; }

/* 3歩の表示 */
.steps { margin: 0; padding: 12px 20px; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; background: var(--card); border-bottom: 1px solid var(--soft-line); }
.steps li { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--sub); }
.steps li::before { content: ""; height: 4px; border-radius: 2px; background: var(--soft-line); }
.steps li.is-done::before, .steps li.is-now::before { background: var(--accent); }
.steps li.is-now { font-weight: 700; color: var(--ink); }

.main { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.foot { margin-top: auto; padding: 0 20px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.foot--two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }

h1, h2 { margin: 0; }
.h1 { font-size: 20px; font-weight: 700; }
.h2 { font-size: 16px; font-weight: 700; }
.note { margin: 0; font-size: 13px; color: var(--sub); line-height: 1.6; }
.lead { margin: 0; font-size: 14px; line-height: 1.6; }

.card { background: var(--card); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.8; }
.warn { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.6; }
.error { color: var(--error); font-size: 14px; font-weight: 700; margin: 0; }

/* ボタン */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 16px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-size: 16px; font-weight: 700; text-decoration: none; text-align: center; }
.btn--main { min-height: 56px; background: var(--accent); border-color: var(--accent); color: #fff; font-size: 18px; }
.btn--accent { border-color: var(--accent); }
.btn--link { justify-content: space-between; min-height: 56px; padding: 0 18px; font-size: 17px; }
.btn[disabled], .btn[aria-disabled="true"] { background: #D9D4CE; border-color: #D9D4CE; color: #6B635C; cursor: not-allowed; }
.btn--danger { border-color: var(--error); color: var(--error); }

.choice { display: flex; align-items: center; gap: 16px; padding: 22px 20px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--accent); color: var(--ink); text-decoration: none; text-align: left; width: 100%; }
.choice--main { background: var(--accent); color: #fff; }
.choice__title { display: block; font-size: 20px; font-weight: 700; }
.choice__sub { display: block; font-size: 13px; margin-top: 4px; }
.choice:not(.choice--main) .choice__sub { color: var(--sub); }

/* 入力 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .legend { font-size: 13px; font-weight: 700; }
.field__head { display: flex; align-items: center; gap: 8px; }
.input { width: 100%; height: 50px; border: 1.5px solid var(--line); border-radius: 8px; padding: 0 14px; font-size: 17px; background: var(--card); }
textarea.input { height: auto; padding: 12px 14px; font-size: 16px; resize: none; }
.input--big { height: 60px; font-size: 26px; font-weight: 700; }
.input.is-check { border: 2px solid var(--warn-line); background: var(--warn-bg); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--warn-strong); color: #3D2E00; font-size: 12px; font-weight: 700; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; }

.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opts--wrap { display: flex; flex-wrap: wrap; }
.opts--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opt { position: relative; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border-radius: 8px; background: var(--card); border: 1.5px solid var(--line); font-size: 15px; }
.opt input { width: 20px; height: 20px; margin: 0; flex: none; }
.opt:has(input:checked) { border: 2px solid var(--ink); font-weight: 700; }
.opt--pill { justify-content: center; padding: 0 4px; }
.opt--pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; }
.opt--pill:has(input:checked) { background: var(--ink); color: #fff; }
.opt--pill:has(input:focus-visible) { outline: 3px solid #1F5FBF; outline-offset: 2px; }

/* 写真 */
.photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: #CFC8C1; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo__del { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: 0; background: none; display: flex; align-items: flex-start; justify-content: flex-end; padding: 4px; }
.photo__del span { width: 24px; height: 24px; border-radius: 50%; background: rgba(31, 26, 23, .85); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }

/* 金額 */
.total { background: var(--ink); color: #fff; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.total__yen { font-size: 40px; font-weight: 700; line-height: 1.2; }
.total__yen small { font-size: 18px; font-weight: 500; }
.total--empty .total__yen { font-size: 20px; }

/* ログイン */
.hero { background: var(--accent); color: #fff; padding: 72px 24px 40px; display: flex; flex-direction: column; gap: 8px; }
.hero h1 { font-size: 30px; line-height: 1.3; }
.hero p { margin: 0; font-size: 14px; line-height: 1.6; }

/* 履歴 */
.hist { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--card); color: var(--ink); text-decoration: none; }
.hist__meta { font-size: 12px; color: var(--sub); }
.hist__title { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.hist__sub { font-size: 13px; color: var(--sub); }
.hist svg { margin-left: auto; flex: none; }
.day { font-size: 14px; font-weight: 700; margin-top: 4px; }
.busy { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; font-size: 16px; font-weight: 700; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--soft-line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
[hidden] { display: none !important; }
