@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@500;600;700;800;900&family=Shippori+Mincho:wght@500;600;700&family=IBM+Plex+Sans+JP:wght@400;500;700&display=swap");

:root {
  --bg: #070806;
  --paper: #efe1c0;
  --paper-2: #d8c59b;
  --ink: #21190f;
  --muted: #776b58;
  --line: rgba(201, 177, 121, 0.32);
  --gold: #d7b86a;
  --red: #9b2f27;
  --green: #2d5d49;
  --blue: #244a6b;
  --violet: #5b4a73;
  --font-serif: "Noto Serif JP", "Shippori Mincho", serif;
  --font-sans: "IBM Plex Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(ellipse at 80% 42%, rgba(205, 166, 83, 0.24), transparent 42rem),
    radial-gradient(ellipse at 17% 18%, rgba(255, 250, 229, 0.9), transparent 34rem),
    radial-gradient(ellipse at 50% 108%, rgba(155, 122, 63, 0.18), transparent 40rem),
    linear-gradient(102deg, #f4ead0 0%, #ead9b3 46%, #d9bd7c 100%);
  background-attachment: fixed;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 38px;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font-sans);
  background:
    radial-gradient(ellipse at 80% 42%, rgba(205, 166, 83, 0.24), transparent 42rem),
    radial-gradient(ellipse at 17% 18%, rgba(255, 250, 229, 0.9), transparent 34rem),
    radial-gradient(ellipse at 50% 108%, rgba(155, 122, 63, 0.18), transparent 40rem),
    linear-gradient(102deg, #f4ead0 0%, #ead9b3 46%, #d9bd7c 100%);
  background-attachment: fixed;
}

body.result-mode {
  color: var(--paper);
  background:
    radial-gradient(ellipse at 80% 42%, rgba(205, 166, 83, 0.24), transparent 42rem),
    radial-gradient(ellipse at 17% 18%, rgba(255, 250, 229, 0.9), transparent 34rem),
    radial-gradient(ellipse at 50% 108%, rgba(155, 122, 63, 0.18), transparent 40rem),
    linear-gradient(102deg, #f4ead0 0%, #ead9b3 46%, #d9bd7c 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' seed='18' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0.22 0 0 0 0 0 0.18 0 0 0 0 0 0.1 0 0 0 0 0 0.42 0'/%3E%3C/filter%3E%3Crect width='320' height='320' filter='url(%23paper)' opacity='0.62'/%3E%3C/svg%3E"),
    repeating-linear-gradient(96deg, rgba(72, 52, 26, 0.018) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(4deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 17px);
  background-size: 320px 320px, 100% 13px, 100% 17px;
  mix-blend-mode: multiply;
  opacity: 0.45;
}

body.result-mode::before {
  mix-blend-mode: multiply;
  opacity: 0.45;
}

body.modal-open {
  overflow: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(95, 70, 38, 0.08), transparent 13%, transparent 84%, rgba(86, 63, 33, 0.13)),
    linear-gradient(180deg, rgba(255, 250, 232, 0.42), transparent 20%, transparent 76%, rgba(93, 67, 34, 0.12)),
    radial-gradient(ellipse at center, transparent 42%, rgba(77, 55, 29, 0.09) 100%);
  mix-blend-mode: multiply;
}

.app-shell {
  position: relative;
  z-index: 1;
}

button,
input {
  font: inherit;
}

button {
  border-radius: 0;
}

.app-shell {
  width: min(1120px, 100%);
  min-height: calc(100vh - 38px);
  margin: 0 auto;
  padding: 12px 16px 18px;
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(460px, 1fr);
  gap: clamp(22px, 4vw, 56px);
  align-items: center;
}

.app-shell > * {
  min-width: 0;
}

.result-mode .app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  width: min(1320px, 100%);
  min-height: calc(100vh - 36px);
  padding-top: clamp(28px, 5vh, 64px);
  padding-bottom: clamp(28px, 5vh, 64px);
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  padding: 8px 16px 10px;
  color: rgba(33, 25, 15, 0.56);
  font-size: 11px;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.site-footer-links {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  pointer-events: auto;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-footer a:hover,
.site-footer a[aria-current="page"] {
  color: rgba(33, 25, 15, 0.78);
  border-bottom-color: rgba(45, 93, 73, 0.42);
}

.legal-shell {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
  min-height: calc(100vh - 56px);
  margin: 0 auto;
  padding: clamp(28px, 7vw, 72px) 18px 24px;
}

.legal-back-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 0 12px;
  color: rgba(33, 25, 15, 0.72);
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(88, 67, 37, 0.14);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.legal-back-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.36);
}

.legal-card {
  padding: clamp(24px, 5vw, 42px);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent 26%),
    linear-gradient(155deg, rgba(244, 233, 207, 0.96), rgba(213, 191, 145, 0.96));
  border: 1px solid rgba(94, 70, 36, 0.22);
  box-shadow:
    0 24px 70px rgba(46, 34, 17, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.legal-kicker {
  margin: 0 0 8px;
  color: #2d5d49;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-card h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.32;
}

.legal-updated {
  margin: 10px 0 30px;
  color: rgba(33, 25, 15, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.legal-card section {
  padding-top: 18px;
  border-top: 1px solid rgba(88, 67, 37, 0.14);
}

.legal-card section + section {
  margin-top: 18px;
}

.legal-card h2 {
  margin: 0 0 8px;
  color: rgba(33, 25, 15, 0.9);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.5;
}

.legal-card p {
  margin: 0;
  color: rgba(33, 25, 15, 0.74);
  font-size: 13px;
  line-height: 1.9;
}

.details-panel {
  border: 1px solid var(--line);
  background: rgba(8, 8, 6, 0.76);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.control-pane {
  border: 0;
  background: transparent;
  box-shadow: none;
  align-self: start;
  padding: 0;
  position: sticky;
  top: 28px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.brand-seal {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(58, 45, 27, 0.12);
}

.brand-mark {
  width: fit-content;
  color: #202319;
  font-size: 15px;
  font-weight: 700;
}

.brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: rgba(33, 25, 15, 0.58);
  margin-left: 6px;
  white-space: nowrap;
}

.hero-copy {
  margin-bottom: 30px;
}

.hero-copy::before {
  content: "";
  display: block;
  width: 44px;
  height: 1px;
  margin: 0 0 18px 2px;
  background: rgba(33, 25, 15, 0.32);
}

.preview-caption {
  margin: 0 0 8px;
  color: rgba(33, 25, 15, 0.58);
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

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

h1 {
  margin-bottom: 20px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.45;
  letter-spacing: 0;
  overflow-wrap: normal;
}

@media (min-width: 768px) {
  .sp-only {
    display: none;
  }
}

.lead {
  max-width: 30em;
  margin-bottom: 0;
  color: rgba(33, 25, 15, 0.7);
  line-height: 1.9;
  font-family: var(--font-serif);
  font-size: 15px;
}

.diagnosis-form {
  padding: 15px 17px 16px;
  background: rgba(238, 224, 194, 0.76);
  border: 1px solid rgba(88, 67, 37, 0.18);
  box-shadow:
    0 18px 42px rgba(76, 58, 30, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.diagnosis-form label {
  display: block;
  color: rgba(33, 25, 15, 0.74);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 9px;
}

.help-link {
  min-height: 24px;
  justify-content: flex-end;
  gap: 4px;
  color: rgba(33, 25, 15, 0.52);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 150ms ease;
  white-space: nowrap;
}

.help-link i {
  font-size: 14px;
}

.help-link:hover {
  color: #2d5d49;
}

.input-line {
  margin-bottom: 10px;
}

.input-line input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(88, 67, 37, 0.24);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  border-radius: 4px;
  padding: 0 14px;
  outline: none;
}

.input-line input:focus {
  border-color: rgba(45, 93, 73, 0.74);
  box-shadow: 0 0 0 3px rgba(45, 93, 73, 0.12);
}

.input-line input::placeholder {
  color: rgba(33, 25, 15, 0.36);
}

.diagnosis-form.is-suspended .input-line input:disabled {
  cursor: not-allowed;
  color: rgba(33, 25, 15, 0.48);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.46),
      rgba(255, 255, 255, 0.46) 8px,
      rgba(45, 93, 73, 0.045) 8px,
      rgba(45, 93, 73, 0.045) 16px
    );
  border-color: rgba(88, 67, 37, 0.2);
}

.diagnosis-form.is-suspended .input-line input:disabled::placeholder {
  color: rgba(33, 25, 15, 0.55);
  font-weight: 700;
}

.service-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  color: #725f3e;
  font-size: 12px;
  font-weight: 700;
}

.service-status::before {
  width: 7px;
  height: 7px;
  content: "";
  flex: 0 0 auto;
  border-radius: 50%;
  background: #a67638;
  box-shadow: 0 0 0 3px rgba(166, 118, 56, 0.12);
}

.icon-button,
.primary-button,
.secondary-button,
.action-button {
  border: 1px solid rgba(88, 67, 37, 0.2);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button {
  height: 50px;
  color: var(--gold);
  font-weight: 700;
  font-size: 12px;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 93, 73, 0.55);
  background: rgba(255, 255, 255, 0.72);
}

button:disabled,
button[aria-busy="true"] {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.diagnosis-form.is-suspended button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  background: #54675f;
}

.diagnosis-form.is-suspended button:disabled:hover {
  border-color: rgba(33, 25, 15, 0.16);
  background: #54675f;
  transform: none;
}

.field-error {
  min-height: 0;
  margin: 0;
  color: #9b2f27;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.field-error:not(:empty) {
  margin: 0 0 10px;
}

.field-error-action {
  width: fit-content;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0 10px;
  color: #2d5d49;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(45, 93, 73, 0.28);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.field-error-action i {
  font-size: 15px;
}

.button-stack {
  display: grid;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #f4ecdc;
  background: #2d5d49;
  border-color: rgba(33, 25, 15, 0.16);
}

.primary-button:hover {
  color: #fff7e8;
  background: #254b3c;
}

.secondary-button {
  display: grid;
  place-items: center;
  color: rgba(33, 25, 15, 0.76);
  text-align: center;
  text-decoration: none;
}

.secondary-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.setup-entry {
  margin-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: rgba(33, 25, 15, 0.62);
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(88, 67, 37, 0.13);
  border-radius: 4px;
}

.setup-entry p {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.55;
}

.setup-link-button {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  color: #2d5d49;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(45, 93, 73, 0.24);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.setup-link-button i {
  font-size: 15px;
}

.setup-link-button:hover {
  color: #244b3b;
  background: rgba(255, 255, 255, 0.62);
}

.privacy-note {
  margin: 18px 0 0;
  color: rgba(33, 25, 15, 0.5);
  font-size: 12px;
  line-height: 1.8;
}

.home-preview {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: 14px;
}

.mobile-preview {
  display: none;
}

.mobile-preview .preview-caption {
  display: none;
}

.result-mode .home-preview {
  display: none;
}

.preview-stage {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  perspective: 1200px;
}

.preview-caption {
  grid-column: 1;
  grid-row: 1;
}

.preview-sheet {
  position: relative;
  width: min(100%, 520px);
  margin: 0 auto;
  aspect-ratio: 4 / 5;
  transform: rotate(1.5deg);
  transform-origin: center;
  filter: drop-shadow(0 30px 34px rgba(77, 57, 31, 0.28));
}

.preview-carousel {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.preview-output-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  opacity: 0;
  transform: translateY(14px) rotate(-0.6deg) scale(0.982);
  filter: blur(7px);
  transition:
    opacity 900ms ease,
    transform 1100ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 900ms ease;
}

.preview-output-image.is-active {
  z-index: 2;
  opacity: 1;
  transform: translateY(0) rotate(0) scale(1);
  filter: blur(0);
}

.preview-output-image.is-leaving {
  z-index: 1;
  opacity: 0;
  transform: translateY(-12px) rotate(0.7deg) scale(1.012);
  filter: blur(8px);
}

.preview-fallback {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  padding: clamp(24px, 4vw, 42px);
  place-items: center;
  color: rgba(33, 25, 15, 0.46);
  font-family: var(--font-sans);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 28%),
    rgba(239, 225, 192, 0.5);
  border: 1px dashed rgba(94, 70, 36, 0.34);
}

.preview-sheet.use-fallback .preview-fallback {
  display: grid;
}

.preview-fallback span {
  padding: 10px 14px;
  border: 1px solid rgba(94, 70, 36, 0.22);
  background: rgba(255, 255, 255, 0.28);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  .preview-output-image {
    transition: opacity 180ms ease;
    transform: none;
    filter: none;
  }

  .preview-output-image.is-leaving {
    transform: none;
    filter: none;
  }
}

.result-pane {
  --action-rail-width: 42px;
  --action-rail-gap: 8px;
  width: 100%;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--action-rail-width);
  gap: 0 var(--action-rail-gap);
  align-items: start;
}

.result-pane.is-revealing .share-card {
  animation: pageRevealLeft 920ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
}

.result-pane.is-revealing .details-panel {
  animation: pageRevealRight 980ms cubic-bezier(0.16, 1, 0.3, 1) 220ms both;
}

.result-pane.is-revealing .result-topbar {
  animation: resultTopbarReveal 680ms cubic-bezier(0.16, 1, 0.3, 1) 360ms both;
}

.result-topbar {
  position: sticky;
  z-index: 30;
  top: 14px;
  width: var(--action-rail-width);
  display: flex;
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-end;
  align-items: center;
  flex-direction: column;
  gap: 8px;
}

.back-button {
  min-height: 38px;
  padding: 0;
  border: 1px solid rgba(88, 67, 37, 0.2);
  color: rgba(33, 25, 15, 0.78);
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
}

.icon-action {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.icon-action:disabled {
  cursor: wait;
  opacity: 0.62;
}

.icon-action i,
.icon-button i {
  font-size: 20px;
  display: block;
}

.result-brand {
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.result-grid {
  display: grid;
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: repeat(2, minmax(420px, 660px));
  gap: 0;
  align-items: start;
  justify-content: center;
  position: relative;
  isolation: isolate;
}

.result-grid > * {
  min-width: 0;
}

.result-grid::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 24px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(112, 82, 40, 0), rgba(112, 82, 40, 0.16) 46%, rgba(255, 246, 219, 0.18) 50%, rgba(112, 82, 40, 0.16) 54%, rgba(112, 82, 40, 0));
}

.share-card {
  --type-main: var(--green);
  --type-accent: var(--gold);
  width: 100%;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  position: relative;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-serif);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 22%),
    radial-gradient(circle at 76% 20%, color-mix(in srgb, var(--type-accent), transparent 78%), transparent 20rem),
    linear-gradient(90deg, #f4e7c9 0%, #ead8ad 62%, #d9bf86 100%);
  border: 1px solid rgba(247, 224, 166, 0.65);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.5);
}

