:root {
  color-scheme: light;
  --paper: #f5ead6;
  --ink: #2a1c17;
  --accent: #852629;
  --line: #aa9076;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  font: 1rem/1.4 system-ui, sans-serif;
}
header, main, footer { width: min(100%, 56rem); margin-inline: auto; }
header, footer { padding: .65rem clamp(.75rem, 3vw, 1.6rem); }
a { color: var(--accent); text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.top, .controls, footer { display: flex; align-items: center; gap: .5rem; }
.top, footer { justify-content: space-between; }
.top { flex-wrap: wrap; font-weight: 650; }
h1 { margin: .45rem 0 .65rem; font: bold clamp(1.3rem, 4vw, 2rem)/1.07 Georgia, serif; }
.controls { align-items: end; }
.contents { min-width: 0; flex: 1; display: grid; gap: .2rem; }
select, button { font: inherit; color: var(--ink); background: #fffaef; border: 1px solid var(--line); min-height: 2.5rem; border-radius: .2rem; }
select { width: 100%; padding: .35rem; }
button { padding: .35rem .55rem; cursor: pointer; }
button:disabled, select:disabled { opacity: .58; cursor: default; }
main { position: relative; min-height: 0; min-width: 0; border-block: 1px solid var(--line); }
#viewer { height: 100%; }
#status { position: absolute; z-index: 1; inset: .6rem 1rem auto; padding: .75rem; background: var(--paper); }
noscript { position: absolute; inset: 3rem 1rem auto; }
footer { padding-bottom: max(.65rem, env(safe-area-inset-bottom)); }
output { color: var(--accent); font-size: .9rem; text-align: center; }
@media (max-width: 480px) { footer button { font-size: .875rem; } }
