:root {
  --wall-ink: #11100d;
  --wall-paper: #efe5cf;
  --wall-cream: #fff8e9;
  --wall-blue: #075bd7;
  --wall-red: #e43f20;
  --wall-yellow: #e8a928;
  --wall-muted: #6f6557;
}

html { scroll-behavior: smooth; }

body.legacy-page {
  margin: 0;
  background-color: var(--wall-paper) !important;
  background-image: radial-gradient(rgba(17, 16, 13, .13) .7px, transparent .8px) !important;
  background-size: 7px 7px !important;
  color: var(--wall-ink) !important;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif !important;
  font-size: 15px !important;
  line-height: 1.75 !important;
  overflow-x: hidden;
}

body.legacy-page *, body.legacy-page *::before, body.legacy-page *::after { box-sizing: border-box; }
body.legacy-page a { color: inherit; text-decoration: none; }
body.legacy-page img { max-width: 100%; }
body.legacy-page > div:not(.legacy-ad-note) { background-color: transparent !important; }

.legacy-ad-note {
  padding: 7px 5vw;
  background: var(--wall-ink);
  color: #d9d0bf;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .06em;
  text-align: center;
}

.legacy-site-header {
  position: sticky !important;
  top: 0;
  z-index: 90 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 10px max(5vw, 24px) !important;
  background: rgba(239, 229, 207, .97) !important;
  border: 0 !important;
  border-bottom: 3px solid var(--wall-ink) !important;
  backdrop-filter: blur(12px);
}

.legacy-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--wall-ink) !important;
  line-height: 1.22;
}

.legacy-logo > b {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--wall-red);
  color: #fff;
  border: 2px solid var(--wall-ink);
  box-shadow: 4px 4px 0 var(--wall-ink);
  font: 900 23px/1 "Yu Mincho", serif;
  transform: rotate(-4deg);
}

.legacy-logo > span { display: flex; min-width: 0; flex-direction: column; }
.legacy-logo small { font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.legacy-logo strong { font-size: 15px; font-weight: 900; white-space: nowrap; }
.legacy-site-header nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); }
.legacy-site-header nav > a { padding: 8px 0; border-bottom: 3px solid transparent; font-size: 13px; font-weight: 900; white-space: nowrap; }
.legacy-site-header nav > a:hover { border-color: var(--wall-red); }
.legacy-site-header .legacy-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  background: var(--wall-red);
  color: #fff !important;
  border: 2px solid var(--wall-ink);
  box-shadow: 5px 5px 0 var(--wall-ink);
}

.legacy-masthead {
  --legacy-masthead-min: 500px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 1fr);
  min-height: var(--legacy-masthead-min);
  overflow: hidden;
  background: var(--wall-paper);
  border-bottom: 5px solid var(--wall-ink);
}

.legacy-masthead--compact {
  --legacy-masthead-min: 470px;
  grid-template-columns: minmax(0, .84fr) minmax(420px, 1.16fr);
}

.legacy-masthead--dense {
  --legacy-masthead-min: 560px;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr);
}

.legacy-masthead::before {
  position: absolute;
  z-index: 2;
  top: 22px;
  left: 52%;
  width: 70px;
  height: 12px;
  background: var(--wall-yellow);
  border: 2px solid var(--wall-ink);
  content: "";
  transform: rotate(5deg);
}

.legacy-masthead-copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--legacy-masthead-min);
  padding: clamp(44px, 5vw, 70px) clamp(30px, 5vw, 76px);
  background-color: var(--wall-paper);
  background-image: radial-gradient(rgba(17, 16, 13, .15) .65px, transparent .75px);
  background-size: 7px 7px;
  border-right: 4px solid var(--wall-ink);
}

.legacy-kicker {
  align-self: flex-start;
  margin: 0 0 20px;
  padding: 9px 12px;
  background: var(--wall-blue);
  color: #fff;
  border: 2px solid var(--wall-ink);
  box-shadow: 4px 4px 0 var(--wall-ink);
  font: 900 12px/1 Arial, sans-serif;
  letter-spacing: .15em;
  transform: rotate(-1deg);
}