.share-card::before {
  content: none;
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(33, 25, 15, 0.14);
  pointer-events: none;
}

.share-card::after {
  content: none;
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(33, 25, 15, 0.022) 1px, transparent 1px),
    linear-gradient(rgba(33, 25, 15, 0.018) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.35;
  pointer-events: none;
}

.card-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 34px;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto;
  gap: 12px;
}

.placeholder .card-inner {
  align-content: center;
  grid-template-rows: auto auto auto;
}

.card-kicker,
.section-label {
  color: color-mix(in srgb, var(--type-main), #21190f 22%);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 14px;
  align-items: center;
}

.card-title-row > * {
  min-width: 0;
}

.share-card h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.16;
  letter-spacing: 0;
  word-break: keep-all;
}

.share-card .short-label {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 9px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
}

.character {
  --body: var(--type-main);
  --accent: var(--type-accent);
  position: relative;
  width: 108px;
  height: 136px;
  margin-left: auto;
}

.character::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 5px;
  height: 90px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--body), white 8%), color-mix(in srgb, var(--body), black 24%));
  clip-path: polygon(50% 0, 88% 24%, 78% 100%, 22% 100%, 12% 24%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.character::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 10px;
  width: 46px;
  height: 46px;
  border-radius: 50% 50% 42% 42%;
  background: var(--accent);
  border: 4px solid rgba(33, 25, 15, 0.78);
  box-shadow:
    22px 20px 0 -17px var(--ink),
    -22px 20px 0 -17px var(--ink);
}

