:root {
  --bg: #ffffff;
  --text: #1b1f24;
  --muted: #666;
  --border: #e5e7eb;
  --accent: #0ea5e9; /* 水色系 */
  --accent-strong: #0284c7;
  --warning-bg: #fff7ed;
  --warning-border: #fbbf24;
  --success-bg: #ecfdf5;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Noto Sans JP",
    sans-serif;
  line-height: 1.6;
}
.container {
  max-width: 1300px;
  margin-inline: auto;
  padding: 1rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
}
a:hover {
  color: var(--accent-strong);
}
a[aria-disabled="true"] {
  color: var(--muted);
  pointer-events: none;
  text-decoration: line-through;
}
.site-header {
  border-bottom: 1px solid var(--border);
  padding-block: 1rem;
}
.site-title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
}
.site-subtitle {
  margin: 0.25rem 0 0.5rem;
  color: var(--muted);
}
.note {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: 0.5rem;
}
.site-nav .btn {
  display: inline-block;
  margin-top: 0.5rem;
}

.btn {
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-strong);
  color: #fff;
}

.accordion {
  border: 2px solid var(--border);
  border-radius: 6px;
  background: #f3f6fa;
  margin: 1rem 0;
  overflow: hidden;
}
.accordion[open] .accordion-summary {
  border-bottom: 1px solid var(--border);
}
.accordion-summary {
  cursor: pointer;
  padding: 1rem;
  list-style: none;
  position: relative;
  font-weight: 600;
}
.accordion-summary::-webkit-details-marker {
  display: none;
}
.accordion-summary::after {
  content: "＋";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--muted);
}
.accordion[open] .accordion-summary::after {
  content: "－";
}
.accordion-panel {
  padding: 1rem;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 80%;
}
.table caption {
  text-align: left;
  padding: 0.75rem;
  font-weight: 600;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0.5rem;
  text-align: left;
}
.table tbody td,
.table tbody th {
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  padding: 0.55rem 0.5rem;
}
.table tbody tr:nth-child(even) {
  background: #fbfdff;
}
.table tbody tr:hover {
  background: #f1fafe;
}

.koma {
  white-space: nowrap;
}
.period {
  white-space: nowrap;
}
.links .due {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 0.25rem;
  padding: 0.05rem 0.35rem;
  margin-left: 0.3rem;
  font-size: 0.85em;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.8em;
  line-height: 1;
  border: 1px solid var(--border);
}
.badge.live {
  background: #e0f2fe;
  color: #075985;
  border-color: #76cfff;
}
.badge.ondemand {
  background: #ffedf7;
  color: #f85159;
  border-color: #ff6a7d;
}

.callout {
  border-left: 4px solid var(--border);
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  border-radius: 0.25rem;
  background: #f8fafc;
}
.callout.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.updated {
  color: var(--muted);
  font-weight: 400;
  margin-left: 0.75rem;
  font-size: 0.9em;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1rem 0;
  color: var(--muted);
  text-align: center;
}

/* フォーカス可視化 */
:focus-visible {
  outline: 3px solid #94a3b8;
  outline-offset: 2px;
  border-radius: 0.25rem;
}
/* 既存提案CSSに追加・一部上書き */

.table-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0.75rem;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 0.5rem 0.5rem 0 0;
  background: #f8fafc;
}
.section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.section-title .divider {
  margin: 0 0.35rem;
  color: var(--muted);
}
.syllabus-link {
  font-weight: 600;
}
.syllabus-link[aria-disabled="true"] {
  color: var(--muted);
  text-decoration: line-through;
}

.table-updated {
  margin: 0 0 0 auto;
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  font-size: 0.9em;
}
.table-wrap {
  border: 1px solid var(--border);
  border-top: none; /* ヘッダ帯と一体化 */
  border-radius: 0 0 0.5rem 0.5rem; /* 角丸つなぎ */
  overflow-x: auto; /* ← 収まらない分は横スクロール */
}

/* 参考：既存の .table thead th 固定等はそのまま活かす */

/* 押せる（青いボタン） */
.links .btn-link {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  background: #0ea5e9;
  color: #fff;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}
.links .btn-link:hover {
  background: #0284c7;
}

/* 押せない（グレー） */
.links .btn-disabled {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  background: #e5e7eb;
  color: #6b7280;
  border: 1px solid #d1d5db;
  border-radius: 0.35rem;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.35rem;
  cursor: default;
}

/* 列幅を固定して、同一の colgroup に従わせる */
.table-schedule {
  table-layout: fixed; /* col の width を優先 */
  border-collapse: separate;
  border-spacing: 0;
  min-width: 820px; /* 必要に応じて調整（横スクロール閾値） */
}

/* 長文対策：セル内で折返し */
.table-schedule th,
.table-schedule td {
  padding: 0.55rem 0.75rem; /* 右側は0.75rem以上あると読みやすい */
  vertical-align: top;
  overflow-wrap: anywhere; /* 長い単語/URL対策 */
  word-break: break-word; /* or overflow-wrap: anywhere; */
}

/* ヘッダ固定を使っている場合はそのまま維持 */
.table-schedule thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

/* 以前の .period{white-space:nowrap} を上書きする */
.table-schedule .period {
  white-space: normal; /* 改行を許可 */
  overflow-wrap: anywhere; /* どこでも折返し可（強め） */
  word-break: break-word; /* 単語途中でも折返し */
  line-break: strict; /* 日本語向けの改行ルール */
}

.webclass-link {
  font-weight: 600;
}

.news-section {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background-color: #fafafa;
}

.news-section h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.news-section ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.news-section li {
  font-size: 0.95rem;
  margin-bottom: 6px;
}
