:root {
  --navy: #17324d;
  --blue: #176b87;
  --blue-dark: #0e536c;
  --blue-pale: #eaf6f9;
  --green: #16735a;
  --green-pale: #eaf7f1;
  --orange: #a34f00;
  --orange-pale: #fff4e5;
  --red: #b42318;
  --red-pale: #fff0ee;
  --ink: #1d2939;
  --muted: #5e6b7a;
  --line: #d7dee7;
  --surface: #ffffff;
  --surface-soft: #f5f8fb;
  --shadow: 0 8px 24px rgba(23, 50, 77, 0.08);
  --radius: 18px;
  --radius-small: 11px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f3f6f8;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 4px solid rgba(23, 107, 135, 0.25);
  outline-offset: 2px;
}

.page-shell {
  width: min(100% - 32px, 980px);
  margin-inline: auto;
}

.site-header {
  background: linear-gradient(135deg, var(--navy), var(--blue-dark));
  color: #fff;
  border-bottom: 5px solid #6fc4d8;
}

.header-inner {
  min-height: 126px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
}

.site-header--compact .header-inner {
  min-height: 104px;
}

.clinic-name {
  margin: 0 0 2px;
  color: #d7f2f8;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  line-height: 1.35;
}

.season-label,
.header-link {
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 7px 14px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.header-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.page-main {
  padding-block: 28px 56px;
}

.preview-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  border: 1px solid #f0bf79;
  border-radius: var(--radius-small);
  padding: 14px 16px;
  background: var(--orange-pale);
  color: #713600;
}

.preview-notice strong {
  flex: none;
}

.preview-notice--strong {
  justify-content: center;
  flex-wrap: wrap;
  margin-block: 18px 22px;
}

.status-card,
.content-card,
.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 30px;
}

.status-card h2,
.content-card h2,
.form-card h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.45;
}

