:root {
  --paper: #fbfaf7;
  --surface: #ffffff;
  --surface-soft: #f3f0ea;
  --ink: #171717;
  --muted: #686761;
  --faint: #989187;
  --line: #ded9cf;
  --wood: #b99a6f;
  --wood-dark: #715b3f;
  --ready: #2f6f4e;
  --prepare: #8a7659;
  --locked: #777777;
  --shadow: 0 18px 54px rgba(34, 30, 24, 0.08);
  --max: 1040px;
  --pad: clamp(22px, 5.8vw, 56px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  line-height: 1.85;
  -webkit-user-select: none;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
}

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

button,
a,
input,
textarea,
select {
  -webkit-user-select: auto;
  user-select: auto;
}

.hidden {
  display: none !important;
}

.page-watermark-layer,
.modal-watermark-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 70px 90px;
  align-content: start;
  pointer-events: none;
  overflow: hidden;
}

.page-watermark-layer {
  color: rgba(23, 23, 23, 0.045);
}

.page-watermark-layer span,
.modal-watermark-layer span {
  display: block;
  min-height: 90px;
  transform: rotate(-45deg);
  font-size: clamp(0.72rem, 2vw, 1.05rem);
  font-weight: 700;
  line-height: 1.8;
  white-space: pre-line;
}

main,
.security-banner,
.watermark,
.image-modal {
  position: relative;
}

main,
.security-banner,
.watermark {
  z-index: 2;
}

.security-banner {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 58px;
  padding: 8px var(--pad);
  border-bottom: 1px solid rgba(22, 22, 22, 0.07);
  background: rgba(251, 250, 247, 0.86);
  backdrop-filter: blur(14px);
}

.security-banner-title,
.security-banner-id {
  display: block;
  line-height: 1.35;
  white-space: normal;
}

.security-banner-title {
  color: var(--ink);
  font-size: clamp(0.86rem, 3.6vw, 1rem);
  font-weight: 700;
}

.security-banner-id {
  color: rgba(23, 23, 23, 0.52);
  font-size: 0.68rem;
  font-weight: 700;
}

.interactive-replay {
  min-height: 100svh;
  background: radial-gradient(circle at 50% 0%, rgba(185, 154, 111, 0.1), transparent 34%), var(--paper);
}

.replay-progress {
  position: fixed;
  top: 78px;
  left: var(--pad);
  right: var(--pad);
  z-index: 5;
  max-width: 720px;
  margin: 0 auto;
  color: rgba(23, 23, 23, 0.48);
  font-size: 0.72rem;
  font-weight: 700;
}

.progress-track {
  height: 3px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.08);
}

.progress-track span {
  display: block;
  width: 12.5%;
  height: 100%;
  border-radius: inherit;
  background: var(--wood-dark);
  transition: width 260ms ease;
}

.replay-scene {
  min-height: 100svh;
  display: none;
  align-items: flex-start;
  padding: 128px var(--pad) 64px;
}

.replay-scene.is-active {
  display: flex;
}

.scene-inner,
.section-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.scene-inner {
  display: flex;
  flex-direction: column;
  max-width: 760px;
}

.scene-visual {
  position: relative;
  display: block;
  order: 8;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 320px;
  margin-top: clamp(24px, 6vw, 42px);
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(222, 217, 207, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(105deg, rgba(185, 154, 111, 0.14) 0 16px, rgba(113, 91, 63, 0.08) 16px 32px),
    #e8e3da;
  box-shadow: 0 18px 54px rgba(34, 30, 24, 0.065);
}

.scene-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.replay-scene[image-fit="contain"] .scene-visual {
  background: #f7f7f4;
}

.replay-scene[image-fit="contain"] .scene-visual img,
.scene-visual[data-image-fit="contain"] img {
  object-fit: contain;
}

.scene-visual.is-zoomable {
  appearance: none;
  color: inherit;
  cursor: zoom-in;
  font: inherit;
}

.scene-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.55), transparent 36%);
  pointer-events: none;
}

[data-image-watermark] {
  position: relative;
}