.legacy-masthead h1 {
  max-width: 900px;
  margin: 0;
  color: var(--wall-ink);
  font: 900 clamp(36px, 4.7vw, 68px)/1.04 "Yu Mincho", "Noto Serif JP", serif;
  letter-spacing: -.055em;
  line-break: strict;
  text-wrap: balance;
  word-break: auto-phrase;
}

.legacy-page-summary {
  max-width: 780px;
  margin: 22px 0 0;
  color: #3f392f;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.8;
}

.legacy-route-mark {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-top: 25px;
  font: 900 11px/1 Arial, sans-serif;
  letter-spacing: .12em;
}

.legacy-route-mark span { padding: 7px 9px; border: 2px solid var(--wall-ink); background: var(--wall-cream); }
.legacy-route-mark i { color: var(--wall-red); font-size: 18px; font-style: normal; }

.legacy-masthead-art { position: relative; min-height: var(--legacy-masthead-min); margin: 0; background: var(--wall-blue); overflow: hidden; }
.legacy-masthead-art::after { position: absolute; inset: 16px; border: 3px solid var(--wall-cream); content: ""; pointer-events: none; mix-blend-mode: screen; }
.legacy-masthead-art img { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: var(--legacy-hero-focus, center center); filter: saturate(1.08) contrast(1.04); }
.legacy-masthead-art figcaption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  max-width: calc(100% - 36px);
  padding: 8px 10px;
  overflow: hidden;
  background: var(--wall-ink);
  color: var(--wall-cream);
  border-left: 7px solid var(--wall-red);
  font: 900 10px/1.2 Arial, sans-serif;
  letter-spacing: .1em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legacy-original-title { display: none !important; }

body.legacy-page main {
  width: min(1160px, calc(100% - 40px));
  max-width: 1160px !important;
  margin: 0 auto !important;
  padding: 42px 0 64px !important;
}

body.legacy-editorial main { max-width: 920px !important; }
body.legacy-agency main { max-width: 1040px !important; }
body.legacy-guide main { max-width: 1080px !important; }

body.legacy-page main > nav:first-child {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
  margin: 0 0 22px !important;
  padding: 8px 12px !important;
  overflow-x: auto;
  background: var(--wall-yellow) !important;
  color: var(--wall-ink) !important;
  border: 2px solid var(--wall-ink) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  white-space: nowrap;
}

body.legacy-page main p,
body.legacy-page main li,
body.legacy-page main dd {
  font-size: 15px !important;
  line-height: 1.9 !important;
}

body.legacy-page main small { font-size: 12px !important; line-height: 1.65 !important; }
body.legacy-page main h2 {
  margin-top: 38px !important;
  margin-bottom: 16px !important;
  padding: 7px 0 7px 17px !important;
  color: var(--wall-ink) !important;
  border-left: 9px solid var(--wall-blue) !important;
  font: 900 clamp(21px, 2.4vw, 30px)/1.35 "Yu Mincho", "Noto Serif JP", serif !important;
  letter-spacing: -.025em !important;
}

body.legacy-page main h3 {
  margin-top: 28px !important;
  color: var(--wall-ink) !important;
  font-size: 18px !important;
  line-height: 1.5 !important;
  font-weight: 900 !important;
}

body.legacy-page main h4 { color: var(--wall-ink) !important; font-size: 16px !important; font-weight: 900 !important; }
body.legacy-page main strong { color: inherit; }

body.legacy-page main > div[style*="background: #fff"],
body.legacy-page main > div[style*="background:#fff"],
body.legacy-page main > section[style*="background: #fff"],
body.legacy-page main > section[style*="background:#fff"] {
  background: var(--wall-cream) !important;
  border: 3px solid var(--wall-ink) !important;
  border-radius: 0 !important;
  box-shadow: 9px 9px 0 var(--wall-blue) !important;
}

