/* PiCO ヒアリング — calm cream paper + muted jade (not LINE green / not Ayurveda tea) */
:root {
  --bg: #f7f3ec;
  --bg-glow: #efe8dc;
  --card: #fffcf7;
  --ink: #1c1a17;
  --ink-soft: #3a3630;
  --muted: #6b655c;
  --line: rgba(28, 26, 23, 0.1);
  --line-strong: rgba(28, 26, 23, 0.16);
  --accent: #3a8f6f;
  --accent-dark: #2f7a5e;
  --accent-soft: rgba(58, 143, 111, 0.12);
  --accent-glow: rgba(58, 143, 111, 0.22);
  --danger: #a32020;
  --ok: #2a6b4f;
  --shadow: 0 10px 32px rgba(40, 32, 20, 0.07);
  --shadow-sm: 0 2px 10px rgba(40, 32, 20, 0.05);
  --radius: 1.1rem;
  --radius-sm: 0.85rem;
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fade-ms: 250ms;
  --max: 28rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(ellipse 90% 45% at 50% -8%, rgba(58, 143, 111, 0.1), transparent 55%),
    linear-gradient(180deg, var(--bg-glow) 0%, var(--bg) 42%, #f3eee6 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

.wrap {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.site-header {
  margin-bottom: 1rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.brand-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.site-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.stage-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.progress-count {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(28, 26, 23, 0.08);
  overflow: hidden;
  margin-bottom: 1.15rem;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  transition: width 0.35s var(--ease);
}

.step-body {
  animation: fade-in var(--fade-ms) var(--ease) both;
}

.step-body.is-leaving {
  animation: fade-out 180ms ease both;
}

.intro {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.65;
}

.intro:empty {
  display: none;
}

.question {
  margin: 0 0 1rem;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.55;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.opt {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: 3.1rem;
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
  animation: opt-in 0.28s var(--ease) both;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.opt:nth-child(1) { animation-delay: 30ms; }
.opt:nth-child(2) { animation-delay: 55ms; }
.opt:nth-child(3) { animation-delay: 80ms; }
.opt:nth-child(4) { animation-delay: 105ms; }
.opt:nth-child(5) { animation-delay: 130ms; }
.opt:nth-child(6) { animation-delay: 155ms; }
.opt:nth-child(7) { animation-delay: 180ms; }
.opt:nth-child(8) { animation-delay: 205ms; }

.opt:hover {
  border-color: rgba(58, 143, 111, 0.35);
  background: #fbfefc;
}

.opt:active {
  transform: scale(0.985);
}

.opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-glow);
  color: var(--ink);
  font-weight: 500;
}

.opt input {
  margin: 0.2rem 0 0;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.text-wrap input,
.text-wrap textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.text-wrap input:focus,
.text-wrap textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.err {
  color: var(--danger);
  font-size: 0.88rem;
  min-height: 1.25em;
  margin: 0.75rem 0 0.25rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
  align-items: center;
}

.btn {
  font: inherit;
  font-weight: 500;
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  min-height: 2.75rem;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    opacity 0.2s,
    transform 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn:not(:disabled):active {
  transform: scale(0.98);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(28, 26, 23, 0.04);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  margin-left: auto;
  padding-inline: 1.45rem;
  font-weight: 700;
  box-shadow: 0 6px 16px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.draft-note {
  margin: 1.1rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
}

.card-done {
  text-align: center;
  animation: fade-in 0.3s var(--ease) both;
}

.done-icon {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0.15rem auto 0.85rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 700;
}

.card-done h2 {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.done-msg {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  white-space: pre-wrap;
  line-height: 1.7;
}

.save-status {
  margin: 1rem 0 0.25rem;
  font-size: 0.92rem;
  line-height: 1.65;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(28, 26, 23, 0.03);
  border: 1px solid var(--line);
}

.save-status.ok {
  color: var(--ok);
  background: var(--accent-soft);
  border-color: rgba(58, 143, 111, 0.28);
}

.save-status.err {
  color: var(--danger);
  font-weight: 600;
  background: rgba(163, 32, 32, 0.06);
  border-color: rgba(163, 32, 32, 0.2);
}

.card-done .actions {
  justify-content: center;
  margin-top: 1.25rem;
}

.card-done .btn-ghost {
  margin-left: 0;
}

#summary {
  white-space: pre-wrap;
  font-size: 0.85rem;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 240px;
  overflow: auto;
  text-align: left;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes opt-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .step-body,
  .opt,
  .card-done {
    animation: none !important;
  }
}
