:root {
  --bg: #e9e4d8; --ink: #23302b; --muted: #6b7a72; --panel: #fffaf0; --line: rgba(35, 48, 43, .14); --accent: #e2725b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #091115; --ink: #e8efe9; --muted: #9bb0a8; --panel: #12212a; --line: rgba(232, 239, 233, .14); --accent: #f4a261; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.4 Inter, system-ui, sans-serif; }

.bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.bar strong { font: 800 18px Fraunces, Georgia, serif; }
.bar .back { color: var(--accent); font-weight: 600; text-decoration: none; }
.bar .spacer { flex: 1; }
.group { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.bar button { font: 600 13px Inter, sans-serif; color: var(--ink); background: transparent; border: 0; padding: 7px 11px; cursor: pointer; }
.group button + button { border-left: 1px solid var(--line); }
.group button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.bar button.primary { background: var(--accent); color: #fff; border-radius: 10px; }
.bar button:disabled { opacity: .5; cursor: wait; }
.dpi { font-size: 12px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.dpi select { font: inherit; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 5px; }

#stage { padding: 24px 16px 48px; display: flex; justify-content: center; }
#stage svg { width: min(100%, 1400px); height: auto; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); background: #fff; }
.loading { color: var(--muted); }

@media print {
  .bar { display: none; }
  body { background: none; }
  #stage { padding: 0; display: block; }
  #stage svg { width: 100%; height: 100%; box-shadow: none; }
}
