:root {
  color-scheme: light;
  --paper: #f4f2eb;
  --surface: #fffefa;
  --ink: #242f2a;
  --muted: #526059;
  --line: #dedfd3;
  --green: #235642;
  --green-dark: #173e2e;
  --radius: 20px;
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .54; }
button:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #597c68; outline-offset: 3px; }
.masthead {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  min-height: 70px; padding: .8rem max(1.35rem, calc((100% - 980px)/2));
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: .65rem; font-size: 1.16rem; font-weight: 750; white-space: nowrap; }
.brand-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--green); display: grid; place-items: center; }
.brand-icon::before { content: ""; width: 17px; height: 11px; border: 2px solid #f7f4e9; border-radius: 3px; }
.property { color: var(--muted); font-size: .88rem; text-align: right; }
main { max-width: 1024px; margin: auto; padding: clamp(2.15rem, 6.5vw, 5rem) 1.35rem 3rem; }
.intro { margin-bottom: 2rem; }
.eyebrow { color: var(--green); font-size: .77rem; letter-spacing: .15em; font-weight: 750; margin: 0 0 .55rem; }
h1 { font-family: Georgia, serif; font-weight: 400; font-size: clamp(2.8rem, 7vw, 4.4rem); line-height: 1.03; letter-spacing: -.045em; margin: 0 0 .7rem; }
.intro > p:last-child, .instruction, .status { color: var(--muted); line-height: 1.55; }
.intro > p:last-child { margin: 0; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 1rem; align-items: stretch; }
.card, .help { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card { padding: clamp(1rem, 3vw, 1.65rem); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.018em; }
.spec { color: var(--muted); font-size: .81rem; font-variant-numeric: tabular-nums; }
.preview-stage { background: #e9ece2; border: 1px solid #dfe3d7; border-radius: 14px; margin-top: 1rem; padding: clamp(.7rem, 3vw, 1.75rem); }
.frame { border: 1px solid #c9c7bb; background: #faf8f0; border-radius: 14px; padding: clamp(.48rem, 1.45vw, .95rem); box-shadow: 0 5px 12px #23342920; }
canvas { background: #fff; width: 100%; height: auto; display: block; image-rendering: pixelated; border: 1px solid #d0d0c8; }
.inks { display: flex; gap: .6rem 1.05rem; flex-wrap: wrap; margin: .95rem 0 1.15rem; padding: 0; list-style: none; font-size: .79rem; color: var(--muted); }
.inks li { display: flex; align-items: center; gap: .35rem; }
.inks i { width: .7rem; height: .7rem; border-radius: 50%; border: 1px solid #0003; display: inline-block; }
.black { background: #000; } .white { background: #fff; } .red { background: #f00; } .yellow { background: #ff0; }
.mode label { display: block; font-size: .83rem; font-weight: 660; margin-bottom: .38rem; }
select { background: var(--surface); color: var(--ink); border: 1px solid #b6c0b7; padding: .62rem .7rem; border-radius: 8px; width: 100%; }
.instruction { margin: .55rem 0 1rem; font-size: .91rem; }
dl { margin: 0 0 1rem; border-block: 1px solid var(--line); }
dl div { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; padding: .57rem 0; font-size: .83rem; }
dl div + div { border-top: 1px solid var(--line); }
dt { color: var(--muted); } dd { margin: 0; text-align: right; font-weight: 640; overflow-wrap: anywhere; min-width: 0; }
button { border: 1px solid var(--green); border-radius: 9px; padding: .7rem .8rem; width: 100%; min-height: 44px; font-size: .9rem; font-weight: 700; }
.primary { background: var(--green); color: #fff; margin-top: .57rem; }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.secondary { background: var(--surface); color: var(--green-dark); }
.secondary:hover:not(:disabled) { background: #eff4ee; }
progress { width: 100%; margin-top: .8rem; accent-color: var(--green); height: .65rem; }
.status { font-size: .84rem; min-height: 2.4em; margin: .8rem 0 0; }
.status[data-tone="error"] { color: #9c302c; }
.status[data-tone="success"] { color: var(--green-dark); }
.help { margin-top: .75rem; padding: .9rem 1.1rem; border-radius: 12px; }
summary { cursor: pointer; font-size: .88rem; font-weight: 680; }
.help ol, .help ul { padding-left: 1.3rem; margin: .7rem 0 .2rem; color: var(--muted); line-height: 1.6; font-size: .88rem; overflow-wrap: anywhere; }
@media (max-width: 715px) { .workspace { grid-template-columns: minmax(0, 1fr); } }
