:root {
  --page-cream: #fffdf2;
  --surface: #fffefa;
  --surface-white: #fff;
  --navy: #22364f;
  --text: #2e4360;
  --muted: #50627b;
  --coral: #ff622e;
  --coral-dark: #b83218;
  --coral-hover: #92240f;
  --soft-yellow: #fff4c7;
  --line: #e8e0c7;
  --control-line: #8995a5;
  --error: #a52317;
  --error-soft: #fff1ee;
  --footer: #142b46;
  --footer-muted: #d7e0ea;
  --content-width: 960px;
  --wide-width: 1200px;
}

.conversion-page {
  --conversion-shell-content: 960px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--page-cream);
  font-family: "Noto Sans JP", "Yu Gothic", "YuGothic", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

body.is-submitting {
  cursor: progress;
}

img {
  max-width: 100%;
}

a {
  color: var(--coral-dark);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--coral-dark);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: #fff;
  background: var(--navy);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 242, 0.96);
}

.header-inner {
  display: flex;
  width: min(calc(100% - 48px), 1200px);
  min-height: 68px;
  margin: 0 auto;
  align-items: center;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--navy);
  font-family: Poppins, "Noto Sans JP", sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-copy {
  display: grid;
  line-height: 1.22;
}

.brand-wordmark {
  display: block;
  justify-self: start;
  width: auto;
  height: 20px;
}

