:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --paper: #ffffff;
  --ink: #1f2a37;
  --muted: #64748b;
  --line: #d9e2ec;
  --soft: #edf7f4;
  --soft-2: #f2f5f8;
  --primary: #147d8f;
  --primary-dark: #0f5f6c;
  --warn-bg: #fff4d8;
  --warn-text: #684600;
  --radius: 10px;
  --maxw: 960px;
  --wide: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui,
    sans-serif;
  line-height: 1.85;
}

a {
  color: var(--primary);
}

code {
  border-radius: 4px;
  background: var(--soft-2);
  padding: 0.1em 0.35em;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.92em;
}

.mono {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.9em;
}

/* skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  background: var(--paper);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.checker-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.checker-share-note {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 249, 251, 0.94);
  backdrop-filter: blur(10px);
}
.nav {
  display: flex;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 12px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  font-size: 17px;
}
.nav-links {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--ink);
}
.nav-toggle {
  display: none;
}

.hero,
section,
footer {
  padding: 64px 20px;
}
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
}
.wide {
  max-width: var(--wide);
}

.eyebrow {
margin: 0 0 12px;
color: var(--primary-dark);
font-size: 12px;
font-weight: 700;
letter-spacing: 0.16em;
text-transform: uppercase;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.32;
}
h1 {
  font-size: clamp(32px, 4vw, 50px);
}
h2 {
  font-size: clamp(25px, 3vw, 34px);
  margin-bottom: 16px;
}
h3 {
  font-size: clamp(18px, 2vw, 22px);
}
section p {
  margin: 0 0 16px;
}

.hero-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  align-items: start;
}
.lead {
  font-size: 17px;
  color: #33414f;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
}
.btn-ghost {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--soft-2);
}
.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--paper);
}
.quick {
  background: var(--soft);
}
.quick-grid {
  display: grid;
  gap: 10px;
}
.quick-item {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  padding: 10px 12px;
}
.quick-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.quick-value {
  font-weight: 700;
}

.callout {
  border: 1px solid var(--line);
  background: var(--soft-2);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 16px 0;
}
.callout-tip {
  border-color: rgba(20, 125, 143, 0.3);
  background: var(--soft);
  font-weight: 600;
}
.callout a,
.callout-tip a {
  color: var(--primary-dark);
}
.note {
  border-left: 4px solid var(--primary);
  padding-left: 14px;
  color: #33414f;
}

.grid-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}
.tip {
  display: flex;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  align-items: flex-start;
}
.warn {
  color: var(--warn-text);
  font-weight: 800;
}

ol.steps {
  margin: 16px 0;
  padding-left: 22px;
}
ol.steps li {
  margin-bottom: 10px;
}

/* table */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 20px 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}
thead {
  background: var(--soft-2);
}
th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tbody tr:last-child td {
  border-bottom: none;
}

/* breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  padding: 14px 20px 0;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--ink);
}

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 20px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}

/* checker */
.checker {
  margin: 24px 0;
}
.checker-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}
.field {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.field legend {
  font-weight: 700;
  font-size: 14px;
  padding: 0 6px;
}
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.pill {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.pill[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.result-panel {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 18px;
}
.result-conclusion {
  border: 1px solid rgba(20, 125, 143, 0.25);
  background: var(--soft);
  border-radius: 8px;
  padding: 14px 16px;
}
.result-def {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.result-def > div {
  border: 1px solid var(--line);
  background: var(--soft-2);
  border-radius: 8px;
  padding: 12px;
}
.result-def dt {
  font-weight: 700;
  font-size: 13px;
}
.warn-box {
  border: 1px solid #f0d79a;
  background: var(--warn-bg);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 16px;
}
.warn-box h3,
.notes h3,
.next h3 {
  font-size: 14px;
  margin-bottom: 6px;
}
.notes {
  margin-top: 16px;
}
.next {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.next .link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--primary);
}
.chip:hover {
  background: var(--soft-2);
}
.checker-disclaimer {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

/* FAQ */
.faq {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 16px;
}
.faq-item + .faq-item {
  border-top: 1px solid var(--line);
}
.faq-q {
  width: 100%;
  text-align: left;
  background: var(--paper);
  border: none;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.faq-q:hover {
  background: var(--soft-2);
}
.faq-a {
  padding: 0 20px 18px;
  font-size: 14px;
}

/* decoder */
.decoder-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 15px;
  font-family: Consolas, "Cascadia Mono", monospace;
}
.decoder-out {
  margin-top: 16px;
}

/* JSON-LD pre / prose */
.prose p {
  margin: 0 0 16px;
}

/* responsive */
@media (max-width: 860px) {
  .hero-grid,
  .checker-grid,
  .result-def {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .hero,
  section,
  footer {
    padding: 44px 18px;
  }
}

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

/* print */
@media print {
  .site-header,
  .nav,
  .cta-row,
  .checker-disclaimer {
    display: none;
  }
  body {
    background: #fff;
  }
  a {
    color: #000;
    text-decoration: underline;
  }
}

/* focus visibility */
a:focus-visible,
button:focus-visible,
.pill:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(20, 125, 143, 0.5);
  outline-offset: 2px;
}

/* FAQ リスト */
.faq-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}
.faq-list dt {
  font-weight: 700;
  color: var(--ink);
  margin-top: 0.5rem;
}
.faq-list dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

/* 警告カード */
.callout-warn {
  border-left-color: #b45309;
  background: #fffbeb;
}
.callout-warn strong {
  color: #92400e;
}

/* 目次 (TOC) */
.toc {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0;
  background: var(--surface);
}
.toc strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}
.toc ul {
  margin: 0;
  padding-left: 20px;
}
.toc a {
  color: var(--primary-dark);
}

/* 図解・数式 */
.figure {
  margin: 20px 0;
}
.figure-body {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface);
}
.diagram {
  white-space: pre;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.figure-cap {
  margin: 0 0 8px;
  font-weight: 600;
}
.figure-note {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 16px 0;
  overflow-x: auto;
  font-size: 0.95rem;
}

/* ツール: フォーム・タブ・コード */
.field {
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.field label {
  font-weight: 600;
}
.field input[type="text"],
.field input[type="number"],
.field select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  max-width: 420px;
}
.field-help,
.field-error {
  font-size: 0.82rem;
  color: #475569;
}
.field-help code {
  color: #334155;
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 4px;
}
.field-error {
  color: #b91c1c;
}
}
.tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0 6px;
}
.tab {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px 8px 0 0;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.9rem;
}
.tab[aria-selected="true"] {
  background: var(--primary-dark);
  color: #fff;
  border-color: var(--primary-dark);
}
.code-block {
  border: 1px solid var(--line);
  border-radius: 0 8px 8px 8px;
  background: #f8fafc;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  margin: 0 0 10px;
}

/* チェックリスト */
.check-list {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0;
}
.check-list li {
  position: relative;
  padding-left: 1.6em;
  margin: 0.4rem 0;
}
.check-list li::before {
  content: "☑";
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* GGUF Metadata Inspector (V6) */
.inspector-drop {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.inspector-drop:hover,
.inspector-drop:focus-visible,
.inspector-drop.dragover {
  border-color: var(--primary);
  background: #f0fbfd;
  outline: none;
}
.inspector-controls {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.inspector-controls > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.inspector-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.inspector-result table caption {
  caption-side: top;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.inspector-result h3 {
  margin-top: 1.5rem;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.btn-link {
  display: inline;
  color: var(--primary-dark);
  text-decoration: underline;
  cursor: pointer;
  border: 0;
  background: none;
  font: inherit;
  padding: 0;
}
.btn-link:focus-visible {
  outline: 3px solid rgba(20, 125, 143, 0.5);
  outline-offset: 2px;
}
