:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --ink: #1c2330;
  --sub: #5d6675;
  --line: #e2ded6;
  --brand: #1d3557;
  --brand-strong: #142640;
  --brand-soft: #e9eef5;
  --accent: #a8834a;
  --closed-bg: #ebe8e2;
  --closed-ink: #aaa59c;
  --warn-bg: #fdf3e2;
  --warn-ink: #8a4b0f;
  --danger: #a3261c;
  --ok: #1f6f4a;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
a { color: var(--brand); text-underline-offset: 3px; }
h1 { font-size: 21px; line-height: 1.5; margin: 6px 0 10px; letter-spacing: .02em; }
h2, h3 { margin: 0; }
p { margin: 0 0 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid #7fa3cf;
  outline-offset: 2px;
}

/* ---- 枠組み ---- */
.demo-banner {
  padding: 8px 16px;
  background: #fff4d6;
  border-bottom: 1px solid #ecd9a4;
  color: #6b4e0e;
  font-size: 13px;
}
header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--brand-strong); text-decoration: none; }
.brand-mark {
  width: 14px; height: 14px;
  background: linear-gradient(135deg, var(--brand) 0 55%, var(--accent) 55% 100%);
  border-radius: 3px;
  align-self: center;
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .08em; }
.brand-sub { color: var(--sub); font-size: 13px; letter-spacing: .06em; }
.page { max-width: 1040px; margin: 0 auto; padding: 18px 16px 40px; }
.site-footer { max-width: 1040px; margin: 0 auto; padding: 18px 16px 32px; color: var(--sub); font-size: 12px; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; }

.intro { margin-bottom: 14px; }
.lead { color: var(--sub); }
.fine { color: var(--sub); font-size: 13px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
}
.notice {
  margin: 0 0 14px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--brand-soft);
  border: 1px solid #cdd8e7;
}
.notice.warn { background: var(--warn-bg); border-color: #efd3a6; color: var(--warn-ink); }

/* ---- 所要時間と週の切り替え ---- */
.controls { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.segmented { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.segmented-label { font-size: 13px; color: var(--sub); margin-right: 6px; }
.segmented a {
  min-width: 72px;
  min-height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 14px;
  border: 1px solid #c9d3e1;
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
.segmented a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.week-label { font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.nav-btn {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #c9d3e1;
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
}
.nav-btn.off { color: var(--closed-ink); border-color: var(--line); background: transparent; }
.legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--sub); font-size: 13px; margin: 6px 0 12px; }
.legend .chip.sample { min-height: 28px; padding: 0 10px; font-size: 12px; margin-left: 6px; }
.legend .chip.sample:first-child { margin-left: 0; }

/* ---- 週の枠 ---- */
.week { display: grid; gap: 12px; }
.day {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.day-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; font-size: 15px; }
.day-date { font-size: 18px; font-weight: 700; color: var(--brand-strong); }
.day-wd { color: var(--sub); font-weight: 600; }
.day-tag { margin-left: auto; font-size: 12px; color: var(--sub); background: var(--closed-bg); border-radius: 999px; padding: 1px 9px; font-weight: 500; }
.day-off .day-date { color: var(--sub); }
.day-none { margin: 0; color: var(--closed-ink); font-size: 13px; }
.slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chip {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  text-decoration: none;
}
.chip.open { background: var(--surface); border: 1px solid var(--brand); color: var(--brand); font-weight: 700; }
.chip.open:hover { background: var(--brand); color: #fff; }
.chip.closed { background: var(--closed-bg); color: var(--closed-ink); border: 1px solid transparent; cursor: default; }

/* ---- 申込フォーム ---- */
.back { display: inline-block; margin-bottom: 6px; font-size: 14px; }
.picked {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  margin: 4px 0 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}
.picked-label { width: 100%; font-size: 12px; color: var(--sub); letter-spacing: .04em; }
.picked-when { font-size: 17px; color: var(--brand-strong); }
.picked-len { font-size: 13px; color: var(--sub); }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.req, .opt { font-style: normal; font-size: 11px; font-weight: 600; border-radius: 4px; padding: 0 6px; }
.req { color: #fff; background: var(--accent); }
.opt { color: var(--sub); background: var(--closed-bg); }
.field-help { font-size: 12px; color: var(--sub); }
.field-error { font-size: 13px; color: var(--danger); font-weight: 600; }
input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #c9cfd8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
[aria-invalid="true"] { border-color: var(--danger); background: #fff8f7; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---- ボタン ---- */
button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: var(--brand-strong); }
button[disabled] { opacity: .6; cursor: progress; }
.secondary { background: var(--surface); color: var(--brand); border-color: #c9d3e1; }
.secondary:hover { background: var(--brand-soft); }
.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.danger:hover { background: #861d15; }
.wide { width: 100%; }

/* ---- 完了・確認画面 ---- */
.done { text-align: left; display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.done .button { align-self: flex-start; margin-top: 8px; }
.done-mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ok);
  position: relative;
}
.done-mark::after {
  content: ""; position: absolute; left: 13px; top: 8px; width: 8px; height: 15px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.done-when { font-size: 17px; font-weight: 700; color: var(--brand-strong); }
.hint { margin-top: 8px; padding: 12px 14px; border-radius: 8px; background: var(--brand-soft); font-size: 14px; }
.hint p { margin: 4px 0 0; }
.status-line { color: var(--sub); }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--closed-bg); color: var(--sub); }
.badge-pending { background: #fdf0d8; color: #8a5a0b; }
.badge-confirmed { background: #dff1e7; color: var(--ok); }
.details { display: grid; grid-template-columns: 5.5em 1fr; gap: 8px 12px; margin: 0 0 14px; }
.details dt { color: var(--sub); font-size: 13px; padding-top: 1px; }
.details dd { margin: 0; }
.multiline { white-space: pre-wrap; }
.actions { display: flex; flex-direction: column; gap: 12px; }
.actions p { margin: 0; }

/* ---- デモの送信記録 ---- */
.section-title { font-size: 16px; margin: 18px 0 8px; }
.plain-list { margin: 0; padding-left: 32px; }
.mail { margin-bottom: 12px; }
.mail-meta { font-size: 12px; color: var(--sub); margin: 0 0 4px; }
.mail-subject { font-size: 15px; margin-bottom: 8px; }
.mail-body { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.7; background: #faf9f6; padding: 10px 12px; border-radius: 8px; }

/* ---- 広い画面: 曜日を横に並べる ---- */
@media (min-width: 720px) {
  h1 { font-size: 26px; }
  .page { padding-top: 26px; }
  .controls { flex-direction: row; align-items: center; justify-content: space-between; }
  .week-nav { gap: 16px; }
  .card { padding: 22px 24px; }
}
@media (min-width: 900px) {
  .week { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
  .day { padding: 12px 10px; }
  .day-head { flex-wrap: wrap; justify-content: center; text-align: center; }
  .day-tag { margin-left: 0; }
  .slots { grid-template-columns: 1fr; }
  .form { max-width: 640px; }
}
