:root {
  --bg: #f3f5f8; --card: #fff; --ink: #1d2733; --ink2: #4b5866; --muted: #7a8794; --line: #dfe4ea;
  --navy: #1f3b5a; --navy2: #2b5480; --accent: #0f7b6c; --accent-bg: #e5f4f1;
  --red: #c0392b; --red-bg: #fdecea; --amber: #b7791f; --amber-bg: #fff6e0;
  --blue-bg: #e8f0fb; --green-bg: #e9f6ec; --violet-bg: #f0ecfb;
  /* dataviz palette */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --st-good: #0ca30c; --st-warn: #fab219; --st-serious: #ec835a; --st-critical: #d03b3b;
  --r: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Yu Gothic UI","Yu Gothic","Hiragino Sans","Noto Sans JP","Meiryo",sans-serif; font-size: 14px; line-height: 1.65; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.top { background: var(--navy); color: #fff; }
.top-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.logo { width: 40px; height: 40px; border-radius: 9px; background: rgba(255,255,255,.12); display: grid; place-items: center; flex: none; }
.ttl { font-weight: 700; font-size: 17px; letter-spacing: .02em; }
.sub { font-size: 12px; opacity: .8; }
.demo-badge { background: #f5c451; color: #3a2a00; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.intro { margin: 18px 0 14px; color: var(--ink2); }
.intro p { margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 16px; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card-h h2 { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.muted { color: var(--muted); font-size: 12px; font-weight: normal; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.lead { color: var(--ink2); margin: 0 0 10px; font-size: 13px; }

/* ステップ・タブ */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 18px 0 14px; }
.step { display: flex; align-items: center; gap: 8px; justify-content: center; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 10px; font: inherit; font-weight: 700; font-size: 13px; color: var(--ink2); cursor: pointer; position: relative; text-align: center; }
.step .num { background: #b8c3cf; }
.step.on { border-color: var(--navy); color: var(--navy); box-shadow: 0 2px 0 var(--navy); }
.step.on .num { background: var(--navy); }
.step em { font-style: normal; background: var(--red); color: #fff; font-size: 11px; padding: 0 7px; border-radius: 99px; }
.step em:empty { display: none; }
.panel { display: none; }
.panel.on { display: block; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 26px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 13px; font-weight: 600; margin-left: 2px; }
.kpi.ng .v { color: var(--red); } .kpi.ok .v { color: var(--accent); }

/* 表 */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.tbl th { background: #eef2f6; color: var(--ink2); font-weight: 700; text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 9px; border-bottom: 1px solid #edf0f3; vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .c { text-align: center; }
.tbl .nw { white-space: nowrap; }
.tbl td.msg { min-width: 220px; font-size: 12px; color: var(--ink2); }

.chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.chip.ok { background: var(--accent-bg); color: var(--accent); }
.chip.ng { background: var(--red-bg); color: var(--red); }
.chip.warn { background: var(--amber-bg); color: var(--amber); }
.chip.info { background: var(--blue-bg); color: var(--navy2); }
.chip.kaigo { background: var(--blue-bg); color: #1a5fb4; }
.chip.iryo { background: #fdeee6; color: #b4480f; }
.chip.off { background: #eef0f2; color: var(--muted); }

/* 週間工程表グリッド */
.sched-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 10px; font-size: 12px; color: var(--ink2); align-items: center; }
.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.08); }
.lg i.ok { background: #fff; } .lg i.chg { background: var(--amber-bg); border-color: #e4c781; }
.lg i.dup { background: var(--red-bg); border-color: #e9a79e; } .lg i.lack { background: #fff4d6; border-color: #e4c781; }
.sched { border-collapse: collapse; width: 100%; font-size: 12px; }
.sched th, .sched td { border: 1px solid var(--line); padding: 5px 7px; text-align: center; vertical-align: top; }
.sched thead th { background: #eef2f6; color: var(--ink2); white-space: nowrap; }
.sched th.user { text-align: left; min-width: 150px; position: sticky; left: 0; background: #eef2f6; z-index: 2; }
.sched td.user { text-align: left; background: #f8fafb; position: sticky; left: 0; z-index: 1; font-weight: 600; }
.sched td.user small { display: block; font-weight: normal; color: var(--muted); font-size: 11px; }
.sched td .v { display: block; line-height: 1.35; }
.sched td .v b { font-weight: 700; } .sched td .v span { color: var(--ink2); font-size: 11px; }
.sched td.chg { background: var(--amber-bg); } .sched td.dup { background: var(--red-bg); }
.sched tr.lack td.user { box-shadow: inset 4px 0 0 var(--st-warn); }
.flag { display: inline-block; font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 4px; margin-top: 2px; }
.flag.chg { background: var(--amber); color: #fff; } .flag.dup { background: var(--red); color: #fff; }

/* グラフ */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-box { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.chart-box h3 { margin: 0 0 2px; font-size: 14px; }
.chart-box .cap { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.cv { position: relative; height: 230px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--ink2); }
.legend-row .k { display: inline-flex; align-items: center; gap: 6px; }
.legend-row .k i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* 設定 */
.set-note { background: var(--accent-bg); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 0 0 12px; }
.howto { background: #fff; border: 1px dashed #b9c6d3; border-radius: var(--r); padding: 14px 18px; margin-bottom: 16px; }
.howto h3 { margin: 0 0 6px; font-size: 14px; }
.howto ol, .howto ul { margin: 0; padding-left: 20px; color: var(--ink2); font-size: 13px; }
.howto li { margin: 3px 0; }
.prod { margin: 10px 0 0; background: var(--accent-bg); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.sec-note { background: #f8fafb; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; font-size: 12.5px; color: var(--ink2); margin-top: 4px; }
.sec-note b { color: var(--ink); }

.foot { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 0 30px; }
.foot p { margin: 2px 0; }

@media (max-width: 920px) {
  .chart-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .sub { display: none; }
  .ttl { font-size: 15px; }
  .steps { grid-template-columns: 1fr; }
  .step { justify-content: flex-start; }
  .card { padding: 14px; }
}