.character .tool {
  position: absolute;
  right: 3px;
  bottom: 18px;
  width: 64px;
  height: 10px;
  background: var(--ink);
  transform: rotate(-38deg);
}

.character .tool::after {
  content: "";
  position: absolute;
  right: -12px;
  top: -11px;
  width: 30px;
  height: 30px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.motif-forest .tool::after,
.motif-marsh .tool::after,
.motif-lake .tool::after {
  border-radius: 50%;
  clip-path: none;
}

.motif-sea::before,
.motif-current::before,
.motif-onsen::before {
  clip-path: polygon(50% 0, 88% 30%, 70% 92%, 50% 100%, 30% 92%, 12% 30%);
}

.motif-volcano::after,
.motif-desert::after {
  border-radius: 48% 48% 40% 40%;
  clip-path: polygon(50% 0, 78% 18%, 94% 68%, 50% 100%, 6% 68%, 22% 18%);
}

.motif-blueprint::before,
.motif-mountain::before {
  clip-path: polygon(50% 0, 96% 96%, 4% 96%);
}

.summary-band {
  border-top: 1px solid rgba(33, 25, 15, 0.24);
  border-bottom: 1px solid rgba(33, 25, 15, 0.24);
  padding: 13px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.summary-band p,
.observation p,
.detail-copy p {
  margin: 0;
  line-height: 1.75;
}

.summary-band p {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.visual-grid {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(33, 25, 15, 0.18);
}

.radar-wrap {
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  background: rgba(33, 25, 15, 0.06);
  border: 1px solid rgba(33, 25, 15, 0.12);
}

.radar-chart {
  width: 132px;
  height: 132px;
  overflow: visible;
}

.radar-ring {
  fill: rgba(33, 25, 15, 0.035);
  stroke: rgba(33, 25, 15, 0.22);
  stroke-width: 1;
}

.radar-ring.inner {
  fill: transparent;
  opacity: 0.65;
}

.radar-axis line {
  stroke: rgba(33, 25, 15, 0.14);
  stroke-width: 1;
}

.radar-axis text {
  fill: rgba(33, 25, 15, 0.66);
  font-size: 8px;
  font-weight: 700;
}

.radar-fill {
  fill: color-mix(in srgb, var(--type-main), transparent 58%);
  stroke: var(--type-main);
  stroke-width: 2;
}

.metric-bars {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.metric-bar {
  display: grid;
  gap: 5px;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(33, 25, 15, 0.74);
  font-size: 11px;
  font-weight: 700;
}

.bar-head strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 12px;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  background: rgba(33, 25, 15, 0.12);
  border: 1px solid rgba(33, 25, 15, 0.08);
}

.bar-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--type-main), var(--type-accent));
}

.observation {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
  min-height: 0;
  overflow: hidden;
  font-size: 13px;
}

