/* Notiworks tokens（saiq-portal src/styles/notiworks.css と同じ値） */
:root {
  color-scheme: light;
  --bg: #ffffff; --bg-alt: #f7f7f5; --fg: #191919; --fg-muted: #66645f;
  --line: #e6e5e1; --line2: #d6d4ce; --accent: #191919; --accent-soft: #f1f1ef;
  --keep: #73716b;
  --err: #a8322a; --err-soft: #f7e7e4; --err-fg: #8f2a23;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Arial,
          "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, "Yu Gothic Medium", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
section, .page, .done { scroll-margin-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.7 var(--sans); }
h1, h2, h3, .lead { word-break: auto-phrase; text-wrap: balance; }
h1 { font-size: clamp(26px, 4.4vw, 38px); line-height: 1.35; margin: 0 0 12px; font-weight: 700; }
h2 { font-size: clamp(21px, 3vw, 27px); line-height: 1.4; margin: 0 0 16px; font-weight: 700; }
h3 { font-size: 19px; margin: 0; }
h4 { font-size: 15px; margin: 20px 0 6px; }
a { color: var(--fg); }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 14px; color: var(--fg-muted); }
.hint { font-size: 13px; color: var(--fg-muted); font-weight: 400; }
.lead { color: var(--fg-muted); margin: 0 0 20px; }
.eyebrow { font-size: 13px; font-weight: 700; color: var(--fg-muted); margin: 0 0 4px; letter-spacing: .04em; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 20px; }
.band { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 56px 0; }

/* skip */
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; }
.skip:focus { left: 12px; top: 12px; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* header：ナビは3つだけなので、スマホでも隠さず並べる */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.brand-sub { font-weight: 400; font-size: 13px; color: var(--fg-muted); }
nav { display: flex; gap: 4px; }
nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; text-decoration: none; font-size: 15px; border-radius: 6px; }
nav a:hover { background: var(--accent-soft); }

.notice { margin-top: 16px; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; font-size: 14px; max-width: 960px; }

.hero { padding-top: 40px; padding-bottom: 48px; }

/* 図①：手順（CSS Grid） */
.flow { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; counter-reset: none; }
.flow li { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 15px; position: relative; }
.flow .no { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; align-items: center; justify-content: center; margin-right: 8px; }

/* 手順インジケータ */
.steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.steps li { text-align: center; font-size: 14px; padding: 8px 4px; border-bottom: 3px solid var(--line); color: var(--fg-muted); }
.steps li[aria-current="step"] { border-color: var(--accent); color: var(--fg); font-weight: 700; }
.steps li.done { border-color: var(--line2); color: var(--fg); }

.panel { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 700; font-size: 18px; margin-bottom: 12px; padding: 0; }
.field { margin: 0 0 16px; }
.field > label, .label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--fg); background: #fff; border: 1px solid var(--line2); border-radius: 8px; padding: 10px 12px; min-height: 44px; }
textarea { resize: vertical; }

