:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #12263a;
  --muted: #5f6b7a;
  --line: #d8e0ea;
  --brand: #0f766e;
  --accent: #f59e0b;
  --danger: #b91c1c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 0% 0%, #d7eef4 0%, var(--bg) 35%);
}

header {
  padding: 16px 24px;
  background: linear-gradient(120deg, #0f766e, #155e75);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 { margin: 0; font-size: 20px; }
header .right { display: flex; gap: 8px; align-items: center; }

main {
  max-width: 1100px;
  margin: 18px auto;
  padding: 0 14px 30px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(10, 37, 64, 0.06);
}

.grid {
  display: grid;
  gap: 10px;
}

.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

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

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

textarea { min-height: 88px; }

button {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
}

button.secondary { background: #334155; }
button.warn { background: var(--accent); color: #1f2937; }
button.danger { background: var(--danger); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.row { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 12px;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; font-size: 13px; }
th { background: #f8fafc; }

.card-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.card-link {
  display: block;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(135deg, #ffffff, #eff6ff);
}
.card-link strong { display: block; margin-bottom: 4px; }

.code {
  background: #111827;
  color: #d1fae5;
  border-radius: 10px;
  padding: 10px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

/* アコーディオン（折りたたみ） */
.panel.collapsible > h2 {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel.collapsible > h2::after {
  content: '▼';
  font-size: 12px;
  transition: transform 0.2s;
}
.panel.collapsible.collapsed > h2::after {
  transform: rotate(-90deg);
}
.panel.collapsible > .panel-body {
  transition: max-height 0.3s ease, opacity 0.2s ease;
  overflow: hidden;
}
.panel.collapsible.collapsed > .panel-body {
  max-height: 0 !important;
  opacity: 0;
  padding: 0;
}

@media (max-width: 900px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .card-links {
    grid-template-columns: 1fr;
  }
}
