:root {
  color-scheme: light;
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: #111827;
  background: #f8fafc;
  --accent: #0f766e;
  --line: #d7e1e8;
  --muted: #475569;
}

* { box-sizing: border-box; }
body { margin: 0; }
.shell { max-width: 71rem; margin: auto; padding-inline: 1.35rem; }
header { background: white; border-bottom: 1px solid var(--line); }
.bar { display: flex; min-height: 3.55rem; align-items: center; justify-content: space-between; gap: .85rem; }
.brand { font-size: 1.08rem; font-weight: 800; letter-spacing: -.035em; color: inherit; text-decoration: none; }
.brand span, strong { color: var(--accent); }
nav { display: flex; gap: .95rem; }
nav a { font-size: .9rem; color: var(--muted); text-decoration: none; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; top: -4rem; left: .75rem; z-index: 1; padding: .6rem; background: white; }
.skip:focus { top: .5rem; }
main { padding-block: 2rem 1.65rem; }
h1 { margin: 0; font-size: clamp(2.05rem, 5vw, 3.05rem); line-height: 1.06; letter-spacing: -.06em; }
h2 { margin: 0 0 .65rem; font-size: 1.22rem; letter-spacing: -.025em; }
h3 { margin: 0 0 .45rem; font-size: .95rem; }
p { margin: .5rem 0; line-height: 1.5; }
.intro { max-width: 46rem; }
.note, footer { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.work { margin-top: 1.3rem; padding: 1.15rem; background: white; border: 1px solid var(--line); border-radius: .55rem; }
.steps { display: flex; flex-wrap: wrap; gap: .5rem; }
button { font: inherit; color: inherit; border: 1px solid #9eacb7; border-radius: .28rem; background: white; cursor: pointer; }
.steps button { font-size: .87rem; padding: .53rem .64rem; }
.steps button[aria-pressed="true"] { color: white; background: var(--accent); border-color: var(--accent); }
.steps button:disabled { opacity: .5; cursor: default; }
#step-note { min-height: 1.5rem; }
#status { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: .8rem 0 1rem; padding: .62rem 0; border-block: 1px solid var(--line); }
#status div { font-size: .86rem; }
dt { color: var(--muted); }
dd { margin: .14rem 0 0; font-weight: 630; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1rem; }
#items { display: grid; gap: .45rem; }
.scene { text-align: left; padding: .48rem .63rem; border-color: var(--line); overflow-wrap: anywhere; font-size: .86rem; }
.scene[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.scene span { display: block; font-weight: 650; }
.scene small { color: var(--muted); font-size: .81rem; }
canvas { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: .28rem; }
.legend { display: flex; flex-wrap: wrap; gap: .65rem; font-size: .82rem; }
.legend i { display: inline-block; width: .65rem; height: .65rem; border: 1px solid var(--accent); background: #bde0d9; margin-right: .3rem; }
.legend .area { background: white; border: 2px dashed #111827; }
.evidence { min-width: 0; overflow-wrap: anywhere; }
.evidence a { font-size: .87rem; }
details { border-top: 1px solid var(--line); margin-top: .8rem; padding: .7rem 0 .15rem; }
summary { cursor: pointer; font-size: .89rem; font-weight: 650; }
pre { overflow: auto; max-height: 21rem; padding: .68rem; background: #f8fafc; border: 1px solid var(--line); font-size: .8rem; }
.lower { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1.3rem; }
#added { columns: 2; padding-left: 1.4rem; font-family: monospace; overflow-wrap: anywhere; }
#added li { margin-bottom: .25rem; }
.table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: .45rem .5rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .84rem; }
th { font-weight: 650; }
footer { border-top: 1px solid var(--line); margin-top: 1.3rem; padding-top: .7rem; }

@media (max-width: 43rem) {
  .shell { padding-inline: .85rem; }
  main { padding-block: 1.3rem; }
  .grid { grid-template-columns: 1fr; }
  .work { padding: .8rem; }
  #added { columns: 1; }
}

@media (max-width: 23rem) {
  nav { gap: .5rem; }
  nav a { font-size: .8rem; }
}
