:root {
  --c-bg: #f7f8fa;
  --c-card: #ffffff;
  --c-border: #e3e6eb;
  --c-text: #1f2630;
  --c-muted: #6b7280;
  --c-primary: #2b6cb0;
  --c-primary-text: #ffffff;
  --c-danger: #c53030;
  --c-success: #2f855a;
  --c-warn: #b7791f;
  --c-disabled: #e5e7eb;
  --c-mine: #c6f6d5;
  --c-busy: #fed7d7;
  --c-free: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.mock-banner {
  background: #fff5d6;
  border-bottom: 2px solid #f6c453;
  color: #7a5b00;
  text-align: center;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}

.hdr {
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 10;
}
.hdr-inner {
  max-width: 1000px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-weight: 700; color: var(--c-text); }
.hdr nav a { margin-left: 16px; }

.container { max-width: 1000px; margin: 0 auto; padding: 16px; }
.ftr { max-width: 1000px; margin: 24px auto; padding: 16px; color: var(--c-muted); font-size: 12px; text-align: center; }

.card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
}
.card h2 { margin-top: 0; font-size: 18px; }

.note {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 14px;
}
.note strong { color: #b7791f; }

.muted { color: var(--c-muted); font-size: 13px; }
.err { color: var(--c-danger); }
.ok { color: var(--c-success); }

button, .btn {
  display: inline-block;
  font: inherit;
  background: var(--c-primary); color: var(--c-primary-text);
  border: none; border-radius: 8px;
  padding: 10px 16px; cursor: pointer;
  min-height: 44px; line-height: 1.2;
  text-align: center;
}
button:hover, .btn:hover { opacity: 0.9; text-decoration: none; color: var(--c-primary-text); }
button:disabled { background: var(--c-disabled); color: #888; cursor: not-allowed; }
button.danger, .btn.danger { background: var(--c-danger); }
button.secondary, .btn.secondary { background: #fff; color: var(--c-primary); border: 1px solid var(--c-primary); }
button.secondary:hover, .btn.secondary:hover { color: var(--c-primary); }

input[type="text"], input[type="url"], select {
  font: inherit; padding: 10px 12px;
  border: 1px solid var(--c-border); border-radius: 8px;
  width: 100%; min-height: 44px;
  background: #fff;
}
label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 14px; }
.field-row { display: flex; gap: 8px; }
.field-row > * { flex: 1; }

.room-list { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .room-list { grid-template-columns: 1fr 1fr; } }
.room-card { display: block; color: var(--c-text); }
.room-card:hover { text-decoration: none; }
.room-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.room-head h2 { margin: 0; font-size: 18px; }

/* トップ：今日の利用状況ミニバー */
.today-bar { margin-top: 8px; }
.today-bar-hours {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--c-muted);
  padding: 0 1px 2px;
}
.today-bar-hours span { flex: 0 0 auto; }
.today-bar-track {
  display: flex;
  width: 100%;
  height: 18px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--c-free);
}
.today-slot { flex: 1 1 0; min-width: 0; }
.today-slot.free { background: var(--c-free); }
.today-slot.busy { background: var(--c-busy); }
.today-slot.now {
  background: #fc8181;
  position: relative;
}
.today-slot.now::after {
  content: "";
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 50%;
  width: 2px;
  background: #c53030;
  transform: translateX(-50%);
}
.today-bar-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--c-muted);
  margin-top: 6px;
  flex-wrap: wrap;
}
.today-bar-legend .legend-box {
  display: inline-block;
  width: 10px; height: 10px;
  vertical-align: middle;
  margin-right: 3px;
  border: 1px solid var(--c-border);
}
.today-bar-legend .legend-box.free { background: var(--c-free); }
.today-bar-legend .legend-box.busy { background: var(--c-busy); }
.today-bar-legend .legend-box.now { background: #fc8181; border-color: #c53030; }

.status-free { color: var(--c-success); font-weight: 700; }
.status-busy { color: var(--c-danger); font-weight: 700; }
.status-closed { color: var(--c-muted); font-weight: 700; }

.tt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tt {
  border-collapse: collapse;
  min-width: 720px;
  font-size: 13px;
}
.tt th, .tt td {
  border: 1px solid var(--c-border);
  padding: 0; text-align: center;
  white-space: nowrap;
}
.tt th.hour { background: #fafafa; font-weight: 600; padding: 4px 2px; min-width: 44px; }
.tt th.date { background: #fafafa; min-width: 110px; text-align: left; padding: 6px 8px; }
.tt td.slot { width: 11px; height: 32px; background: var(--c-free); cursor: pointer; }
.tt td.slot.busy { background: var(--c-busy); cursor: not-allowed; }
.tt td.slot.mine { background: var(--c-mine); }
.tt td.slot.closed { background: #eef0f3; cursor: not-allowed; }
.tt td.slot.past { background: #eef0f3; opacity: 0.6; cursor: not-allowed; }
.tt td.slot.start-of-hour { border-left: 2px solid var(--c-border); }
.tt-legend { font-size: 12px; color: var(--c-muted); margin: 8px 0; }
.tt-legend .legend-box {
  display: inline-block; width: 12px; height: 12px;
  vertical-align: middle; margin: 0 4px 0 12px;
  border: 1px solid var(--c-border);
}

table.admin { width: 100%; border-collapse: collapse; font-size: 14px; }
table.admin th, table.admin td {
  border-bottom: 1px solid var(--c-border);
  padding: 8px; text-align: left; vertical-align: top;
}
table.admin th { background: #fafafa; }

.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copy-row input { font-family: ui-monospace, monospace; font-size: 13px; }

.flow-nav {
  background: #eef4ff;
  border: 1px solid #b9d2ff;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 13px;
}
.flow-nav strong { color: #2b4eb0; }
.flow-nav a { margin-right: 10px; }
