:root {
  color-scheme: dark;
  --night: #0b1117;
  --panel: #121b24;
  --line: #283744;
  --light: #eff5ee;
  --muted: #acbbc2;
  --accent: #a1f5cd;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--night);
  color: var(--light);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button { font: inherit; color: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button:disabled { opacity: 0.55; cursor: default; }

.site-header { border-bottom: 1px solid #24303a; }
.header-inner, main { width: min(calc(100% - 64px), 1140px); margin-inline: auto; }
.header-inner { min-height: 64px; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; font-size: 21px; font-weight: 800; letter-spacing: -0.055em; }
.brand:hover, .brand-dot { color: var(--accent); }
.brand-mark { width: 21px; aspect-ratio: 1; display: inline-block; margin-right: 9px; background: var(--accent); border-radius: 50% 50% 50% 4px; transform: rotate(-12deg); }
.app-name { color: var(--muted); border-left: 1px solid var(--line); padding-left: 20px; font-size: 14px; }
main { padding-block: clamp(28px, 5vw, 56px) 32px; }
.intro { margin-bottom: 27px; }
.intro h1 { margin: 0; font-size: clamp(2.7rem, 7vw, 5.3rem); font-weight: 720; line-height: 1.02; letter-spacing: -0.095em; }
.intro em { color: var(--accent); font-style: normal; }
.intro p { margin: 15px 0 0; color: var(--muted); line-height: 1.55; font-size: 16px; }

.postcard { margin: 0; border: 1px solid var(--line); border-radius: 19px; background: var(--panel); box-shadow: 0 25px 95px -48px #61dcb74f; }
.viewfinder { border-radius: 18px 18px 0 0; background: #091421; }
canvas { width: 100%; aspect-ratio: 16 / 9; display: block; border-radius: inherit; cursor: grab; touch-action: none; }
canvas.is-dragging { cursor: grabbing; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 20px; align-items: center; padding: 17px 21px; border-top: 1px solid var(--line); }
.palette-control { position: relative; margin: 0; padding: 0 0 0 65px; min-width: 0; border: 0; }
.palette-control legend { position: absolute; left: 0; top: 13px; padding: 0; color: var(--muted); font-size: 14px; }
.palettes, .actions { display: flex; flex-wrap: wrap; gap: 7px; }
.palette, .button { display: inline-flex; align-items: center; justify-content: center; line-height: 1.3; cursor: pointer; }
.palette { gap: 7px; padding: 7px 10px 7px 7px; min-height: 44px; border: 1px solid transparent; border-radius: 999px; background: transparent; font-size: 14px; }
.palette:hover { background: #263743; }
.palette[aria-pressed="true"] { border-color: #4b655f; background: #243830; }
.swatch { display: block; width: 22px; height: 22px; border-radius: 50%; }
.swatch-boreal { background: linear-gradient(135deg, #a2f7bc, #47ceb3 58%, #536adb); }
.swatch-violet { background: linear-gradient(135deg, #ffd3fb, #ba7bff 58%, #553cbb); }
.swatch-ember { background: linear-gradient(135deg, #ffdd98, #f7837f 58%, #a551b0); }
.swatch-glacier { background: linear-gradient(135deg, #d3f5ff, #6abff5 58%, #555be4); }
.button { min-height: 44px; min-width: 100px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-weight: 700; }
.secondary { background: #192731; }
.secondary:hover:not(:disabled) { background: #263743; }
.primary { background: var(--accent); color: #14271f; border-color: transparent; }
.primary:hover:not(:disabled) { background: #d4ffe8; }
.scene-details { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin: 13px 2px 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
#export-size { white-space: nowrap; }

@media (max-width: 740px) {
  .header-inner, main { width: min(calc(100% - 30px), 1140px); }
  .toolbar { align-items: stretch; padding: 12px; }
  .palette-control { flex-basis: 100%; }
}
@media (max-width: 450px) {
  .header-inner { gap: 12px; }
  .app-name { padding-left: 12px; }
  .intro { margin-bottom: 20px; }
  .palette-control { padding: 24px 0 0; }
  .palette-control legend { top: 0; }
  .palette { padding-inline: 7px; gap: 5px; }
  .actions { width: 100%; }
  .button { flex: 1; }
}