body.legacy-page main [style*="background: #FAFCFF"],
body.legacy-page main [style*="background:#FAFCFF"],
body.legacy-page main [style*="background: #FBF9F4"],
body.legacy-page main [style*="background:#FBF9F4"],
body.legacy-page main [style*="background: #FBF7EF"],
body.legacy-page main [style*="background:#FBF7EF"] {
  background: #f6ead2 !important;
  border-color: var(--wall-ink) !important;
  border-radius: 0 !important;
}

body.legacy-page main a[style*="background: #D42F2F"],
body.legacy-page main a[style*="background:#D42F2F"],
body.legacy-page main button[style*="background: #D42F2F"],
body.legacy-page main button[style*="background:#D42F2F"] {
  background: var(--wall-red) !important;
  color: #fff !important;
  border: 2px solid var(--wall-ink) !important;
  border-radius: 0 !important;
  box-shadow: 4px 4px 0 var(--wall-ink) !important;
}

body.legacy-page main a[style*="border: 1.5px solid #D42F2F"],
body.legacy-page main a[style*="border:1.5px solid #D42F2F"] {
  background: var(--wall-cream) !important;
  color: var(--wall-red) !important;
  border: 2px solid var(--wall-ink) !important;
  border-radius: 0 !important;
  box-shadow: 4px 4px 0 var(--wall-yellow) !important;
}

body.legacy-page table {
  width: 100%;
  border: 2px solid var(--wall-ink) !important;
  border-collapse: collapse !important;
  background: var(--wall-cream) !important;
  font-size: 13.5px !important;
}

body.legacy-page table th,
body.legacy-page table td {
  padding: 10px 12px !important;
  border: 1px solid var(--wall-ink) !important;
  border-radius: 0 !important;
  font-size: 13.5px !important;
  line-height: 1.65 !important;
  vertical-align: top;
}

body.legacy-page table th { background: var(--wall-ink) !important; color: var(--wall-cream) !important; font-weight: 900 !important; }
body.legacy-page table td { background: var(--wall-cream) !important; color: var(--wall-ink) !important; }

.legacy-database .chipgroup { margin-bottom: 18px !important; padding: 15px !important; background: var(--wall-cream); border: 2px solid var(--wall-ink); }
.legacy-database .chip {
  min-height: 38px;
  padding: 8px 13px !important;
  background: var(--wall-cream) !important;
  color: var(--wall-ink) !important;
  border: 2px solid var(--wall-ink) !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  box-shadow: 3px 3px 0 var(--wall-yellow);
}
.legacy-database .chip.active { background: var(--wall-blue) !important; color: #fff !important; box-shadow: 3px 3px 0 var(--wall-ink); }
.legacy-database .db-card {
  align-self: stretch;
  height: 100% !important;
  background: var(--wall-cream) !important;
  border: 3px solid var(--wall-ink) !important;
  border-radius: 0 !important;
  box-shadow: 8px 8px 0 var(--wall-blue) !important;
  transition: transform .16s ease, box-shadow .16s ease;
}
.legacy-database #cardGrid { align-items: stretch; }
.legacy-database .db-card > :nth-child(3) { min-height: 201px !important; }
.legacy-database .db-card > :nth-child(4) { min-height: 133px !important; }
.legacy-database .db-card > :nth-child(5) { min-height: 86px !important; }
.legacy-database .db-card > :nth-child(6) { min-height: 51px !important; }
.legacy-database .db-card [style*="font-size:10.5px"] { font-size: 11.5px !important; }
.legacy-database .db-card [style*="font-size:12.5px"] { font-size: 13.5px !important; }
.legacy-database .db-card div:has(> a > img[src*="afi-b.com"]),
.legacy-database .db-card div:has(> a > img[src*="a8.net"]) {
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(7, 91, 215, .92), rgba(7, 91, 215, .92) 48%, rgba(228, 63, 32, .92) 48%, rgba(228, 63, 32, .92));
  border: 2px solid var(--wall-ink);
}
.legacy-database .db-card div:has(> a > img[src*="afi-b.com"])::before,
.legacy-database .db-card div:has(> a > img[src*="a8.net"])::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  color: #fff;
  content: "公式サイトの情報を確認";
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  text-align: center;
}
.legacy-database .db-card div:has(> a > img[src*="afi-b.com"]) > a,
.legacy-database .db-card div:has(> a > img[src*="a8.net"]) > a { position: relative; z-index: 1; }
.legacy-database .db-card:nth-of-type(3n+2) { box-shadow: 8px 8px 0 var(--wall-red) !important; }
.legacy-database .db-card:nth-of-type(3n) { box-shadow: 8px 8px 0 var(--wall-yellow) !important; }
.legacy-database .db-card:hover { transform: translate(3px, 3px); box-shadow: 4px 4px 0 var(--wall-ink) !important; }
.legacy-database .db-card h2 { margin-top: 0 !important; padding-left: 12px !important; border-left-width: 6px !important; font-size: 20px !important; }
.legacy-database .hide { display: none !important; }

