:root {
  --paper: #fff;
  --ink: #1a1c1e;
  --muted: #5c5a55;
  --line: #c9c4b8;
  --gamma: #1f6f86;
  --gamma-bg: #e7f3f6;
  --old-bg: #f4f2ec;
  --mark: #fff6d8;
  --good: #2c6b3f;
  --bad: #a33b2c;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: #d8d4cc;
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", sans-serif;
}

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-size: 13px;
}
.bar a, .bar button {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-decoration: none;
  cursor: pointer;
  border-radius: 2px;
}
.bar a.pdf {
  color: #fff;
  background: var(--gamma);
  border-color: var(--gamma);
}
.bar a.pdf.is-busy { opacity: .55; pointer-events: none; }

.page {
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  margin: 0 auto 24px;
  background: var(--paper);
  padding: 10mm 12mm 12mm;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
  overflow: hidden;
  border-top: 5px solid var(--gamma);
  display: flex;
  flex-direction: column;
}

.kicker {
  margin: 0;
  font-size: 9pt;
  letter-spacing: .12em;
  color: var(--muted);
}
h1 {
  margin: 3px 0 2px;
  font-size: 15.5pt;
  font-weight: 650;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Hiragino Mincho", serif;
  letter-spacing: .04em;
}
.sub {
  margin: 0 0 10px;
  font-size: 9pt;
  color: var(--muted);
}

.lead {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 7px;
  padding: 7px 12px;
  background: var(--gamma-bg);
  border: 1px solid #b7d4dc;
}
.lead-k {
  margin: 0;
  font-size: 8pt;
  letter-spacing: .08em;
  color: var(--muted);
}
.lead-v {
  margin: 2px 0 0;
  font-size: 11pt;
}
.lead-up {
  text-align: right;
  padding-left: 16px;
  border-left: 1px solid #b7d4dc;
}
.lead-pct {
  margin: 0;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 28pt;
  font-weight: 650;
  letter-spacing: -.04em;
  color: var(--gamma);
  line-height: 1;
}

.photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 7px;
}
.photo {
  position: relative;
  border: 1px solid var(--line);
  height: 50mm;
  background: var(--old-bg);
  cursor: pointer;
  overflow: hidden;
}
.photo.new { background: var(--gamma-bg); }
.photo img {
  display: none;
  width: 100%;
  height: calc(100% - 22px);
  object-fit: contain;
  background: #fff;
}
.photo.has-img img { display: block; }
.photo.dark.has-img,
.photo.dark.has-img img { background: #111; }
.photo.light.has-img,
.photo.light.has-img img { background: #fff; }
.bar button:disabled { opacity: .55; cursor: wait; }

.photo .ph {
  position: absolute;
  inset: 0 0 22px;
  pointer-events: none;
}
.photo.has-img .ph { display: none; }
.photo figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8.5pt;
  background: #efece4;
  border-top: 1px solid var(--line);
}
.photo.new figcaption { background: #d3e8ee; }
.photo input { display: none; }

table.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
  flex: 1;
  height: 100%;
}
table.spec th, table.spec td {
  border: 1px solid var(--line);
  padding: 4.5px 8px;
  vertical-align: middle;
  text-align: left;
}
table.spec tbody tr { height: 6.8%; }
table.spec tr.mark { height: 9%; }
table.spec thead th {
  background: #efece4;
  font-weight: 650;
  font-size: 8.5pt;
}
table.spec th.item {
  width: 28%;
  background: #f7f5f0;
  font-weight: 650;
}
table.spec td.old { background: #faf9f6; }
table.spec td.new { background: var(--gamma-bg); font-weight: 650; }
table.spec tr.mark th.item,
table.spec tr.mark td.old { background: var(--mark); }
table.spec tr.mark td.new { background: #dceef2; }
table.spec tr.mark .num { font-size: 13pt; }
.num {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11pt;
  letter-spacing: -.03em;
}
.ok { color: var(--good); font-weight: 650; }

footer.sheet {
  margin-top: 8px;
  font-size: 7.5pt;
  color: var(--muted);
  line-height: 1.45;
}
footer.sheet a { color: var(--gamma); }

@page {
  size: A4 portrait;
  margin: 0;
}
body.exporting {
  background: #fff;
}
body.exporting .bar { display: none; }
body.exporting .page {
  margin: 0;
  box-shadow: none;
}

@media print {
  html, body { background: #fff; margin: 0; }
  .bar { display: none !important; }
  .page {
    width: 210mm;
    min-height: 297mm;
    height: 297mm;
    margin: 0;
    padding: 10mm 12mm 12mm;
    box-shadow: none;
    overflow: hidden;
  }
  .photo { cursor: default; }
}
