:root {
  color-scheme: light;
  --canvas: #faf6f1;
  --surface: #ffffff;
  --ink: #0e0e0f;
  --muted: #5c5e63;
  --border: #dfddd8;
  --bg: var(--canvas);
  --text: var(--ink);
  --brand: #f23718;
  --brand-dark: #bc1717;
  --blue: #176cb7;
  --danger: #dc3a37;
  --danger-bg: #fff4f3;
  --review: #df8700;
  --review-bg: #fff8eb;
  --ok: #279452;
  --ok-bg: #f1faef;
  --unknown: #6a667b;
  --unknown-bg: #f4f3f8;
  --shadow: none;
  --radius: 4px;
  --max: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--canvas);
  font-family: YakuHanJP, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

button, input, select, textarea { font: inherit; }

button, select { min-height: 44px; }

.page-shell {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
}

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgb(35 107 194 / 38%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 16px;
  color: #000;
  background: #fff;
}

.skip-link:focus { transform: none; }

.brand-header {
  background: #fff;
  border-bottom: 1px solid #e6e6e6;
}

.brand-header__inner {
  display: grid;
  grid-template-columns: 320px 1fr 440px;
  align-items: center;
  gap: 28px;
  width: min(1260px, calc(100% - 32px));
  min-height: 118px;
  margin: auto;
}

.brand-header__logo img {
  display: block;
  width: 100%;
  height: auto;
}

.brand-header__message {
  display: grid;
  font-size: 13px;
  line-height: 1.5;
}

.brand-header__message strong { font-size: 15px; }

.brand-header__actions { text-align: right; }

.brand-header__actions p,
.brand-header__actions small {
  display: block;
  margin: 0;
  font-size: 13px;
}

.brand-header__actions > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px 0 4px;
}

.brand-header__actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  color: #fff;
  background: var(--blue);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.brand-nav {
  color: #fff;
  background: #8a0002;
  border-top: 1px solid #ececec;
}

.brand-nav__inner {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  width: min(1260px, calc(100% - 32px));
  margin: auto;
}

.brand-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 6px;
  color: #fff;
  border-left: 1px solid #ececec;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}

.brand-nav a:last-child { border-right: 1px solid #ececec; }
.brand-nav a:hover { color: #fff; background: #700002; }

main {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
  padding: 34px 0 72px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a { color: inherit; }

.hero {
  max-width: 100%;
  padding: 0 0 24px;
  text-align: center;
}

h1, h2, p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 3.2vw, 2.6rem);
  line-height: 1.28;
  letter-spacing: .02em;
}

h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.4;
}

.lead {
  max-width: 100%;
  margin: 10px 0 0;
  color: #323232;
  font-size: 1rem;
}

.panel {
  margin-top: 16px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.usage-limits {
  width: min(100%, 620px);
  margin: 0 auto 38px;
  padding: 14px 24px;
  border: 1px solid #e0d5ab;
  background-color: #fffbea;
  text-align: center;
}

.usage-limits h2 {
  margin: 0 0 5px;
  font-size: 16px;
  line-height: 1.4;
}

.usage-limits p {
  margin: 0;
  color: #454545;
  font-size: 13px;
  line-height: 1.55;
}

.url-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
  align-items: center;
  gap: 30px;
}

.url-card {
  display: flex;
  min-height: 158px;
  flex-direction: column;
  justify-content: center;
  padding: 26px 34px;
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 5px;
  box-shadow: 0 4px 14px rgb(0 0 0 / 8%);
}

.url-card__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 13px;
  font-size: 18px;
  font-weight: 700;
}

.url-card__label::before {
  content: "▤";
  color: #af0d0d;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.url-flow__arrow {
  color: #555;
  font-size: 43px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  color: #2b2b2b;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 3px;
}

