:root {
  color-scheme: light;
  --paper: #f7f0e7;
  --sheet: #fffdf9;
  --sheet-soft: #fbf6ef;
  --ink: #24344d;
  --muted: #5d6878;
  --red: #a82034;
  --red-soft: #f8e2e6;
  --blue-soft: #e8f0f8;
  --gold: #c89f39;
  --line: rgba(112, 83, 60, .17);
  --line-strong: rgba(112, 83, 60, .28);
  --shadow: 0 22px 64px rgba(72, 50, 34, .10);
  --font-display: "Noto Serif", "Times New Roman", serif;
  --font-body: "Noto Sans", "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 2% 2%, rgba(247, 217, 224, .62), transparent 25%),
    radial-gradient(circle at 98% 12%, rgba(221, 235, 248, .78), transparent 24%),
    linear-gradient(rgba(154, 119, 88, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 119, 88, .045) 1px, transparent 1px),
    var(--paper);
  background-size: auto, auto, 32px 32px, 32px 32px, auto;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

::selection { background: var(--red); color: #fff; }
a { color: inherit; }
img { max-width: 100%; }
a:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  transform: translateY(-160%);
  padding: 11px 15px;
  border-radius: 12px;
  background: var(--sheet);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-decoration: none;
  font-weight: 750;
}
.skip-link:focus { transform: translateY(0); }

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 180;
  height: 3px;
  background: rgba(255,255,255,.48);
}
.scroll-progress span {
  display: block;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  height: 100%;
  background: linear-gradient(90deg, var(--red), #d15a69, var(--gold));
}

.detail-header {
  position: sticky;
  top: 14px;
  z-index: 120;
  padding: 0 18px;
}
.detail-header nav {
  width: min(1280px, 100%);
  min-height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(130px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  border: 1px solid rgba(169, 129, 97, .22);
  border-radius: 24px;
  background: rgba(255, 251, 246, .92);
  box-shadow: 0 14px 38px rgba(78, 55, 41, .11);
  backdrop-filter: blur(14px);
}
.detail-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.detail-brand-mark { width: 50px; height: 50px; display: block; object-fit: contain; }
.detail-brand > span { display: grid; gap: 2px; }
.detail-brand strong { font-family: var(--font-display); font-size: 1.08rem; }
.detail-brand small { color: #88796f; font-size: .77rem; }
.detail-header-links {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(248, 226, 230, .5);
}
.detail-header-links a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 17px;
  border-radius: 999px;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 750;
  transition: color .35s var(--ease), background .35s var(--ease), transform .35s var(--ease);
}
.detail-header-links a:hover { color: var(--red); background: rgba(255,255,255,.75); transform: translateY(-1px); }
.detail-course {
  justify-self: end;
  padding: 10px 15px;
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  color: var(--red);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.detail-page {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px 18px 0;
}
.detail-hero {
  position: relative;
  min-height: 300px;
  padding: 34px clamp(24px, 4vw, 52px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    radial-gradient(circle at 90% 12%, rgba(221,235,248,.68), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,249,242,.94));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.detail-hero::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: 14px;
  width: 220px;
  height: 125px;
  background: url('assets/cathedral.svg') center / contain no-repeat;
  opacity: .28;
  pointer-events: none;
}
.back-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  text-decoration: none;
  font-weight: 750;
  font-size: .88rem;
  transition: transform .35s var(--ease), color .35s var(--ease);
}
.back-btn:hover { color: var(--red); transform: translateX(-3px); }
.detail-hero-copy { position: relative; z-index: 2; width: min(820px, 78%); margin-top: 28px; }
.back-tag {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.detail-hero h1 {
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.9rem);
  line-height: 1.04;
  letter-spacing: -.035em;
}
.detail-hero-copy > p { margin: 18px 0 0; color: var(--muted); line-height: 1.75; }
.hero-page-number {
  position: absolute;
  right: 32px;
  top: 30px;
  color: rgba(36, 52, 77, .07);
  font-family: var(--font-display);
  font-size: clamp(6rem, 12vw, 9rem);
  line-height: 1;
}

.detail-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}
.detail-index {
  position: sticky;
  top: 108px;
  align-self: start;
  max-height: calc(100vh - 130px);
  overflow: auto;
  padding: 24px 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 251, 246, .9);
  box-shadow: 0 16px 42px rgba(78, 55, 41, .08);
  scrollbar-width: thin;
}
.detail-index > p {
  margin: 0 0 16px;
  color: var(--red);
  font-family: var(--font-display);
  font-size: 1.42rem;
}
.detail-index nav { display: grid; gap: 6px; }
.detail-index nav a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 14px;
  text-decoration: none;
  transition: background .35s var(--ease), color .35s var(--ease), transform .35s var(--ease);
}
.detail-index nav a span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-family: var(--font-display);
  font-size: .84rem;
}
.detail-index nav a b { font-size: .86rem; line-height: 1.35; }
.detail-index nav a:hover,
.detail-index nav a.active { background: #fff; color: var(--red); transform: translateX(3px); }
.index-note {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
  color: #a18777;
  font-family: var(--font-display);
  text-align: center;
  letter-spacing: .16em;
}

.report-sheet {
  min-width: 0;
  padding: clamp(24px, 4vw, 54px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--sheet);
  box-shadow: var(--shadow);
}
.report-label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  margin-bottom: 34px;
  color: #9c7d6e;
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.report-label i { height: 1px; background: var(--line-strong); }
.report-label b { color: var(--red); font-family: var(--font-display); font-size: 1rem; }
.report-body { min-width: 0; }
.report-body > :first-child { margin-top: 0; }
.document-kind { margin: 0 0 10px !important; color: var(--red) !important; font-size: .78rem !important; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.report-body h2,
.report-body h3,
.report-body h4 {
  scroll-margin-top: 116px;
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.2;
}
.report-body h2 {
  margin: 54px 0 18px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.85rem, 3vw, 2.75rem);
}
.report-body h3 { margin: 34px 0 12px; font-size: clamp(1.35rem, 2.2vw, 1.8rem); color: var(--red); }
.report-body h4 { margin: 24px 0 10px; font-size: 1.15rem; }
.report-body p,
.report-body li,
.report-body td,
.report-body th {
  font-size: 1rem;
  line-height: 1.78;
}
.report-body p { margin: 0 0 15px; color: var(--muted); }
.report-body strong { color: var(--ink); }
.report-body mark { background: transparent; color: inherit; }
.report-body ul,
.report-body ol { margin: 12px 0 20px; padding-left: 1.45rem; color: var(--muted); }
.report-body li { margin: 7px 0; padding-left: .2rem; }
.report-body a:not(.evidence-link) {
  color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.report-body blockquote {
  margin: 24px 0;
  padding: 18px 20px;
  border-left: 3px solid var(--red);
  border-radius: 0 16px 16px 0;
  background: var(--sheet-soft);
}

.procedure-list { display: grid; gap: 22px; }
.procedure-step {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 18px;
  scroll-margin-top: 116px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.procedure-step:last-child { border-bottom: 0; padding-bottom: 0; }
.step-number {
  position: sticky;
  top: 116px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-family: var(--font-display);
  font-size: 1rem;
}
.step-body > p:first-child { font-size: 1.04rem; color: var(--ink); }

.evidence-single,
.evidence-strip {
  margin: 18px 0 26px;
  display: grid;
  gap: 14px;
}
.evidence-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.evidence-link {
  display: block;
  padding: 8px;
  border-radius: 18px;
  background: var(--sheet-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.evidence-link:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(72,50,34,.10); }
.evidence-link img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 920px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}
.evidence-single .evidence-link { width: min(100%, 820px); margin-inline: auto; }

.table-scroll {
  width: 100%;
  margin: 24px 0 34px;
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(72,50,34,.05);
}
.report-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  border-spacing: 0;
}
.report-table caption { padding: 14px 16px; font-family: var(--font-display); font-weight: 700; text-align: left; }
.report-table th,
.report-table td {
  min-width: 120px;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  color: var(--muted);
  background: #fff;
}
.report-table th { color: var(--ink); background: var(--red-soft); font-weight: 800; }
.report-table tr:first-child td { color: var(--ink); font-weight: 750; background: var(--red-soft); }
.report-table tr:last-child > * { border-bottom: 0; }
.report-table tr > *:last-child { border-right: 0; }
.report-table p { margin: 0 0 8px; font-size: .9rem; line-height: 1.55; }
.report-table p:last-child { margin-bottom: 0; }

.source-file {
  margin-top: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, #283a55, #1f2d43);
  color: #fff;
}
.source-file > div { display: grid; gap: 4px; }
.source-file strong { font-family: var(--font-display); font-size: 1.12rem; }
.source-file span { color: rgba(255,255,255,.7); font-size: .84rem; }
.source-file a {
  flex: 0 0 auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  text-decoration: none;
  font-weight: 750;
}

.detail-footer {
  width: min(1280px, calc(100% - 36px));
  margin: 24px auto 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
  border-radius: 24px;
  background: #24344d;
  color: #fff;
}
.detail-footer p { margin: 0; color: rgba(255,255,255,.78); }
.detail-footer a { color: #fff; text-decoration: none; font-weight: 750; }

@media (max-width: 1040px) {
  .detail-header nav { grid-template-columns: 1fr auto; }
  .detail-course { display: none; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-index {
    position: relative;
    top: 0;
    max-height: none;
  }
  .detail-index nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .detail-index nav a { flex: 0 0 auto; min-width: 150px; }
}

@media (max-width: 760px) {
  .detail-header { top: 8px; padding: 0 8px; }
  .detail-header nav { min-height: 68px; padding: 9px 12px; border-radius: 20px; }
  .detail-brand-mark { width: 44px; height: 44px; }
  .detail-brand strong { font-size: 1rem; }
  .detail-brand small { font-size: .7rem; }
  .detail-header-links { display: none; }
  .detail-page { padding: 16px 8px 0; }
  .detail-hero { min-height: 0; padding: 24px 20px 28px; border-radius: 24px; }
  .detail-hero-copy { width: 100%; }
  .detail-hero-copy > p { display: none; }
  .hero-page-number { display: none; }
  .detail-hero::after { width: 120px; height: 72px; opacity: .18; }
  .detail-layout { gap: 16px; margin-top: 16px; }
  .detail-index,
  .report-sheet { border-radius: 22px; }
  .detail-index { padding: 18px 14px; }
  .report-sheet { padding: 24px 18px; }
  .procedure-step { grid-template-columns: 40px minmax(0,1fr); gap: 12px; }
  .step-number { position: static; width: 38px; height: 38px; font-size: .82rem; }
  .evidence-strip { grid-template-columns: 1fr; }
  .source-file,
  .detail-footer { flex-direction: column; align-items: flex-start; }
  .source-file a { width: 100%; justify-content: center; }
  .detail-footer { width: calc(100% - 16px); padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}


/* ===== Taste-skill polish for detail pages ===== */
:root {
  --paper: #f8f2ea;
  --sheet: #fffdf9;
  --sheet-soft: #fcf7f0;
  --ink: #273752;
  --muted: #606c80;
  --red: #ad2236;
  --red-soft: #f8e5e8;
  --gold: #caa54b;
}
body {
  background:
    radial-gradient(circle at 0% 3%, rgba(246, 221, 227, .78), transparent 22%),
    radial-gradient(circle at 100% 10%, rgba(221, 235, 248, .76), transparent 22%),
    linear-gradient(rgba(154, 119, 88, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 119, 88, .03) 1px, transparent 1px),
    var(--paper);
  background-size: auto, auto, 38px 38px, 38px 38px, auto;
}
body::before { opacity: .04; }
body::after {
  content: '';
  position: fixed;
  right: 10px;
  bottom: 10px;
  width: 150px;
  height: 150px;
  pointer-events: none;
  background: url('assets/floral-corner.svg') right bottom/contain no-repeat;
  opacity: .07;
}
.detail-header nav {
  position: relative;
  background: rgba(255,251,246,.94);
}
.detail-header nav::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -8px;
  height: 14px;
  background: url('assets/lace-border.svg') center/100% 100% no-repeat;
  opacity: .95;
  pointer-events: none;
}
.detail-header-links {
  background: linear-gradient(180deg, rgba(248, 226, 230, .55), rgba(251, 240, 242, .42));
}
.detail-page { padding-top: 30px; }
.detail-hero {
  box-shadow: 0 20px 50px rgba(72, 50, 34, .09);
  background:
    radial-gradient(circle at 92% 15%, rgba(221,235,248,.62), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,249,242,.96));
}
.detail-hero::before {
  content: '';
  position: absolute;
  left: 26px;
  top: 22px;
  width: 96px;
  height: 70px;
  background: url('assets/floral-corner.svg') left top/contain no-repeat;
  opacity: .11;
}
.detail-hero::after { opacity: .18; }
.back-btn {
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 20px rgba(72,50,34,.04);
}
.detail-hero h1 { letter-spacing: -.04em; max-width: 80%; }
.hero-page-number { color: rgba(39,55,82,.05); }
.detail-index {
  position: sticky;
  overflow: visible;
  background: linear-gradient(180deg, rgba(255,251,246,.95), rgba(255,247,240,.92));
}
.detail-index::before {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  bottom: 14px;
  border: 1px dashed rgba(171,132,101,.18);
  border-radius: 18px;
  pointer-events: none;
}
.detail-index::after {
  content: '';
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 84px;
  height: 84px;
  background: url('assets/floral-corner.svg') center/contain no-repeat;
  opacity: .12;
}
.detail-index > p {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}
.detail-index nav,
.index-note { position: relative; z-index: 1; }
.detail-index nav a {
  min-height: 52px;
  border-radius: 16px;
}
.detail-index nav a:hover,
.detail-index nav a.active {
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 18px rgba(72,50,34,.05);
}
.report-sheet {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,251,246,.96));
}
.report-sheet::before {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 22px;
  border: 1px solid rgba(171,132,101,.11);
  pointer-events: none;
}
.report-label { position: relative; z-index: 1; }
.report-body { position: relative; z-index: 1; }
.report-body h2 {
  position: relative;
  padding-bottom: 14px;
}
.report-body h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 110px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), rgba(202,165,75,.88));
}
.report-body h3 {
  display: inline-block;
  padding-right: 16px;
  background: linear-gradient(180deg, transparent 62%, rgba(248,229,232,.65) 0);
}
.procedure-list { gap: 26px; }
.procedure-step {
  padding: 18px 18px 24px;
  border: 1px solid rgba(171,132,101,.12);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(252,247,240,.78));
}
.procedure-step:last-child { padding-bottom: 18px; }
.step-number {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248,229,232,.98), rgba(255,255,255,.94));
  box-shadow: inset 0 0 0 1px rgba(173,34,54,.08), 0 10px 20px rgba(72,50,34,.05);
}
.step-body > p:first-child {
  margin-top: 2px;
  font-size: 1.02rem;
}
.evidence-single,
.evidence-strip { margin: 18px 0 4px; }
.evidence-link {
  padding: 10px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #fbf5ee);
  box-shadow: 0 12px 26px rgba(72,50,34,.05);
}
.evidence-link img {
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(171,132,101,.12);
}
.table-scroll {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(252,247,240,.96));
}
.report-table th {
  background: rgba(248,229,232,.72);
  color: var(--ink);
  font-weight: 700;
}
.report-table tr:nth-child(even) td { background: rgba(252,247,240,.62); }
.source-file {
  margin-top: 36px;
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248,229,232,.48), rgba(255,251,246,.92));
  border: 1px solid rgba(171,132,101,.18);
  box-shadow: 0 14px 30px rgba(72,50,34,.05);
}
.source-file a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(171,132,101,.16);
  text-decoration: none;
  font-weight: 750;
}
.detail-footer {
  background: linear-gradient(135deg, #24344d, #1d2a42 65%, #162136);
  box-shadow: 0 22px 44px rgba(28, 41, 64, .24);
}
@media (max-width: 1120px) {
  .detail-hero h1 { max-width: none; }
}
@media (max-width: 780px) {
  body::after { width: 100px; height: 100px; }
  .procedure-step {
    padding: 16px 14px 20px;
    border-radius: 18px;
  }
}
