:root {
  --ink: #262a33;
  --muted: #707784;
  --soft-muted: #969daa;
  --line: rgba(132, 151, 176, 0.25);
  --line-strong: rgba(127, 157, 196, 0.42);
  --surface: rgba(255, 255, 255, 0.9);
  --surface-soft: rgba(250, 252, 255, 0.78);
  --shadow: 0 12px 34px rgba(69, 82, 112, 0.07);
  --pearl-gradient: linear-gradient(118deg, rgba(220, 246, 251, 0.94), rgba(234, 230, 250, 0.92) 52%, rgba(249, 229, 239, 0.9));
  --focus: rgba(93, 158, 213, 0.38);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f6f8fc;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(205, 239, 249, 0.38), transparent 29%),
    radial-gradient(circle at 95% 25%, rgba(237, 218, 247, 0.32), transparent 30%),
    #f7f9fd;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

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

button:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.ambient-light {
  position: fixed;
  z-index: -1;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(42px);
  pointer-events: none;
}

.ambient-light--top {
  top: -180px;
  left: -120px;
  background: rgba(178, 230, 244, 0.32);
}

.ambient-light--bottom {
  right: -160px;
  bottom: -160px;
  background: rgba(231, 190, 221, 0.24);
}

.app-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: clip;
  background: rgba(252, 253, 255, 0.94);
  box-shadow: 0 0 44px rgba(71, 87, 116, 0.08);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  height: 68px;
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(131, 151, 178, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  place-items: center;
  width: 126px;
  height: 35px;
}

.brand img {
  display: block;
  width: 126px;
  height: 35px;
  object-fit: contain;
}

.progress-track {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  overflow: hidden;
  background: rgba(220, 227, 239, 0.5);
}

.progress-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #9bd9ea, #b8b5e9 58%, #e2accb);
}

.app-main,
.consult-view {
  min-height: calc(100vh - 68px);
  min-height: calc(100dvh - 68px);
}

.compact-hero {
  position: relative;
  overflow: hidden;
  padding: 24px 20px 22px;
  text-align: center;
  background:
    radial-gradient(circle at 18% 28%, rgba(200, 237, 247, 0.33), transparent 32%),
    radial-gradient(circle at 86% 35%, rgba(240, 216, 235, 0.26), transparent 34%),
    linear-gradient(128deg, rgba(247, 252, 255, 0.95), rgba(250, 248, 255, 0.94));
  border-bottom: 1px solid rgba(139, 156, 181, 0.13);
}

.consult-orb {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto 7px;
}

.orb-core {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 37%, rgba(255, 255, 255, 0.98) 0 16%, rgba(207, 242, 248, 0.92) 35%, rgba(225, 220, 248, 0.88) 64%, rgba(248, 214, 233, 0.8) 100%);
  border: 1px solid rgba(137, 190, 222, 0.55);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.28),
    0 8px 20px rgba(117, 145, 184, 0.12);
}

.orb-spark {
  position: absolute;
  color: #a78bd0;
  font-size: 14px;
  line-height: 1;
}

.orb-spark--one {
  top: 1px;
  right: -1px;
  color: #7f9fdb;
}

.orb-spark--two {
  bottom: 6px;
  left: -1px;
  color: #ca8fbb;
}

.eyebrow {
  margin: 0 0 5px;
  color: #708092;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.compact-hero h1 {
  margin: 0;
  color: #272b34;
  font-size: clamp(23px, 6vw, 27px);
  line-height: 1.45;
  letter-spacing: 0.03em;
}

.hero-copy {
  margin: 10px 0 0;
  color: #6f7784;
  font-size: 14px;
  line-height: 1.7;
}

.reassurance {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
}

.reassurance span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  color: #596778;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(141, 164, 193, 0.24);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 5px 16px rgba(82, 100, 130, 0.05);
}

.reassurance span::before {
  content: "✔";
  margin-right: 5px;
  color: #7597ab;
  font-size: 11px;
}

.step-body {
  display: grid;
  gap: 16px;
  padding: 18px 12px 30px;
}