.status-card p:last-child {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.status-badge {
  flex: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
}

.status-badge--preparing {
  background: #eef1f5;
  color: #485668;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-block: 20px;
}

.action-grid--single {
  grid-template-columns: 1fr;
}

.action-card {
  min-height: 118px;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  border: 2px solid #b7cad3;
  border-radius: var(--radius);
  padding: 20px;
  background: #fff;
  color: var(--navy);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: var(--shadow);
}

.action-card--primary {
  border-color: var(--blue);
  background: linear-gradient(145deg, #f2fbfd, #fff);
}

.action-card--disabled {
  cursor: not-allowed;
  opacity: 0.58;
  pointer-events: none;
}

.action-card.is-disabled {
  border-color: #c9d2d8;
  background: #eef1f3;
  color: #65727b;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
}

.action-card.is-disabled:hover {
  border-color: #c9d2d8;
  box-shadow: none;
  transform: none;
}

.reservation-unlock-note {
  margin: -6px 2px 0;
  color: #7b3c00;
  font-size: 0.93rem;
  font-weight: 700;
}

.action-icon {
  width: 50px;
  height: 50px;
  display: grid;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-size: 1.7rem;
  font-weight: 700;
}

.action-card strong,
.action-card small {
  display: block;
}

.existing-reservation-guide {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  border: 1px solid #b7cad3;
  border-radius: var(--radius);
  padding: 20px 22px;
  background: #fff;
}

.existing-reservation-icon {
  width: 44px;
  height: 44px;
  display: grid;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-size: 1.4rem;
  font-weight: 800;
}

.existing-reservation-guide h2 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 1.15rem;
}

.existing-reservation-guide p {
  margin: 0;
}

.small-note {
  margin-top: 5px !important;
  color: var(--muted);
  font-size: 0.92rem;
}

.action-card strong {
  margin-bottom: 5px;
  font-size: 1.08rem;
}

.action-card small {
  color: var(--muted);
  line-height: 1.5;
}

.content-card {
  margin-top: 20px;
  padding: 28px 30px;
}

.content-card--muted {
  background: var(--surface-soft);
}

.content-card--attention {
  border: 2px solid #e6a447;
  border-left-width: 9px;
  background: linear-gradient(145deg, #fff5e6, #fffaf2);
}

.content-card--attention h2 {
  color: #7b3c00;
}

.content-card--attention .information-item {
  margin-top: 10px;
  border: 1px solid #efd0a6;
  border-radius: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.attention-confirmation {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 20px;
  border: 2px solid #d8861c;
  border-radius: 12px;
  padding: 15px 17px;
  background: #fff;
  color: #6f3500;
  font-weight: 800;
  cursor: pointer;
}

.attention-confirmation input {
  width: 24px;
  height: 24px;
  flex: none;
  margin: 0;
  accent-color: #b65f00;
}

.attention-confirmation:focus-within {
  outline: 3px solid rgba(0, 128, 170, 0.26);
  outline-offset: 3px;
}

.phone-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  border: 2px solid var(--blue-dark);
  border-radius: 9px;
  padding: 8px 13px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 800;
  text-decoration: none;
}

.phone-button:hover {
  background: var(--blue-pale);
}

.compact-list {
  margin: 0;
  padding-left: 21px;
  color: var(--muted);
}

.compact-list li + li {
  margin-top: 4px;
}

.information-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin-top: 16px;
}

.information-item {
  border-top: 1px solid var(--line);
  padding-block: 17px 5px;
}

.information-item h3 {
  margin: 0 0 5px;
  color: var(--navy);
  font-size: 1rem;
}

.information-item p {
  margin: 0;
  color: var(--muted);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.guide-question {
  margin-block: 12px;
}

.guide-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guide-options button {
  min-height: 54px;
  border: 1px solid #b5c8d1;
  border-radius: 10px;
  padding: 11px 14px;
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.guide-options button:hover {
  border-color: var(--blue);
  background: var(--blue-pale);
}

.guide-answer {
  margin-top: 16px;
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  padding: 17px 18px;
  background: var(--blue-pale);
}

.guide-answer h3,
.guide-answer p {
  margin-top: 0;
}

.guide-answer p:last-child {
  margin-bottom: 0;
}

.guide-answer-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 1.25rem;
}

.guide-answer-list li {
  padding-left: 3px;
}

.guide-back-button {
  min-height: 44px;
  padding: 7px 20px;
}

.questionnaire-download {
  margin-top: 16px;
}

.primary-button,
.secondary-button,
.button-link {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 11px 22px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  border: 2px solid var(--blue-dark);
  background: var(--blue-dark);
  color: #fff;
}

.primary-button:hover {
  border-color: var(--navy);
  background: var(--navy);
}

.secondary-button {
  border: 2px solid #8796a6;
  background: #fff;
  color: var(--navy);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--navy);
  background: #f1f4f7;
}

.secondary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 26px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.footer-small {
  margin-top: 4px !important;
  font-size: 0.85rem;
}

.reserve-main {
  max-width: 900px;
}

.stepper {
  margin: 24px 0;
  overflow: hidden;
}

.stepper ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.stepper li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #6c7887;
  font-weight: 700;
}

.stepper li::before,
.stepper li::after {
  content: "";
  position: absolute;
  top: 18px;
  z-index: -1;
  width: 50%;
  height: 3px;
  background: #ccd5de;
}

.stepper li::before {
  left: 0;
}

.stepper li::after {
  right: 0;
}

.stepper li:first-child::before,
.stepper li:last-child::after {
  display: none;
}

.stepper li span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 3px solid #ccd5de;
  border-radius: 50%;
  background: #f3f6f8;
}

.stepper li.is-active,
.stepper li.is-done {
  color: var(--blue-dark);
}