body.legacy-page details {
  margin: 13px 0 !important;
  overflow: hidden;
  background: var(--wall-cream) !important;
  border: 2px solid var(--wall-ink) !important;
  border-radius: 0 !important;
  box-shadow: 5px 5px 0 var(--wall-yellow) !important;
}
body.legacy-page details summary { padding: 16px 18px !important; color: var(--wall-ink) !important; font-size: 15px !important; font-weight: 900 !important; cursor: pointer; }
body.legacy-page details[open] summary { background: var(--wall-blue) !important; color: #fff !important; }

.legacy-shindan {
  --navy: var(--wall-ink);
  --ink: var(--wall-ink);
  --coral: var(--wall-red);
  --coral-d: #bd2d14;
  --cream: var(--wall-paper);
  --warm: var(--wall-cream);
  --line: var(--wall-ink);
  --line2: #c8bda8;
  --gold: #8e6511;
  --muted: var(--wall-muted);
  --r: 0;
  --maxw: 720px;
}

.legacy-shindan .wrap { width: min(720px, calc(100% - 32px)); max-width: 720px !important; padding: 38px 0 64px !important; }
.legacy-shindan .intro-card { padding: 30px !important; background: var(--wall-cream); border: 3px solid var(--wall-ink); box-shadow: 10px 10px 0 var(--wall-blue); }
.legacy-shindan .btn,
.legacy-shindan .opt,
.legacy-shindan .chip,
.legacy-shindan .toggle,
.legacy-shindan .svc,
.legacy-shindan .bars,
.legacy-shindan .res-desc,
.legacy-shindan .rk {
  border: 2px solid var(--wall-ink) !important;
  border-radius: 0 !important;
}
.legacy-shindan .btn { background: var(--wall-red) !important; box-shadow: 5px 5px 0 var(--wall-ink); }
.legacy-shindan .opt { background: var(--wall-cream) !important; box-shadow: 4px 4px 0 var(--wall-yellow); font-size: 15px !important; }
.legacy-shindan .opt:hover { background: var(--wall-yellow) !important; }
.legacy-shindan .chip.on { background: var(--wall-blue) !important; }
.legacy-shindan .svc { box-shadow: 7px 7px 0 var(--wall-blue); }
.legacy-shindan .psych { background: var(--wall-ink) !important; border: 3px solid var(--wall-blue); border-radius: 0 !important; }
.legacy-shindan .progress { height: 7px !important; border: 1px solid var(--wall-ink); border-radius: 0 !important; }
.legacy-shindan .progress span { background: var(--wall-red) !important; border-radius: 0 !important; }
.legacy-shindan.diag-focus > .legacy-ad-note,
.legacy-shindan.diag-focus > .legacy-masthead { display: none !important; }

body.legacy-page footer {
  margin-top: 40px !important;
  padding: 44px 0 28px !important;
  background: var(--wall-ink) !important;
  color: #d8d0c2 !important;
  border-top: 9px solid var(--wall-blue) !important;
}
body.legacy-page footer a { color: var(--wall-cream) !important; font-size: 13px !important; }
body.legacy-page footer nav { gap: 10px 22px !important; border-color: rgba(255,255,255,.28) !important; }
body.legacy-page footer > div > div[style*="background"] { border: 2px solid var(--wall-cream) !important; border-radius: 0 !important; background: rgba(255,255,255,.06) !important; }
body.legacy-page footer a[style*="background: #D42F2F"],
body.legacy-page footer a[style*="background:#D42F2F"] { background: var(--wall-red) !important; border: 2px solid var(--wall-cream) !important; border-radius: 0 !important; }

@media (max-width: 900px) {
  .legacy-site-header { min-height: 68px; padding: 9px 18px !important; }
  .legacy-site-header nav > a:not(.legacy-nav-cta) { display: none; }
  .legacy-site-header .legacy-nav-cta { padding: 9px 13px; box-shadow: 4px 4px 0 var(--wall-ink); }
  .legacy-masthead,
  .legacy-masthead--compact,
  .legacy-masthead--dense { grid-template-columns: 1fr; min-height: 0; }
  .legacy-masthead-copy { min-height: 0; padding: 42px 24px; border-right: 0; border-bottom: 4px solid var(--wall-ink); }
  .legacy-masthead-art { min-height: 330px; height: 330px; max-height: 430px; }
  .legacy-masthead-art img { min-height: 0; height: 100%; }
  .legacy-masthead::before { top: auto; bottom: 315px; left: 68%; }
  body.legacy-page main { width: min(100% - 28px, 1160px); padding-top: 30px !important; }
  body.legacy-page table { display: block; max-width: 100%; overflow-x: auto; white-space: normal; }
}

@media (max-width: 560px) {
  body.legacy-page { font-size: 15px !important; }
  .legacy-ad-note { font-size: 10px; }
  .legacy-logo > b { flex-basis: 36px; width: 36px; height: 36px; font-size: 20px; }
  .legacy-logo small { display: none; }
  .legacy-logo strong { max-width: 145px; overflow: hidden; font-size: 12px; line-height: 1.25; white-space: normal; }
  .legacy-site-header .legacy-nav-cta { font-size: 12px; }
  .legacy-masthead-copy { padding: 35px 18px 40px; }
  .legacy-kicker { margin-bottom: 17px; font-size: 10px; }
  .legacy-masthead h1 { font-size: clamp(31px, 10vw, 46px); overflow-wrap: anywhere; }
  .legacy-page-summary { margin-top: 17px; font-size: 15px; line-height: 1.75; }
  .legacy-route-mark { margin-top: 20px; }
  .legacy-masthead-art { min-height: 280px; height: 280px; }
  .legacy-masthead-art img { min-height: 0; height: 100%; }
  .legacy-masthead::before { display: none; }
  body.legacy-page main { width: calc(100% - 24px); padding: 24px 0 48px !important; }
  body.legacy-page main p,
  body.legacy-page main li,
  body.legacy-page main dd { font-size: 15px !important; line-height: 1.85 !important; }
  body.legacy-page main h2 { margin-top: 30px !important; padding-left: 12px !important; border-left-width: 7px !important; font-size: 21px !important; }
  body.legacy-page main h3 { font-size: 16px !important; }
  body.legacy-page table th,
  body.legacy-page table td { min-width: 110px; padding: 9px 10px !important; font-size: 13.5px !important; }
  .legacy-shindan .wrap { width: calc(100% - 24px); padding-top: 24px !important; }
  .legacy-shindan .intro-card { padding: 24px 17px !important; box-shadow: 6px 6px 0 var(--wall-blue); }
}

@media (min-width: 901px) {
  .legacy-masthead,
  .legacy-masthead--compact,
  .legacy-masthead--dense {
    --legacy-masthead-min: 520px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    height: 520px;
  }

  .legacy-masthead-copy,
  .legacy-masthead-art {
    min-height: 520px;
    height: 520px;
  }

  .legacy-masthead-copy {
    padding: 38px clamp(30px, 4vw, 58px);
  }

  .legacy-masthead--dense h1 {
    font-size: clamp(36px, 3.7vw, 52px);
    line-height: 1.06;
  }

  .legacy-masthead--dense .legacy-page-summary {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.65;
  }

  .legacy-masthead--dense .legacy-route-mark {
    margin-top: 18px;
  }
}

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