:root {
  --blue: #a4d4e4;
  --blue-deep: #2f8196;
  --blue-ink: #264b57;
  --blue-pale: #eaf7fa;
  --blue-soft: #dff1f7;
  --ink: #344b55;
  --muted: #687d86;
  --orange: #f28a00;
  --line: #d8e9ef;
  --white: #fff;
  --shadow: 0 16px 45px rgba(55, 111, 132, .13);
  --radius: 18px;
  --max: 1040px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, var(--blue-pale), #fff 460px);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select,
textarea {
  font: inherit;
}

.availability-header {
  border-bottom: 1px solid rgba(164, 212, 228, .65);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
}

.header-inner,
.availability-main,
.availability-footer {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding-inline: 20px;
}

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-ink);
  font-weight: 800;
  letter-spacing: .04em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}

.home-link {
  color: var(--blue-deep);
  font-size: .86rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.availability-main {
  padding-block: 42px 70px;
}

.hero {
  display: grid;
  gap: 24px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue-deep);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .16em;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--blue-ink);
  line-height: 1.45;
}

h1 {
  margin-bottom: 14px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.9rem, 7vw, 3.35rem);
  font-weight: 600;
  letter-spacing: .04em;
  overflow-wrap: normal;
  word-break: keep-all;
}

.lead {
  max-width: 44rem;
  margin: 0;
  color: var(--muted);
}

.status-card {
  align-self: start;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 8px;
  border-bottom: 1px solid var(--line);
}

.status-row:last-child {
  border-bottom: 0;
}

.status-row dt {
  color: var(--blue-deep);
  font-size: .78rem;
  font-weight: 800;
}

.status-row dd {
  margin: 0;
  color: var(--blue-ink);
  font-weight: 800;
}

.notice {
  margin-bottom: 26px;
  padding: 18px 20px;
  border: 1px solid #f3cf9d;
  border-left: 6px solid var(--orange);
  border-radius: 14px;
  background: #fff8ee;
  color: #744b16;
  font-weight: 700;
}

.message-notice {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid #f3cf9d;
  border-radius: 12px;
  background: #fff8ee;
  color: #744b16;
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.55;
}

.usage-card {
  margin-bottom: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.usage-card h2 {
  margin-bottom: 12px;
  font-size: 1.18rem;
}

.usage-steps {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.usage-step {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 14px;
  background: #fafdfe;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.usage-step:hover,
.usage-step:focus-visible {
  outline: 0;
  box-shadow: 0 8px 22px rgba(55, 111, 132, .13);
  transform: translateY(-1px);
}

.usage-step-one {
  border-left-color: var(--orange);
}

.usage-step-two {
  border-left-color: #f6b24b;
}

.usage-step-three {
  border-left-color: #38a957;
}

.usage-step-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-ink);
  font-weight: 900;
}

.usage-card p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

#course-section,
#slots-section,
#line-section {
  scroll-margin-top: 16px;
}

.control-panel,
.message-panel {
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.control-panel {
  padding: 26px;
  border-color: #f2c37e;
}

.message-panel {
  padding: 22px;
}

.section-title {
  margin-bottom: 14px;
  font-size: 1.25rem;
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-badge {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: .95rem;
  font-weight: 900;
}

.step-badge-one {
  background: var(--orange);
}

.step-badge-two {
  background: #f6b24b;
}

.step-badge-three {
  background: #38a957;
}

.course-label {
  display: grid;
  gap: 8px;
  color: var(--blue-ink);
  font-weight: 800;
}

.option-checks {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.option-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--blue-ink);
  background: #fafdfe;
  font-weight: 800;
}

.option-check input {
  width: 18px;
  height: 18px;
  margin-top: .32em;
  accent-color: var(--orange);
  flex: 0 0 auto;
}

.option-check span {
  display: grid;
  gap: 2px;
}

.option-check small {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.priority-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--blue-ink);
  background: #fafdfe;
  font-weight: 800;
}

.priority-check input {
  width: 18px;
  height: 18px;
  margin-top: .32em;
  accent-color: var(--orange);
  flex: 0 0 auto;
}

.priority-check span {
  display: grid;
  gap: 2px;
}