.stepper li.is-active span,
.stepper li.is-done span {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.stepper li.is-done::before,
.stepper li.is-done::after,
.stepper li.is-active::before {
  background: var(--blue);
}

.form-card {
  padding: 30px;
}

.field-help {
  margin-top: 7px;
  color: var(--muted);
}

.choice-fieldset,
.slot-fieldset {
  margin: 24px 0 0;
  border: 0;
  padding: 0;
}

.choice-fieldset legend {
  font-weight: 800;
}

.choice-fieldset em,
.field em {
  color: var(--red);
  font-size: 0.8rem;
  font-style: normal;
}

.count-choices,
.slot-grid {
  display: grid;
  gap: 12px;
}

.count-choices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.slot-grid {
  grid-template-columns: repeat(2, minmax(0, 180px));
  margin-top: 10px;
}

.count-choices label,
.slot-grid label {
  cursor: pointer;
}

.count-choices input,
.slot-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.count-choices span,
.slot-grid span {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px solid #b8c5d0;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  color: var(--navy);
}

.slot-grid span {
  flex-direction: column;
}

.slot-grid small {
  color: var(--green);
  font-weight: 700;
}

.count-choices input:checked + span,
.slot-grid input:checked + span {
  border-color: var(--blue);
  background: var(--blue-pale);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.12);
}

.inline-notice,
.important-box,
.mail-help-box {
  margin-top: 20px;
  border-radius: var(--radius-small);
  padding: 16px 18px;
}

.inline-notice {
  border: 1px solid #eab269;
  background: var(--orange-pale);
  color: #683300;
}

.inline-notice--neutral {
  border-color: #a9ccd6;
  background: var(--blue-pale);
  color: var(--navy);
}

.inline-notice p,
.mail-help-box p {
  margin: 4px 0 0;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.form-actions--end {
  justify-content: flex-end;
}

.form-actions--center {
  justify-content: center;
}

.subsection {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.subsection h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
}

.field--wide {
  grid-column: 1 / -1;
}

.field input,
.field select {
  width: 100%;
  min-height: 50px;
  border: 2px solid #aab7c4;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
}

.field input:focus,
.field select:focus {
  border-color: var(--blue);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--red);
  background: #fffafa;
}

.birthdate-fields {
  display: grid;
  grid-template-columns: minmax(82px, 1.35fr) auto minmax(62px, 1fr) auto minmax(62px, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.birthdate-fields input,
.birthdate-fields select {
  min-width: 0;
}

.birthdate-unit {
  color: var(--navy);
  font-weight: 700;
  white-space: nowrap;
}

.field small {
  color: var(--muted);
  font-weight: 400;
}

.field-warning {
  color: var(--orange);
  font-size: 0.9rem;
  font-weight: 700;
}

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  font-weight: 700;
  cursor: pointer;
}

.check-line input {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 3px;
  accent-color: var(--blue);
}

.patient-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.patient-card {
  border: 1px solid #cbd6df;
  border-radius: 14px;
  padding: 20px;
  background: #fbfcfd;
}

.patient-card h4 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 1.08rem;
}

.patient-result {
  margin-top: 14px;
  border-left: 4px solid var(--green);
  padding: 10px 12px;
  background: var(--green-pale);
  color: #0d5945;
  font-weight: 700;
}

.patient-result.is-error {
  border-left-color: var(--red);
  background: var(--red-pale);
  color: var(--red);
}

.selection-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  border: 1px solid #a9ccd6;
  border-radius: 10px;
  padding: 13px 15px;
  background: var(--blue-pale);
  color: var(--navy);
}

.selection-status span {
  color: var(--muted);
  font-size: 0.9rem;
}

.representative-fieldset {
  margin-top: 16px;
}

.representative-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.representative-options label {
  cursor: pointer;
}

.representative-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.representative-options span {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  border: 2px solid #b8c5d0;
  border-radius: 10px;
  padding: 10px 13px;
  background: #fff;
  color: var(--navy);
}

.representative-options small {
  color: var(--muted);
  font-weight: 400;
}

.representative-options input:checked + span {
  border-color: var(--blue);
  background: var(--blue-pale);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.12);
}

.external-representative-fields,
.representative-contact-fields {
  margin-top: 18px;
}

.date-field {
  max-width: 330px;
  margin-top: 22px;
}

.error-summary {
  margin-top: 20px;
  border: 2px solid var(--red);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--red-pale);
  color: #7a1b15;
  font-weight: 700;
}

.error-summary ul {
  margin: 6px 0 0;
  padding-left: 22px;
}

