:root {
  color-scheme: light dark;
  --page: #f5f7fa;
  --surface: #fff;
  --text: #172638;
  --muted: #495a6f;
  --border: #cbd4df;
  --accent: #07596a;
  --button: #07596a;
  --on-button: #fff;
  --tint: #e8f3f4;
  font: 100%/1.6 system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #111a25;
    --surface: #192635;
    --text: #eef4fb;
    --muted: #b7c6d6;
    --border: #536478;
    --accent: #8ae0e5;
    --button: #8ae0e5;
    --on-button: #10222b;
    --tint: #213943;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(100% - 2rem, 68rem); margin-inline: auto; }
header, footer { background: var(--surface); }
header { border-bottom: 1px solid var(--border); }
footer { border-top: 1px solid var(--border); margin-top: 4rem; }
.bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .65rem 1.5rem; padding-block: 1rem; }
nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.brand { font-weight: 800; text-decoration: none; color: var(--text); }
.skip { position: absolute; top: .5rem; left: .5rem; padding: .5rem; background: var(--surface); }
.skip:not(:focus) { clip-path: inset(50%); }
main { padding-top: clamp(1.5rem, 5vw, 3.5rem); }
h1, h2, h3 { line-height: 1.22; }
h1 { font-size: clamp(2rem, 6vw, 3.1rem); margin: 0 0 .65rem; overflow-wrap: anywhere; }
h2 { font-size: 1.35rem; }
p { max-width: 70ch; }
.lead { font-size: 1.12rem; color: var(--muted); margin: 0 0 1.6rem; }
.grid, .tool, .fields { display: grid; gap: 1rem; }
.grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.tool { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
.card, .panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: .8rem; padding: clamp(1rem, 3vw, 1.5rem); min-width: 0;
}
.card h2, .panel h2:first-child { margin-top: 0; }
.card p, .hint, figcaption { color: var(--muted); }
.drop { border: 2px dashed var(--border); border-radius: .55rem; background: var(--tint); padding: 1rem; }
.drop.active { border-color: var(--accent); }
label { display: block; font-weight: 650; margin-block: .65rem .25rem; }
label:has(input[type=checkbox]) { font-weight: 500; }
input, textarea, select, button { font: inherit; max-width: 100%; }
input:not([type=checkbox]), textarea, select {
  width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: .35rem; padding: .45rem .55rem;
}
input[type=color] { min-height: 2.65rem; }
textarea { resize: vertical; }
button, .download {
  background: var(--button); color: var(--on-button); border: 1px solid var(--button);
  border-radius: .35rem; padding: .45rem .85rem; font-weight: 650; cursor: pointer; text-decoration: none;
}
button.secondary { background: var(--surface); color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-top: 1rem; }
.output-status { min-height: 1.6em; overflow-wrap: anywhere; }
figure { margin: .75rem 0; }
img, canvas { display: block; max-width: 100%; max-height: 25rem; height: auto; object-fit: contain; margin-inline: auto; }
figcaption { margin-top: .4rem; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; }
.stats dd { font-variant-numeric: tabular-nums; margin: 0; text-align: end; }
.guide { margin-top: 2.25rem; }
@media (max-width: 44rem) { .tool { grid-template-columns: minmax(0, 1fr); } }
