:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #222222;
  --muted: #6b6b6b;
  --line: #dddad3;
  --primary: #2f5d50;          /* お店のしつらえで上書きされる（admin.js の applyTheme） */
  --primary-text: #ffffff;
  --focus: color-mix(in srgb, var(--primary) 45%, #ffffff);
  --danger: #b3261e;
  --badge-draft: #8a6d1d;
  --badge-future: #2b5e9e;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px; /* iPhone で入力時に拡大されない大きさ */
  line-height: 1.6;
}

h1 { font-size: 1.25rem; margin: 0 0 16px; }
h2 { font-size: 1.05rem; margin: 28px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
h1 + h2 { border-top: 0; padding-top: 0; margin-top: 0; }

.topbar {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.app-name { font-size: .8rem; color: var(--muted); }
.site-name { font-weight: bold; }
.site-select { font-size: 1rem; min-height: 44px; padding: 6px 10px; }
.topbar-menu { display: flex; gap: 16px; }
.small-btn { min-height: 44px; padding: 6px 14px; font-size: .9rem; font-weight: normal; }
.footer-links { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 16px; }
.footer-links a { display: inline-block; padding: 12px; color: var(--primary); }
.req, .opt { font-size: .75rem; font-weight: normal; padding: 0 6px; border-radius: 4px; vertical-align: 2px; }
.req { background: #fdecea; color: var(--danger); }
.opt { background: var(--bg); color: var(--muted); }

main { max-width: 720px; margin: 0 auto; padding: 20px 16px 80px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
}
.narrow { max-width: 420px; margin: 24px auto; }

label { display: block; margin-bottom: 18px; font-weight: bold; }
label.check { font-weight: normal; display: flex; gap: 10px; align-items: flex-start; }
label.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], textarea {
  display: block; width: 100%;
  margin-top: 6px; padding: 12px;
  font: inherit; font-weight: normal;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 10em; }
input[type="date"] { -webkit-appearance: none; appearance: none; min-height: 48px; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input:focus, textarea:focus, .btn:focus-visible, select:focus { outline: 3px solid var(--focus); outline-offset: 1px; }

.hint { display: block; font-weight: normal; font-size: .85rem; color: var(--muted); margin-top: 4px; }
.counter { font-weight: normal; font-size: .8rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 18px;
  font: inherit; font-weight: bold; text-decoration: none;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text);
  cursor: pointer;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }

.error { color: var(--danger); background: #fdecea; border-radius: 8px; padding: 10px 12px; }

.help { margin-top: 16px; font-size: .9rem; }
.help summary { cursor: pointer; color: var(--primary); }

.list-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.list-head h1 { margin: 0; }

.post-list { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; }
.post-list a {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; min-height: 72px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none;
}
.post-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; background: var(--bg); }
.post-meta { min-width: 0; }
.post-date { font-size: .85rem; color: var(--muted); }
.post-title { font-weight: bold; overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: .75rem; padding: 0 8px; border-radius: 999px; border: 1px solid currentColor; margin-left: 6px; }
.badge.draft { color: var(--badge-draft); }
.badge.future { color: var(--badge-future); }

.photo { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0 0 18px; }
.photo legend { font-weight: bold; padding: 0 4px; }
.photo-preview img { display: block; max-width: 100%; max-height: 320px; border-radius: 6px; margin-bottom: 10px; }
.photo-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.file-btn { margin: 0; font-weight: bold; position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.form-actions .btn.primary { flex: 1 1 200px; }
.danger-zone { margin-top: 32px; padding-top: 16px; border-top: 1px dashed var(--line); text-align: right; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content; background: #222; color: #fff; padding: 12px 20px; border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.file-btn.busy { opacity: .6; pointer-events: none; }

/* お店のしつらえ */
body.font-mincho { font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif; }
.brand-logo { display: block; max-height: 32px; max-width: 160px; object-fit: contain; }
.login-logo { max-height: 64px; max-width: 240px; margin: 0 auto 16px; }
.topbar-title { align-items: center; }
h1 { color: var(--primary); }

/* メニュー（Web8 CMS） */
.module-list { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 12px; }
.module-card {
  display: flex; flex-direction: column; gap: 2px;
  padding: 18px 16px; min-height: 72px;
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--primary);
  border-radius: var(--radius); color: inherit; text-decoration: none;
}
.module-card:hover { border-color: var(--primary); }
.module-name { font-weight: bold; font-size: 1.1rem; color: var(--primary); }
.module-desc { font-size: .85rem; color: var(--muted); }
.module-card.off { background: var(--bg); border-left-color: var(--line); cursor: not-allowed; }
.module-card.off .module-name { color: var(--muted); }

/* カレンダー */
.cal-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin: 12px 0; }
.cal-nav h2 { margin: 0; padding: 0; border: 0; text-align: center; font-size: 1.15rem; }
.cal-nav .btn { min-height: 44px; padding: 6px 12px; font-weight: normal; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { text-align: center; font-size: .8rem; color: var(--muted); padding: 4px 0; }
.cal-head.sun { color: #b3261e; }
.cal-head.sat { color: #2b5e9e; }
.cal-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  min-height: 60px; padding: 6px 2px; gap: 2px;
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.cal-cell.empty { background: transparent; border: 0; cursor: default; }
.cal-cell.past { opacity: .55; }
.cal-cell.today { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal-cell[disabled] { cursor: wait; }
.cal-num { font-weight: bold; line-height: 1.2; }
.cal-st { font-size: .7rem; line-height: 1.2; padding: 1px 4px; border-radius: 4px; }
.cal-mark { position: absolute; top: 2px; right: 4px; font-size: .55rem; color: var(--primary); }
.cal-cell.s-closed { background: #fbe9e7; }
.cal-cell.s-closed .cal-st { background: #b3261e; color: #fff; }
.cal-cell.s-am .cal-st, .cal-cell.s-pm .cal-st { background: #f3e2b3; color: #5c4400; }
.cal-cell.s-open.changed .cal-st { background: #dcefe4; color: #1d5a3a; }
.cal-chip { display: inline-block; font-size: .8rem; padding: 0 8px; border-radius: 999px; margin-right: 4px; }
.cal-chip.s-closed { background: #b3261e; color: #fff; }
.cal-chip.s-am, .cal-chip.s-pm { background: #f3e2b3; color: #5c4400; }
.cal-chip.s-open { background: #dcefe4; color: #1d5a3a; }
.cal-legend { margin: 12px 0 4px; line-height: 2; }
.cal-changes { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.cal-changes .link-button { min-height: 32px; }
.cal-dialog { border: 0; border-radius: var(--radius); padding: 20px 16px; width: min(420px, calc(100% - 32px)); }
.cal-dialog::backdrop { background: rgba(0,0,0,.4); }
.cal-dialog h2 { margin-top: 0; padding-top: 0; border-top: 0; }
.cal-choices { border: 0; padding: 0; margin: 0 0 12px; }
.cal-choices label.check { margin-bottom: 4px; align-items: center; min-height: 40px; }
@media (max-width: 380px) { .cal-cell { min-height: 52px; } .cal-st { font-size: .65rem; padding: 0 2px; } }

/* 本文の飾り・見え方・公開のしかた */
.body-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.body-tools .small-btn { min-height: 40px; }
#body-input { margin-top: 0; }
label[for="body-input"] { margin-bottom: 4px; }
.body-preview { margin: 8px 0 18px; padding: 12px; border: 1px dashed var(--line); border-radius: 8px; background: #fffdf8; }
.preview-label { font-size: .8rem; color: var(--muted); margin: 0 0 8px; }
.preview-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 10px; }
.preview-text a { color: var(--primary); }
.preview-photo { display: block; max-width: 100%; max-height: 360px; border-radius: 6px; margin: 0 0 10px; }
.publish-choices { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0 0 18px; }
.publish-choices legend { font-weight: bold; padding: 0 4px; }
.publish-choices label.check { margin-bottom: 8px; }
.notice { background: #fff6dc; border-radius: 8px; padding: 10px 12px; color: #5c4400; }
.badge.review { color: #b05a00; font-weight: bold; }