.confirmation-content {
  margin-top: 20px;
}

.confirmation-block {
  border-top: 1px solid var(--line);
  padding-block: 16px;
}

.confirmation-block h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 1.05rem;
}

.confirmation-list {
  display: grid;
  grid-template-columns: minmax(130px, 0.4fr) 1fr;
  gap: 5px 16px;
  margin: 0;
}

.confirmation-list dt {
  color: var(--muted);
  font-weight: 700;
}

.confirmation-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.email-confirmation {
  border: 2px solid #e2a24e;
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--orange-pale);
  color: #713600;
  font-size: 1.05rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.important-box {
  border: 1px solid #9ec5d0;
  background: var(--blue-pale);
}

.important-box h3 {
  margin: 0;
  color: var(--navy);
}

.important-box ul {
  margin-bottom: 0;
  padding-left: 22px;
}

.questionnaire-guidance {
  margin-top: 18px;
  border-top: 1px solid #9ec5d0;
  padding-top: 17px;
}

.questionnaire-guidance h4 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 1rem;
}

.questionnaire-guidance p {
  margin: 0;
}

.check-line--consent {
  border: 2px solid #b8c5d0;
  border-radius: 10px;
  padding: 15px;
  background: #fff;
}

.complete-card {
  text-align: center;
}

.complete-mark {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--green-pale);
  color: var(--green);
  font-size: 2.2rem;
  font-weight: 900;
}

.mail-help-box {
  border: 1px solid #e7b46f;
  background: var(--orange-pale);
  color: #713600;
  text-align: left;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 22px, 980px);
  }

  .header-inner {
    min-height: 104px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding-block: 17px;
  }

  .site-header--compact .header-inner {
    min-height: 96px;
  }

  .season-label,
  .header-link {
    align-self: flex-start;
  }

  .preview-notice,
  .status-card,
  .existing-reservation-guide,
  .selection-status {
    flex-direction: column;
    gap: 8px;
  }

  .status-card,
  .content-card,
  .form-card {
    padding: 21px 18px;
  }

  .action-grid,
  .information-grid,
  .guide-options,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: auto;
  }

  .action-card {
    min-height: 104px;
  }

  .stepper li small {
    font-size: 0.72rem;
  }

  .count-choices {
    gap: 7px;
  }

  .count-choices span {
    min-height: 62px;
    padding-inline: 5px;
  }

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

  .representative-options {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions--end,
  .form-actions--center {
    flex-direction: column;
  }

  .form-actions .primary-button,
  .form-actions .secondary-button,
  .form-actions .button-link {
    width: 100%;
  }

  .confirmation-list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .confirmation-list dd {
    margin-bottom: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.patient-help-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: 5px;
  border: 1px solid #9bb0c2;
  border-radius: 50%;
  padding: 0;
  background: #fff;
  color: var(--blue-dark);
  font-size: .9rem;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
}

.patient-help-tip:hover::after,
.patient-help-tip:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 20;
  left: 0;
  right: auto;
  top: 36px;
  width: min(260px, 75vw);
  transform: none;
  border-radius: 9px;
  padding: 10px 12px;
  background: #21364a;
  color: #fff;
  font-size: .84rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  box-shadow: var(--shadow);
}

@media (min-width: 561px) {
  .patient-help-tip.tooltip-open-right:hover::after,
  .patient-help-tip.tooltip-open-right:focus-visible::after {
    left: 0;
    right: auto;
    transform: none;
  }

  .patient-help-tip.tooltip-open-left:hover::after,
  .patient-help-tip.tooltip-open-left:focus-visible::after {
    left: auto;
    right: 0;
    transform: none;
  }
}

.patient-faq {
  margin-top: 24px;
}

.patient-faq details {
  border-top: 1px solid var(--line);
  padding: 15px 2px;
}

.patient-faq summary {
  color: var(--navy);
  font-weight: 800;
  line-height: 1.55;
  cursor: pointer;
}

.patient-faq details p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.reservation-faq,
.manage-faq {
  width: min(100%, 900px);
  margin-inline: auto;
}

