:root {
  --bg: #fafafa;
  --fg: #222;
  --muted: #666;
  --line: #ddd;
  --accent: #b5473c;
  --accent-fg: #fff;
  --ok: #2e7d32;
  --error: #c62828;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.6; }
body.admin { --accent: #345; }
a { color: var(--accent); }
main { max-width: 860px; margin: 0 auto; padding: 1rem 16px 3rem; }
.admin-bar { display: flex; align-items: center; gap: 1rem; padding: 0.4rem 16px; background: #263238; color: #eceff1; font-size: 0.85rem; flex-wrap: wrap; }
.admin-bar nav { display: flex; gap: 0.75rem; }
.admin-bar a { color: #eceff1; text-decoration: none; }
.admin-bar a:hover { text-decoration: underline; }
.admin-bar-label { font-weight: 700; padding: 0 0.4rem; background: var(--accent); color: var(--accent-fg); border-radius: 3px; }
.admin-bar-tools { margin-left: auto; display: flex; gap: 0.75rem; align-items: center; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 16px; border-bottom: 1px solid var(--line); background: #fff; flex-wrap: wrap; }
.site-header .brand { font-weight: 700; text-decoration: none; color: var(--fg); font-size: 1.1rem; }
.site-header nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.site-header nav a { text-decoration: none; }
.site-footer { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between; padding: 1rem 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.badge { display: inline-block; margin-left: 0.5rem; padding: 0 0.4rem; font-size: 0.7rem; background: var(--accent); color: var(--accent-fg); border-radius: 3px; vertical-align: middle; }
form.inline { display: inline; }
button.link { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
button, .button { background: var(--accent); color: var(--accent-fg); border: none; border-radius: 4px; padding: 0.5rem 1rem; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
button.secondary, .button.secondary { background: #fff; color: var(--fg); border: 1px solid var(--line); }
button.danger { background: var(--error); }
button[disabled] { opacity: 0.5; cursor: default; }
.flash { padding: 0.75rem 1rem; border-radius: 4px; }
.flash.ok { background: #e8f5e9; color: var(--ok); }
.flash.error { background: #ffebee; color: var(--error); }
label { display: block; margin: 0.75rem 0 0.25rem; font-weight: 600; }
input[type="text"], input[type="email"], input[type="date"], input[type="time"], input[type="number"], input[type="datetime-local"], select, textarea { width: 100%; padding: 0.5rem; border: 1px solid var(--line); border-radius: 4px; font: inherit; background: #fff; }
textarea { min-height: 12rem; font-family: ui-monospace, monospace; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.actions { margin-top: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1rem; margin: 1rem 0; }
.card h3 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.85rem; color: var(--muted); }
.status { display: inline-block; padding: 0 0.5rem; border-radius: 3px; font-size: 0.8rem; background: #eee; }
.status.published, .status.open { background: #e8f5e9; color: var(--ok); }
.status.cancelled, .status.closed, .status.full { background: #ffebee; color: var(--error); }
.status.draft, .status.before { background: #fff3e0; color: #e65100; }
.event-list { list-style: none; padding: 0; }
.event-list li { background: #fff; border: 1px solid var(--line); border-radius: 6px; margin: 0.75rem 0; overflow: hidden; }
.event-list li a { display: block; padding: 1rem; text-decoration: none; color: inherit; }
.event-list .date { color: var(--muted); font-size: 0.9rem; }
.cover { width: 100%; max-height: 360px; object-fit: cover; border-radius: 6px; }
.slot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.slot:last-child { border-bottom: none; }
.slot .meta { color: var(--muted); font-size: 0.9rem; }
.body-md img { max-width: 100%; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.checks label { display: inline-flex; align-items: center; gap: 0.25rem; margin: 0 0.5rem 0 0; font-weight: normal; }
@media (max-width: 600px) { th, td { padding: 0.4rem 0.25rem; font-size: 0.9rem; } }
li.passkey { margin: 0.5rem 0; }
li.passkey input[type="text"] { width: 14em; display: inline-block; padding: 0.3rem; }

label.check { display: block; margin: 0.75rem 0; font-weight: normal; }
label.check input { width: auto; margin-right: 0.25rem; }
.legal h2 { font-size: 1.05rem; margin-top: 1.5rem; }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.image-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; }
.image-grid.small { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 0.4rem; }
.image-grid.small label { cursor: pointer; border: 2px solid transparent; border-radius: 6px; padding: 1px; }
.image-grid.small label.selected, .image-grid.small label:has(input:checked) { border-color: var(--accent); }
.image-grid.small input { display: none; }
.image-card a { display: inline-block; margin-right: 0.5rem; }
.image-card .small { font-size: 0.8rem; }