.brand-service {
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.page {
  padding: 88px 20px 96px;
}

.wrap {
  width: min(100%, var(--content-width));
  margin: 0 auto;
}

.intro h1 {
  max-width: none;
  margin: 0 0 26px;
  color: var(--navy);
  font-size: clamp(34px, 3.2vw, 46px);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.wrap-unit {
  display: inline-block;
}

.intro-lead {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.9;
}

.report-box {
  margin: 32px 0 24px;
  padding: 26px 30px;
  border: 1px solid var(--line);
  background: var(--surface-white);
}

.report-box h2 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.5;
}

.report-box ul {
  margin: 0;
  padding-left: 1.45em;
}

.report-box li {
  padding-left: 5px;
  color: var(--text);
  line-height: 1.9;
}

.report-box li + li {
  margin-top: 8px;
}

.report-box li::marker {
  color: var(--coral);
  font-size: 1.2em;
}

.reassurance {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.9;
}

.form-heading {
  margin: 54px 0 18px;
}

.step-label {
  margin: 0 0 8px;
  color: var(--coral-dark);
  font-family: Poppins, "Noto Sans JP", sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.form-heading h2,
.booking-heading h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.5;
}

.form-heading p:last-child,
.booking-heading .booking-lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.diagnosis-form {
  padding: 42px 32px 46px;
  border: 1px solid var(--line);
  background: var(--surface-white);
}

.form-error-summary {
  margin: 0 0 32px;
  padding: 16px 18px;
  border: 1px solid #d88d83;
  border-left: 5px solid var(--error);
  color: var(--error);
  background: var(--error-soft);
}

.form-error-summary p {
  margin: 0;
  font-weight: 800;
}

.form-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-group + .form-group,
.form-group + .optional-details,
.optional-details + .application-details,
.application-details + .consent-group {
  margin-top: 36px;
}

.form-label,
.form-group legend {
  display: block;
  width: 100%;
  margin: 0 0 11px;
  padding: 0;
  color: var(--navy);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.55;
}

.required-label,
.optional-label {
  margin-left: 7px;
  font-size: 13px;
  font-weight: 800;
}

.required-label {
  color: var(--coral-dark);
}

.optional-label {
  color: var(--muted);
}

.group-hint,
.field-hint,
.character-count {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.text-control {
  display: block;
  width: min(100%, 620px);
  min-height: 52px;
  padding: 11px 13px;
  border: 1px solid var(--control-line);
  border-radius: 4px;
  color: var(--navy);
  background: #fff;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
}

textarea.text-control {
  width: 100%;
  min-height: 148px;
  resize: vertical;
}

.text-control:hover {
  border-color: var(--navy);
}

.text-control[aria-invalid="true"] {
  border-width: 2px;
  border-color: var(--error);
}

.field-error {
  margin: 8px 0 0;
  color: var(--error);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
}

.choice {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  background: var(--surface-white);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.choice:hover {
  border-color: var(--control-line);
  background: #fffaf0;
}

.choice:has(input:checked) {
  border-color: var(--coral-dark);
  background: #fff4ef;
}

.choice input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--coral-dark);
}

.choice span {
  min-width: 0;
}

.group-guidance {
  display: flex;
  margin-bottom: 10px;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
}

.group-guidance .group-hint {
  margin: 0;
}

.selection-count {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.conditional-field {
  margin-top: 14px;
}

.js .conditional-field[data-active="false"] {
  display: none;
}

.optional-details,
.application-details {
  border: 1px solid var(--line);
  background: var(--surface);
}

.optional-details summary,
.application-details summary {
  padding: 18px 20px;
  color: var(--navy);
  cursor: pointer;
  font-weight: 900;
  line-height: 1.6;
}

.optional-details summary small {
  display: block;
  margin: 2px 0 0 1.4em;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.optional-details[open] summary,
.application-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.optional-details-inner,
.application-details-inner {
  padding: 26px 24px;
}

.application-details-inner p {
  margin: 0 0 12px;
  color: var(--navy);
}

.application-details-inner ol {
  margin: 0;
  padding-left: 1.4em;
}

.application-details-inner li + li {
  margin-top: 8px;
}

.consent-group {
  padding-top: 4px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.75;
  cursor: pointer;
}

.consent-label input {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  margin: 5px 0 0;
  accent-color: var(--coral-dark);
}

.turnstile-wrap {
  margin-top: 28px;
}

.form-actions {
  margin-top: 40px;
}

.submit-button,
.secondary-button {
  display: inline-flex;
  min-height: 60px;
  padding: 12px 28px;
  border-radius: 4px;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.5;
  cursor: pointer;
}

.submit-button {
  width: min(100%, 420px);
  border: 1px solid var(--coral-dark);
  color: #fff;
  background: var(--coral-dark);
}

.submit-button:hover {
  border-color: var(--coral-hover);
  background: var(--coral-hover);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.submit-note {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.site-footer {
  padding: 68px 0 0;
  color: #fff;
  background: var(--footer);
}

.footer-inner,
.footer-bottom {
  width: min(calc(100% - 48px), var(--wide-width));
  margin: 0 auto;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.15fr 0.55fr 0.65fr;
  gap: 64px;
  padding-bottom: 54px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.footer-brand > img,
.footer-brand-mark {
  width: 44px;
  height: 44px;
}

.footer-brand-mark {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: Poppins, "Noto Sans JP", sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.footer-brand-copy {
  display: grid;
  line-height: 1.25;
}

.footer-wordmark {
  display: block;
  width: auto;
  height: 20px;
  margin-bottom: 5px;
}

.footer-brand-copy span {
  font-size: 13px;
  font-weight: 700;
}

.footer-company {
  margin: 20px 0 0;
  color: var(--footer-muted);
  font-size: 14px;
}

.footer-column {
  display: grid;
  align-content: start;
  gap: 12px;
}

.footer-column h2 {
  margin: 0 0 7px;
  color: #ff9c7b;
  font-size: 15px;
  font-weight: 900;
}

.footer-column a {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.footer-column a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-bottom {
  padding: 24px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  color: var(--footer-muted);
  font-size: 13px;
}

.booking-page {
  padding-top: 58px;
}

.booking-heading {
  margin-bottom: 18px;
}

.booking-actions {
  display: flex;
  margin-bottom: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.booking-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.secondary-button {
  min-height: 50px;
  flex: 0 0 auto;
  border: 1px solid var(--control-line);
  color: var(--navy);
  background: #fff;
  font-size: 15px;
}

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

.timerex-shell {
  width: 100%;
  min-height: 600px;
  padding: 24px;
  border: 1px solid var(--line);
  background: #fff;
}

#timerex_calendar {
  width: 100%;
}

.timerex-calendar-fallback {
  display: block;
  width: 100%;
  height: 1000px;
  border: 0;
  background: #fff;
}

.booking-status {
  margin: 0 0 20px;
  padding: 13px 16px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
}

.booking-status:empty {
  display: none;
}

.booking-status[data-complete="true"] {
  color: var(--navy);
  border: 2px solid var(--coral);
  background: var(--soft-yellow);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.75;
}

.booking-error {
  padding: 30px 24px;
  border: 1px solid #d88d83;
  color: var(--error);
  background: var(--error-soft);
  text-align: center;
}

@media (max-width: 800px) {
  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-main {
    gap: 38px;
  }
}

@media (max-width: 720px) {
  .page {
    padding-inline: 16px;
  }

  .diagnosis-form {
    padding-inline: 16px;
  }
}

@media (max-width: 640px) {
  .header-inner,
  .footer-inner,
  .footer-bottom {
    width: min(calc(100% - 32px), var(--content-width));
  }

  .header-inner {
    min-height: 62px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-wordmark {
    height: 16px;
  }

  .brand-service {
    font-size: 12px;
  }

  .page {
    padding: 36px 16px 64px;
  }

  .intro h1 {
    margin-bottom: 20px;
    font-size: 30px;
    line-height: 1.45;
  }

  .intro-lead {
    font-size: 16px;
  }

  .report-box {
    margin-top: 26px;
    padding: 20px 18px;
  }

  .report-box h2 {
    font-size: 19px;
  }

  .report-box li,
  .reassurance {
    font-size: 15px;
  }

  .form-heading {
    margin-top: 46px;
  }

  .form-heading h2,
  .booking-heading h1 {
    font-size: 27px;
  }

  .diagnosis-form {
    padding: 28px 16px 32px;
  }

  .form-group + .form-group,
  .form-group + .optional-details,
  .optional-details + .application-details,
  .application-details + .consent-group {
    margin-top: 30px;
  }

  .form-label,
  .form-group legend {
    font-size: 16px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .choice {
    min-height: 48px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .optional-details summary,
  .application-details summary {
    padding: 16px;
  }

  .optional-details-inner,
  .application-details-inner {
    padding: 22px 16px;
  }

  .form-actions {
    margin-top: 34px;
  }

  .submit-button {
    width: 100%;
    font-size: 16px;
  }

  .site-footer {
    padding-top: 50px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-bottom: 40px;
  }

  .footer-bottom {
    padding-bottom: 26px;
  }

  .booking-page {
    padding-top: 34px;
  }

  .booking-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .secondary-button {
    width: 100%;
  }

  .timerex-shell {
    min-height: 520px;
    padding: 10px 4px;
  }

  .timerex-calendar-fallback {
    height: 1100px;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
