/* =========================================================
   くまさんのパン屋さん  （モバイルファースト）
   ========================================================= */
:root {
  --bg: #fef5de;
  --text: #58321c;
  --text-sub: #6e4528;      /* 補足文：背景との比 7:1 以上 */
  --accent: #aeb260;        /* オリーブ：文字は濃い茶色 */
  --accent-soft: #e3e5b9;
  --sub: #f0dcaa;
  --card: #fffbef;
  --line: #e2c98e;
  --full: #f1c8b4;          /* 満席 */
  --full-text: #6b2a12;
  --none: #ece4cf;          /* 開催なし */
  --error: #a3260f;
  --radius-lg: 28px;
  --radius: 18px;
  --shadow: 0 4px 0 rgba(88, 50, 28, .08);
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .02em;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.4; margin: 0; }
p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; border-radius: 8px; }
.small { font-size: .875rem; line-height: 1.75; }
.muted { color: var(--text-sub); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- デモ操作バー ---------- */
.demo-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 8px 16px;
  background: var(--text); color: var(--bg);
  font-size: .8125rem;
}
.demo-bar__label { font-weight: 700; padding: 2px 10px; border: 1.5px dashed var(--sub); border-radius: 99px; }
.demo-bar__switch { display: flex; background: rgba(254, 245, 222, .15); border-radius: 99px; padding: 3px; }
.seg {
  border: 0; background: transparent; color: var(--bg);
  padding: 6px 12px; border-radius: 99px; cursor: pointer; font-weight: 700; min-height: 36px;
}
.seg[aria-pressed="true"] { background: var(--accent); color: var(--text); }
.demo-bar__reset {
  margin-left: auto; border: 1.5px solid var(--sub); background: transparent; color: var(--bg);
  padding: 5px 12px; border-radius: 99px; cursor: pointer; min-height: 36px;
}
.demo-bar__reset:hover { background: rgba(254, 245, 222, .12); }
.demo-bar :focus-visible { outline-color: var(--sub); }

.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 60; margin: 0;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px;
  font-size: .875rem; transition: .25s; max-width: calc(100% - 32px); text-align: center;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- レイアウト ---------- */
.layout {
  display: grid; gap: 20px;
  padding: 16px 16px 8px;
  max-width: 640px; margin: 0 auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "fv" "class" "reserve" "sale" "photos" "about";
}
.area-fv { grid-area: fv; }
.area-class { grid-area: class; }
.area-reserve { grid-area: reserve; }
.area-sale { grid-area: sale; }
.area-photos { grid-area: photos; }
.area-about { grid-area: about; }

@media (min-width: 1080px) {
  .layout {
    max-width: 1360px; gap: 28px; padding: 28px 28px 8px;
    grid-template-columns: 280px minmax(0, 1fr) 300px;
    grid-template-areas:
      "sale fv      photos"
      "sale class   photos"
      "sale reserve photos"
      "sale about   photos";
  }
  .sticky { position: sticky; top: 76px; }
}
@media (min-width: 1360px) {
  .layout { grid-template-columns: 300px minmax(0, 1fr) 320px; gap: 36px; }
}

/* ---------- カード・見出し ---------- */
.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  position: relative;
}
@media (min-width: 600px) { .card { padding: 32px 32px; } }

.sec-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.375rem; font-weight: 700; margin-bottom: 16px;
}
.sec-title svg, .sub-title svg {
  width: 38px; height: 38px; flex: none; padding: 6px;
  background: var(--sub); border-radius: 50%; color: var(--text);
}
.sub-title { display: flex; align-items: center; gap: 8px; font-size: 1.125rem; font-weight: 700; margin-bottom: 12px; }
.sub-title:focus { outline: none; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 24px;
  border-radius: 99px; border: 2px solid var(--text);
  font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.4;
  transition: transform .15s, box-shadow .15s;
}
.btn--primary { background: var(--accent); color: var(--text); box-shadow: 0 4px 0 var(--text); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--text); }
.btn--primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--text); }
.btn--ghost { background: var(--card); color: var(--text); }
.btn--ghost:hover { background: var(--sub); }
.btn--lg { min-height: 56px; font-size: 1.0625rem; padding: 12px 28px; }
.btn--sm { min-height: 40px; padding: 6px 18px; font-size: .9375rem; }
.btn--block { width: 100%; }

