:root {
  --ink: #25312e;
  --muted: #61706c;
  --line: #dce3e0;
  --soft: #f5f7f6;
  --green: #18745f;
  --green-dark: #0f5a49;
  --green-soft: #e8f4f0;
  --red: #a43a34;
  --red-soft: #fbefee;
  --orange: #8a5a11;
  --orange-soft: #fff5df;
  --blue: #2b6388;
  --blue-soft: #edf5fa;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}
a { color: var(--green-dark); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button, input, select { min-height: 42px; }
:focus-visible { outline: 3px solid #e4a52e; outline-offset: 2px; }
[hidden] { display: none !important; }

.content-width { width: min(760px, calc(100% - 32px)); margin-inline: auto; }
.wide-width { width: min(1100px, calc(100% - 32px)); margin-inline: auto; }

.site-header { border-bottom: 1px solid #e6ebe9; }
.header-inner { width: min(760px, calc(100% - 32px)); min-height: 54px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-name { color: var(--green); font-weight: 750; text-decoration: none; }
.header-inner span { color: var(--muted); font-size: .83rem; }

.intro { padding: 28px 0 18px; }
h1, h2, h3 { line-height: 1.42; }
h1 { margin: 0 0 12px; font-size: clamp(1.65rem, 3vw, 2rem); letter-spacing: -.025em; }
h2 { margin: 0 0 16px; font-size: 1.35rem; }
h3 { margin: 0 0 8px; font-size: 1.06rem; }
.intro > p { margin: 0 0 12px; color: #4e5d59; }
.privacy-line { display: flex; flex-wrap: wrap; gap: 6px 13px; margin-top: 16px; padding: 10px 13px; border-left: 4px solid var(--green); background: var(--green-soft); color: #275047; font-size: .91rem; }
.verified { margin-top: 8px !important; color: var(--muted) !important; font-size: .82rem; }

.checker { margin-top: 14px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.input-tabs { display: flex; gap: 0; overflow-x: auto; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.input-tab { flex: 0 0 auto; padding: 9px 16px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.input-tab.is-active { border-color: var(--green); color: var(--green-dark); font-weight: 700; }
.input-panel > label { display: block; margin-bottom: 7px; font-weight: 650; }
textarea, input[type="text"], input[type="search"], select { width: 100%; border: 1px solid #aebbb6; border-radius: 6px; background: #fff; color: var(--ink); }
textarea { min-height: 235px; padding: 12px; resize: vertical; font-family: Consolas, "SFMono-Regular", monospace; font-size: .91rem; line-height: 1.55; }
input[type="text"], input[type="search"], select { padding: 8px 10px; }

.drop-zone, .folder-box { padding: 27px 18px; border: 1px dashed #9ab7ae; border-radius: 7px; background: #f8fbfa; text-align: center; }
.drop-zone { display: grid; justify-items: center; gap: 7px; }
.drop-zone.is-dragging { border-color: var(--green); background: var(--green-soft); }
.drop-zone small, .support-note { color: var(--muted); }
.file-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 7px 15px; border: 1px solid var(--green); border-radius: 6px; background: #fff; color: var(--green-dark); cursor: pointer; font-weight: 700; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-options { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 15px; }
.file-options > * { min-width: 210px; flex: 1; }
.file-options label { display: block; font-size: .87rem; font-weight: 650; }
.input-state { min-height: 1.5em; color: var(--green-dark); font-size: .9rem; }

.settings { margin-top: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.settings > summary { padding: 12px 3px; cursor: pointer; font-weight: 700; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; padding: 3px 3px 18px; }
.field { display: grid; gap: 4px; }
.field label, .field > label { font-size: .86rem; font-weight: 650; }
.field small { color: var(--muted); }
.field-wide { grid-column: 1 / -1; }
.check-field { display: flex; align-items: flex-start; gap: 8px; }
.check-field input { min-height: 0; margin-top: .42em; }

.primary-actions, .button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.primary-actions { margin-top: 20px; }
button { padding: 8px 16px; border: 1px solid var(--green); border-radius: 6px; background: #fff; color: var(--green-dark); cursor: pointer; font-weight: 650; }
button:hover { background: var(--green-soft); }
button:disabled { cursor: wait; opacity: .55; }
.primary-button { background: var(--green); color: #fff; }
.primary-button:hover { background: var(--green-dark); }
.secondary-button { border-color: #aebbb6; color: var(--ink); }
.text-button { border-color: transparent; }
.progress-wrap { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.progress-wrap progress { flex: 1; height: 11px; accent-color: var(--green); }
.progress-wrap span { min-width: 145px; color: var(--muted); font-size: .85rem; text-align: right; }
.status { margin-top: 15px; padding: 10px 12px; border-radius: 6px; font-size: .92rem; }
.status--info { background: var(--blue-soft); color: var(--blue); }
.status--success { background: var(--green-soft); color: var(--green-dark); }
.status--error { background: var(--red-soft); color: var(--red); }

.results { scroll-margin-top: 15px; margin-top: 35px; }
.summary-grid { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.summary-grid > div { padding: 15px; border-right: 1px solid var(--line); background: var(--soft); }
.summary-grid > div:last-child { border-right: 0; }
.summary-grid strong { display: block; font-size: 1.55rem; line-height: 1.25; }
.summary-grid span { color: var(--muted); font-size: .82rem; }
.summary-grid .summary-ok { background: var(--green-soft); }
.summary-grid .summary-error { background: var(--red-soft); }
.summary-grid .summary-warning { background: var(--orange-soft); }
.summary-grid .summary-info { background: var(--blue-soft); }
.summary-caption, .visible-count { color: var(--muted); font-size: .88rem; }

.result-tools { display: grid; grid-template-columns: 180px minmax(240px, 1fr) 180px; gap: 12px; align-items: end; margin: 22px 0 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: .87rem; }
th, td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #f1f4f3; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.cell-number { text-align: right; white-space: nowrap; }
.path-cell { min-width: 210px; max-width: 340px; overflow-wrap: anywhere; font-family: Consolas, "SFMono-Regular", monospace; font-size: .82rem; }
.suggestion-cell { color: var(--green-dark); }
.issue-cell { min-width: 190px; }
.status-label { white-space: nowrap; font-weight: 750; }
.status-label--error { color: var(--red); }
.status-label--warning { color: var(--orange); }
.status-label--info { color: var(--blue); }
.status-label--ok { color: var(--green); }
.details-cell { width: 78px; white-space: nowrap; }
.details-toggle { padding: 2px 0; border: 0; background: transparent; color: var(--green-dark); font: inherit; font-weight: 650; cursor: pointer; }
.details-toggle:hover { text-decoration: underline; }
.details-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }
.has-open-details td { border-bottom-color: transparent; }
.detail-row > td { padding: 0 11px 14px; background: #f7faf8; overflow-wrap: anywhere; }
.result-detail-panel { padding: 14px 16px; border-left: 3px solid var(--green); background: #fff; }
.detail-meta { margin: 0 0 12px; color: var(--muted); font-size: .82rem; }
.detail-issue-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.detail-issue { padding: 11px 13px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 5px; background: #fff; }
.detail-issue--error { border-left-color: var(--red); }
.detail-issue--warning { border-left-color: var(--orange); }
.detail-issue--info { border-left-color: var(--blue); }
.detail-issue-heading { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.detail-issue-heading code { padding: 2px 5px; border-radius: 3px; background: #eef2f0; color: var(--muted); font-size: .75rem; }
.detail-issue > p { margin: 7px 0 0; font-size: .84rem; }
.detail-issue dl { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 4px 10px; margin: 9px 0 0; font-size: .8rem; }
.detail-issue dt { color: var(--muted); font-weight: 650; }
.detail-issue dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.load-more { display: block; margin: 15px auto 0; }
.result-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 25px; }
.result-action-grid section { padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--soft); }
.result-action-grid p { margin: 0 0 13px; color: var(--muted); font-size: .88rem; }
.button-row button { background: #fff; }

.guide { padding: 60px 0 65px; }
.guide h2 { margin-top: 2.3em; padding: 8px 12px; border-left: 4px solid var(--green); background: var(--soft); }
.guide h2:first-child { margin-top: 0; }
.guide p, .guide li { color: #45534f; }
.guide code { padding: .1em .34em; border-radius: 4px; background: #f0f3f2; font-family: Consolas, monospace; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { padding: 13px 3px; cursor: pointer; font-weight: 650; }
.faq p { margin: 0; padding: 0 3px 14px; }
.source-list { padding-left: 22px; }

.site-footer { border-top: 1px solid var(--line); background: var(--soft); }
.footer-inner { width: min(760px, calc(100% - 32px)); margin-inline: auto; padding: 27px 0; color: var(--muted); font-size: .84rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 15px; }
.noscript { margin: 0; padding: 10px; background: var(--red-soft); color: var(--red); text-align: center; }

@media (max-width: 820px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-grid > div { border-bottom: 1px solid var(--line); }
  .summary-grid > div:nth-child(3n) { border-right: 0; }
  .result-tools { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; grid-row: 1; }
  .result-action-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .header-inner { align-items: flex-start; flex-direction: column; gap: 0; padding: 9px 0; }
  .intro { padding-top: 21px; }
  .checker { width: calc(100% - 20px); padding: 16px 13px; }
  .input-tab { padding: 8px 11px; font-size: .87rem; }
  .settings-grid, .result-tools { grid-template-columns: 1fr; }
  .field-wide, .search-field { grid-column: auto; grid-row: auto; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid > div, .summary-grid > div:nth-child(3n) { border-right: 1px solid var(--line); }
  .summary-grid > div:nth-child(2n) { border-right: 0; }
  .primary-actions > *, .button-row > * { width: 100%; }
  .progress-wrap { align-items: stretch; flex-direction: column; }
  .progress-wrap span { text-align: left; }
  .table-wrap { border: 0; overflow: visible; }
  table, thead, tbody, tr, th, td { display: block; min-width: 0; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tbody { display: grid; gap: 12px; }
  tbody tr { padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
  tbody td { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 9px; padding: 6px 0; border: 0; text-align: left; }
  tbody td::before { color: var(--muted); font-size: .78rem; font-weight: 650; }
  tbody td:nth-child(1)::before { content: "行"; }
  tbody td:nth-child(2)::before { content: "判定"; }
  tbody td:nth-child(3)::before { content: "元のパス"; }
  tbody td:nth-child(4)::before { content: "問題数"; }
  tbody td:nth-child(5)::before { content: "主な問題"; }
  tbody td:nth-child(6)::before { content: "修正候補"; }
  tbody td:nth-child(7)::before { content: "詳細"; }
  .path-cell, .issue-cell { min-width: 0; max-width: none; }
  tbody tr.has-open-details { border-radius: 7px 7px 0 0; }
  tbody tr.detail-row { margin-top: -13px; padding: 0; border-top: 0; border-radius: 0 0 7px 7px; }
  tbody tr.detail-row td { display: block; padding: 0 12px 12px; }
  tbody tr.detail-row td::before { content: none; }
  .result-detail-panel { padding: 12px; }
  .detail-issue dl { grid-template-columns: 76px minmax(0, 1fr); }
}

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