.input-section {
  position: relative;
  padding: 15px 13px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.88)) padding-box,
    linear-gradient(118deg, rgba(129, 204, 226, 0.42), rgba(165, 155, 224, 0.36), rgba(226, 163, 199, 0.34)) border-box;
  border: 1px solid transparent;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.question-section {
  padding-top: 17px;
}

.question-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.question-heading--stacked {
  display: block;
}

.question-heading h2 {
  margin: 0;
  color: #303540;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.question-heading p {
  margin: 4px 0 0;
  color: #858d9a;
  font-size: 11px;
  line-height: 1.55;
}

.question-heading .section-kicker {
  margin: 0 0 3px;
  color: #7e8796;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.optional-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 28px;
  padding: 4px 9px;
  color: #78818e;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(139, 155, 180, 0.24);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
}

.direct-question-list {
  display: grid;
  gap: 8px;
}

.direct-question-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 12px 11px 12px 13px;
  text-align: left;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(143, 160, 184, 0.28);
  border-radius: 13px;
  box-shadow: 0 5px 14px rgba(75, 90, 119, 0.04);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.direct-question-button:active,
.part-button:active,
.more-toggle:active,
.unclear-link:active,
.primary-button:active:not(:disabled) {
  transform: scale(0.985);
}

.direct-question-button.is-selected {
  background: linear-gradient(112deg, rgba(224, 245, 250, 0.96), rgba(235, 229, 249, 0.95), rgba(247, 228, 239, 0.92));
  border-color: rgba(126, 166, 209, 0.5);
  box-shadow: 0 7px 18px rgba(95, 109, 149, 0.08);
}

.direct-question-label {
  color: #444b58;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}

.choice-check,
.part-check {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(126, 147, 175, 0.42);
  border-radius: 8px;
}

.direct-question-button.is-selected .choice-check,
.part-button.is-selected .part-check {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(101, 146, 190, 0.56);
}

.direct-question-button.is-selected .choice-check::after,
.part-button.is-selected .part-check::after {
  content: "";
  width: 8px;
  height: 13px;
  margin-top: -2px;
  border-right: 2px solid #5f7488;
  border-bottom: 2px solid #5f7488;
  transform: rotate(42deg);
}

.more-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  margin-top: 9px;
  color: #657181;
  background: rgba(247, 250, 254, 0.78);
  border: 1px solid rgba(139, 158, 184, 0.22);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.more-chevron {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(129, 147, 173, 0.28);
  border-radius: 50%;
}

.more-chevron::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid #778293;
  border-bottom: 1.5px solid #778293;
  transform: rotate(45deg);
  transition: transform 180ms ease, top 180ms ease;
}

.more-toggle.is-open .more-chevron::after {
  top: 7px;
  transform: rotate(225deg);
}

.more-question-reveal {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 300ms cubic-bezier(0.22, 0.75, 0.32, 1), opacity 180ms ease;
}

.more-question-reveal.is-open {
  max-height: 760px;
  opacity: 1;
}

.direct-question-list--more {
  padding-top: 9px;
}

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

.part-button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 10px;
  color: #535b68;
  text-align: left;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(143, 160, 184, 0.28);
  border-radius: 13px;
  box-shadow: 0 4px 13px rgba(75, 90, 119, 0.035);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}

.part-button.is-selected {
  background: linear-gradient(112deg, rgba(224, 245, 250, 0.96), rgba(235, 229, 249, 0.95), rgba(247, 228, 239, 0.92));
  border-color: rgba(126, 166, 209, 0.5);
}

.part-label {
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.note-field {
  display: block;
}

.note-field textarea {
  display: block;
  width: 100%;
  min-height: 126px;
  padding: 13px 14px;
  color: #424955;
  resize: vertical;
  background: linear-gradient(128deg, rgba(250, 253, 255, 0.96), rgba(252, 249, 255, 0.94));
  border: 1px solid rgba(137, 155, 181, 0.26);
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.75;
}

.note-field textarea:focus {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(111, 164, 204, 0.52);
}

.note-field textarea::placeholder {
  color: #a1a8b3;
}

.character-count {
  margin-top: 5px;
  padding-right: 3px;
  color: #979eaa;
  font-size: 10px;
  line-height: 1.4;
  text-align: right;
}

.final-action {
  display: grid;
  gap: 6px;
  padding: 4px 2px 0;
  text-align: center;
}

.final-action-note {
  margin: 0;
  color: #818a97;
  font-size: 9px;
  line-height: 1.45;
}

.unclear-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  color: #697483;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 120ms ease;
}

