/* 物販ツールズ — スマホを先に設計し、広い画面で広げる */
:root {
  --ink: #1D211E;
  --muted: #555B56;
  --line: #E3E6E2;
  --line-soft: #EEF0ED;
  --ground: #F7F8F6;
  --surface: #FFFFFF;
  --fill: #F2F4F1;
  --accent: #116149;       /* サイトの色（見出し・強調） */
  --cta: #C2410C;          /* ボタンの色（白文字で 5.2:1） */
  --cta-hover: #9A3412;
  --loss: #B42318;         /* 赤字の表示 */
  --brand: var(--accent);  /* サービスの色（ページごとに上書き） */
  --brand-text: var(--accent);
  --radius: 10px;
  --radius-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
a { color: var(--ink); }
a:hover { color: var(--accent); }
h1, h2, p { margin: 0; }

.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ヘッダー・フッター */
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-logo { display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.site-logo__name { font-size: 19px; font-weight: 700; letter-spacing: .02em; }
.site-logo__tag { font-size: 11px; color: var(--muted); }
.site-header__link { min-height: 44px; display: flex; align-items: center; font-size: 14px; color: var(--muted); text-decoration: none; }
.site-footer { margin-top: 32px; padding: 20px; background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.site-footer__nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer__nav a { min-height: 44px; display: flex; align-items: center; font-size: 13px; color: var(--muted); }
.site-footer__note, .site-footer__copy { font-size: 12px; color: var(--muted); }

/* 見出しまわり */
.hero, .page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 28px 0 24px; }
.page-head { padding: 16px 0 22px; }
.page-head--brand { border-top: 4px solid var(--brand); }
.hero__title { font-size: 28px; line-height: 1.35; font-weight: 700; margin-bottom: 8px; }
.hero__lead, .page-head__lead, .lead { font-size: 15px; line-height: 1.7; color: var(--muted); }
.hero__lead { margin-bottom: 18px; }
.page-head__title { font-size: 26px; font-weight: 700; margin: 4px 0 6px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }
.brand-badge { display: inline-block; font-size: 12px; font-weight: 700; color: var(--brand-text); border: 1.5px solid var(--brand); border-radius: 999px; padding: 2px 10px; }

.section { padding-top: 24px; }
.section__title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.small-note { font-size: 12px; line-height: 1.7; color: var(--muted); margin-top: 12px; }
.muted { color: var(--muted); }

/* カード */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }

/* 入力 */
.form { display: flex; flex-direction: column; gap: 14px; }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form__row--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form__row--3 .field--main { grid-column: 1 / -1; }
.form__note { font-size: 12px; color: var(--muted); text-align: center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 14px; font-weight: 500; }
.field__hint { font-weight: 400; color: var(--muted); }
.field__box { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 12px; background: var(--surface); border: 1px solid #C9CEC8; border-radius: var(--radius); }
.field__box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 97, 73, .18); }
.field--main .field__box { height: 52px; border: 1.5px solid var(--ink); }
.field__input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.field--main .field__input { font-size: 18px; }
.field__unit { font-size: 14px; color: var(--muted); }
.field--error .field__box { border-color: var(--loss); }
.field__error { font-size: 13px; color: var(--loss); }
.field__select { height: 48px; padding: 0 12px; border: 1px solid #C9CEC8; border-radius: var(--radius); background: var(--surface); font: inherit; font-size: 16px; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border: 0; border-radius: var(--radius); font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn--cta { background: var(--cta); color: #FFFFFF; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.btn--cta:hover { background: var(--cta-hover); color: #FFFFFF; }
.btn--large { min-height: 54px; font-size: 17px; width: 100%; }

/* 一覧・タイル */
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.list__item { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; text-decoration: none; border-bottom: 1px solid var(--line-soft); }
.list__item:last-child { border-bottom: 0; }
.list__item > span { display: flex; flex-direction: column; gap: 2px; }
.list__item--card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 52px; }
.list__name { font-size: 15px; font-weight: 500; }
.list__desc { font-size: 12px; color: var(--muted); }
.chevron { flex-shrink: 0; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { min-height: 84px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 12px; text-decoration: none; }
.tile__name { font-size: 15px; font-weight: 700; }
.tile__desc { font-size: 12px; color: var(--muted); }

/* 比較結果 */
.best { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius-lg); background: var(--accent); color: #FFFFFF; margin-bottom: 24px; }
.best__eyebrow { font-size: 13px; font-weight: 500; }
.best__name { font-size: 24px; font-weight: 700; }
.best__profit { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.best__label { font-size: 14px; }
.best__num { font-size: 40px; font-weight: 700; line-height: 1; }
.best__unit { font-size: 16px; font-weight: 700; }
.best__rate { font-size: 14px; margin-left: 8px; }
.best__diff { font-size: 13px; }
.ranking { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ranking__item { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.ranking__item:last-child { border-bottom: 0; }
.ranking__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ranking__name { font-size: 15px; font-weight: 500; display: flex; gap: 12px; }
.ranking__item--top .ranking__name { font-weight: 700; }
.ranking__rank { font-weight: 700; min-width: 1em; }
.ranking__profit { font-size: 18px; font-weight: 700; }
.ranking__detail { font-size: 12px; color: var(--muted); }
.bar { height: 8px; border-radius: 4px; background: var(--line-soft); }
.bar__fill { height: 8px; border-radius: 4px; background: #8C938D; }
.ranking__item--top .bar__fill { background: var(--accent); }
.is-loss { color: var(--loss); }

/* 個別計算 */
.fee-layout { display: grid; gap: 16px; padding-top: 20px; }
.result { display: flex; flex-direction: column; gap: 16px; }
.result--done { border: 1.5px solid var(--accent); }
.result__label { font-size: 14px; font-weight: 500; }
.result__profit { display: flex; align-items: baseline; gap: 6px; color: var(--accent); }
.result__profit.is-loss { color: var(--loss); }
.result__num { font-size: 44px; font-weight: 700; line-height: 1.1; }
.result__unit { font-size: 18px; font-weight: 700; }
.result__empty { font-size: 14px; line-height: 1.7; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: var(--radius); background: var(--fill); }
.stat__label { font-size: 12px; color: var(--muted); }
.stat__value { font-size: 17px; font-weight: 700; }
.breakdown { margin: 0; border-top: 1px solid var(--line-soft); }
.breakdown > div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.breakdown dt, .breakdown dd { margin: 0; }
.breakdown .is-minus { color: var(--muted); }
.breakdown .is-total { border-bottom: 0; padding-top: 12px; font-size: 15px; font-weight: 700; }
.callout { padding: 12px; border-radius: var(--radius); background: var(--fill); }
.callout__title { font-size: 13px; font-weight: 700; }
.callout__text { font-size: 12px; line-height: 1.6; color: var(--muted); }

/* 解説・よくある質問 */
.prose { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.8; }
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.faq details { padding: 4px 16px; border-bottom: 1px solid var(--line-soft); }
.faq details:last-child { border-bottom: 0; }
.faq summary { min-height: 48px; display: flex; align-items: center; font-size: 15px; font-weight: 500; cursor: pointer; }
.faq p { margin: 0 0 14px; font-size: 14px; line-height: 1.8; color: var(--muted); }

/* セミナー */
.seminar { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.seminar__eyebrow { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .08em; }
.seminar__title { font-size: 18px; line-height: 1.5; font-weight: 700; }
.seminar__meta { font-size: 14px; line-height: 1.7; color: var(--muted); margin-bottom: 4px; }

/* 広い画面 */
@media (min-width: 900px) {
  .container { max-width: 1040px; }
  .hero .container, .page-head .container { max-width: 1040px; }
  .hero .form { max-width: 560px; }
  .form__row--3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .form__row--3 .field--main { grid-column: auto; }
  .form--compact { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
  .form--compact .form__row { flex: 1 1 560px; }
  .fee-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 段階制などのまとまり */
.fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fieldset .field__label { padding: 0; }

/* 送料 */
.reasons { margin: 0; padding-left: 1.2em; font-size: 14px; line-height: 1.8; color: var(--ink); }
.tag { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; background: var(--fill); font-size: 11px; font-weight: 500; color: var(--muted); }
.ranking__name a { color: inherit; }

/* 選択肢 */
.choice { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; font-size: 14px; line-height: 1.6; cursor: pointer; }
.choice input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.more { border-top: 1px solid var(--line-soft); padding-top: 8px; }
.more summary { min-height: 44px; display: flex; align-items: center; font-size: 14px; font-weight: 500; color: var(--accent); cursor: pointer; }
.more .fieldset { margin-top: 8px; }

/* 商品コード変換 */
.field__textarea { width: 100%; padding: 12px; border: 1px solid #C9CEC8; border-radius: var(--radius); background: var(--surface); font: inherit; font-size: 16px; line-height: 1.6; font-family: ui-monospace, "SF Mono", Menlo, monospace; resize: vertical; }
.field__textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 97, 73, .18); }
.codes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.codes__item { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.codes__row { display: flex; gap: 12px; align-items: flex-start; }
.codes__row + .codes__row { margin-top: 10px; }
.codes__img { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 6px; }
.codes__in { font-size: 14px; word-break: break-all; }
.codes__in strong { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; }
.codes__title { font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 2px; }
.codes__none { font-size: 13px; color: var(--loss); }
.prose h2 { font-size: 16px; margin: 18px 0 4px; }
.prose h3 { font-size: 14px; margin: 14px 0 2px; }
.terms { font-size: 13px; line-height: 1.9; }
.terms h6 { font-size: 13px; margin: 16px 0 0; }

/* はみ出し防止（2026-10-12）：入力欄は本来の幅を持つので、グリッドやフレックスの中で縮められるようにする */
.field, .field__box, .form, .card, .fee-layout > * { min-width: 0; }
.field__input { width: 100%; }
.fee-layout { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .fee-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* トップ：お知らせ・タイル6つ */
.notice { padding: 14px 16px; border-radius: 12px; background: #EAF3EF; border: 1px solid #CFE3DA; }
.notice__title { font-size: 14px; font-weight: 700; color: var(--accent); }
.notice__text { font-size: 13px; line-height: 1.7; color: var(--ink); margin-top: 2px; }
@media (min-width: 900px) { .tiles--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 表（利益早見表・商品コード） */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line, #E5E5E0); text-align: right; }
.table thead th { position: sticky; top: 0; background: var(--bg-soft, #F6F5F1); font-size: 12px; font-weight: 700; text-align: center; }
.table tbody th { text-align: left; font-weight: 700; }
.table td.is-loss { color: #C0392B; }
.table td.muted { text-align: left; white-space: normal; }
