@font-face {
  font-family: "Zen Maru Gothic Local";
  src: url("./assets/fonts/ZenMaruGothic-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fffdfc;
  --wash: #f7f1f3;
  --rose: #b8667a;
  --rose-deep: #8d4054;
  --rose-soft: #efdce2;
  --lavender: #ddd8ec;
  --sage: #dce7df;
  --ink: #31303a;
  --muted: #6e6975;
  --line: #ded6db;
  --shadow: 0 24px 70px rgba(84, 53, 68, 0.13);
  --display: "Zen Maru Gothic Local", "Tsukushi A Round Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  --body: "Zen Maru Gothic Local", "Tsukushi A Round Gothic", "Hiragino Maru Gothic ProN", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  background: var(--wash);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(184, 102, 122, 0.3);
  outline-offset: 3px;
}

.page-wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 15%, rgba(239, 220, 226, 0.95) 0 13%, transparent 36%),
    radial-gradient(circle at 92% 88%, rgba(221, 216, 236, 0.85) 0 12%, transparent 33%),
    linear-gradient(135deg, #fbf7f8 0%, #f4f0f6 100%);
}

.page-wash::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image: repeating-linear-gradient(0deg, transparent 0 7px, rgba(70, 51, 61, 0.08) 8px);
  mix-blend-mode: multiply;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  height: 100dvh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}

.screen-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(140, 111, 123, 0.2);
  border-radius: 28px;
  background: rgba(255, 253, 252, 0.96);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  color: var(--rose-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.start-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 6vh, 48px) 26px;
  text-align: center;
}

.start-screen::before,
.start-screen::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
}

.start-screen::before {
  width: 150px;
  height: 150px;
  top: -48px;
  right: -44px;
  background: var(--rose-soft);
}

.start-screen::after {
  width: 110px;
  height: 110px;
  left: -52px;
  bottom: 35px;
  background: radial-gradient(circle at 38% 38%, #fff9d9 0 16%, #eadff1 54%, #ddd8ec 100%);
}

.start-screen__thread {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 150px;
  margin: 0 auto 28px;
}

.start-screen__thread::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  border-top: 2px dashed var(--rose);
}

.start-screen__thread span {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 1px var(--rose);
}

.start-screen h1 {
  position: relative;
  z-index: 1;
  margin: 14px 0 16px;
  font-family: var(--display);
  font-size: clamp(34px, 10vw, 48px);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: 0.02em;
}

.start-screen h1 em {
  position: relative;
  color: var(--rose-deep);
  font-style: normal;
  white-space: nowrap;
}

.start-screen h1 em::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 0;
  height: 8px;
  z-index: -1;
  border-radius: 99px;
  background: var(--rose-soft);
  transform: rotate(-1.5deg);
}

.start-screen__lead {
  position: relative;
  z-index: 1;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.8;
}

.start-screen__promise {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-bottom: 24px;
}

.start-screen__promise span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.primary-button {
  position: relative;
  z-index: 1;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--rose-deep);
  box-shadow: 0 12px 26px rgba(141, 64, 84, 0.24);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(141, 64, 84, 0.28);
}