.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.product { text-align: left; font: inherit; color: inherit; background: #fff; border: 1px solid var(--line2); border-radius: 10px; padding: 14px; cursor: pointer; min-height: 44px; }
.product[aria-checked="true"] { border: 2px solid var(--accent); padding: 13px; background: var(--accent-soft); }
.product .p-name { font-weight: 700; display: block; }
.product .p-desc { font-size: 13px; color: var(--fg-muted); display: block; margin: 2px 0 6px; }
.product .p-price { font-size: 14px; }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { font: inherit; color: inherit; background: #fff; border: 1px solid var(--line2); border-radius: 8px; padding: 8px 14px; min-height: 44px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 受取日カレンダー */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.cal .dow { text-align: center; font-size: 12px; color: var(--fg-muted); }
.day { font: inherit; color: inherit; background: #fff; border: 1px solid var(--line2); border-radius: 8px; min-height: 56px; padding: 4px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.day .d { font-size: 15px; font-weight: 700; }
.day .s { font-size: 11px; color: var(--fg-muted); }
.day[disabled] { background: var(--bg-alt); color: #a9a6a0; cursor: not-allowed; border-style: dashed; }
.day[disabled] .s { color: #8f8b84; }
.day[aria-checked="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.day[aria-checked="true"] .s { color: #fff; }
.day.pad { visibility: hidden; }

.summary { display: grid; grid-template-columns: 8em 1fr; gap: 6px 12px; margin: 0 0 12px; }
.summary dt { color: var(--fg-muted); font-size: 14px; }
.summary dd { margin: 0; }
.total { font-size: 20px; font-weight: 700; margin: 8px 0; }

.error { background: var(--err-soft); color: var(--err-fg); border: 1px solid #e8c7c2; border-radius: 8px; padding: 10px 12px; font-size: 14px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 700; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 8px; padding: 0 20px; cursor: pointer; text-decoration: none; }
.btn.ghost { background: #fff; color: var(--fg); border-color: var(--line2); font-weight: 400; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.small-btn { padding: 0 12px; }

.done { margin-top: 0; }
.done-title { font-weight: 700; font-size: 18px; margin: 0 0 6px; }

/* 店主の画面 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 0; overflow-x: auto; }
.tab { font: inherit; font-size: 15px; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; min-height: 44px; cursor: pointer; color: var(--fg-muted); white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--fg); border-color: var(--accent); font-weight: 700; }

.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.db { width: 100%; border-collapse: collapse; font-size: 15px; }
.db th { text-align: left; font-weight: 400; font-size: 13px; color: var(--fg-muted); border-bottom: 1px solid var(--line); padding: 8px 10px; white-space: nowrap; }
.db td { border-bottom: 1px solid var(--line); padding: 0; white-space: nowrap; }
.db td > button, .db td > span { display: block; padding: 10px; }
.db td.num, .db th.num { text-align: right; }
.row-btn { font: inherit; color: inherit; background: none; border: 0; text-align: left; width: 100%; min-height: 44px; cursor: pointer; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.db tr.is-new td { background: #fbfaf6; }

.badge { display: inline-block; font-size: 13px; padding: 1px 8px; border-radius: 4px; border: 1px solid var(--line2); background: #fff; }
.badge.s-受付 { background: var(--accent); color: #fff; border-color: var(--accent); }
.badge.s-仕様確認済 { background: var(--accent-soft); }
.badge.s-制作中 { background: #fff; border-style: dashed; }
.badge.s-受渡済 { color: var(--keep); }

.page { margin-top: 16px; border: 1px solid var(--line2); border-radius: 12px; padding: 20px; background: #fff; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.props { display: grid; grid-template-columns: 7em 1fr; gap: 6px 12px; margin: 0 0 16px; font-size: 15px; }
.props dt { color: var(--fg-muted); }
.props dd { margin: 0; }
.spec, .checks { margin: 0; padding-left: 1.2em; }
.checks { list-style: none; padding-left: 0; }
.checks li { min-height: 32px; }
.checks label { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
.checks input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }

.sub { margin: 40px 0 12px; font-size: 17px; }
/* 図④：数量 */
.load { display: grid; gap: 6px; }
.load-row { display: grid; grid-template-columns: 6.5em 1fr 3.5em; align-items: center; gap: 10px; font-size: 14px; }
.bar { height: 14px; background: var(--accent-soft); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; background: var(--accent); }
.load-row.full .bar > span { background: var(--keep); }

/* 図③：構造 */
.arch { display: grid; grid-template-columns: 1fr 32px 1fr 32px 1fr; align-items: stretch; gap: 8px; margin: 8px 0 16px; }
.box { background: #fff; border: 1px solid var(--line2); border-radius: 10px; padding: 16px; }
.box.strong { border: 2px solid var(--accent); padding: 15px; }
.box p { margin: 0 0 4px; }
.box-title { font-weight: 700; }
.arrow { position: relative; }
.arrow::before { content: ""; position: absolute; top: 50%; left: 4px; right: 8px; border-top: 2px solid var(--fg-muted); }
.arrow::after { content: ""; position: absolute; top: calc(50% - 5px); right: 4px; border: 6px solid transparent; border-left-color: var(--fg-muted); border-right: 0; }

.site-foot { border-top: 1px solid var(--line); padding: 28px 0; padding-bottom: max(40px, env(safe-area-inset-bottom)); font-size: 14px; color: var(--fg-muted); }
.site-foot a { min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 820px) {
  input, select, textarea { font-size: 16px !important; }
  .flow { grid-template-columns: 1fr; }
  .products { grid-template-columns: 1fr; }
  .arch { grid-template-columns: 1fr; }
  .arrow { height: 28px; }
  .arrow::before { left: 50%; right: auto; top: 2px; bottom: 8px; border-top: 0; border-left: 2px solid var(--fg-muted); }
  .arrow::after { left: calc(50% - 5px); right: auto; top: auto; bottom: 2px; border: 6px solid transparent; border-top-color: var(--fg-muted); border-bottom: 0; }
  .brand-sub { display: none; }
  .head-row { flex-wrap: nowrap; padding: 0 12px; }
  .cal { gap: 3px; }
  .day .d { font-size: 13px; }
  .day .s { font-size: 10px; }
  nav { gap: 0; }
  nav a { padding: 0 8px; font-size: 14px; }
  .table-scroll::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 36px; pointer-events: none; background: linear-gradient(to right, transparent, var(--bg)); }
  .table-scroll::before { content: "→ 横にスクロールできます"; display: block; font-size: 12px; color: var(--fg-muted); margin: 6px 0; }
  .summary, .props { grid-template-columns: 6em 1fr; }
  .panel, .page { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .001ms !important; animation-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