input[readonly] { background: #fafafa; }

.turnstile-container {
  width: min(100%, 410px);
  min-height: 1px;
  margin: 18px auto 0;
}

.primary-action {
  display: block;
  width: min(100%, 426px);
  margin: 10px auto 0;
  padding: 15px 26px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 8px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 5px;
  cursor: pointer;
}

.primary-action:hover { background: #d72a10; }
.primary-action:disabled {
  color: #fff;
  background: #858585;
  cursor: not-allowed;
  opacity: 1;
}
.form-status {
  min-height: 0;
  margin: 28px auto 0;
  color: #f00;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
}
.form-status:empty { margin-top: 0; }
.form-status.is-error { color: #f00; font-weight: 700; }

.privacy-note {
  margin: 38px 0 8px;
  color: #333;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.result-transition {
  margin: 8px 0 12px;
  color: #222;
  font-size: 46px;
  line-height: 1;
  text-align: center;
}

.summary > h2 {
  font-size: clamp(1.8rem, 3vw, 2.15rem);
  text-align: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-top: 22px;
  padding: 34px 48px;
  background: #fffbea;
  border: 1px solid #e0d5ab;
}

.summary-card {
  display: flex;
  min-height: 82px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 20px;
  font-weight: 700;
  align-items: center;
}

.summary-card strong { font-size: 1.45rem; }
.summary-card--danger { color: var(--danger); background: var(--danger-bg); }
.summary-card--review { color: var(--review); background: var(--review-bg); }
.summary-card--ok { color: var(--ok); background: var(--ok-bg); }
.summary-card--unknown { color: var(--unknown); background: var(--unknown-bg); }

.results {
  margin-top: 28px;
  padding: 38px 50px;
  border-radius: 5px;
}

.results-toolbar { align-items: center; }

.filters, .exports {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 0;
}

.filter {
  padding: 9px 18px;
  color: #292929;
  background: transparent;
  border: 0;
  border-bottom: 2px solid #d8d8d8;
  border-radius: 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}

.filter.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: transparent;
  box-shadow: none;
}

.exports { gap: 8px; }

.exports button {
  padding: 9px 18px;
  color: #fff;
  background: #222;
  border: 1px solid #222;
  border-radius: 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.exports button::before {
  content: "★";
  margin-right: 7px;
  color: #fff;
  font-size: 11px;
}

.export-status {
  min-height: 1.5em;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.result-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid #d6d6d6;
  border-radius: 2px;
}

.result-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
}

.result-table th, .result-table td {
  padding: 14px;
  vertical-align: top;
  text-align: left;
  border-bottom: 1px solid #e4e4e4;
}

.result-table thead th {
  background: #f8f8f8;
  font-size: .9rem;
}

.result-table tbody th {
  width: 18%;
  background-color: #f9f9f9;
  border-right: 1px solid #e0e0e0;
}
.result-table tbody td:nth-child(2), .result-table tbody td:nth-child(3) { width: 24%; }
.result-table tbody td:last-child { width: 34%; }
.result-table tbody tr[data-status="action_required"] td:last-child { background: var(--danger-bg); }
.result-table tbody tr[data-status="review"] td:last-child { background: var(--review-bg); }
.result-table tbody tr[data-status="ok"] td:last-child { background: #f2fff4; }
.result-table tbody tr[data-status="indeterminate"] td:last-child { background: var(--unknown-bg); }
.result-table tbody tr[data-status="info"] td:last-child { background: #edf6fc; }
.result-table tbody tr:last-child > * { border-bottom: 0; }

.category {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
}

.status {
  display: inline-block;
  padding: 3px 8px;
  border-left: 3px solid currentColor;
  border-radius: 1px;
  font-size: 13px;
  font-weight: 800;
}

.status--action_required { color: var(--danger); background: var(--danger-bg); }
.status--review { color: var(--review); background: var(--review-bg); }
.status--ok { color: var(--ok); background: var(--ok-bg); }
.status--indeterminate { color: var(--unknown); background: var(--unknown-bg); }
.status--info { color: #376d96; background: #edf6fc; }

.result-table td > p { margin: 8px 0; font-size: .9rem; }

details { color: var(--muted); font-size: 13px; }
summary { cursor: pointer; font-weight: 700; }
details p { margin: 5px 0; }

.empty-filter {
  margin: 20px 0 0;
  padding: 16px;
  text-align: center;
  background: #f7f7f7;
  border-radius: 2px;
}

.explanation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.explanation-grid .panel { margin-top: 18px; }

.evidence-list { margin: 14px 0 0; }
.evidence-list div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eee; }
.evidence-list dt { font-weight: 700; }
.evidence-list dd { margin: 0; overflow-wrap: anywhere; }
.explanation-grid ul { margin-bottom: 0; padding-left: 1.25rem; }

footer {
  padding-block: 35px;
  background: #fff;
  border-top: 1px solid var(--border);
}

footer .page-shell {
  display: flex;
  align-items: center;
  gap: 24px;
}

footer img {
  width: 230px;
  height: auto;
}

footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

[hidden] { display: none !important; }

@media (max-width: 1000px) {
  .brand-header__inner {
    grid-template-columns: 260px 1fr;
    min-height: 96px;
  }

  .brand-header__message { display: none; }

  .brand-nav__inner {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .brand-nav a { border-bottom: 1px solid #ececec; }
}

@media (max-width: 760px) {
  main { width: min(calc(100% - 24px), var(--max)); padding-top: 26px; }
  .hero { padding-inline: 0; }
  .panel { padding: 16px; border-radius: 3px; }
  h1 { font-size: 1.75rem; }
  .lead { font-size: .94rem; }
  .results-toolbar { display: block; }
  .usage-limits { margin-bottom: 24px; padding: 13px 15px; }
  .url-flow { grid-template-columns: 1fr; gap: 14px; }
  .url-card { min-height: 132px; padding: 22px 18px; }
  .url-flow__arrow { transform: rotate(90deg); font-size: 36px; }
  .privacy-note { margin-top: 26px; font-size: 14px; }
  .primary-action { border-radius: 8px; font-size: 19px; }
  .form-status { font-size: 24px; letter-spacing: 2px; }
  .result-transition { font-size: 38px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px 12px; }
  .summary-card { min-height: 76px; padding: 8px; font-size: 16px; }
  .summary-card strong { font-size: 1.25rem; }
  .results { padding: 20px 14px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; }
  .filter { flex: 0 0 auto; padding-inline: 14px; font-size: 14px; }
  .exports { margin-top: 14px; }
  .exports button { flex: 1 1 30%; padding-inline: 8px; }
  .explanation-grid { grid-template-columns: 1fr; }
  .result-table-wrap { overflow: visible; border: 0; }
  .result-table { min-width: 0; display: block; }
  .result-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .result-table tbody, .result-table tr, .result-table th, .result-table td { display: block; width: 100% !important; }
  .result-table tr { margin-top: 12px; overflow: hidden; border: 1px solid #ddd; border-radius: 2px; }
  .result-table th, .result-table td { border-bottom: 1px solid #eee; }
  .result-table td::before { display: block; margin-bottom: 4px; color: var(--muted); font-size: 13px; font-weight: 800; }
  .result-table td:nth-child(2)::before { content: "旧ページ"; }
  .result-table td:nth-child(3)::before { content: "新ページ"; }
  .result-table td:nth-child(4)::before { content: "診断"; }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 24px, 1200px);
  }

  .brand-header__inner {
    width: calc(100% - 24px);
    grid-template-columns: 1fr;
    gap: 8px;
    padding-block: 14px;
  }

  .brand-header__logo {
    width: 250px;
    max-width: 100%;
  }

  .brand-header__actions { text-align: left; }

  .brand-header__actions p,
  .brand-header__actions small { display: none; }

  .brand-header__actions > div {
    justify-content: flex-start;
    margin: 0;
  }

  .brand-header__actions a {
    min-height: 44px;
    font-size: 13px;
  }

  .brand-nav__inner {
    width: 100%;
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .brand-nav a {
    flex: 0 0 auto;
    min-width: 132px;
    padding-inline: 12px;
  }

  footer .page-shell {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 420px) {
  .brand-header__actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .brand-header__actions a {
    padding-inline: 8px;
    text-align: center;
    line-height: 1.35;
  }
}

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