@media (max-width: 560px) {
  .patient-help-tip:hover::after,
  .patient-help-tip:focus-visible::after {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 18px;
    width: auto;
    transform: none;
  }
}

/* v0.82: フェーズ案内文の限定装飾 */
.phase-message-red { color: var(--red); }
.phase-message-blue { color: var(--blue); }
.phase-message-black { color: var(--ink); }

.rich-text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.rich-text-toolbar button {
  min-width: 54px;
  border: 1px solid #aab7c4;
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.rich-text-toolbar button:hover,
.rich-text-toolbar button:focus-visible {
  border-color: var(--blue);
  background: var(--blue-pale);
}

.rich-text-editor {
  min-height: 118px;
  margin-top: 8px;
  border: 2px solid #aab7c4;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rich-text-editor:focus {
  border-color: var(--blue);
  outline: 4px solid rgba(23, 107, 135, 0.14);
}

.rich-text-editor[aria-invalid="true"] {
  border-color: var(--red);
  background: #fffafa;
}

.rich-text-editor:empty::before {
  content: attr(data-placeholder);
  color: #7a8794;
  pointer-events: none;
}

#status-description {
  white-space: pre-wrap;
}

/* v0.82: 患者用予約カレンダー */
.date-field--calendar {
  max-width: 680px;
}

.booking-calendar {
  width: min(100%, 620px);
  margin-top: 8px;
  border: 1px solid #c7d3dc;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.booking-calendar__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.booking-calendar__header strong {
  color: var(--navy);
  font-size: 1.12rem;
  text-align: center;
}

.booking-calendar__nav {
  min-height: 40px;
  padding: 6px 12px;
}

.booking-calendar__weekdays,
.booking-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.booking-calendar__weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  text-align: center;
}

.booking-calendar__weekdays span:first-child { color: var(--red); }
.booking-calendar__weekdays span:last-child { color: var(--blue); }

.booking-calendar__blank {
  min-height: 58px;
}

.booking-calendar__day {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 2px solid #c4d0da;
  border-radius: 10px;
  padding: 5px 2px;
  background: #fff;
  color: var(--navy);
  line-height: 1.2;
}

.booking-calendar__day strong {
  font-size: 1.05rem;
}

.booking-calendar__day small {
  font-size: .63rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.booking-calendar__day.is-available {
  border-color: #87b7c5;
  background: #f5fcfd;
  cursor: pointer;
}

.booking-calendar__day.is-available:hover,
.booking-calendar__day.is-available:focus-visible {
  border-color: var(--blue);
  background: var(--blue-pale);
}

.booking-calendar__day.is-unavailable,
.booking-calendar__day.is-unavailable:disabled {
  border-color: #e0aaa4;
  background: var(--red-pale);
  color: var(--red);
  cursor: not-allowed;
  opacity: 1;
}

.booking-calendar__day.is-selected {
  border-color: var(--green);
  background: var(--green-pale);
  color: #0d5945;
  box-shadow: 0 0 0 2px rgba(22, 115, 90, .14);
}

.booking-calendar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.calendar-legend::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 5px;
  border: 1px solid #aab7c4;
  border-radius: 3px;
  vertical-align: -1px;
  background: #fff;
}

.calendar-legend--available::before { background: #f5fcfd; border-color: #87b7c5; }
.calendar-legend--closed::before { background: var(--red-pale); border-color: #e0aaa4; }
.calendar-legend--selected::before { background: var(--green-pale); border-color: var(--green); }

.booking-calendar__status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

@media (max-width: 560px) {
  .booking-calendar {
    padding: 10px 8px;
  }
  .booking-calendar__weekdays,
  .booking-calendar__grid {
    gap: 3px;
  }
  .booking-calendar__day {
    min-height: 58px;
    border-radius: 8px;
    padding-inline: 1px;
  }
  .booking-calendar__day small {
    font-size: .56rem;
  }
  .booking-calendar__nav {
    min-width: 0;
    padding-inline: 8px;
    font-size: .88rem;
  }
}
