:root {
  --bg: #f6f3ee;
  --bg-2: #fbfaf7;
  --ink: #1c1916;
  --ink-soft: #4a4540;
  --muted: #7a746c;
  --line: #e6e0d6;
  --line-strong: #d5cfc4;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(52, 40, 24, 0.06), 0 1px 2px rgba(52, 40, 24, 0.04);
  --shadow-lg: 0 24px 60px rgba(52, 40, 24, 0.14);
  --ok: #15803d;
  --ok-bg: #ecfdf3;
  --warn: #b45309;
  --warn-bg: #fff7ed;
  --fail: #b91c1c;
  --fail-bg: #fef2f2;
  --skip: #6b7280;
  --skip-bg: #f3f4f6;
  --unknown: #7c6f5e;
  --unknown-bg: #f5f0e8;
  --peach: #fde7d0;
  --radius: 20px;
  --header-h: 72px;
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 500px at 8% -10%, #fde8d6 0%, transparent 55%),
    radial-gradient(900px 480px at 100% 0%, #e7eefc 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-feature-settings: "palt";
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; }

.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

/* Header */
.site-header {
  position: relative;
  z-index: 40;
  background: rgba(246, 243, 238, 0.92);
  border-bottom: 1px solid rgba(214, 207, 196, 0.7);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(145deg, #1c1916, #5b5147);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; letter-spacing: 0.02em; font-size: 13px;
  flex-shrink: 0;
}
.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.stamp {
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,0.8);
}
.stamp b { font-weight: 700; color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 4px rgba(22,163,74,.15); }

/* Hero / KPI */
.hero { padding: 28px 0 8px; }
.kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 8px;
}
.hero h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.lede { margin: 0 0 22px; color: var(--ink-soft); font-size: 15px; max-width: 46em; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .num {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.kpi .sub { font-size: 12px; color: var(--ink-soft); }
.kpi.warn-card { background: linear-gradient(180deg, #fffaf3, #fff); border-color: #f3d2a8; }
.kpi.warn-card a {
  color: inherit;
  text-decoration: none;
  display: block;
}
.kpi.warn-card a:hover .num { color: var(--warn); }
.kpi .num em { font-style: normal; font-size: 0.48em; letter-spacing: 0; font-weight: 700; color: var(--muted); margin-left: 4px; }

/* Sections */
.section { padding: 28px 0 8px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.section-head h3 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* Review cards */
.review-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.review {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.review:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.review .no {
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #fff;
}
.review.r1 { border-top: 3px solid #7c3aed; }
.review.r1 .no { background: #7c3aed; }
.review.r2 { border-top: 3px solid #d97706; }
.review.r2 .no { background: #d97706; }
.review.r3 { border-top: 3px solid #0891b2; }
.review.r3 .no { background: #0891b2; }
.review.r4 { border-top: 3px solid #b45309; }
.review.r4 .no { background: #b45309; }
.review h4 { margin: 0; font-size: 14px; line-height: 1.45; }
.review p { margin: 0; font-size: 12.5px; color: var(--ink-soft); }

/* Timeline */
.tl-mount { min-width: 0; }
.timeline-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tl-hint {
  display: none;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  background: #faf8f4;
  border-bottom: 1px solid var(--line);
}
.tl-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.tl-shell {
  --label: 128px;
  --week: 86px;
  --other: 150px;
  --hours-min: 640px;
  display: grid;
  grid-template-columns: var(--label) minmax(0, 1fr);
  align-items: stretch;
}
.tl-left { background: #fff; z-index: 3; }
.tl-scroll {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.tl-right {
  width: max(100%, calc(var(--hours-min) + var(--week) + var(--other)));
}
.tl-head-lab, .tl-head-right {
  height: 36px;
  background: #fbfaf7;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.tl-head-lab {
  display: flex; align-items: center;
  padding-left: 14px;
}
.tl-head-right, .tl-row-right {
  display: grid;
  grid-template-columns: minmax(var(--hours-min), 1fr) var(--week) var(--other);
  min-width: calc(var(--hours-min) + var(--week) + var(--other));
  align-items: stretch;
}
.tl-row {
  border-top: 1px solid #eee8de;
  height: 58px;
  min-height: 58px;
  box-sizing: border-box;
  overflow: hidden;
}
.tl-left .tl-row:nth-child(odd),
.tl-right > .tl-row:nth-child(odd) { background: #fff; }
.tl-left .tl-row:nth-child(even),
.tl-right > .tl-row:nth-child(even) { background: #fffcf8; }

.hours {
  position: relative;
  height: 36px;
}
.hours .h {
  position: absolute;
  top: 0; bottom: 0;
  transform: translateX(-50%);
  display: flex; align-items: flex-start;
  padding-top: 8px;
  font-variant-numeric: tabular-nums;
}
.hours .h.is-0 { transform: none; padding-left: 4px; }

.hours .h::before {
  content: "";
  position: absolute;
  left: 50%; top: 26px;
  width: 1px; height: 10px;
  background: var(--line-strong);
}
.col-lab, .side {
  display: flex; align-items: center; justify-content: center;
  border-left: 1px solid var(--line);
  text-align: center;
  padding: 0 6px;
  line-height: 1.3;
}
.col-lab { justify-content: flex-start; padding-left: 14px; border-left: 0; color: var(--ink-soft); }
.band-4 {
  position: absolute;
  top: 0; bottom: 0;
  background: rgba(253, 186, 116, 0.28);
  pointer-events: none;
  z-index: 0;
}
.band-label {
  display: none;
}

.tl-row.tall { height: 88px; min-height: 88px; }
.row-lab {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 8px 12px;
  height: 100%;
  border-right: 1px solid var(--line);
}
.swatch { width: 8px; height: 28px; border-radius: 99px; flex-shrink: 0; }
.row-lab .name { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.row-lab .meta { font-size: 10px; color: var(--muted); font-weight: 500; }

.track {
  position: relative;
  min-height: 58px;
}
.tl-row.tall .track { min-height: 88px; }
.vgrid {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(100% / 24 - 1px),
    #efe9df calc(100% / 24 - 1px),
    #efe9df calc(100% / 24)
  );
  pointer-events: none;
}
.chip {
  position: absolute;
  height: 26px;
  border: 0;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 112px;
  box-shadow: 0 4px 10px rgba(28,25,22,0.12);
  z-index: 1;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, filter .12s ease;
}
.chip:hover, .chip:focus-visible {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.06);
  z-index: 4;
  outline: 2px solid #fff;
  outline-offset: 1px;
}
.chip.warnish {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f59e0b, 0 4px 10px rgba(28,25,22,0.12);
}
.chip.tiny { padding: 0 7px; max-width: 72px; font-size: 10px; height: 22px; }
.side-stack {
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center;
  gap: 4px; padding: 6px 6px;
  background: #faf8f4;
}
.side-stack .chip {
  position: relative;
  left: auto !important; top: auto !important;
  width: 100%;
  max-width: none;
  height: 22px;
  transform: none !important;
}
.side-stack .chip:hover, .side-stack .chip:focus-visible {
  transform: translateY(-1px) scale(1.03) !important;
}

/* Filters + list */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.filters .tabs { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.tab[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.search {
  position: relative;
}
.search input {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px 8px 34px;
  font-size: 13px;
  width: min(260px, 100%);
  outline: none;
}
.search input:focus { border-color: #9a8570; box-shadow: 0 0 0 3px rgba(154,133,112,.2); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.case-block { margin: 0 0 18px; }
.case-block[hidden] { display: none; }
.case-head {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px;
}
.case-head h4 { margin: 0; font-size: 16px; }
.badge {
  display: inline-flex; align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}
.badge.on { background: #ecfdf3; color: #166534; }
.badge.hold { background: #fff7ed; color: #9a3412; }
.badge.common { background: #eef2ff; color: #3730a3; }
.count-pill { color: var(--muted); font-size: 12px; font-weight: 600; }

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 118px 1fr auto;
  gap: 10px 14px;
  align-items: start;
  cursor: pointer;
  text-align: left;
  width: 100%;
  box-shadow: 0 1px 0 rgba(255,255,255,.7);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.item:hover { border-color: #cbbb9f; box-shadow: var(--shadow); }
.item[hidden] { display: none; }
.item.reviewish { background: linear-gradient(90deg, #fff7ed 0%, #fff 28%); }
.time-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f4eee5;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1.3;
}
.item h5 { margin: 0; font-size: 14px; font-weight: 700; }
.item .bot { font-size: 12px; color: var(--muted); font-weight: 600; }
.item .desc { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.result {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.result.ok { background: var(--ok-bg); color: var(--ok); }
.result.fail { background: var(--fail-bg); color: var(--fail); }
.result.skip { background: var(--skip-bg); color: var(--skip); }
.result.unknown { background: var(--unknown-bg); color: var(--unknown); }
.flag {
  display: inline-flex;
  margin-left: 6px;
  background: #fff7ed;
  color: #9a3412;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
}

/* Footer notes */
.notes {
  margin: 28px 0 64px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}
.note {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}
.note h3 { margin: 0 0 8px; font-size: 15px; }
.note p, .note li { font-size: 13px; color: var(--ink-soft); }
.note ul { margin: 0; padding-left: 1.1em; }
.bot-cloud {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.bot-cloud span {
  background: #f4eee5;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  color: var(--ink-soft);
}
.fine { margin-top: 24px; text-align: center; color: var(--muted); font-size: 11px; }

/* Drawer */
.overlay {
  position: fixed; inset: 0;
  background: rgba(28, 25, 22, 0.38);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  z-index: 60;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  background: #fff;
  box-shadow: var(--shadow-lg);
  z-index: 70;
  transform: translateX(100%);
  transition: transform .24s ease, visibility .24s ease;
  display: flex; flex-direction: column;
  visibility: hidden;
  pointer-events: none;
}
.drawer.open {
  transform: none;
  visibility: visible;
  pointer-events: auto;
}
.drawer header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer header h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.drawer header .bot { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.close {
  border: 0; background: #f4eee5; width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; font-size: 18px; color: var(--ink);
  flex-shrink: 0;
}
.drawer .body { padding: 16px 18px 32px; overflow: auto; }
.kv { display: grid; gap: 12px; }
.kv dt { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; }
.kv dd { margin: 3px 0 0; font-size: 14px; }
.alert {
  background: var(--warn-bg);
  border: 1px solid #f3d2a8;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: #9a3412;
}

@media (max-width: 980px) {
  .kpi-grid, .review-grid { grid-template-columns: 1fr 1fr; }
  .notes { grid-template-columns: 1fr; }
  .tl-hint { display: block; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 20px); }
  .site-header .wrap { padding: 8px 0; }
  .brand h1 { font-size: 15px; }
  .brand p { font-size: 11px; }
  .stamp { display: none; }
  .tl-shell { --label: 108px; --week: 78px; --other: 136px; --hours-min: 560px; }
  .row-lab { padding-left: 8px; padding-right: 6px; }
  .row-lab .name { font-size: 11.5px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .item { grid-template-columns: 1fr; }
  .item .result { justify-self: start; }
  .drawer {
    top: auto; bottom: 0; left: 0; right: 0;
    height: min(86vh, 640px);
    width: 100%;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .drawer.open { transform: translateY(0); }
  .search { width: 100%; }
  .search input { width: 100%; }
  .hero { padding-top: 18px; }
}
