:root { color-scheme: light; font-family: "Segoe UI", system-ui, sans-serif; color: #222c26; background: #f5f6f1; }
* { box-sizing: border-box; }
body { margin: 0; }
header { height: 66px; border-bottom: 1px solid #e0e4da; background: #fff; display: flex; align-items: center; gap: 11px; padding: 0 max(24px, calc((100vw - 1380px) / 2)); }
.mark { background: #254435; color: white; border-radius: 9px; width: 34px; height: 34px; display: grid; place-items: center; font-size: 24px; }
header h1 { font-size: 1rem; line-height: 1.2; margin: 0; }
header #reset { margin-left: auto; flex: none; }
main { width: min(1380px, calc(100% - 64px)); margin: 32px auto 42px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 18px; }
.viewer { min-height: 580px; position: relative; overflow: hidden; background: #dce6e3; border-radius: 18px; }
canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; cursor: grab; touch-action: none; }
canvas:active { cursor: grabbing; }
canvas:focus-visible { outline: 3px solid #32664c; outline-offset: -4px; }
.viewer-top, .viewer-bottom { position: absolute; left: 16px; right: 16px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.viewer-top { top: 16px; }
.viewer-bottom { bottom: 16px; justify-content: space-between; flex-wrap: wrap; }
.pill { background: #f9fbf6ee; padding: 8px 12px; border-radius: 20px; font-size: .82rem; font-weight: 600; }
.views { pointer-events: auto; display: flex; gap: 3px; padding: 4px; background: #fff; border-radius: 12px; }
button, select { font: inherit; color: inherit; border: 1px solid #dce2d8; border-radius: 9px; background: white; padding: 9px 12px; font-size: .875rem; }
button { cursor: pointer; }
button:hover { border-color: #668471; }
button[aria-pressed=true] { background: #284c39; color: white; border-color: #284c39; }
.views button { border-color: transparent; }
aside { border: 1px solid #e0e4da; background: white; border-radius: 18px; }
.aside-head, .controls { padding: 18px; }
.aside-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
h2 { font: 400 1.6rem Georgia, serif; margin: 0; }
.controls { border-top: 1px solid #e8ebe3; display: grid; gap: 9px; }
label, legend { font-size: .875rem; font-weight: 650; }
select { width: 100%; }
fieldset { border: 0; padding: 0; margin: 8px 0 0; min-width: 0; }
fieldset:disabled { opacity: .5; }
legend { padding: 0; margin-bottom: 10px; }
legend span { margin-left: 5px; font-weight: 400; color: #556457; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 34px; height: 34px; padding: 0; background: var(--swatch); border: 1px solid #0002; }
.swatches button[aria-pressed=true] { background: var(--swatch); outline: 2px solid #284c39; outline-offset: 2px; }
.swatches button:disabled { cursor: default; }
@media (max-width: 830px) { .workspace { grid-template-columns: 1fr; } .viewer { min-height: 430px; } }
@media (max-width: 460px) { main { width: calc(100% - 28px); margin-top: 22px; } header { padding-inline: 14px; } .viewer { min-height: 370px; } }

.viewer:fullscreen { width: 100%; height: 100%; min-height: 0; border-radius: 0; }
.viewer.expanded { position: fixed; inset: 0; z-index: 10; min-height: 0; border-radius: 0; }
body.viewer-expanded { overflow: hidden; }
.fullscreen-button { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; padding: 10px; }
.fullscreen-button svg { display: block; width: 100%; height: 100%; }
.fullscreen-button .collapse-icon,
.fullscreen-button[aria-pressed="true"] .expand-icon { display: none; }
.fullscreen-button[aria-pressed="true"] .collapse-icon { display: block; }
