* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #ece6d8; color: #1f1d26; font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { display: flex; flex-direction: column; }
header, footer { background: #f4efe3; padding: 6px 12px; }
header { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-bottom: 1px solid #cfc4ac; }
footer { border-top: 1px solid #cfc4ac; }
#styles { display: flex; flex-wrap: wrap; gap: 4px; }
button { font: inherit; font-size: 12px; background: #fbf8f0; color: #1f1d26; border: 1px solid #b9ae98; border-radius: 99px; padding: 3px 10px; cursor: pointer; }
button[aria-pressed="true"] { background: #26232f; color: #f4efe3; border-color: #26232f; }
[hidden] { display: none !important; }
.spacer { margin-left: auto; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#stage { position: relative; flex: 1; min-height: 0; }
#art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; touch-action: none; cursor: grab; }
#caption { position: absolute; left: 14px; top: 10px; max-width: max(200px, calc(100% - 340px)); pointer-events: none; text-shadow: 0 0 6px rgba(244, 239, 227, .9); }
#caption b { display: block; font: 20px Georgia, serif; }
#caption span { font-size: 12.5px; }
#stage[data-look="dusk"] #caption { color: #f6ead2; text-shadow: 0 0 6px rgba(20, 10, 30, .95); }
.zoom { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 5px; }
#read { position: absolute; right: 10px; top: 10px; width: min(300px, calc(100% - 20px)); max-height: calc(100% - 20px); overflow: auto; background: rgba(251, 248, 240, .94); border: 1px solid #cfc4ac; border-radius: 10px; padding: 6px 12px; font-size: 12.5px; }
#read summary { cursor: pointer; font: 14px Georgia, serif; }
table { border-collapse: collapse; width: 100%; }
td { padding: 3px 4px; border-top: 1px solid #ded4bd; vertical-align: top; }
#read td:first-child { width: 28px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
#history { position: absolute; right: 10px; top: 10px; bottom: 10px; width: min(370px, 46%); overflow: auto; background: rgba(251, 248, 240, .97); border: 1px solid #cfc4ac; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
#hOwl { margin: 6px 0; padding: 7px 9px; background: #26232f; color: #f4efe3; border-radius: 8px; }
#history h2 { margin: 0; font: 17px Georgia, serif; }
#history .row { margin: 6px 0; }
#close { margin-left: auto; }
#hChart { width: 100%; height: auto; }
#stage:has(#history:not([hidden])) #read { display: none; }
#scrub { flex: 1; min-width: 140px; }
#date { color: #5f5749; font-size: 12.5px; }
#strip { display: block; width: 100%; max-height: 92px; object-fit: contain; cursor: pointer; }
@media (max-width: 700px) {
  #history { left: 8px; right: 8px; top: auto; width: auto; height: 62%; }
  #caption span { display: none; }
  #read { top: 44px; left: 10px; right: auto; width: auto; max-width: calc(100% - 20px); max-height: calc(100% - 54px); }
}
