body {
  background: #ffffff;
  color: #222222;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  line-height: 1.7;
  font-size: 17px;
}

h1 {
  font-size: 2rem;
  margin-bottom: 6px;
  color: #111111;
}

p.lead {
  color: #555555;
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 1.05rem;
}

section {
  margin-bottom: 20px;
  padding-top: 14px;
  border-top: 1px solid #e0e0e0;
}

section h2 {
  font-size: 1.35rem;
  color: #111111;
  margin-bottom: 4px;
}

section p.desc {
  font-size: 0.92rem;
  color: #666666;
  margin-top: 0;
  margin-bottom: 12px;
}

ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

li {
  padding: 5px 0;
  font-size: 1rem;
}

a {
  color: #0050c8;
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: underline;
}

.pending {
  color: #777777;
  font-weight: normal;
}

.pending::after {
  content: "（準備中）";
  font-size: 0.85em;
  margin-left: 4px;
}

/* ===== search.html ===== */
.tag-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tag-btn {
  padding: 6px 14px;
  border: 1px solid #888;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

.tag-btn.active {
  background: #333;
  color: #fff;
  border-color: #333;
}

.result-count {
  font-size: 0.9rem;
  color: #555;
  margin: 8px 0;
}

.result-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.result-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
}

.result-card h3 {
  margin: 0 0 8px;
}

.result-card .badge {
  display: inline-block;
  background: #eee;
  color: #333;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.result-card .desc {
  font-size: 0.9rem;
  color: #444;
}

.result-card .tags {
  font-size: 0.8rem;
  color: #777;
}

/* ===== torque.html ===== */
.responsive-image {
  max-width: 100%;
  height: auto;
}

.break-word {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.torque-page mjx-container[display="true"] {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ===== shared design tokens (visible foundation) ===== */
:root {
  --color-bg: #ffffff;
  --color-text: #222222;
  --color-heading: #111111;
  --color-muted: #666666;
  --color-border: #e0e0e0;
  --color-accent: #0050c8;
  --color-note-bg: #f7f7f7;
  --page-max-width: 960px;
  --radius: 8px;
}

/* ===== breadcrumb / back link (site-wide) ===== */
.breadcrumb {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 0 0 16px;
}

.breadcrumb a {
  color: var(--color-accent);
}

a.back {
  display: inline-block;
  margin-top: 24px;
  font-weight: 600;
}

/* ===== site header / nav (home-page, category-page) ===== */
.home-page .site-desc,
.category-page .page-lead {
  color: var(--color-muted);
  font-size: 1.05rem;
  margin: 0 0 16px;
}

.home-page .site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 4px 0 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.home-page .site-nav a {
  font-size: 0.95rem;
}

/* ===== category cards (home-page, category-page) ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 8px 0 32px;
}

.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--color-heading);
}

.card .card-desc {
  font-size: 0.92rem;
  color: var(--color-muted);
  margin: 0 0 10px;
}

.card .card-items {
  font-size: 0.85rem;
  color: #555555;
  margin: 0 0 12px;
  flex-grow: 1;
}

.card .card-link {
  font-weight: 600;
  font-size: 0.95rem;
}

.card.card-pending {
  background: #fafafa;
}

.card .card-status {
  display: inline-block;
  font-size: 0.72rem;
  background: #eeeeee;
  color: #555555;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-weight: normal;
}

/* ===== category page building blocks ===== */
.item-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.item-list li {
  border-top: 1px solid var(--color-border);
  padding: 12px 0;
}

.item-list li:first-child {
  border-top: none;
}

.item-list .item-name {
  font-weight: 600;
  color: var(--color-heading);
  margin-right: 6px;
}

.item-list .item-desc {
  font-size: 0.95rem;
  color: #444444;
}

.note-box {
  background: var(--color-note-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.92rem;
  color: #555555;
  margin: 0 0 24px;
}

/* ===== calculation UI (torque.html) ===== */
.calc-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0 24px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 4px;
}

.field input {
  width: 100%;
  max-width: 240px;
  padding: 8px 10px;
  font-size: 1rem;
  border: 1px solid #aaaaaa;
  border-radius: 4px;
  box-sizing: border-box;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--color-accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn:hover {
  background: #003d99;
}

.result-box {
  background: var(--color-note-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 12px 0 20px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-heading);
  min-height: 1.4em;
}

details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin: 12px 0;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-accent);
}

/* ===== updates.html ===== */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 24px;
}

table.updates-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: 0.9rem;
}

table.updates-table th,
table.updates-table td {
  border: 1px solid var(--color-border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

table.updates-table th {
  background: var(--color-note-bg);
  color: var(--color-heading);
  white-space: nowrap;
}

/* ===== section-properties.html ===== */
.section-diagram {
  display: flex;
  justify-content: center;
  margin: 4px 0 16px;
}

.section-diagram svg {
  max-width: 100%;
  height: auto;
}

/* ===== mobile (all pages) ===== */
@media (max-width: 480px) {
  body {
    padding: 16px 16px 40px;
    font-size: 16px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .field input {
    max-width: 100%;
  }
}