.observation p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.evidence-list,
.karma-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.evidence-list li,
.karma-list li {
  padding: 7px 9px;
  background: rgba(33, 25, 15, 0.08);
  border-left: 4px solid var(--type-main);
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.stat-grid {
  align-self: end;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stat {
  min-height: 62px;
  padding: 8px;
  background: rgba(33, 25, 15, 0.1);
  border: 1px solid rgba(33, 25, 15, 0.12);
}

.stat dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.stat dd {
  margin: 8px 0 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.sheet-card {
  aspect-ratio: 3 / 4;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 20%),
    radial-gradient(circle at 82% 17%, color-mix(in srgb, var(--type-accent), transparent 45%), transparent 12rem),
    linear-gradient(160deg, #f1e4c5, #c4ad7b);
}

.sheet-card::before {
  content: none;
  inset: 16px;
}

.sheet-card::after {
  content: none;
}

.sheet-inner {
  --illustration-rail: 190px;
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 21px 27px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.sheet-inner > *:not(.character-cutout) {
  position: relative;
  z-index: 3;
  min-width: 0;
}

.sheet-header {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: color-mix(in srgb, var(--type-main), #21190f 18%);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.sheet-brand {
  display: flex;
  align-items: baseline;
  min-width: 0;
}

.sheet-brand span {
  min-width: 0;
  color: rgba(33, 25, 15, 0.62);
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.sheet-brand small {
  margin-left: 8px;
  color: rgba(33, 25, 15, 0.46);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

.account-badge {
  min-width: 0;
  width: clamp(132px, 17vw, 178px);
  max-width: 178px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(33, 25, 15, 0.08);
  border: 1px solid rgba(33, 25, 15, 0.14);
  overflow: hidden;
}

.account-badge img,
.account-badge > span {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(33, 25, 15, 0.5);
  border-radius: 50%;
}

.account-badge img {
  object-fit: cover;
}

.account-badge > span {
  display: grid;
  place-items: center;
  background: var(--type-main);
  color: var(--paper);
  font-size: 11px;
}

.account-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-badge strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.18;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.account-copy small {
  min-width: 0;
  overflow: hidden;
  color: rgba(33, 25, 15, 0.56);
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-title {
  padding: 0;
  min-height: 92px;
  margin-right: var(--illustration-rail);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sheet-class {
  display: inline-block;
  margin-bottom: 5px;
  padding: 0;
  color: color-mix(in srgb, var(--type-main), #21190f 16%);
  background: transparent;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.sheet-title h2 {
  max-width: 340px;
  margin: 0;
  font-size: 33px;
  line-height: 1.08;
}

.sheet-title p {
  margin: 10px 0 0;
  color: rgba(33, 25, 15, 0.7);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.specimen-code {
  display: none;
}

.card-footer-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.character-cutout {
  position: absolute;
  right: 28px;
  top: 108px;
  z-index: 2 !important;
  width: 150px;
  height: 190px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 18px 18px rgba(33, 25, 15, 0.26));
  pointer-events: none;
}

.image-character {
  right: 5px;
  top: 74px;
  width: 216px;
  height: 500px;
}

.character-cutout::before {
  content: "";
  position: absolute;
  left: 38px;
  right: 10px;
  bottom: 4px;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(33, 25, 15, 0.22), transparent 68%);
  filter: blur(1px);
  pointer-events: none;
}

.character-cutout::after {
  content: none;
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(33, 25, 15, 0.12);
  border-radius: inherit;
  pointer-events: none;
}

.image-character img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right top;
  transform: none;
}

.character-cutout .cloak,
.character-cutout .head,
.character-cutout .gear {
  position: absolute;
  display: block;
}

.character-cutout .cloak {
  left: 48px;
  right: 34px;
  bottom: 10px;
  height: 126px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--type-main), white 15%), color-mix(in srgb, var(--type-main), black 18%));
  clip-path: polygon(50% 0, 86% 18%, 98% 72%, 72% 100%, 24% 96%, 2% 64%, 16% 18%);
}

.character-cutout .head {
  left: 72px;
  top: 18px;
  width: 62px;
  height: 62px;
  border-radius: 50% 48% 44% 52%;
  background: var(--type-accent);
  border: 5px solid rgba(33, 25, 15, 0.78);
}

.character-cutout .gear {
  right: 8px;
  bottom: 38px;
  width: 92px;
  height: 12px;
  background: var(--ink);
  transform: rotate(-38deg);
  transform-origin: center;
}

.character-cutout .gear::before {
  content: "";
  position: absolute;
  right: -20px;
  top: -16px;
  width: 38px;
  height: 38px;
  background: var(--type-accent);
  clip-path: polygon(50% 0, 92% 44%, 68% 100%, 16% 84%, 0 28%);
}

.character-map .cloak::before,
.character-map .cloak::after {
  content: "";
  position: absolute;
  background: rgba(239, 225, 192, 0.9);
  border: 2px solid rgba(33, 25, 15, 0.45);
}

.character-map .cloak::before {
  left: -28px;
  top: 32px;
  width: 44px;
  height: 32px;
  transform: rotate(-12deg);
  clip-path: polygon(0 6%, 100% 0, 88% 100%, 8% 88%);
}

.character-map .cloak::after {
  right: -24px;
  top: 48px;
  width: 38px;
  height: 28px;
  transform: rotate(18deg);
  clip-path: polygon(8% 0, 100% 12%, 92% 92%, 0 100%);
}

.guide-box {
  min-width: 0;
  padding: 9px 0 11px;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(33, 25, 15, 0.16);
}

.guide-box h3 {
  margin: 0 0 8px;
  color: color-mix(in srgb, var(--type-main), #21190f 18%);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.guide-box p {
  margin: 0;
  color: rgba(33, 25, 15, 0.82);
  font-size: 12px;
  line-height: 1.52;
}

.guide-summary {
  padding: 0 4px 2px 0;
  margin-right: var(--illustration-rail);
  border-bottom: 0;
  overflow: visible;
}



.guide-summary p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.82;
  letter-spacing: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.guide-summary strong {
  font-weight: 900;
}

.sheet-main-grid {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 12px;
  margin-right: 0;
  min-height: 0;
}

.sheet-main-grid .guide-box {
  min-height: 124px;
}

.sheet-card .radar-chart {
  width: 102px;
  height: 102px;
  display: block;
  margin: 18px auto 0;
}

.chart-note {
  margin-top: 2px !important;
  color: rgba(33, 25, 15, 0.54) !important;
  font-size: 8px !important;
  line-height: 1.35 !important;
  text-align: center;
}

.top-title-box ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-title-box li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
  min-height: 20px;
  padding: 3px 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.22);
  border: 0;
  border-left: 3px solid color-mix(in srgb, var(--type-main), transparent 20%);
  border-radius: 0;
  font-size: 9.5px;
  font-weight: 800;
  box-shadow: none;
}

.top-title-box li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-title-box li strong {
  font-family: var(--font-serif);
  font-size: 11px;
  white-space: nowrap;
}

.habit-box ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.habit-box {
  margin-right: 0;
}

.habit-box li {
  min-width: 0;
  padding: 4px 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.28);
  border: 0;
  border-radius: 999px;
  font-size: 10.5px;
  line-height: 1.35;
  font-weight: 800;
  box-shadow: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-flavor-note {
  margin: 0;
  margin-right: 126px;
  padding: 13px 16px 13px 15px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--type-main), transparent 70%), rgba(255, 255, 255, 0.18)),
    rgba(255, 255, 255, 0.2);
  border-left: 5px solid color-mix(in srgb, var(--type-main), transparent 8%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.card-flavor-note p {
  margin: 0;
  color: rgba(33, 25, 15, 0.9);
  font-size: clamp(14px, 2.1vw, 18px);
  font-weight: 900;
  line-height: 1.82;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: auto-phrase;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  flex: 1;
}

.fact-strip div {
  min-height: 46px;
  padding: 5px 6px;
  background: rgba(255, 255, 255, 0.24);
  border: 0;
  border-top: 1px solid rgba(33, 25, 15, 0.16);
  border-radius: 0;
  box-shadow: none;
}

.fact-strip span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.fact-strip strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.1;
}

.trait-table {
  display: grid;
  gap: 8px;
}

.trait-table div {
  display: grid;
  grid-template-columns: 64px 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.2);
  border-left: 3px solid color-mix(in srgb, var(--type-main), transparent 30%);
}

.trait-table span,
.trait-table strong {
  color: var(--ink);
  font-weight: 800;
}

.trait-table em {
  color: rgba(33, 25, 15, 0.64);
  font-size: 10.5px;
  font-style: normal;
}

.trait-score-note {
  margin: 12px 0 0;
  color: rgba(33, 25, 15, 0.6);
  font-size: 10.5px;
  line-height: 1.7;
}

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

.recommendation-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  border-left: 3px solid color-mix(in srgb, var(--type-main), transparent 30%);
}

.recommendation-card strong {
  color: var(--ink);
  font-size: 15px;
}

.recommendation-card a {
  color: color-mix(in srgb, var(--type-main), #1d5f76 28%);
  text-decoration: none;
}

.recommendation-card a:hover {
  color: color-mix(in srgb, var(--type-accent), #1d5f76 32%);
}

.game-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 1px;
}

.game-badges span {
  max-width: 100%;
  padding: 2px 7px 3px;
  color: rgba(33, 25, 15, 0.72);
  background: rgba(255, 255, 255, 0.26);
  border: 1px solid rgba(88, 67, 37, 0.12);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
}

.game-rating {
  font-size: 11px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 1px;
  margin-bottom: 3px;
}

.loading-rating, .rating-none {
  color: rgba(33, 25, 15, 0.45);
  font-style: italic;
}

.rating-badge {
  font-weight: 800;
}

.rating-8, .rating-9 {
  color: #3f7b9c; /* Overwhelmingly/Very Positive (Steam blue/green) */
}

.rating-6, .rating-7 {
  color: #5d7439; /* Mostly/Positive */
}

.rating-5 {
  color: #a48c5a; /* Mixed */
}

.rating-1, .rating-2, .rating-3, .rating-4 {
  color: #b05c5a; /* Negative */
}

.rating-count {
  color: rgba(33, 25, 15, 0.6);
  font-size: 10px;
}

.recommendation-card p {
  margin: 0;
  color: rgba(33, 25, 15, 0.66);
  font-size: 12px;
  line-height: 1.65;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.result-topbar .result-actions {
  display: contents;
}

.primary-action {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(88, 67, 37, 0.2);
}

.action-button {
  min-height: 42px;
  padding: 0;
}

.details-panel {
  position: relative;
  aspect-ratio: 3 / 4;
  height: auto;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--font-serif);
  color: var(--ink);
  background:
    linear-gradient(225deg, rgba(255, 255, 255, 0.2), transparent 23%),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.22), transparent 15rem),
    linear-gradient(90deg, #d9bf86 0%, #ead8ad 38%, #f4e7c9 100%);
  border-color: rgba(247, 224, 166, 0.58);
}

.details-panel::after {
  content: none;
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 42px;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(244, 231, 201, 0.82), rgba(244, 231, 201, 0));
}

