:root {
  --accent: #1f3a5f;
  --accent-soft: #e8eef6;
  --ok: #2e7d32;
  --ng: #b23b3b;
  --line: #d9dee5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: #f4f6f9;
  color: #222;
  line-height: 1.6;
}
.card {
  max-width: 640px;
  margin: 32px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 32px 36px;
}
.event-nav { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.event-tab {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 600;
  background: #fff;
}
.event-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 4px; color: var(--accent); }
.lead { margin: 0 0 12px; color: #555; }
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 0 0 20px;
}
legend { font-weight: 700; color: var(--accent); padding: 0 6px; }
label, .label { display: block; margin: 0 0 14px; font-size: .9rem; font-weight: 600; }
input, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 400;
}
.req { color: var(--ng); font-size: .7rem; margin-left: 4px; }
.hint { color: #888; font-size: .85rem; margin: 4px 0; }

/* 週ナビ */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 4px 0 10px;
}
.week-nav span { font-weight: 700; color: var(--accent); min-width: 12em; text-align: center; }
.week-nav button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  font-size: .9rem;
}
.week-nav button:disabled { color: #ccc; cursor: not-allowed; }

/* 週カレンダー（縦＝時間帯 / 横＝平日） */
.calendar { overflow-x: auto; }
.cal-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal-table th, .cal-table td { border: 1px solid var(--line); text-align: center; }
.cal-table thead th { background: var(--accent-soft); color: var(--accent); font-size: .8rem; padding: 6px 2px; }
.cal-table th.slot-h { background: #fafbfc; font-size: .8rem; font-weight: 600; width: 56px; padding: 2px; }
.cal-table thead th.sat { color: #1f6feb; }
.cal-table thead th.sun { color: #c0392b; }
.cal-table thead th.na { color: #bbb; background: #f4f5f7; }
.daytag { display: inline-block; margin-left: 2px; font-size: .65rem; color: #b23b3b; }
.cal-table td { padding: 3px; }
.cal-table td.na { background: #f4f5f7; }
.daycell { display: inline-block; width: 100%; padding: 7px 0; color: #b0b0b0; font-size: .8rem; font-weight: 600; }
.legend { margin: 8px 0 0; font-size: .72rem; color: #888; }
.cell {
  width: 100%;
  padding: 7px 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.cell.open { background: #eef7ef; color: var(--ok); }
.cell.open:hover { background: #d8eeda; }
.cell.closed { color: #c2c2c2; cursor: not-allowed; }
.cell.unknown { display: inline-block; width: 100%; padding: 7px 0; background: #fff7e6; color: #b8860b; cursor: not-allowed; }
.cell.selected { background: var(--accent); color: #fff; }
.selected-label { margin: 10px 0 0; font-weight: 700; color: var(--accent); font-size: .9rem; min-height: 1.2em; }
#submit {
  width: 100%;
  padding: 13px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
#submit:disabled { background: #b9c2cf; cursor: not-allowed; }
.result {
  margin-top: 20px;
  padding: 16px;
  border-radius: 8px;
  white-space: pre-wrap;
  font-size: .92rem;
}
.result.ok { background: #eef7ef; border: 1px solid var(--ok); color: #1f5d22; }
.result.ng { background: #fbeeee; border: 1px solid var(--ng); color: #8a2d2d; }