/* ---------- ファーストビュー ---------- */
.fv {
  position: relative; text-align: center;
  background: var(--sub);
  border-radius: var(--radius-lg);
  padding: 28px 20px 28px;
  overflow: hidden;
}
.fv::before { /* やわらかい水玉 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(254, 245, 222, .7) 2.5px, transparent 3px);
  background-size: 22px 22px; opacity: .6;
}
.fv > * { position: relative; }
.fv__bear { width: 56px; height: 56px; color: var(--text); margin: 0 auto 4px; display: block; }
.fv__sub { font-size: .875rem; font-weight: 700; margin-bottom: 4px; }
.fv__title { font-size: 2.25rem; font-weight: 700; letter-spacing: .06em; line-height: 1.3; margin-bottom: 18px; }
.fv__photo { margin: 0 0 18px; }
.fv__photo img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 40% 40% 28px 28px / 22% 22% 28px 28px;
  border: 4px solid var(--card);
}
.fv__lead { font-size: clamp(.8125rem, 3.7vw, 1rem); margin-bottom: 20px; }
.deco { position: absolute; color: var(--text); opacity: .55; width: 42px; height: 42px; }
.deco--whisk { top: 22px; left: 14px; transform: rotate(-18deg); }
.deco--loaf { top: 26px; right: 12px; transform: rotate(-8deg); }
@media (min-width: 600px) {
  .fv { padding: 36px 40px; }
  .fv__title { font-size: 2.75rem; }
  .fv__title br { display: none; }
  .deco { width: 56px; height: 56px; }
  .deco--whisk { left: 32px; } .deco--loaf { right: 32px; }
}

/* ---------- 教室案内 ---------- */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 16px 0 20px; }
.tags li {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-soft); border-radius: 99px; padding: 4px 14px; font-size: .875rem; font-weight: 700;
}
.tags svg { width: 20px; height: 20px; }

.info { margin: 0; display: grid; gap: 0; }
.info > div {
  display: grid; grid-template-columns: 6.2em 1fr; gap: 12px;
  padding: 12px 0; border-bottom: 2px dotted var(--line);
}
.info > div:first-child { border-top: 2px dotted var(--line); }
.info dt { font-weight: 700; }
.info dd { margin: 0; }
.price { font-size: 1.25rem; }

.notice {
  background: #fff; border: 2px dashed var(--accent); border-radius: var(--radius);
  padding: 12px 16px; margin: 20px 0 0;
}
.notice__head { display: block; font-weight: 700; font-size: .9375rem; }
.notice--allergy strong { background: linear-gradient(transparent 60%, var(--sub) 60%); }