.setup-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.setup-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 12%, rgba(244, 233, 207, 0.24), transparent 34rem),
    rgba(49, 38, 22, 0.5);
  backdrop-filter: blur(10px) saturate(0.86);
}

.setup-modal-card {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: clamp(22px, 4vw, 34px);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(45, 93, 73, 0.62) transparent;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 26%),
    linear-gradient(155deg, rgba(244, 233, 207, 0.98), rgba(213, 191, 145, 0.98));
  border: 1px solid rgba(94, 70, 36, 0.24);
  box-shadow:
    0 34px 90px rgba(46, 34, 17, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
  outline: none;
}

.setup-modal-card::-webkit-scrollbar {
  width: 7px;
}

.setup-modal-card::-webkit-scrollbar-track {
  background: transparent;
}

.setup-modal-card::-webkit-scrollbar-thumb {
  background: rgba(45, 93, 73, 0.58);
  border-radius: 999px;
  border: 2px solid rgba(239, 225, 192, 0.72);
}

.setup-modal-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.setup-kicker {
  margin: 0 0 6px;
  color: #2d5d49;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.setup-modal h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(24px, 4vw, 35px);
  line-height: 1.28;
}

.setup-close-button {
  flex: 0 0 auto;
  border-radius: 4px;
  color: rgba(33, 25, 15, 0.68);
  background: rgba(255, 255, 255, 0.28);
}

.setup-close-button::before {
  content: "x";
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.setup-close-button i {
  display: none;
}

.setup-modal-lead {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 0 24px;
  color: rgba(33, 25, 15, 0.72);
  font-size: 14px;
  line-height: 1.9;
}

.setup-steps {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
}

.setup-step {
  display: grid;
  grid-template-columns: minmax(260px, 0.98fr) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 26px);
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(88, 67, 37, 0.14);
  border-radius: 6px;
}

.setup-step-image {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #17212a;
  border: 1px solid rgba(33, 25, 15, 0.18);
  border-radius: 4px;
  box-shadow: 0 16px 28px rgba(58, 43, 22, 0.18);
}

.setup-step-copy {
  min-width: 0;
}

.setup-modal-lead strong,
.setup-step-copy strong {
  overflow-wrap: anywhere;
}

.step-number {
  display: block;
  margin-bottom: 6px;
  color: rgba(45, 93, 73, 0.72);
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 900;
}

.setup-step h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.38;
}

.setup-step p {
  margin: 0;
  color: rgba(33, 25, 15, 0.72);
  font-size: 13px;
  line-height: 1.8;
}

.setup-steam-link {
  position: relative;
  z-index: 1;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 18px 0 0 auto;
  padding: 0 14px;
  color: #f4ecdc;
  background: #2d5d49;
  border: 1px solid rgba(33, 25, 15, 0.16);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.setup-steam-link:hover {
  background: #254b3c;
}

.share-assist-modal {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: grid;
  place-items: center;
  padding: 24px;
}

.share-assist-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 22% 16%, rgba(244, 233, 207, 0.24), transparent 30rem),
    rgba(49, 38, 22, 0.48);
  backdrop-filter: blur(10px) saturate(0.86);
}

.share-assist-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  padding: clamp(22px, 4vw, 30px);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 26%),
    linear-gradient(155deg, rgba(244, 233, 207, 0.98), rgba(213, 191, 145, 0.98));
  border: 1px solid rgba(94, 70, 36, 0.24);
  box-shadow:
    0 34px 90px rgba(46, 34, 17, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
  outline: none;
}

.share-assist-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.share-assist-kicker {
  margin: 0 0 6px;
  color: #2d5d49;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.share-assist-card h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.28;
}

.share-assist-close {
  flex: 0 0 auto;
  border-radius: 4px;
  color: rgba(33, 25, 15, 0.68);
  background: rgba(255, 255, 255, 0.28);
}

.share-assist-close::before {
  content: "x";
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.share-assist-close i {
  display: none;
}

.share-assist-status {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(88, 67, 37, 0.14);
  border-left: 5px solid #2d5d49;
}

.share-assist-status[data-share-status="fallback"] {
  border-left-color: #9b2f27;
}

.share-assist-status > i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #f4ecdc;
  background: #2d5d49;
  border-radius: 999px;
  font-size: 20px;
}

.share-assist-status[data-share-status="fallback"] > i {
  background: #9b2f27;
}

.share-assist-status p {
  margin: 0 0 5px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.4;
}

.share-assist-status span {
  display: block;
  color: rgba(33, 25, 15, 0.72);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.8;
}

.share-assist-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.share-assist-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  color: rgba(33, 25, 15, 0.82);
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(88, 67, 37, 0.18);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.share-assist-button:hover {
  background: rgba(255, 255, 255, 0.38);
}

.share-assist-button.primary {
  color: #f4ecdc;
  background: #2d5d49;
  border-color: rgba(33, 25, 15, 0.16);
}

.share-assist-button.primary:hover {
  background: #254b3c;
}

.loading-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(75, 63, 39, 0.28);
  backdrop-filter: blur(8px) saturate(0.92);
}

