* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: #eef5f1;
  color: #162923;
  font: 1.125rem/1.55 system-ui, sans-serif;
}
main { max-width: 48rem; margin: 1rem auto; padding: 1rem; }
.controls { background: #fff; padding: 1.25rem; border-radius: 1rem; }
h1, h2, p { margin: 0 0 .65em; }
.controls h1 { margin-top: .6em; }
a { color: #075746; }
select, button {
  font: inherit;
  min-height: 3rem;
  padding: .35em .65em;
  border: 1px solid #075746;
  border-radius: .35em;
  background: #fff;
  color: #162923;
}
button { background: #075746; color: #fff; font-weight: 700; }
:focus-visible { outline: 3px solid #bd5200; outline-offset: 3px; }
.error { color: #9c1919; font-weight: 700; }
.controls p:empty { margin: 0; }
#print-controls, #record-error:not(:empty) { margin-top: .8rem; }
.print-guide { margin: 1rem 0 .75rem; font-size: 1.125rem; }

@media screen {
  #report { margin-top: 1rem; font-size: 1.125rem; }
  .summary, .details {
    padding: clamp(.75rem, 4vw, 1.5rem);
    background: #fff;
    border-radius: 1rem;
  }
  .summary h1 { font-size: 1.75rem; overflow-wrap: anywhere; }
  .summary h2, .details h2 { font-size: 1.4rem; }
  .summary section, .details { margin-top: 1rem; }
  .summary dl { margin: 0; }
  .summary dd { margin: 0 0 .65rem; font-size: 1.25rem; font-weight: 700; }
  .detail-scroll { overflow-x: auto; }
  .details table { width: 100%; border-collapse: collapse; }
  .details th, .details td {
    padding: .4rem;
    border: 1px solid #81938c;
    text-align: center;
    white-space: nowrap;
  }
  .details th { background: #eef5f1; }
  .scroll-hint { display: none; }
}

@media screen and (max-width: 40rem) {
  main { margin: .5rem auto; padding: .5rem; }
  .scroll-hint { display: block; }
}

@page { size: A4 portrait; margin: 12mm; }
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  main { max-width: none; margin: 0; padding: 0; }
  .controls, .scroll-hint { display: none; }
  .summary h1 { font-size: 26pt; overflow-wrap: anywhere; white-space: pre-wrap; }
  .summary h2 { font-size: 19pt; }
  .summary section { margin-top: 9mm; break-inside: avoid; }
  dl { display: grid; grid-template-columns: max-content 1fr; gap: 2mm 6mm; }
  dt, dd { font-size: 16pt; margin: 0; }
  dd { font-weight: 700; }
  .details { break-before: page; }
  table { border-collapse: collapse; width: 100%; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  th, td { border: 1px solid #333; text-align: center; padding: 1mm; }
}
