/* 役員会に出す報告書。画面ではA4風に並べ、印刷時はA4縦で改ページする */
:root {
  --green: #2f5d2f;
  --green-light: #e3efdd;
  --brown: #7a4a1e;
  --text: #1b2a1b;
  --muted: #5a6b5a;
  --line: #d5ddd2;
  --bg: #eef2ec;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

[hidden] { display: none !important; }

#controls { position: sticky; top: 0; z-index: 1000; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; }
.controls-inner { display: flex; flex-wrap: wrap; align-items: center; }
.controls-inner > * { margin: 4px 16px 4px 0; }
#controls .hint { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
select, button { font: inherit; }
.primary { background: var(--green); color: #fff; border: 0; border-radius: 999px; padding: 8px 20px; font-weight: 700; cursor: pointer; }

.message { max-width: 640px; margin: 40px auto; padding: 24px; background: #fff; border-radius: 12px; text-align: center; }

main { padding: 16px 0 48px; }

.page {
  width: 210mm; min-height: 297mm; margin: 0 auto 16px; padding: 16mm 15mm;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); position: relative;
}

.page-header { display: flex; justify-content: space-between; border-bottom: 2px solid var(--green); padding-bottom: 4px; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.sample-badge { color: #b3261e; font-weight: 700; }

h1 { font-size: 26px; margin: 8px 0 4px; color: var(--green); }
h2 { font-size: 19px; margin: 0 0 10px; color: var(--green); border-left: 6px solid var(--green); padding-left: 8px; }
h3 { font-size: 15px; margin: 16px 0 6px; }
p { margin: 4px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.kpis { display: flex; margin: 14px -6px; }
.kpi { flex: 1; margin: 0 6px; background: var(--green-light); border-radius: 10px; padding: 10px 12px; }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.kpi .sub { font-size: 12px; }

.conclusions { background: #fffbe6; border: 1px solid #f0dc8a; border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.conclusions li { margin: 4px 0; font-weight: 600; }

.report-map { height: 150mm; border: 1px solid var(--line); border-radius: 6px; }
.legend { font-size: 12px; margin-top: 6px; }
.legend span { display: inline-block; margin-right: 14px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 4px; }

.hotspot-label {
  width: 30px; height: 30px; border-radius: 50%; background: #b3261e; color: #fff; font-weight: 700;
  text-align: center; line-height: 26px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); font-size: 15px;
}
.pin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 2px rgba(0, 0, 0, 0.6); }
.pin-open { background: var(--brown); }
.pin-resolved { background: #2e7d32; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: left; vertical-align: top; }
th { background: var(--green-light); font-weight: 700; }
td.num, th.num { text-align: right; }

.spot { display: flex; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; page-break-inside: avoid; }
.spot .rank { width: 34px; height: 34px; border-radius: 50%; background: #b3261e; color: #fff; font-weight: 700; font-size: 18px; text-align: center; line-height: 34px; flex-shrink: 0; margin-right: 10px; }
.spot .body { flex: 1; }
.spot img { width: 96px; height: 72px; object-fit: cover; border-radius: 4px; margin-left: 10px; }

.chart { width: 100%; }
.chart text { font-size: 11px; fill: var(--text); }
.chart .bar { fill: var(--green); }
.chart .bar.peak { fill: #b3261e; }

.proposal { border-left: 5px solid var(--green); background: #f7faf5; padding: 8px 12px; margin: 10px 0; page-break-inside: avoid; }
.proposal .title { font-weight: 700; font-size: 15px; }
.proposal ul { margin: 4px 0; padding-left: 20px; }

.footnote { position: absolute; bottom: 10mm; left: 15mm; right: 15mm; font-size: 11px; color: var(--muted); }

@media screen and (max-width: 840px) {
  .page { width: auto; min-height: 0; margin: 0 0 12px; padding: 16px; }
  .footnote { position: static; margin-top: 12px; }
  .report-map { height: 360px; }
}

@page { size: A4 portrait; margin: 0; }

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  main { padding: 0; }
  .page { margin: 0; box-shadow: none; page-break-after: always; width: 210mm; height: 297mm; overflow: hidden; }
  .page:last-child { page-break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.same-dog { display: inline-block; margin: 2px 0; padding: 1px 8px; border-radius: 999px; background: #fdecea; color: #8a1c14; font-weight: 700; font-size: 12px; }