[data-image-watermark]::before {
  content: attr(data-image-watermark);
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 120%;
  transform: translate(-50%, -50%) rotate(-22deg);
  color: rgba(23, 23, 23, 0.14);
  font-size: clamp(0.8rem, 3vw, 1.45rem);
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.scene-visual[data-image-fit="contain"]::before,
.replay-scene[image-fit="contain"] .scene-visual::before,
.modal-image-frame::before {
  color: rgba(23, 23, 23, 0.11);
}

.zoom-hint {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 3;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(251, 250, 247, 0.82);
  color: rgba(23, 23, 23, 0.58);
  backdrop-filter: blur(12px);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
}

.eyebrow {
  order: 1;
  margin: 0 0 16px;
  color: var(--wood-dark);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
}

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

h1 {
  order: 2;
  max-width: 15.5em;
  font-size: clamp(1.96rem, 6.8vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.24;
}

h2 {
  order: 2;
  max-width: 14em;
  font-size: clamp(1.62rem, 6.4vw, 3.15rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
}

h3 {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.45;
}

p {
  order: 3;
  color: var(--muted);
  font-size: clamp(0.98rem, 3.9vw, 1.08rem);
}

.lead,
.replay-scene .scene-inner > p:not(.eyebrow) {
  max-width: 38em;
  margin-top: 28px;
  color: #3a3935;
  font-size: clamp(1.02rem, 4.2vw, 1.22rem);
}

.document-id-label {
  margin-top: 18px;
  color: rgba(23, 23, 23, 0.5);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
}

strong {
  color: var(--ink);
  font-weight: 700;
  background: linear-gradient(transparent 62%, rgba(185, 154, 111, 0.25) 62%);
}

.nowrap {
  white-space: nowrap;
}

.choice-group {
  order: 4;
  display: grid;
  gap: 12px;
  margin-top: 34px;
  align-items: stretch;
}

.question {
  order: -1;
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--ink);
  font-weight: 700;
}

.choice-card {
  width: 100%;
  height: 100%;
  min-height: 64px;
  padding: 18px 20px;
  border: 1px solid rgba(222, 217, 207, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(34, 30, 24, 0.045);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.choice-card:hover {
  transform: translateY(-1px);
  border-color: rgba(113, 91, 63, 0.32);
}

.choice-card.selected {
  border-color: rgba(113, 91, 63, 0.74);
  background: #f2ede4;
  box-shadow: inset 0 0 0 1px rgba(113, 91, 63, 0.18), 0 14px 34px rgba(34, 30, 24, 0.07);
}

.choice-card.correct {
  border-color: rgba(76, 116, 86, 0.68);
  background: #edf3ec;
  box-shadow: inset 0 0 0 1px rgba(76, 116, 86, 0.18), 0 14px 34px rgba(34, 30, 24, 0.07);
}

.image-note,
.answer-note {
  max-width: 42em;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(113, 91, 63, 0.14);
  border-radius: 8px;
  background: rgba(246, 242, 235, 0.72);
}

.image-note,
.answer-note p {
  color: #4a4741;
  font-size: clamp(0.88rem, 3.5vw, 0.98rem);
  line-height: 1.8;
}

.image-note {
  order: 9;
}

.answer-note {
  order: 4;
  margin-top: 18px;
}

.answer-note p + p {
  margin-top: 8px;
}

.scene-actions {
  order: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-button,
.card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.primary-button:hover,
.card-button:hover {
  background: transparent;
  color: var(--ink);
  transform: translateY(-1px);
}

.primary-button:disabled,
.card-button:disabled {
  border-color: rgba(23, 23, 23, 0.18);
  background: rgba(23, 23, 23, 0.08);
  color: rgba(23, 23, 23, 0.45);
  cursor: default;
}

.primary-button:disabled:hover,
.card-button:disabled:hover {
  transform: none;
}

.dashboard {
  min-height: 100svh;
}

.dashboard-hero {
  min-height: auto;
  display: flex;
  align-items: flex-start;
  padding: 52px var(--pad) 52px;
}

.dashboard-section {
  padding: 64px var(--pad);
}

.message-section,
.timeline-section {
  background: #fffefa;
}

.progress-section {
  background: var(--surface-soft);
}

.section-heading {
  margin-bottom: 28px;
}

.message-panel {
  padding: clamp(28px, 7vw, 48px);
  border: 1px solid rgba(222, 217, 207, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.message-panel h2,
.dashboard-section h2 {
  max-width: none;
}

.message-body {
  margin-top: 26px;
}

.message-body p + p {
  margin-top: 14px;
}

.signature {
  color: var(--ink);
  font-weight: 700;
}

.progress-grid {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.progress-item {
  padding: 22px;
  border: 1px solid rgba(222, 217, 207, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.label {
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 700;
}

.value {
  margin-top: 6px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 700;
}

.timeline-list {
  position: relative;
  display: grid;
  gap: 22px;
  margin-top: 32px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 9px;
  width: 1px;
  background: rgba(113, 91, 63, 0.18);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 18px;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  width: 19px;
  height: 19px;
  margin-top: 6px;
  border: 1px solid rgba(113, 91, 63, 0.38);
  border-radius: 999px;
  background: var(--paper);
}

.timeline-item.is-available .timeline-marker,
.timeline-item.is-complete .timeline-marker {
  background: var(--ready);
  border-color: var(--ready);
}

.timeline-content {
  min-width: 0;
}

.timeline-phase {
  margin-bottom: 8px;
  color: var(--wood-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.timeline-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid rgba(222, 217, 207, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 36px rgba(34, 30, 24, 0.05);
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.timeline-item.is-available .timeline-card:hover,
.timeline-item.is-complete .timeline-card:hover {
  transform: translateY(-2px);
  border-color: rgba(113, 91, 63, 0.3);
}

.timeline-item.is-preparing,
.timeline-item.is-locked {
  opacity: 0.56;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.status-completed,
.status-open {
  background: rgba(47, 111, 78, 0.1);
  color: var(--ready);
}

.status-preparing {
  background: rgba(138, 118, 89, 0.13);
  color: var(--prepare);
}

.status-locked {
  background: rgba(119, 119, 119, 0.12);
  color: var(--locked);
}

.timeline-card h3 {
  margin-top: 16px;
}

.timeline-card p {
  margin-top: 14px;
}

.card-button {
  width: fit-content;
  margin-top: auto;
}

.module-anchor {
  height: 1px;
}

.watermark {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  max-width: min(86vw, 380px);
  padding: 8px 10px;
  border: 1px solid rgba(22, 22, 22, 0.08);
  border-radius: 6px;
  background: rgba(251, 250, 247, 0.76);
  color: rgba(22, 22, 22, 0.48);
  backdrop-filter: blur(14px);
  font-size: 0.66rem;
  line-height: 1.5;
  text-align: right;
}

.watermark span {
  display: block;
  white-space: nowrap;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-watermark-layer {
  z-index: 2;
  color: rgba(255, 255, 255, 0.11);
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 72px 96px;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  z-index: 1;
  background: rgba(12, 12, 12, 0.62);
}

.image-modal-content {
  position: relative;
  z-index: 3;
  width: min(100%, 1120px);
  max-height: 88svh;
  padding: 44px 12px 12px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.modal-image-frame {
  position: relative;
  overflow: hidden;
}

.image-modal-content img {
  display: block;
  width: 100%;
  max-height: calc(88svh - 68px);
  object-fit: contain;
  pointer-events: none;
}

.image-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(23, 23, 23, 0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

@media (min-width: 760px) {
  .choice-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-list {
    gap: 26px;
  }

  .timeline-item {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 22px;
  }

  .dashboard-section {
    padding-top: 88px;
    padding-bottom: 88px;
  }

  .watermark {
    right: 20px;
    bottom: 18px;
    font-size: 0.72rem;
  }
}

@media (min-width: 1040px) {
  .choice-group {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .timeline-card {
    max-width: 760px;
  }
}

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

  .choice-card,
  .timeline-card,
  .primary-button,
  .card-button {
    transition: none;
  }
}

@media print {
  body {
    display: none;
  }
}
