/* kizashi 共通スタイル
   8の倍数ルール：余白 8/16/24/32、行の高さ 16/24/32/40/48、角丸 8。1画面（1280×800）に収める */
:root {
  --bg: #F5F6F8; --card: #FFFFFF; --line: #E3E6EB;
  --text: #1F2329; --sub: #626B78;
  --high: #C8322B; --high-bg: #FCECEB;
  --mid: #B26A00;  --mid-bg: #FFF4E0;
  --low: #4D5866;  --low-bg: #EEF0F3;
  --ok: #2E7D4F;
  --accent: #2457C5; --accent-bg: #E8EFFC;
  --side: #1F2329;
  --h0: #F5F6F8; --h1: #E3ECFB; --h2: #B9CFF5; --h3: #7FA6EC; --h4: #2F64D0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  display: flex; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font-family: "Yu Gothic UI", "Yu Gothic", "Hiragino Sans", "Meiryo", sans-serif;
  font-size: 14px; line-height: 24px;
}
a { color: var(--accent); }

/* 左メニュー */
nav.side { width: 240px; flex: none; background: var(--side); color: #C9CED6; display: flex; flex-direction: column; padding: 16px; position: sticky; top: 0; height: 100vh; }
nav.side .app { display: block; height: 48px; line-height: 48px; padding: 0 8px; color: #fff; font-size: 16px; font-weight: 700; margin-bottom: 16px; text-decoration: none; }
nav.side .grp { font-size: 12px; line-height: 16px; color: #8A929E; padding: 0 8px; margin: 16px 0 8px; }
nav.side a.m { display: block; height: 40px; line-height: 40px; padding: 0 16px; border-radius: 8px; color: inherit; text-decoration: none; }
nav.side a.m.on { background: #343A42; color: #fff; font-weight: 700; }
nav.side .sub a { display: block; height: 32px; line-height: 32px; padding: 0 16px 0 32px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 13px; }
nav.side .sub a.on { background: var(--accent); color: #fff; font-weight: 700; }
nav.side .foot { margin-top: auto; font-size: 12px; line-height: 16px; color: #8A929E; padding: 0 8px; }

/* 右側 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
header.top { height: 64px; flex: none; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--card); border-bottom: 1px solid var(--line); }
header.top .crumb { color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.top .crumb b { color: var(--text); font-size: 16px; }
.tags { display: flex; gap: 8px; flex: none; }
.content { flex: 1; padding: 24px 32px; }
.lead { font-size: 24px; line-height: 32px; font-weight: 700; margin-bottom: 8px; }
.lead b { color: var(--high); }
.lead-sub { color: var(--sub); margin-bottom: 16px; }
.note { margin-top: 16px; color: var(--sub); font-size: 12px; line-height: 16px; }
.loading { color: var(--sub); }

.badge { display: inline-block; height: 24px; padding: 0 8px; border-radius: 8px; font-size: 12px; line-height: 24px; font-weight: 700; white-space: nowrap; }
.b-high { color: var(--high); background: var(--high-bg); }
.b-mid  { color: var(--mid);  background: var(--mid-bg); }
.b-low  { color: var(--low);  background: var(--low-bg); }
.b-ok   { color: var(--accent); background: var(--accent-bg); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.card .hd { min-height: 56px; padding: 16px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 700; font-size: 16px; }
.card .hd small { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--sub); }
.empty { padding: 24px; color: var(--sub); }

/* 数字カード */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 24px; }
.tile .label { color: var(--sub); font-size: 12px; line-height: 16px; margin-bottom: 8px; }
.tile .num { font-size: 32px; line-height: 40px; font-weight: 700; }
.tile .num span { font-size: 14px; font-weight: 400; color: var(--sub); margin-left: 8px; }
.tile.red .num { color: var(--high); }
.tile .diff { font-size: 12px; line-height: 16px; color: var(--sub); margin-top: 8px; }

.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ヒートマップ */
.heat { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 8px; padding: 0 16px 8px; }
.heat th { font-size: 12px; line-height: 16px; color: var(--sub); font-weight: 400; text-align: center; height: 32px; }
.heat th.row { text-align: left; color: var(--text); font-size: 13px; font-weight: 700; width: 120px; }
.heat td { height: 24px; border-radius: 8px; text-align: center; font-weight: 700; }
.c0 { background: var(--h0); color: #A0A7B2; font-weight: 400 !important; }
.c1 { background: var(--h1); } .c2 { background: var(--h2); }
.c3 { background: var(--h3); color: #fff; } .c4 { background: var(--h4); color: #fff; }

/* リスト */
.sec { padding: 16px 24px; border-bottom: 1px solid var(--line); }
.sec:last-child { border-bottom: none; }
.sec h3 { font-size: 12px; line-height: 16px; color: var(--sub); font-weight: 400; margin-bottom: 8px; }
.item { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; }
.item .t { font-weight: 700; }
.item .n { white-space: nowrap; color: var(--high); font-weight: 700; }
.item .s { font-size: 12px; line-height: 16px; color: var(--sub); }

/* 表 */
table.list { width: 100%; border-collapse: collapse; }
.list th, .list td { padding: 0 16px; text-align: left; border-bottom: 1px solid var(--line); }
.list th:first-child, .list td:first-child { padding-left: 24px; }
.list th { height: 40px; font-size: 12px; line-height: 16px; color: var(--sub); font-weight: 400; white-space: nowrap; }
.list th em { font-style: normal; color: var(--accent); font-weight: 700; margin-right: 8px; }
.list td { height: 48px; }
.list tr:last-child td { border-bottom: none; }
.list tr.click { cursor: pointer; }
.list tr.click:hover td { background: var(--bg); }
.list .org { font-weight: 700; color: var(--accent); }
table.compact { table-layout: fixed; }
.compact td { height: 40px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 詳細 */
.w5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.w { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.w .k { font-size: 12px; line-height: 16px; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.w .v { font-weight: 700; }
.w .s { font-size: 12px; line-height: 16px; color: var(--sub); margin-top: 8px; }
.lesson { background: var(--mid-bg); border-radius: 8px; padding: 16px 24px; }
.lesson p { font-weight: 700; color: var(--mid); margin-bottom: 8px; }
.risk3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.rk { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 24px; }
.rk .l { font-size: 12px; line-height: 16px; color: var(--sub); margin-bottom: 8px; }
.rk .v { font-size: 16px; font-weight: 700; }
.rk .r { font-size: 12px; line-height: 16px; margin-top: 8px; color: var(--sub); }
.check li { margin: 8px 0 8px 24px; }
.tl { padding: 8px 24px; }
.tl .r { display: grid; grid-template-columns: 112px 32px 120px 1fr; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line); }
.tl .r:last-child { border-bottom: none; }
.tl .d { color: var(--sub); }
.tl .m { width: 16px; height: 16px; border-radius: 8px; background: var(--high); }
.tl .r.pub .m { background: var(--accent); }
.tl .nm { font-weight: 700; }
dl.kv { padding: 8px 24px; }
dl.kv .row { display: grid; grid-template-columns: 128px 1fr; min-height: 48px; align-items: center; border-bottom: 1px solid var(--line); }
dl.kv .row:last-child { border-bottom: none; }
dl.kv dt { color: var(--sub); } dl.kv dd { font-weight: 700; }
.mono { font-family: "Consolas", "Cascadia Mono", monospace; font-size: 13px; }
