:root {
  --bg: #faf6ee;
  --bg-alt: #f0e6d2;
  --ink: #3a2f22;
  --ink-light: #6b5d4a;
  --accent: #b5651d;
  --accent-dark: #8a4e17;
  --border: #d9cdb4;
  --white: #ffffff;
  --focus-ring: #2a5ea8;
  /* 区分バッジ色。白文字とのコントラスト比4.5:1以上を確保した濃色 */
  --badge-1: #a35a1e;
  --badge-2: #5f7a3a;
  --badge-3: #45608c;
  --badge-none: #616161;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.8;
  overflow-x: hidden;
}

a {
  color: var(--accent-dark);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--white);
  color: var(--ink);
  padding: 10px 16px;
  z-index: 100;
  border: 2px solid var(--accent);
  border-radius: 0 0 6px 0;
}

.skip-link:focus {
  left: 0;
}

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

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

header.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

header.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
}

header.site-header .logo {
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: 8px;
}

header.site-header a {
  color: var(--ink-light);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

header.site-header a:hover { color: var(--accent); }

header.site-header a[aria-current="page"] {
  color: var(--accent-dark);
  font-weight: bold;
  border-bottom-color: var(--accent-dark);
}

.breadcrumb {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 10px 0;
  color: var(--ink-light);
}

.breadcrumb li::after {
  content: "›";
  margin-left: 6px;
  color: var(--ink-light);
}

.breadcrumb li:last-child::after {
  content: "";
}

.breadcrumb a {
  color: var(--ink-light);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb [aria-current="page"] {
  color: var(--ink);
  font-weight: bold;
}

.hero {
  padding: 32px 16px;
  text-align: center;
  background: var(--bg-alt);
}

.hero h1 {
  font-size: 1.6rem;
  margin: 0 0 8px;
}

.hero p {
  font-size: 0.95rem;
  color: var(--ink-light);
  max-width: 640px;
  margin: 0 auto;
}

main {
  padding: 32px 0 64px;
}

section { margin-bottom: 40px; }

h2 {
  font-size: 1.25rem;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  margin-bottom: 16px;
}

h3 { font-size: 1.05rem; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.table-wrap table {
  border: none;
  min-width: 480px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.9rem;
}

th, td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--bg-alt);
}

th[scope="row"] {
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  /* 常に白文字固定。区分バッジ色はテーマに関わらず白文字とのコントラスト比4.5:1以上を確保した濃色を使う */
  color: #ffffff;
}

.badge-1 { background: var(--badge-1); }
.badge-2 { background: var(--badge-2); }
.badge-3 { background: var(--badge-3); }

/* 区分バッジのビジュアル識別性を補うアイコン（装飾のみ。CSS生成コンテンツのためスクリーンリーダーの読み上げ対象になりにくく、badge本体のテキストが引き続き正式なラベルとなる） */
.badge-1::before { content: "🍪"; margin-right: 4px; }
.badge-2::before { content: "🍞"; margin-right: 4px; }
.badge-3::before { content: "🍜"; margin-right: 4px; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.filter-field label { font-weight: bold; }

.filter-field select {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9rem;
}

.filter-reset {
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: transparent;
  color: var(--accent-dark);
  font-size: 0.85rem;
  cursor: pointer;
}

.filter-reset:hover { background: var(--bg-alt); }

.filter-count {
  font-size: 0.85rem;
  color: var(--ink-light);
  margin: 0 0 8px;
}

tr[hidden] { display: none; }

.glossary-list dt {
  font-weight: bold;
  color: var(--accent-dark);
  margin-top: 20px;
}

.glossary-list dt:first-of-type { margin-top: 0; }

.glossary-list dd {
  margin: 6px 0 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.card h3 { margin-top: 0; }

.source-note {
  font-size: 0.82rem;
  color: var(--ink-light);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 12px;
}

footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-size: 0.85rem;
  color: var(--ink-light);
}

footer a { color: var(--ink-light); }

footer .footer-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 12px;
  padding: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

footer .footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.footer-updated {
  font-size: 0.78rem;
  margin-top: 4px;
}

.faq-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 16px;
  margin-bottom: 12px;
}

.faq-item summary {
  font-weight: bold;
  padding: 12px 0;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.faq-item p { margin-top: 0; }

.notice {
  background: #fff8e6;
  border: 1px solid #e6d28a;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  header.site-header nav {
    gap: 2px 12px;
  }

  header.site-header .logo {
    width: 100%;
    margin-bottom: 4px;
  }

  .hero {
    padding: 24px 16px;
  }

  .hero h1 {
    font-size: 1.35rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  main {
    padding: 24px 0 48px;
  }

  section {
    margin-bottom: 28px;
  }

  h2 {
    font-size: 1.1rem;
  }

  table {
    font-size: 0.82rem;
  }

  th, td {
    padding: 6px 8px;
  }

  footer .footer-nav {
    gap: 4px 12px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1712;
    --bg-alt: #26201a;
    --ink: #f2ece0;
    --ink-light: #c9bda6;
    --accent: #e2924c;
    --accent-dark: #f2a75c;
    --border: #4a3f30;
    --white: #241d16;
    --focus-ring: #7ab0ff;
    /* 区分バッジ色はテーマ共通（.badgeの白文字と4.5:1以上を確保済みのため変更しない） */
  }

  .notice {
    background: #3a2c13;
    border-color: #6b5320;
    color: var(--ink);
  }

  .skip-link {
    background: var(--white);
    color: var(--ink);
    border-color: var(--accent);
  }
}