.unclear-link span {
  font-size: 13px;
  line-height: 1;
}

.step-dock {
  position: fixed;
  z-index: 50;
  right: 50%;
  bottom: 0;
  width: min(100%, 480px);
  padding: 11px 14px calc(10px + env(safe-area-inset-bottom));
  transform: translateX(50%);
  background: linear-gradient(to top, rgba(252, 253, 255, 0.99) 72%, rgba(252, 253, 255, 0.9));
  border-top: 1px solid rgba(134, 150, 174, 0.18);
  box-shadow: 0 -12px 26px rgba(69, 82, 112, 0.055);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: opacity 180ms ease, transform 210ms ease;
}

.step-dock.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, calc(100% + 24px));
}

.dock-inner {
  width: 100%;
}

.primary-button {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px 8px 8px 42px;
  overflow: hidden;
  color: #343b48;
  background:
    linear-gradient(112deg, rgba(218, 243, 250, 0.98), rgba(229, 224, 248, 0.98) 55%, rgba(247, 224, 237, 0.97)) padding-box,
    linear-gradient(102deg, rgba(78, 176, 209, 0.78), rgba(130, 121, 208, 0.74), rgba(211, 118, 170, 0.68)) border-box;
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 9px 24px rgba(89, 107, 147, 0.11);
  transition: opacity 160ms ease, filter 160ms ease, transform 120ms ease;
}

.primary-button--static {
  min-height: 62px;
}

.primary-button::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -34%;
  width: 24%;
  height: 180%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  transform: rotate(18deg);
  animation: button-shine 4.8s ease-in-out infinite;
}

.primary-button:disabled {
  color: #959ca7;
  background: rgba(239, 242, 247, 0.95);
  border-color: rgba(143, 158, 181, 0.2);
  box-shadow: none;
  cursor: default;
  opacity: 0.86;
}

.primary-button:disabled::before {
  display: none;
}

.button-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  justify-self: end;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(131, 147, 173, 0.22);
  border-radius: 50%;
  font-size: 17px;
  font-weight: 400;
}

.dock-note {
  margin: 6px 0 0;
  color: #7e8794;
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 50%;
  bottom: calc(116px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100% - 40px);
  padding: 10px 15px;
  color: #fff;
  background: rgba(53, 60, 72, 0.92);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(50%, 0);
}

.noscript-message {
  position: fixed;
  z-index: 200;
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 14px;
  color: #5d4651;
  background: #fff1f5;
  border: 1px solid #ebccd8;
  border-radius: 12px;
  font-size: 13px;
  text-align: center;
}

@keyframes button-shine {
  0%, 62% {
    left: -34%;
    opacity: 0;
  }
  68% {
    opacity: 1;
  }
  82%, 100% {
    left: 116%;
    opacity: 0;
  }
}

@media (hover: hover) {
  .direct-question-button:hover,
  .part-button:hover,
  .more-toggle:hover,
  .unclear-link:hover {
    border-color: rgba(113, 153, 197, 0.45);
    background-color: rgba(248, 251, 255, 0.98);
  }

  .primary-button:hover:not(:disabled) {
    filter: saturate(1.04) brightness(1.01);
  }
}

@media (max-width: 370px) {
  .compact-hero {
    padding-right: 15px;
    padding-left: 15px;
  }

  .compact-hero h1 {
    font-size: 22px;
  }

  .step-body {
    padding-right: 9px;
    padding-left: 9px;
  }

  .input-section {
    padding-right: 11px;
    padding-left: 11px;
  }

  .direct-question-label {
    font-size: 12px;
  }

  .part-button {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 6px;
    padding: 8px;
  }

  .choice-check,
  .part-check {
    width: 24px;
    height: 24px;
  }
}

@media (min-width: 600px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    border-radius: 24px;
  }

  .app-header {
    top: 24px;
    border-radius: 24px 24px 0 0;
  }

  .step-dock {
    bottom: 24px;
    border-radius: 0 0 24px 24px;
  }
}

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

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