:root {
  --cream: #fffaf3;
  --ink: #33241a;
  --org-50: #fff5e9;
  --org-100: #ffe6cb;
  --org-200: #ffd0a0;
  --org-300: #ffb066;
  --org-500: #f07c1c;
  --org-600: #dd610d;
  --org-700: #b4490a;
  --org-800: #8c380b;
  --gold-100: #f8edcc;
  --gold-300: #ecd48c;
  --gold-400: #dfbd62;
  --gold-500: #cfa646;
  --gold-600: #b38a2e;
  --gold-700: #8c6a22;
  --sans: "Noto Sans JP", system-ui, sans-serif;
  --display: "Shippori Mincho", "Noto Sans JP", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.8; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
a { color: var(--org-700); }

/* ヘッダー */
.site-header { background: linear-gradient(115deg, var(--org-800) 0%, var(--org-600) 45%, var(--org-500) 78%, #f6a23a 100%); color: #fff; border-bottom: 3px solid var(--gold-400); position: relative; overflow: hidden; }
.site-header::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 88% -20%, rgba(255, 236, 170, .55), transparent 46%), radial-gradient(circle at 62% 130%, rgba(255, 220, 140, .28), transparent 40%); pointer-events: none; }
.header-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.logo { display: flex; flex-direction: column; align-items: center; padding: 6px 12px; border: 1px solid rgba(248, 237, 204, .7); border-radius: 10px; background: rgba(140, 56, 11, .25); }
.logo-main { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: .12em; color: var(--gold-300); line-height: 1.1; }
.logo-rule { width: 100%; height: 1px; background: var(--gold-400); margin: 3px 0; }
.logo-sub { font-size: 9px; letter-spacing: .3em; color: var(--gold-100); line-height: 1.2; }
.brand-kicker { margin: 0; font-size: 12px; letter-spacing: .15em; color: var(--gold-100); }
.brand-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(19px, 3.6vw, 28px); letter-spacing: .06em; line-height: 1.35; text-shadow: 0 1px 2px rgba(120, 45, 5, .35); }
.btn-header { border: 0; border-radius: 999px; padding: 9px 18px; font-size: 14px; font-weight: 700; cursor: pointer; background: #fff; color: var(--org-700); white-space: nowrap; box-shadow: 0 2px 8px rgba(120, 45, 5, .25); transition: .2s; }
.btn-header:hover { background: var(--gold-100); }

/* 本文 */
.main { padding-top: 30px; padding-bottom: 60px; }
.panel-head { margin-bottom: 20px; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .28em; color: var(--gold-600); }
.panel-head h2 { margin: 2px 0 8px; font-family: var(--display); font-weight: 800; font-size: clamp(22px, 4vw, 30px); color: var(--org-700); line-height: 1.4; }
.panel-head h2::after { content: ""; display: block; width: 72px; height: 3px; margin-top: 10px; border-radius: 3px; background: linear-gradient(90deg, var(--org-500), var(--gold-400)); }
.lead { margin: 0; color: rgba(51, 36, 26, .8); max-width: 52em; }
.card { background: #fff; border-radius: 18px; box-shadow: 0 2px 6px rgba(180, 73, 10, .06), 0 0 0 1px var(--org-100); padding: 24px; margin-bottom: 22px; }
.card h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--org-700); line-height: 1.5; }
.result-card { border-top: 4px solid var(--org-500); }
.hint { font-size: 12px; font-weight: 400; color: rgba(51, 36, 26, .62); font-family: var(--sans); }
p.hint { margin: 6px 0 0; }
.label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--org-700); }
.opt { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 99px; background: var(--gold-100); color: var(--gold-700); font-size: 11px; font-weight: 700; }
.input { width: 100%; border: 1px solid var(--org-200); background: #fff; border-radius: 12px; padding: 10px 14px; font: inherit; font-size: 15px; color: var(--ink); outline: none; transition: .2s; }
.input:focus { border-color: var(--org-500); box-shadow: 0 0 0 3px var(--org-100); }
.input::placeholder { color: rgba(51, 36, 26, .34); }
.textarea { resize: vertical; line-height: 1.9; display: block; }
.select { width: auto; padding-right: 30px; }
.grow { flex: 1; width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; margin-top: 12px; }
.row.top0 { margin-top: 0; align-items: flex-start; }
.mt { margin-top: 18px; }
.count { font-size: 13px; color: rgba(51, 36, 26, .65); }

/* ボタン */
button { font-family: inherit; }
.btn-primary, .btn-gold, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; padding: 10px 24px; font-size: 14px; font-weight: 700; cursor: pointer; transition: .2s; line-height: 1.5; }
.btn-primary { background: linear-gradient(90deg, var(--org-700), var(--org-500)); color: #fff; box-shadow: 0 3px 10px rgba(221, 97, 13, .32); }
.btn-gold { background: linear-gradient(90deg, var(--gold-700), var(--gold-500)); color: #fff; box-shadow: 0 2px 8px rgba(140, 106, 34, .28); }
.btn-ghost { background: transparent; color: var(--org-700); box-shadow: inset 0 0 0 1px var(--org-200); font-weight: 500; padding: 9px 16px; }
.btn-ghost:hover { background: var(--org-50); }
.btn-primary:hover, .btn-gold:hover { filter: brightness(1.07); }
button:disabled { opacity: .4; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 34px; font-size: 16px; }
.danger { color: #a33a3a; box-shadow: inset 0 0 0 1px #e6c3c3; }

/* お知らせ・進行状況 */
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--gold-100); border: 1px solid var(--gold-300); color: #5c4718; border-radius: 14px; padding: 12px 18px; margin-bottom: 20px; font-size: 14px; }
.empty { padding: 18px; text-align: center; color: rgba(51, 36, 26, .62); background: var(--org-50); border-radius: 12px; font-size: 14px; }
.progress { margin-top: 16px; padding: 14px 16px; background: var(--org-50); border-radius: 12px; }
.progress-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.progress-msg { color: var(--org-700); font-weight: 500; }
.progress.error .progress-msg { color: #a33a3a; }
.bar { height: 8px; background: #fff; border-radius: 99px; overflow: hidden; margin-top: 10px; box-shadow: inset 0 0 0 1px var(--org-100); }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--org-500), var(--gold-400)); border-radius: 99px; transition: width .4s; }
.progress.running .bar > i { width: 100% !important; background-size: 200% 100%; animation: shine 1.6s linear infinite; background-image: linear-gradient(90deg, var(--org-500), var(--gold-300), var(--org-500)); }
@keyframes shine { to { background-position: -200% 0; } }

/* 紹介文 */
.result-meta { margin: 4px 0 0; font-size: 13px; color: rgba(51, 36, 26, .65); }
.badge { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #e3f3e8; color: #1f6b45; }
.badge.warn { background: #fdecc8; color: #8a5a00; }
.len-note { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: #fdf3dc; border: 1px solid var(--gold-300); color: #6b4e10; font-size: 13px; }
.blurb { margin-top: 16px; padding: 22px 24px; background: #fffdf9; border: 1px solid var(--org-100); border-radius: 14px; font-size: 16px; line-height: 2.05; overflow-wrap: anywhere; }
.blurb p { margin: 0 0 1.25em; }
.blurb p:last-child { margin-bottom: 0; }
.blurb b { color: var(--org-700); font-weight: 800; }
.blurb u { text-decoration-color: var(--gold-500); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.copy-bar { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--org-200); }

/* 履歴 */
.h-group { margin-top: 20px; }
.h-group-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); padding-left: 10px; border-left: 4px solid var(--gold-400); }
.h-group-title small { font-family: var(--sans); font-size: 12px; font-weight: 400; color: rgba(51, 36, 26, .55); }
.h-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 12px 16px; border: 1px solid var(--org-100); border-radius: 12px; margin-bottom: 8px; background: #fff; transition: .15s; }
.h-item.current { border-color: var(--org-500); background: var(--org-50); box-shadow: 0 0 0 2px var(--org-100); }
.h-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: rgba(51, 36, 26, .65); }
.h-meta b { font-family: var(--display); font-size: 15px; color: var(--org-700); }
.h-excerpt { margin: 2px 0 0; font-size: 13px; color: rgba(51, 36, 26, .78); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.h-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cmp-check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--gold-300); font-size: 13px; color: var(--gold-700); cursor: pointer; font-weight: 500; user-select: none; }
.cmp-check:has(input:checked) { background: var(--gold-100); font-weight: 700; }
.cmp-check input { accent-color: var(--org-600); width: 15px; height: 15px; margin: 0; }

/* 見比べ */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.cmp-col { min-width: 0; }
.cmp-head { padding: 10px 14px; border-radius: 12px 12px 0 0; background: linear-gradient(90deg, var(--org-700), var(--org-500)); color: #fff; font-size: 13px; }
.cmp-head b { font-family: var(--display); font-size: 16px; margin-right: 8px; }
.cmp-col .blurb { margin-top: 0; border-radius: 0 0 12px 12px; padding: 18px; font-size: 15px; line-height: 1.95; max-height: 78vh; overflow: auto; }
.cmp-foot { margin-top: 8px; display: flex; justify-content: flex-end; }
.cmp-wait { grid-column: 1 / -1; }

/* 設定 */
.modal { position: fixed; inset: 0; background: rgba(70, 35, 10, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { background: #fff; border-radius: 20px; padding: 26px; width: min(560px, 100%); max-height: 92vh; overflow: auto; border-top: 4px solid var(--gold-400); }
.modal-box h3 { margin: 0 0 16px; font-family: var(--display); font-size: 20px; color: var(--org-700); }
.test-msg { min-height: 1.6em; margin: 10px 0 0; font-size: 13px; }
.test-msg.ok { color: #1f6b45; }
.test-msg.ng { color: #a33a3a; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--org-800); color: #fff; padding: 10px 22px; border-radius: 99px; font-size: 14px; z-index: 60; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: 90vw; text-align: center; }
.site-footer { text-align: center; font-size: 11px; color: rgba(51, 36, 26, .5); padding: 24px 0 36px; }

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .logo { display: none; }
  .blurb { padding: 16px; font-size: 15px; }
  .h-item { grid-template-columns: 1fr; }
  .h-actions { justify-content: flex-start; }
  .compare { grid-template-columns: 1fr; }
  .btn-lg { width: 100%; }
}