.primary-button:disabled {
  opacity: 0.34;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.primary-button--small {
  min-width: 116px;
  min-height: 46px;
  border-radius: 14px;
}

.fine-print {
  position: relative;
  z-index: 1;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.question-screen {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  padding: 20px 18px 16px;
}

.thread-progress {
  padding: 0 2px;
}

.thread-progress__label {
  display: block;
  margin-bottom: 8px;
  color: var(--rose-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.thread-progress__line {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin: 0 5px;
}

.thread-progress__line::before {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 7px;
  border-top: 2px dashed var(--line);
}

.thread-progress__line i {
  position: relative;
  width: 15px;
  height: 15px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: #d9d2d6;
  box-shadow: 0 0 0 1px #d9d2d6;
}

.thread-progress__line i.is-passed {
  background: var(--rose);
  box-shadow: 0 0 0 1px var(--rose);
}

.thread-progress__line i.is-current {
  transform: scale(1.18);
  box-shadow: 0 0 0 1px var(--rose), 0 0 0 5px var(--rose-soft);
}

.question-copy h1 {
  margin: 4px 0 5px;
  font-family: var(--display);
  font-size: clamp(22px, 6vw, 27px);
  font-weight: 600;
  line-height: 1.4;
}

.question-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.option-list {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  min-height: 0;
}

.option-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.option-list--compact .option-button {
  min-height: 49px;
  padding-block: 7px;
}

.option-button:hover {
  border-color: #c99aaa;
  transform: translateX(2px);
}

.option-button.is-selected {
  border-color: var(--rose);
  background: #fff7f9;
  box-shadow: inset 0 0 0 1px var(--rose);
}

.option-button__mark {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-right: 11px;
  border: 1.5px solid #bdb2b7;
  border-radius: 50%;
  background: #fff;
}

.option-button.is-selected .option-button__mark {
  border: 5px solid var(--rose-deep);
}

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

.option-button strong {
  font-size: 13px;
  line-height: 1.45;
}

.option-button small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.question-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 2px;
}

.text-button {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.result-screen {
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 9px;
  width: 100%;
  height: 100%;
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 3.6vh, 28px) 20px 16px;
  border: 1px solid rgba(140, 111, 123, 0.22);
  border-radius: 26px;
  background:
    linear-gradient(rgba(255, 253, 252, 0.94), rgba(255, 253, 252, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(141, 64, 84, 0.08) 24px);
  box-shadow: var(--shadow);
}

.result-card::after {
  content: "";
  position: absolute;
  top: -54px;
  right: -38px;
  width: 135px;
  height: 135px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #fff9d9 0 16%, #eadff1 54%, #ddd8ec 100%);
  opacity: 0.72;
}

.result-card__topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--rose-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.result-card__topline i {
  flex: 1;
  border-top: 2px dashed rgba(184, 102, 122, 0.5);
}

.result-label,
.result-theme span,
.result-action span,
.personal-step > span,
.personal-step > label {
  display: block;
  margin: 0 0 4px;
  color: var(--rose-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.result-label::before {
  content: "✦";
  margin-right: 5px;
  color: #dc9e55;
}

.result-summary {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.result-theme {
  position: relative;
  margin: 0 -4px 12px;
  padding: 11px 13px;
  border-left: 4px solid #d99a59;
  border-radius: 0 13px 13px 0;
  background: linear-gradient(90deg, rgba(255, 234, 204, 0.84), rgba(239, 220, 226, 0.22));
}

.result-theme h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(20px, 5.5vw, 25px);
  font-weight: 600;
  line-height: 1.36;
}

.result-action {
  margin-bottom: 12px;
}

.result-action p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.personal-step {
  padding: 10px 11px;
  border: 1px solid #d9ccd1;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.personal-step small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.step-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.step-input-row input {
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
}

.step-input-row button,
.choice-chips button {
  min-height: 42px;
  border: 1px solid var(--rose);
  border-radius: 10px;
  color: var(--rose-deep);
  background: #fff7f9;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.step-input-row button {
  padding: 0 10px;
}

.choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.choice-chips button {
  min-height: 34px;
  padding: 5px 8px;
}

.personal-step.is-saved {
  position: relative;
  padding-right: 66px;
  background: linear-gradient(135deg, #fff7f9, #f8f4fb);
}

.personal-step.is-saved strong {
  display: block;
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.4;
}

.edit-link {
  position: absolute;
  top: 50%;
  right: 10px;
  min-height: 36px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  text-decoration: underline;
  transform: translateY(-50%);
  cursor: pointer;
}

.save-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.result-controls {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}

.support-button {
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(141, 64, 84, 0.35);
  border-radius: 14px;
  color: var(--rose-deep);
  background: rgba(255, 253, 252, 0.86);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(44, 38, 43, 0.45);
  backdrop-filter: blur(8px);
}

.support-dialog {
  position: relative;
  width: min(100%, 410px);
  padding: 24px 20px max(24px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 18px 18px;
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(40, 25, 34, 0.25);
}

.support-dialog h2 {
  margin: 7px 0 17px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
}

.support-dialog__item {
  display: grid;
  gap: 4px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.support-dialog__item span {
  color: var(--rose-deep);
  font-size: 10px;
  font-weight: 900;
}

.support-dialog__item strong {
  font-size: 13px;
}

.support-dialog__item small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--wash);
  font-size: 23px;
  cursor: pointer;
}

.noscript {
  position: fixed;
  inset: 20px;
  z-index: 99;
  padding: 20px;
  border-radius: 16px;
  background: #fff;
}

@media (max-height: 700px) {
  .app-shell {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .screen-card {
    border-radius: 22px;
  }

  .start-screen {
    padding-block: 20px;
  }

  .start-screen__thread {
    margin-bottom: 18px;
  }

  .question-screen {
    gap: 7px;
    padding: 14px 15px 12px;
  }

  .question-copy h1 {
    margin-top: 1px;
    font-size: 21px;
  }

  .option-list {
    gap: 6px;
  }

  .option-button,
  .option-list--compact .option-button {
    min-height: 45px;
    padding-block: 5px;
    border-radius: 13px;
  }

  .option-button strong {
    font-size: 12px;
  }

  .result-card {
    padding: 14px 16px 12px;
    border-radius: 22px;
  }

  .result-card__topline {
    margin-bottom: 8px;
  }

  .result-summary,
  .result-theme,
  .result-action {
    margin-bottom: 8px;
  }

  .result-theme {
    padding-block: 8px;
  }

  .result-theme h1 {
    font-size: 19px;
  }

  .result-action p {
    font-size: 12px;
    line-height: 1.45;
  }

  .personal-step {
    padding-block: 8px;
  }
}

@media (max-width: 350px), (max-height: 600px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 600px;
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


.option-list.is-multiple .option-button__mark {
  border-radius: 6px;
}

.option-list.is-multiple .option-button.is-selected .option-button__mark {
  display: grid;
  place-items: center;
  border: 1px solid var(--rose-deep);
  background: var(--rose-deep);
}

.option-list.is-multiple .option-button.is-selected .option-button__mark::after {
  content: "✓";
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.option-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}