:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --sunk: #eef2f6;
  --ink: #16201d;
  --muted: #5b6965;
  --line: #d3dcd8;
  --accent: #0a5a8a;
  --accent-ink: #ffffff;
  --accent-soft: #d9e8f3;
  --ok: #2c7a3a;
  --ok-soft: #dcefdc;
  --few: #9a5a00;
  --few-soft: #f7e7cc;
  --danger: #b3261e;
  --head-ink: #0f2f5c;
  --font-display: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-body: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --r: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.7; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; color: var(--head-ink); }
.brand img { width: 56px; height: 56px; object-fit: contain; }
.brand .shop { font-size: 13px; color: var(--muted); }
.brand h1 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 22px; line-height: 1.3; }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; display: grid; gap: 28px; }
section { display: grid; gap: 12px; min-width: 0; }
h2 { margin: 0; font-family: var(--font-display); font-size: 20px; display: flex; align-items: center; gap: 10px; }
.step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 15px; flex: none; }
.intro p { margin: 0; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.err { margin: 0; color: var(--danger); font-size: 14px; min-height: 1em; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 40px; }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 700; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { padding: 4px 10px; font-size: 14px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.big { padding: 12px 20px; font-size: 17px; width: 100%; }
.btn.danger { color: var(--danger); }

.menus { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .menus { grid-template-columns: minmax(0, 1fr); } }
.menu { position: relative; cursor: pointer; }
.menu input { position: absolute; opacity: 0; pointer-events: none; }
.menu-in { display: grid; gap: 4px; height: 100%; border: 2px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 12px 14px; }
.menu-in strong { font-size: 17px; color: var(--head-ink); }
.menu-in span { font-size: 14px; color: var(--muted); }
.menu input:checked + .menu-in { border-color: var(--accent); background: var(--accent-soft); }
.menu input:focus-visible + .menu-in { outline: 2px solid var(--accent); outline-offset: 2px; }

.cal-bar { display: flex; align-items: center; gap: 10px; }
.cal-month { font-family: var(--font-display); font-size: 18px; min-width: 7.5em; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: 13px; color: var(--muted); font-weight: 700; }
.cal-wd.sun { color: var(--danger); } .cal-wd.sat { color: var(--accent); }
.day { min-height: 86px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 4px; display: flex; flex-direction: column; gap: 2px; text-align: left; min-width: 0; }
button.day { cursor: pointer; }
button.day:hover { border-color: var(--accent); }
.day.out { visibility: hidden; }
.day.off { background: var(--sunk); color: var(--muted); }
.day.sel { border: 2px solid var(--accent); background: var(--accent-soft); }
.day .num { font-weight: 700; font-size: 14px; }
.day.sun .num { color: var(--danger); } .day.sat .num { color: var(--accent); }
.day .tch { font-size: 11px; line-height: 1.35; color: var(--head-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day .mk { margin-top: auto; font-size: 12px; font-weight: 700; border-radius: 4px; padding: 0 4px; text-align: center; white-space: nowrap; overflow: hidden; }
.mk.ok { background: var(--ok-soft); color: var(--ok); }
.mk.few { background: var(--few-soft); color: var(--few); }
.mk.full { background: var(--sunk); color: var(--muted); }
.mk.cand { background: var(--accent); color: var(--accent-ink); }
.mk.rest { background: transparent; color: var(--danger); font-weight: 400; }
.mk.openday { background: var(--ok-soft); color: var(--ok); }
.mk.hear { background: #efe6f8; color: #6b3fa0; } /* ヒアリング（総合システムのカレンダーと同じ紫） */
@media (max-width: 520px) {
  .day { min-height: 64px; padding: 3px 2px; }
  .day .tch { font-size: 10px; letter-spacing: -.03em; line-height: 1.25; } /* スマホでも講師の名前を出す */
  .day .mk { font-size: 11px; padding: 0 1px; }
}

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.slot { border: 2px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 12px; text-align: left; cursor: pointer; display: grid; gap: 2px; }
.slot strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.slot span { font-size: 14px; color: var(--muted); }
.slot.sel { border-color: var(--accent); background: var(--accent-soft); }
.code-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.code-form .field { flex: 1 1 200px; margin: 0; }
.code-big { font-size: 34px; font-weight: 900; letter-spacing: .18em; font-variant-numeric: tabular-nums; margin: 4px 0 8px; user-select: all; }
.reg-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.slots-sm { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.slots-sm .slot { padding: 8px 10px; }
.slots-sm .slot strong { font-size: 16px; }
.slot:disabled { cursor: default; background: var(--sunk); color: var(--muted); }
.day-info { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 10px 14px; font-size: 14px; }
.day-info strong { font-size: 16px; }

.picked { border-left: 4px solid var(--accent); background: var(--surface); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0; }
.cands { display: grid; gap: 8px; }
.cand-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cand-row label { font-weight: 700; min-width: 5em; }
.cand-row input, .cand-row select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

form { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; }
.field label { font-weight: 700; font-size: 15px; }
.req { margin-left: 6px; font-size: 12px; color: var(--danger); font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.field select { -webkit-appearance: none; appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23667' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.done { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 12px; }
.done h2 { color: var(--ok); }
.done dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.done dt { color: var(--muted); }
.done dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 700; }
.tab[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.list { display: grid; gap: 8px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; display: grid; gap: 4px; }
.item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-top .btns { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.item .meta { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; white-space: pre-wrap; }
.item.cancel { opacity: .55; }
.badge { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 4px; white-space: nowrap; background: var(--sunk); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.new { background: var(--few-soft); color: var(--few); }
.badge.menu { background: var(--accent-soft); color: var(--accent); }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.ck-row { display: flex; gap: 14px; flex-wrap: wrap; }
.ck-row label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.ck-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
dialog { border: none; border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgb(0 0 0 / .35); }
.dlg { padding: 18px; display: grid; gap: 14px; }
.dlg h3 { margin: 0; font-family: var(--font-display); font-size: 18px; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.dlg-foot .left { margin-right: auto; }
.login { max-width: 360px; }
.sum { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.code-row b { font-size: 18px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.code-row.off b { color: var(--muted); text-decoration: line-through; }

/* チャット */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; min-height: 200px; overflow-y: auto; padding: 12px; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r); }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.shop { align-self: flex-start; align-items: flex-start; }
.msg .bub { white-space: pre-wrap; overflow-wrap: anywhere; padding: 8px 12px; border-radius: 14px; line-height: 1.6; background: var(--surface); border: 1px solid var(--line); }
.msg.me .bub { background: var(--accent); color: #fff; border-color: var(--accent); }
.msg .at { font-size: 12px; color: var(--muted); margin-top: 2px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.chat-form textarea { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); resize: vertical; }
.chat-badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mem-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 2px solid var(--accent); border-radius: var(--r); background: var(--accent-soft); }
.mem-btns { display: flex; gap: 8px; flex-wrap: wrap; }
#sec-chat > .btn { margin-top: 8px; }
.chat-wrap { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 14px; align-items: start; }
.chat-side { display: grid; gap: 8px; }
.chat-q { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.chat-list { display: grid; gap: 6px; max-height: 65vh; overflow-y: auto; }
.chat-item { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.chat-item.sel { border-color: var(--accent); background: var(--accent-soft); }
.ci-top { display: flex; align-items: center; gap: 4px; }
.ci-at { margin-left: auto; font-size: 12px; color: var(--muted); }
.ci-sub, .ci-last { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-main { display: grid; gap: 8px; min-width: 0; }
@media (max-width: 700px) { .chat-wrap { grid-template-columns: 1fr; } .chat-list { max-height: 30vh; } }

.first-reg { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 18px; padding: 14px 16px; border: 2px solid var(--accent); border-radius: var(--r); background: var(--accent-soft); }
.first-reg strong { font-size: 17px; }
.first-reg[hidden] { display: none; }

/* 料金 */
.prices { margin-top: 14px; display: grid; gap: 8px; }
.prices h3 { font-size: 17px; margin: 0; }
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
.price { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 8px; }
.price h4 { margin: 0; font-size: 16px; color: var(--accent); }
.price .plan { display: grid; gap: 4px; border-top: 1px dashed var(--line); padding-top: 8px; }
.price .plan:first-of-type { border-top: 0; padding-top: 0; }
.price table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price td { padding: 3px 0; border-bottom: 1px solid var(--line); }
.price td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price ul { margin: 0; padding-left: 1.1em; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .price-grid { grid-template-columns: minmax(0, 1fr); } }

/* 原料ピックのプラン */
.plans { display: grid; gap: 6px; margin-bottom: 10px; }
.plan-q { margin: 0; font-weight: 700; }
.plan-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-b { text-align: left; border: 2px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 10px 14px; cursor: pointer; display: grid; gap: 2px; font: inherit; color: inherit; }
.plan-b strong { font-size: 17px; }
.plan-b span { font-size: 13.5px; color: var(--muted); }
.plan-b[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 480px) { .plan-btns { grid-template-columns: minmax(0, 1fr); } }

/* 当日予約の受け付け（管理画面） */
#sameday { margin: 4px 0 12px; }
.item.sameday.on { border-color: var(--ok, #2c7a3a); box-shadow: inset 4px 0 0 var(--ok, #2c7a3a); }

/* リユース卸で「要注意」にしたお客さん */
.item.caution { border-left: 4px solid #c0392b; }
.badge.caution { background: #fde8e6; color: #b42318; }
.caution-why { margin: 0 0 6px; color: #b42318; font-weight: 700; font-size: 13.5px; }

/* 身分証明証のお願い */
.id-note { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; background: #fff4e0; color: #8a4b00; font-weight: 700; font-size: 14px; }

/* お客さま情報の登録：名字と名前を横に並べる */
.name2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* マイページ */
.my-head { display: grid; gap: 10px; }
.my-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.my-tab { font: inherit; font-weight: 700; border: 2px solid var(--line, #d9d9d9); background: #fff; color: inherit; border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.my-tab[aria-selected="true"] { border-color: var(--accent, #2f6f4f); background: var(--accent-soft, #e6f2ea); }
.my-url { font-size: 13px; color: var(--muted, #666); margin: 0; overflow-wrap: anywhere; }
.lv-agree { display: flex; gap: 8px; align-items: center; font-weight: 700; margin: 10px 0; }
.lv-agree input { width: 20px; height: 20px; }
.leave-btn { background: #b42318 !important; border-color: #b42318 !important; color: #fff !important; }
.to-my { margin-top: 6px; }

/* リユース卸のイベント */
.ev-box { border: 2px solid var(--accent, #0a5a8a); border-radius: var(--r, 14px); padding: 14px; background: var(--surface, #fff); }
.ev-list { display: grid; gap: 10px; }
.ev-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 4px; }
.ev-card b { font-size: 17px; }
.ev-card ul { margin: 2px 0; padding-left: 1.2em; }
.ev-card .btn { justify-self: start; margin-top: 4px; }
.ev-form { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }

/* 予約の管理画面を、リユース卸の「予約管理」の中に出すとき：見出しは出さず（ログアウトだけ）、余白もリユース卸に合わせる */
body.embed .top { background: transparent; border: 0; }
body.embed .top .brand > img, body.embed .top .brand > div { display: none; }
body.embed main { max-width: none; padding: 0 0 40px; }