/* ---------- カレンダー ---------- */
.cal { background: #fff; border-radius: var(--radius); border: 2px solid var(--line); padding: 14px 8px 10px; margin-top: 12px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 0 4px; }
.cal__month { font-size: 1.125rem; }
.cal__nav {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--text);
  background: var(--card); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.cal__nav:disabled { opacity: .3; cursor: default; }
.legend { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; padding: 0; margin: 0 0 10px; font-size: .8125rem; }
.legend li { display: flex; align-items: center; gap: 4px; }
.legend__chip { padding: 1px 8px; border-radius: 8px; font-weight: 700; font-size: .75rem; }

.cal__week, .cal__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal__week span { text-align: center; font-size: .8125rem; font-weight: 700; padding: 4px 0; }
.cal__week .mon { background: var(--accent-soft); border-radius: 8px; }

.day {
  min-height: 52px; border-radius: 10px; border: 0; background: transparent; padding: 4px 0 2px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: .9375rem; line-height: 1.2;
}
.day--muted { color: rgba(88, 50, 28, .45); }
.nw { display: inline-block; white-space: nowrap; }
.day__st { font-size: .6875rem; font-weight: 700; line-height: 1.15; text-align: center; letter-spacing: 0; }
.day__seat { font-size: .6875rem; line-height: 1.1; }
.day--today .day__num { text-decoration: underline 2px; text-underline-offset: 3px; }

.st-open { background: var(--accent); color: var(--text); }
.st-full { background: var(--full); color: var(--full-text); }
.st-none { background: var(--none); color: var(--text-sub); }
.legend__chip.st-none { background: transparent; border: 1.5px dashed #b49a70; }
.day.st-open { cursor: pointer; border: 2px solid var(--text); font-weight: 700; }
.day.st-open:hover { transform: translateY(-1px); }
.day.st-open[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.day.st-full { border: 2px solid transparent; }
.day.st-none { background: transparent; border: 1.5px dashed #b49a70; }
@media (min-width: 420px) {
  .cal { padding: 16px 12px 12px; }
  .cal__week, .cal__days { gap: 5px; }
  .day { min-height: 60px; }
  .day__st { font-size: .6875rem; }
}

/* 選択中の日程 */
.pick {
  margin-top: 16px; background: var(--accent-soft); border-radius: var(--radius);
  padding: 16px 18px; text-align: center;
}
.pick__label { font-size: .8125rem; font-weight: 700; margin-bottom: 0; }
.pick__date { font-size: 1.25rem; font-weight: 700; margin-bottom: 2px; }
.pick__seats { margin-bottom: 12px; }

/* ---------- フォーム ---------- */
.form-wrap, .done { margin-top: 24px; padding-top: 24px; border-top: 2px dashed var(--line); }
.demo-note {
  background: var(--sub); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px;
}
.demo-note p { margin-bottom: 4px; }
.demo-note .btn { margin-top: 8px; }
.form-date {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  border: 2px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; background: #fff;
}
.form-date > span:first-child { font-size: .8125rem; font-weight: 700; }

.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 700; margin-bottom: 6px; padding: 0; }
.req {
  display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 6px;
  background: var(--text); color: var(--bg); font-size: .6875rem; vertical-align: 2px; line-height: 1.7;
}
.hint { font-size: .875rem; color: var(--text-sub); margin: -2px 0 6px; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; min-height: 50px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 14px; background: #fff;
  font-size: 1rem; /* iOSでズームしない */
}
textarea { resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input:focus, select:focus, textarea:focus { border-color: var(--text); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field.is-error input, .field.is-error select, .field.is-error textarea { border-color: var(--error); background: #fff6f3; }
.err { color: var(--error); font-size: .875rem; font-weight: 700; margin: 6px 0 0; }
.err:empty { display: none; }
.err::before { content: "！ "; }
.err:empty::before { content: none; }
.err--form { margin-bottom: 12px; }

.radios { display: flex; gap: 10px; margin-top: 8px; }
.radio { flex: 1; position: relative; margin: 0 !important; }
.radio input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio span {
  display: flex; align-items: center; justify-content: center; min-height: 50px;
  border: 2px solid var(--line); border-radius: 14px; background: #fff; font-weight: 700;
}
.radio input:checked + span { background: var(--accent); border-color: var(--text); }
.radio input:checked + span::before { content: "✓ "; white-space: pre; }
.radio input:focus-visible + span { outline: 3px solid var(--text); outline-offset: 2px; }
.field--nested { margin: 14px 0 0; padding: 14px; background: var(--card); border-radius: 14px; border: 2px dashed var(--line); }
.field .notice { margin: 0 0 4px; padding: 8px 12px; }

.policy {
  list-style: none; padding: 14px 16px; margin: 8px 0 18px;
  background: #fff; border-radius: var(--radius); border: 2px solid var(--line);
  font-size: .9375rem; line-height: 1.8;
}
.policy li { position: relative; padding-left: 1.3em; }
.policy li + li { margin-top: 8px; }
.policy li::before { content: "●"; position: absolute; left: 0; color: var(--accent); font-size: .8em; top: .2em; }

/* 完了 */
.done { text-align: left; }
.done .sub-title { font-size: 1.25rem; }
.info--done { margin: 16px 0; background: #fff; border-radius: var(--radius); padding: 4px 16px; }
.info--done > div:first-child { border-top: 0; }
.info--done > div:last-child { border-bottom: 0; }
.done__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.done__actions .btn { flex: 1 1 220px; }

/* ---------- 販売カード ---------- */
.sale__img { margin: 0 0 14px; background: #fff; border-radius: var(--radius); padding: 10px; }
.sale__img img { margin: 0 auto; }
.sale__info { margin: 0 0 12px; display: grid; gap: 8px; }
.sale__info > div { display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 0; align-items: baseline; background: var(--accent-soft); border-radius: 12px; padding: 8px 14px; }
.sale__info dt { font-size: .8125rem; font-weight: 700; min-width: 4.5em; }
.sale__info dd { margin: 0; font-size: 1.0625rem; white-space: nowrap; font-weight: 700; }

/* ---------- スライダー ---------- */
.slider__viewport { overflow: hidden; border-radius: var(--radius); background: #fff; touch-action: pan-y; }
.slider__track { list-style: none; margin: 0; padding: 0; display: flex; transition: transform .45s ease; }
.slide { flex: 0 0 100%; margin: 0; }
.slide img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.slide p { margin: 0; padding: 10px 14px; font-size: .9375rem; font-weight: 700; text-align: center; }
.slider__ctrl { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.slider__btn {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  border: 2px solid var(--text); background: var(--accent); color: var(--text);
  font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: 0 3px 0 var(--text);
}
.slider__btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--text); }
.slider__dots { display: flex; gap: 4px; }
.dot { width: 32px; height: 32px; border: 0; background: transparent; padding: 0; cursor: pointer; display: grid; place-items: center; }
.dot::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--text); background: var(--card); transition: .2s; }
.dot[aria-current="true"]::before { background: var(--text); width: 22px; border-radius: 99px; }
.slider__count { text-align: center; margin: 4px 0 0; color: var(--text-sub); }
@media (prefers-reduced-motion: reduce) { .slider__track { transition: none; } html { scroll-behavior: auto; } }

/* ---------- About me ---------- */
.about__photo { margin: 0 0 16px; }
.about__photo img {
  width: 100%; max-width: 360px; margin: 0 auto; border-radius: 50% 50% 24px 24px / 38% 38% 24px 24px;
  border: 4px solid var(--sub);
}
.about__photo figcaption { text-align: center; font-weight: 700; margin-top: 8px; }
@media (min-width: 720px) {
  .about { display: grid; grid-template-columns: 220px 1fr; gap: 0 28px; }
  .about .sec-title { grid-column: 1 / -1; }
}

.footer { text-align: center; padding: 28px 16px 40px; }
.footer p { margin: 0; font-weight: 700; }

/* ---------- 運営者ページ ---------- */
.admin { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 20px; }
.admin__head { padding: 4px 4px 0; }
.admin__eyebrow { display: inline-block; background: var(--accent); padding: 0 12px; border-radius: 99px; font-weight: 700; font-size: .8125rem; margin-bottom: 6px; }
.admin__title { font-size: 1.75rem; }
.admin__title:focus { outline: none; }
.admin__grid { display: grid; gap: 20px; }
@media (min-width: 1000px) { .admin__grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .detail { position: sticky; top: 76px; } }

.summary { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.summary li { background: #fff; border-radius: 14px; border: 2px solid var(--line); padding: 10px 12px; font-size: .875rem; }
.summary strong { display: block; font-size: 1rem; }
.summary .legend__chip { display: inline-block; margin-top: 4px; }
.bar { height: 8px; border-radius: 99px; background: var(--none); overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; background: var(--text); }

.list-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.list-head .sub-title { margin: 0; }
.filter { display: grid; gap: 2px; font-size: .8125rem; font-weight: 700; min-width: 220px; flex: 1 1 220px; max-width: 320px; }
@media (max-width: 759px) { .filter { max-width: none; flex-basis: 100%; } }
.filter select { min-height: 44px; font-weight: 400; }

.rtable { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.rtable th { text-align: left; font-size: .8125rem; padding: 8px 10px; background: var(--sub); }
.rtable th:first-child { border-radius: 10px 0 0 10px; } .rtable th:last-child { border-radius: 0 10px 10px 0; }
.rtable td { padding: 12px 10px; border-bottom: 2px dotted var(--line); vertical-align: middle; }
.rtable tr.is-active td { background: var(--accent-soft); }
.rtable .btn { min-height: 38px; padding: 4px 14px; font-size: .875rem; }
.badge { display: inline-block; font-size: .6875rem; font-weight: 700; padding: 0 8px; border-radius: 99px; background: var(--text); color: var(--bg); margin-left: 4px; vertical-align: 2px; }
.badge--allergy { background: var(--full); color: var(--full-text); }
.nowrap { white-space: nowrap; }
.empty { text-align: center; padding: 24px 0; color: var(--text-sub); }

@media (max-width: 759px) { /* スマホは表をカードに */
  .rtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; }
  .rtable tr { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 8px 14px; margin-bottom: 10px; }
  .rtable tr.is-active { border-color: var(--text); }
  .rtable tr.is-active td { background: transparent; }
  .rtable td { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px dotted var(--line); }
  .rtable td:last-child { border-bottom: 0; display: block; padding-top: 10px; }
  .rtable td::before { content: attr(data-label); font-size: .8125rem; font-weight: 700; color: var(--text-sub); }
  .rtable td:last-child::before { content: none; }
  .rtable td:last-child .btn { width: 100%; }
}
.detail .info > div { grid-template-columns: 7em 1fr; }
.detail .info dd { word-break: break-all; }