.loading-card {
  width: min(480px, 100%);
  padding: 28px 32px 30px;
  text-align: left;
  color: var(--ink);
  border: 1px solid rgba(94, 70, 36, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 28%),
    linear-gradient(160deg, rgba(244, 233, 207, 0.98), rgba(213, 191, 145, 0.98));
  box-shadow:
    0 28px 80px rgba(75, 56, 28, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
  position: relative;
}

.loading-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(94, 70, 36, 0.18);
  pointer-events: none;
}

.loading-profile {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(94, 70, 36, 0.18);
  position: relative;
  z-index: 1;
}

.loading-profile.is-profile-pending {
  grid-template-columns: minmax(0, 1fr);
}

.loading-profile.is-profile-pending .loading-avatar,
.loading-profile.is-profile-pending .loading-profile-text {
  display: none;
}

.loading-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #f7edd7;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(145deg, #2f6a55, #20352b);
  border: 1px solid rgba(94, 70, 36, 0.26);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 900;
  background-size: cover;
  background-position: center;
}

.loading-avatar.has-image {
  border-color: rgba(94, 70, 36, 0.36);
}

.loading-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 23px;
  line-height: 1.25;
}

.loading-profile-text {
  margin: 0;
  color: rgba(33, 25, 15, 0.62);
  font-size: 13px;
  line-height: 1.5;
}

.loading-steps {
  display: grid;
  gap: 13px;
  margin: 24px 0 18px;
  padding: 0;
  list-style: none;
  position: relative;
  z-index: 1;
}

.loading-steps li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: rgba(33, 25, 15, 0.44);
  font-size: 14px;
  transition: color 180ms ease;
}

.loading-steps li span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(94, 70, 36, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.loading-steps li.is-active {
  color: var(--ink);
}

.loading-steps li.is-active span {
  border-color: #2f6a55;
  background: rgba(47, 106, 85, 0.1);
}

.loading-steps li.is-active span::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid rgba(47, 106, 85, 0.22);
  border-top-color: #2f6a55;
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

.loading-steps li.is-done {
  color: rgba(33, 25, 15, 0.76);
}

.loading-steps li.is-done span {
  border-color: rgba(47, 106, 85, 0.62);
  background: rgba(47, 106, 85, 0.14);
}

.loading-steps li.is-done span::before {
  content: "";
  width: 8px;
  height: 12px;
  border: solid #2f6a55;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg) translateY(-1px);
}

.loading-message {
  margin: 0;
  color: rgba(33, 25, 15, 0.68);
  font-size: 13px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

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

@keyframes pageRevealLeft {
  from {
    opacity: 0;
    transform: translateY(34px) rotateX(6deg) rotateZ(-1.4deg);
    filter: blur(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
    filter: blur(0);
  }
}

@keyframes pageRevealRight {
  from {
    opacity: 0;
    transform: translateY(30px) translateX(-24px) rotateY(-8deg);
    filter: blur(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0) translateX(0) rotateY(0);
    filter: blur(0);
  }
}

@keyframes resultTopbarReveal {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-header h3 {
  margin: 0;
  padding: 0;
  color: color-mix(in srgb, var(--type-accent), var(--paper) 24%);
  font-family: var(--font-serif);
  font-size: 25px;
  line-height: 1.2;
  border-bottom: 0;
  background: none;
}

.detail-header {
  padding: 17px 26px 5px;
}

.detail-header span {
  display: block;
  margin-bottom: 0;
  color: color-mix(in srgb, var(--type-main), #21190f 18%);
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.detail-disclaimer {
  margin: 40px 0 0;
  padding: 0;
  color: rgba(33, 25, 15, 0.5);
  font-size: 11px;
  text-align: center;
}

.detail-scroll {
  font-size: 88%;
  min-height: 0;
  overflow: auto;
  padding: 0 24px 28px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--type-main), transparent 34%) transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 44px), rgba(0, 0, 0, 0.14) 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 44px), rgba(0, 0, 0, 0.14) 100%);
}

.detail-scroll::-webkit-scrollbar {
  width: 7px;
}

.detail-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.detail-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--type-main), transparent 40%);
  border-radius: 999px;
  border: 2px solid rgba(239, 225, 192, 0.7);
}

.metrics-table {
  display: grid;
  gap: 8px;
}

.metrics-table h4 {
  margin-bottom: 2px;
}

.metrics-table div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.2);
  border-left: 3px solid color-mix(in srgb, var(--type-main), transparent 30%);
}

.metrics-table span {
  color: rgba(33, 25, 15, 0.7);
  font-size: 11.5px;
}

.metrics-table strong {
  color: var(--ink);
  font-family: var(--font-serif);
}

.detail-block {
  padding: 23px 0;
  border-top: 1px solid rgba(33, 25, 15, 0.16);
}

.detail-block p {
  color: rgba(33, 25, 15, 0.8);
  line-height: 1.82;
}

.detail-block:first-of-type {
  border-top: 0;
}

.detail-share-hook {
  padding: 19px 0 22px;
}

.detail-share-hook p {
  margin: 0;
  padding: 15px 17px;
  color: rgba(33, 25, 15, 0.92);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--type-main), transparent 78%), rgba(255, 255, 255, 0.2)),
    rgba(255, 255, 255, 0.2);
  border-left: 5px solid color-mix(in srgb, var(--type-main), transparent 8%);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.detail-heading {
  margin: 0 0 14px;
  color: color-mix(in srgb, var(--type-main), #21190f 18%);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-heading::before {
  content: "";
  display: block;
  width: 4px;
  height: 14px;
  background: color-mix(in srgb, var(--type-main), var(--type-accent) 18%);
}

.top-games-table {
  display: grid;
  gap: 6px;
}

.top-game-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(33, 25, 15, 0.1);
}

.top-game-row .rank {
  color: rgba(33, 25, 15, 0.42);
  font-size: 10.5px;
  font-family: var(--font-serif);
  text-align: right;
}

.top-game-row .name {
  color: var(--ink);
  font-weight: 700;
  font-size: 11.5px;
}