.priority-check small {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.course-label select {
  width: min(100%, 380px);
  min-height: 48px;
  padding: 8px 42px 8px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--blue-ink);
  background: #fafdfe;
}

.course-note,
.line-note,
.empty-message,
.status-message {
  color: var(--muted);
  font-size: .88rem;
}

.staff-grid {
  display: grid;
  gap: 16px;
}

.staff-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.staff-card h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 1.12rem;
}

.staff-hours {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.slot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.slot-button {
  min-width: 72px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  color: var(--blue-ink);
  background: var(--blue-pale);
  font-weight: 800;
  cursor: pointer;
}

.slot-button:hover,
.slot-button:focus-visible {
  border-color: var(--blue-deep);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(164, 212, 228, .45);
}

.slot-button.selected {
  border-color: var(--orange);
  color: #fff;
  background: var(--orange);
}

.slot-button.selected::before {
  content: "✓ ";
}

.staff-grid.priority-mode .slot-button.selected::before {
  content: attr(data-order);
  display: inline-grid;
  width: 1.45em;
  height: 1.45em;
  margin-right: 6px;
  place-items: center;
  border-radius: 999px;
  color: var(--orange);
  background: #fff;
  font-size: .9em;
  line-height: 1;
}

.candidate-inline-hint {
  display: inline-flex;
  flex: 1 0 100%;
  width: fit-content;
  max-width: max-content;
  margin: 0 0 2px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  color: var(--blue-ink);
  background: #edf8f4;
  font-size: .82rem;
  font-weight: 800;
}

.message-preview {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafdfe;
}

.message-preview summary {
  color: var(--blue-ink);
  font-weight: 800;
  cursor: pointer;
}

.message-preview .line-note {
  margin: 8px 0 0;
}

.message-panel textarea {
  width: 100%;
  min-height: 150px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--blue-ink);
  background: #fafdfe;
  resize: vertical;
}

.qr-panel {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blue-pale);
}

.qr-panel[hidden] {
  display: none;
}

.qr-panel h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.qr-panel p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.qr-panel canvas {
  width: 192px;
  height: 192px;
  border: 12px solid #fff;
  border-radius: 10px;
  background: #fff;
}

.qr-image {
  width: 220px;
  height: 220px;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}

.desktop-line-title {
  display: none;
}

.confirm-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--blue-ink);
  background: #fff;
  font-size: .92rem;
  font-weight: 800;
}

.confirm-check input {
  width: 18px;
  height: 18px;
  margin-top: .32em;
  accent-color: var(--orange);
  flex: 0 0 auto;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.line-step {
  margin-top: 16px;
}

.line-step h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.line-step[hidden] {
  display: none;
}

.line-step .line-button {
  margin-top: 10px;
}

.line-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.line-button {
  min-width: min(100%, 320px);
  min-height: 56px;
  font-size: 1.05rem;
  background: #38a957;
  box-shadow: 0 12px 25px rgba(56, 169, 87, .28);
}

.line-button.disabled {
  cursor: not-allowed;
  opacity: .48;
}

.status-message {
  min-height: 1.6em;
  margin: 10px 0 0;
}

.availability-footer {
  padding-block: 26px 38px;
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}

@media (min-width: 760px) {
  .hero {
    grid-template-columns: 1fr 320px;
    align-items: end;
  }

  .staff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .line-step {
    display: none;
  }

  .message-preview {
    display: none;
  }

  .message-notice {
    display: none;
  }

  .candidate-inline-hint,
  .single-selection-hint {
    display: none;
  }

  .mobile-line-title {
    display: none;
  }

  .desktop-line-title {
    display: inline;
  }

  .qr-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 14px;
  }

  .availability-main {
    padding-top: 30px;
  }

  .control-panel,
  .message-panel,
  .staff-card {
    padding: 18px;
  }

  h1 {
    font-size: clamp(1.7rem, 7.6vw, 2.15rem);
    line-height: 1.35;
  }

  .section-title {
    font-size: 1.12rem;
  }

  .slot-button {
    flex: 1 1 72px;
  }

  .line-button {
    width: 100%;
  }

  .message-notice {
    padding: 10px 12px;
    font-size: .86rem;
    line-height: 1.45;
  }

  .qr-panel {
    display: none;
  }
}
