:root {
  --paper: #FAF8F5;
  --ink: #212B36;
  --muted: #6F6660;
  --line: #E5DED6;
  --accent: #937960;
  --accent-dark: #7A6350;
  --accent-soft: #F1EAE2;
  --white: #FFFFFF;
  --line-green: #06C755;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(33,43,54,.06), 0 8px 24px rgba(33,43,54,.06);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.9;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
}

button,
select,
textarea {
  font: inherit;
}

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

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
}

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.header-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.header-mark i {
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.header-mark i:nth-child(1) { height: 7px; }
.header-mark i:nth-child(2) { height: 13px; }
.header-mark i:nth-child(3) { height: 10px; }

main {
  flex: 1;
}

.view {
  padding: 22px 0 52px;
}

.entry-view {
  min-height: calc(100svh - 150px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.animal-strip {
  width: min(100%, 320px);
  display: flex;
  flex-wrap: wrap;
  align-self: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}

.animal-strip li,
.animal-strip img {
  width: 44px;
  height: 44px;
}

.animal-strip img {
  display: block;
  object-fit: contain;
}

.eyebrow {
  margin-bottom: 15px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1.4;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(35px, 10vw, 46px);
  line-height: 1.3;
  font-weight: 700;
}

h1 span {
  color: var(--accent);
}

.lead {
  max-width: 420px;
  margin-bottom: 42px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.diagnosis-form fieldset {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.diagnosis-form legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
}

.date-selects {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 8px;
}

.select-wrap {
  position: relative;
  display: block;
}

select {
  width: 100%;
  min-height: 56px;
  appearance: none;
  padding: 0 30px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  content: "";
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select-suffix {
  position: absolute;
  top: 50%;
  right: 25px;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
  transform: translateY(-50%);
}

.primary-button,
.line-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 19px 0 22px;
  background: var(--accent);
  color: var(--white);
}

.primary-button span,
.line-button span {
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
}

.primary-button:hover,
.primary-button:active {
  background: var(--accent-dark);
}

.primary-button:active,
.line-button:active {
  transform: translateY(1px);
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.privacy-note span {
  padding-top: 1px;
  color: var(--accent);
  font-size: 8px;
}

.loading-view {
  min-height: calc(100svh - 150px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.loading-orbit {
  position: relative;
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
}

.loading-ring {
  position: absolute;
  inset: 7px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  animation: orbit 2.8s linear infinite;
}

.loading-ring::after {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  transform: translateX(-50%);
}

#loading-image {
  width: 128px;
  height: 128px;
  object-fit: contain;
  animation: breathe 1.2s ease-in-out infinite;
}

.loading-label {
  color: var(--muted);
  font-size: 13px;
}

.loading-dots {
  display: inline-block;
  width: 20px;
  overflow: hidden;
  vertical-align: bottom;
  animation: dots 1.2s steps(4, end) infinite;
}

.result-view {
  padding-top: 24px;
}

.result-intro {
  padding-bottom: 26px;
}

.result-intro h2 {
  margin-bottom: 2px;
  font-size: 34px;
  line-height: 1.3;
}

.result-date {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.result-stack {
  display: grid;
  gap: 14px;
}

.animal-card {
  overflow: hidden;
  padding: 19px 18px 20px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  animation: card-in 500ms both;
}

.result-pair .animal-card:nth-child(1) { animation-delay: 90ms; }
.result-pair .animal-card:nth-child(2) { animation-delay: 180ms; }

.animal-card--essence {
  padding-bottom: 23px;
  border-top: 3px solid var(--accent);
}

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

.result-pair .animal-card {
  padding: 15px 12px 17px;
}

.card-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.card-number {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.card-label {
  font-weight: 700;
}

.animal-card-body {
  display: flex;
  align-items: center;
  gap: 18px;
}

.animal-image-slot {
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
}

.animal-image-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.animal-copy {
  min-width: 0;
}

.animal-role {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.animal-copy h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.result-pair .animal-card-body {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.result-pair .animal-image-slot {
  flex-basis: 72px;
  width: 72px;
  height: 72px;
  align-self: center;
}

.result-pair .animal-copy h3 {
  font-size: 20px;
}

.animal-description {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.animal-description--short {
  margin-top: 14px;
  padding-top: 12px;
}

.animal-description--short:empty {
  display: none;
}

.result-bridge {
  margin: 4px 10px 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
  text-align: center;
}

.code-panel {
  margin-top: 26px;
  padding: 22px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  text-align: center;
}

.code-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.result-code {
  margin-bottom: 18px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.line-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 20px;
  background: var(--line-green);
  color: var(--white);
  font-size: 13px;
}

.line-button:hover,
.line-button:active {
  background: var(--line-green);
}

.copy-fallback {
  margin-top: 14px;
  text-align: left;
}

.copy-fallback textarea {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.copy-fallback p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.copy-toast {
  min-height: 1.5em;
  margin: 10px 0 0;
  color: var(--accent-dark);
  font-size: 12px;
}

.reset-button {
  display: block;
  min-height: 48px;
  margin: 21px auto 0;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid var(--accent);
  background: transparent;
  color: var(--accent-dark);
  font-size: 13px;
  text-decoration: none;
}

.site-footer {
  padding: 18px 0 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.site-footer p {
  margin: 0;
}

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

@keyframes orbit {
  to { transform: rotate(360deg); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.72; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes dots {
  0% { width: 0; }
  30% { width: 7px; }
  60% { width: 13px; }
  90%, 100% { width: 20px; }
}

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

@media (min-width: 600px) {
  .app-shell {
    padding-right: 0;
    padding-left: 0;
  }

  .animal-strip {
    width: 572px;
    max-width: none;
    gap: 4px;
  }
}

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

.code-note {
  margin-top: 0.75rem;
  text-align: center;
}

/* v1.1 (2026-08-26): 04 扉の向こうのあなた・結果サブ行・ボタン上の一言 */
.result-sub { margin: 4px 0 0; color: var(--accent-dark); font-size: .95rem; }
.animal-card--door { margin-top: 14px; background: var(--accent-soft); }
.animal-card--door .animal-description { margin-top: 8px; font-size: 1.02rem; line-height: 1.85; }
.code-push { margin: 0 0 10px; color: var(--ink); font-weight: 700; line-height: 1.7; }