.top-game-row .hours {
  color: color-mix(in srgb, var(--type-main), #21190f 14%);
  font-family: var(--font-serif);
}

.detail-list {
  margin: 0;
  padding-left: 1.2em;
  color: rgba(33, 25, 15, 0.84);
  line-height: 1.86;
}

.habit-list {
  list-style: disc;
  padding-left: 1.2em;
  display: block;
}

.habit-list li {
  padding: 0 0 0 2px;
  background: transparent;
  border-left: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  transform: translate(-50%, 16px);
  padding: 12px 18px;
  border: 1px solid var(--line);
  background: rgba(8, 8, 6, 0.92);
  color: var(--paper);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 1180px) {
  .result-mode .app-shell {
    width: min(768px, 100%);
    min-height: calc(100vh - 36px);
    padding-top: clamp(24px, 5vh, 48px);
    padding-bottom: clamp(24px, 5vh, 48px);
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: min(760px, 100%);
    align-items: start;
  }

  .control-pane {
    position: static;
  }

  .desktop-preview {
    display: none;
  }

  .mobile-preview {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 0;
    margin: 2px 0 24px;
  }

  .mobile-preview .preview-stage {
    grid-column: 1;
    grid-row: auto;
  }

  .mobile-preview .preview-sheet {
    width: min(100%, 440px);
    transform: rotate(1deg);
  }

  .result-grid {
    width: min(100%, 620px);
    grid-template-columns: 1fr;
    justify-self: end;
    justify-content: center;
    justify-items: center;
  }

  .result-grid::before {
    content: none;
  }

  .share-card,
  .details-panel {
    width: min(100%, 620px);
  }

  .result-topbar {
    top: 14px;
    padding: 0;
    align-items: center;
    flex-direction: column;
    gap: 6px;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .result-actions {
    gap: 6px;
    width: auto;
    max-width: none;
    flex-wrap: nowrap;
  }

  .back-button,
  .icon-action {
    width: 38px;
    height: 38px;
    min-height: 38px;
    border-radius: 4px;
    border-color: rgba(75, 63, 39, 0.2);
    color: rgba(33, 25, 15, 0.78);
    background: rgba(255, 255, 255, 0.2);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.35),
      inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  }

  .result-topbar .primary-action {
    background: rgba(255, 255, 255, 0.2);
  }

  .icon-action i,
  .icon-button i {
    font-size: 18px;
  }

  .details-panel {
    aspect-ratio: auto;
    height: auto;
    overflow: visible;
  }

  .detail-scroll {
    overflow: visible;
    max-height: none;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .detail-scroll p,
  .detail-scroll li,
  .detail-scroll .name,
  .trait-score-note,
  .recommendation-card {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 700px) {
  .result-mode .app-shell {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    overflow: visible;
    padding-top: 72px;
    padding-bottom: 18px;
  }

  .result-pane {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .result-grid {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .app-shell {
    min-height: auto;
    padding: 18px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .site-footer {
    position: static;
    padding: 7px 12px 9px;
  }

  .site-footer-links {
    justify-content: flex-start;
    gap: 10px;
  }

  .legal-shell {
    padding: 22px 16px 18px;
  }

  .legal-card {
    padding: 22px 18px;
  }

  .legal-card h2 {
    font-size: 16px;
  }

  .control-pane {
    width: calc(100vw - 36px);
    max-width: 100%;
    padding: 0;
  }

  .hero-brand {
    margin-bottom: 18px;
  }

  .hero-copy {
    width: 100%;
    max-width: 320px;
    margin-bottom: 14px;
  }

  h1 {
    font-size: 24px;
    line-height: 1.5;
    max-width: 100%;
    line-break: anywhere;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .lead {
    font-size: 13px;
    line-height: 1.75;
  }

  .diagnosis-form {
    width: 100%;
    padding: 14px;
  }

  .form-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .help-link {
    justify-content: flex-start;
    white-space: normal;
  }

  .setup-entry {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .setup-link-button {
    justify-content: center;
    width: fit-content;
  }

  .setup-modal {
    padding: 12px;
  }

  .setup-modal-card {
    max-height: calc(100vh - 24px);
    padding: 20px 16px;
  }

  .setup-modal-head {
    gap: 10px;
  }

  .setup-close-button {
    width: 38px;
    height: 38px;
  }

  .setup-step {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .setup-step-image {
    max-height: 190px;
  }

  .setup-modal-lead,
  .setup-step p {
    font-size: 12.5px;
  }

  .share-assist-modal {
    padding: 12px;
  }

  .share-assist-card {
    padding: 20px 16px;
  }

  .share-assist-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .share-assist-button {
    width: 100%;
  }

  .setup-step h3 {
    font-size: 17px;
  }

  .secondary-actions {
    grid-template-columns: 1fr;
  }

  .home-preview {
    width: calc(100vw - 36px);
    max-width: 100%;
    gap: 8px;
    margin-bottom: 18px;
  }

  .mobile-preview .preview-output-image {
    transform: none;
    filter: none;
    transition: opacity 720ms ease;
  }

  .mobile-preview .preview-output-image.is-active,
  .mobile-preview .preview-output-image.is-leaving {
    transform: none;
    filter: none;
  }

  .mobile-preview .preview-output-image.is-leaving {
    opacity: 1;
  }

  .mobile-preview .preview-sheet {
    width: min(100%, 320px);
    transform: rotate(1deg);
  }

  .preview-fallback {
    padding: 18px;
  }

  .details-panel {
    padding: 0;
  }

  .card-inner {
    padding: 20px;
    gap: 8px;
  }

  .result-topbar {
    position: fixed;
    top: 10px;
    right: 10px;
    width: auto;
    align-items: center;
    flex-direction: row;
    gap: 6px;
    max-width: calc(100vw - 20px);
  }

  .share-card {
    width: 100%;
    max-width: calc(100vw - 36px);
    aspect-ratio: auto;
    min-height: 0;
    overflow: visible;
  }

  .details-panel,
  .share-card {
    width: 100%;
    max-width: calc(100vw - 36px);
  }

  .result-actions,
  .result-topbar {
    width: auto;
    max-width: calc(100vw - 20px);
  }

  .result-topbar .result-actions {
    display: flex;
  }

  .details-panel {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .detail-scroll {
    max-height: none;
    overflow: visible;
    padding: 0 18px 24px;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .details-panel h3 {
    padding: 20px 18px 14px;
    font-size: 21px;
  }

  .card-title-row {
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 8px;
  }

  .share-card h2 {
    font-size: 27px;
    word-break: normal;
  }

  .share-card .short-label {
    font-size: 10px;
  }

  .character {
    width: 82px;
    height: 104px;
    margin-left: auto;
  }

  .character::before {
    left: 15px;
    right: 15px;
    height: 68px;
  }

  .character::after {
    left: 23px;
    width: 36px;
    height: 36px;
  }

  .character .tool {
    width: 48px;
  }

  .summary-band {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .summary-band p,
  .observation {
    font-size: 11px;
  }

  .summary-band p {
    -webkit-line-clamp: 2;
  }

  .visual-grid {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 0;
  }

  .radar-wrap {
    width: 112px;
    height: 112px;
  }

  .radar-chart {
    width: 102px;
    height: 102px;
  }

  .radar-axis text {
    font-size: 7px;
  }

  .metric-bars {
    gap: 6px;
  }

  .bar-head {
    font-size: 9px;
  }

  .bar-head strong {
    font-size: 10px;
  }

  .bar-track {
    height: 6px;
  }

  .observation {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .observation p {
    -webkit-line-clamp: 2;
  }

  .evidence-list,
  .karma-list {
    gap: 5px;
    margin-top: 6px;
  }

  .evidence-list li,
  .karma-list li {
    padding: 5px 6px;
    font-size: 10px;
    -webkit-line-clamp: 1;
  }

  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }

  .stat {
    min-height: 52px;
    padding: 6px;
  }

  .stat dt {
    font-size: 9px;
  }

  .stat dd {
    font-size: 14px;
  }

  .card-footer {
    display: none;
  }

  .sheet-inner {
    --illustration-rail: 0px;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 18px 20px 20px;
    gap: 10px;
  }

  .sheet-header {
    order: 1;
    align-items: start;
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .sheet-brand span {
    font-size: 10px;
  }

  .sheet-brand small {
    margin-left: 5px;
    font-size: 7px;
  }

  .account-badge {
    align-self: end;
    max-width: 132px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 5px;
    padding: 4px 5px;
    opacity: 0.86;
  }

  .account-badge img,
  .account-badge > span {
    width: 28px;
    height: 28px;
  }

  .account-badge strong {
    font-size: 10px;
  }

  .account-copy small {
    font-size: 7px;
  }

  .sheet-title {
    order: 3;
    padding: 0;
    min-height: 0;
    max-width: none;
    margin-right: 0;
    text-align: center;
  }

  .sheet-class {
    margin-bottom: 9px;
    font-size: 9px;
  }

  .sheet-title h2 {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    font-size: 27px;
    line-height: 1.14;
  }

  .sheet-title p {
    margin-top: 9px;
    font-size: 11px;
  }

  .card-footer-strip {
    order: 8;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .character-cutout {
    order: 2;
    position: relative;
    right: auto;
    top: auto;
    z-index: 2 !important;
    align-self: center;
    transform: none;
    width: min(56vw, 220px);
    height: min(72vw, 330px);
    margin: 2px auto 4px;
    border-radius: 0;
  }

  .image-character {
    right: auto;
    top: auto;
    width: min(58vw, 224px);
    height: min(78vw, 340px);
  }

  .image-character img {
    object-position: center bottom;
  }

  .character-cutout .cloak {
    left: 34px;
    right: 24px;
    height: 86px;
  }

  .character-cutout .head {
    left: 50px;
    top: 13px;
    width: 43px;
    height: 43px;
  }

  .character-cutout .gear {
    right: 2px;
    bottom: 28px;
    width: 62px;
    height: 8px;
  }

  .character-cutout .gear::before {
    right: -14px;
    top: -11px;
    width: 27px;
    height: 27px;
  }

  .guide-summary {
    order: 5;
    padding-right: 0;
    margin-right: 0;
  }

  .guide-summary p {
    line-height: 1.82;
    -webkit-line-clamp: 6;
  }

  .sheet-main-grid {
    order: 6;
  }

  .habit-box {
    order: 7;
  }

  .card-flavor-note {
    order: 4;
    margin-right: 0;
  }

  .card-flavor-note p {
    font-size: 15px;
    line-height: 1.82;
  }

  .guide-box {
    padding: 10px 8px;
  }

  .guide-box h3 {
    margin-bottom: 5px;
    font-size: 9px;
  }

  .guide-box p {
    font-size: 10px;
    line-height: 1.42;
  }

  .sheet-main-grid {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-right: 0;
  }

  .sheet-main-grid .guide-box {
    min-height: 158px;
  }

  .sheet-main-grid .affinity-box {
    min-height: 188px;
  }

  .sheet-card .radar-chart {
    width: 150px;
    height: 150px;
    margin-top: 4px;
  }

  .chart-note {
    display: block;
    margin-top: 2px !important;
    font-size: 9px !important;
  }

  .top-title-box li {
    gap: 5px;
    padding: 7px 8px;
    font-size: 10px;
  }

  .top-title-box li strong {
    font-size: 12px;
  }

  .habit-box ul {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .habit-box {
    margin-right: 0;
  }

  .habit-box li {
    min-height: 0;
    padding: 7px 8px;
    font-size: 10px;
    line-height: 1.45;
  }

  .fact-strip {
    gap: 6px;
  }

  .fact-strip div {
    min-height: 48px;
    padding: 5px;
  }

  .fact-strip span {
    font-size: 8px;
  }

  .fact-strip strong {
    margin-top: 6px;
    font-size: 12px;
  }

  .trait-table {
    gap: 4px;
  }

  .trait-table div {
    grid-template-columns: 42px 68px minmax(0, 1fr);
    gap: 8px;
    align-items: baseline;
    padding: 7px 10px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.09));
  }

  .trait-table span {
    font-size: 11.5px;
  }

  .trait-table strong {
    font-size: 11.5px;
    white-space: nowrap;
  }

  .trait-table em {
    grid-column: auto;
    font-size: 11px;
    line-height: 1.45;
  }
}

/* Types List Page */
.list-mode {
  display: block;
  width: min(1160px, 100%);
  padding-top: clamp(22px, 4vw, 42px);
  padding-bottom: 56px;
}

.full-width {
  width: 100%;
}

.list-mode .control-pane {
  position: static;
  padding: 0;
}

.list-mode .brand-mark {
  margin-bottom: 12px;
}

.list-mode h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.28;
}

.list-mode .lead {
  max-width: 760px;
  margin-bottom: 18px;
}

.types-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: clamp(24px, 4vw, 34px);
}

.type-list-card {
  min-height: 292px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 24px 34% 24px 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 26%),
    radial-gradient(circle at 82% 14%, color-mix(in srgb, var(--type-accent), transparent 42%), transparent 9rem),
    linear-gradient(160deg, rgba(245, 232, 198, 0.94), rgba(209, 184, 128, 0.88));
  border: 1px solid rgba(88, 67, 37, 0.2);
  border-top: 5px solid color-mix(in srgb, var(--type-main), #21190f 8%);
  box-shadow:
    0 18px 44px rgba(76, 58, 30, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.type-list-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: -1;
  pointer-events: none;
}

.type-list-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -18px;
  z-index: -1;
  width: 54%;
  height: 58%;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--type-main), transparent 72%), transparent 68%);
  filter: blur(18px);
  opacity: 0.9;
  pointer-events: none;
}

.type-list-card:hover {
  border-color: color-mix(in srgb, var(--type-main), rgba(88, 67, 37, 0.24) 50%);
  box-shadow:
    0 18px 44px rgba(76, 58, 30, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.type-list-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.type-list-art {
  position: absolute;
  right: 24px;
  top: 22px;
  bottom: -8px;
  z-index: 1;
  width: 30%;
  filter: drop-shadow(0 18px 18px rgba(33, 25, 15, 0.22));
  pointer-events: none;
}

.type-list-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
}

.type-list-card .type-zone {
  margin-bottom: 12px;
  color: color-mix(in srgb, var(--type-main), #21190f 18%);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.type-list-card h2 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.7vw, 31px);
  line-height: 1.28;
  margin: 0 0 10px;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.24);
}

.type-list-card .summary {
  font-size: 13px;
  line-height: 1.75;
  color: rgba(33, 25, 15, 0.72);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.types-error {
  color: var(--red);
  font-weight: 700;
}

@media (max-width: 860px) {
  .types-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .list-mode {
    padding-top: 20px;
  }

  .list-mode h1 {
    font-size: clamp(30px, 9vw, 38px);
    line-height: 1.28;
  }

  .list-mode .lead {
    max-width: none;
  }

  .type-list-card {
    min-height: 0;
    padding: 18px 18px 22px;
    display: flex;
    flex-direction: column;
  }

  .type-list-art {
    position: relative;
    order: 1;
    inset: auto;
    width: min(72%, 240px);
    height: 250px;
    margin: 0 auto 12px;
    display: block;
  }

  .type-list-copy {
    order: 2;
  }

  .type-list-art img {
    object-position: center bottom;
  }

  .type-list-card .type-zone,
  .type-list-card h2,
  .type-list-card .summary {
    text-align: left;
  }

  .type-list-card .summary {
    display: block;
    overflow: visible;
  }
}