:root {
  color-scheme: dark;
  --bg: #000;
  --sidebar: oklch(8% 0 0);
  --text: oklch(94% 0 0);
  --muted: oklch(62% 0 0);
  --line: oklch(100% 0 0 / 0.12);
  --accent: #0c8ce9;
  --background: oklch(0 0 0);
  --foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --border: oklch(0.985 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --field-line: oklch(100% 0 0 / 0.22);
  --button-line: oklch(100% 0 0 / 0.30);
  --button-line-soft: oklch(100% 0 0 / 0.18);
  --clear: oklch(0% 0 0 / 0);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: sans-serif;
  font-size: 16px;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 332px;
  background: var(--bg);
}

.city-overlay {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 10;
  width: min(190px, calc(100vw - 28px));
  display: grid;
  gap: 6px;
}

.city-overlay select {
  min-height: 34px;
  border: 1px solid var(--button-line-soft);
  background-color: oklch(0% 0 0 / 0.54);
  padding: 6px 28px 6px 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.time-presets {
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 8px 9px 9px;
  border: 1px solid var(--button-line-soft);
  background: oklch(0% 0 0 / 0.46);
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.time-live-toggle,
.time-preset-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.time-live-toggle {
  color: var(--text);
}

.time-live-toggle input {
  justify-self: end;
}

.time-presets input[type="date"] {
  grid-column: auto;
  width: 100%;
  min-height: 28px;
  border: 0;
  border-bottom: 1px solid oklch(100% 0 0 / 0.18);
  background: var(--clear);
  color: var(--text);
  padding: 1px 0 5px;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}

.time-presets input[type="range"] {
  grid-column: auto;
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}

.time-presets output {
  min-width: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.canvas-shell {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg);
}

.art-reflection-frame {
  width: min(100%, calc((100vh - 32px) * .818));
  max-width: 860px;
  display: block;
}

svg#art {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  touch-action: manipulation;
}

#plainCssBackground {
  overflow: hidden;
}

.plain-css-background {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  --bg-c0: oklch(12% 0.040 265);
  --bg-c1: oklch(24% 0.080 260);
  --bg-c2: oklch(42% 0.120 245);
  --bg-c3: oklch(58% 0.150 210);
  --bg-c4: oklch(70% 0.160 80);
  --bg-c5: oklch(60% 0.160 340);
  --bg-c6: oklch(46% 0.130 290);
  --bg-c7: oklch(82% 0.090 96);
  --bg-c8: oklch(92% 0.060 96);
  --orbit-x: 50%;
  --orbit-y: 50%;
  --sky-angle: 180deg;
  --beam-angle: 315deg;
  background: linear-gradient(var(--sky-angle), var(--bg-c0), var(--bg-c4), var(--bg-c8));
}

.plain-css-background::before,
.plain-css-background::after {
  content: "";
  position: absolute;
  inset: -12%;
  pointer-events: none;
  opacity: 0;
}

.plain-css-background--smooth {
  background-image:
    radial-gradient(circle at var(--orbit-x) var(--orbit-y), color-mix(in oklch, var(--bg-c5) 72%, var(--bg-c8)) 0 10%, transparent 46%),
    linear-gradient(var(--sky-angle), var(--bg-c0) 0%, var(--bg-c2) 32%, var(--bg-c5) 70%, var(--bg-c8) 100%);
  background-blend-mode: screen, normal;
}

.plain-css-background--smooth::after {
  opacity: 0.20;
  background:
    repeating-linear-gradient(90deg, transparent 0 17px, color-mix(in oklch, var(--bg-c7) 28%, transparent) 17px 18px),
    repeating-linear-gradient(0deg, transparent 0 23px, color-mix(in oklch, var(--bg-c1) 24%, transparent) 23px 24px);
  background-position: var(--orbit-x) var(--orbit-y), var(--orbit-x) var(--orbit-y);
  mix-blend-mode: soft-light;
}

.plain-css-background--radial-gradient {
  background-image: radial-gradient(circle at var(--orbit-x) var(--orbit-y),
    color-mix(in oklch, var(--bg-c8) 88%, var(--bg-c7)) 0%,
    color-mix(in oklch, var(--bg-c7) 72%, var(--bg-c5)) 18%,
    color-mix(in oklch, var(--bg-c5) 76%, var(--bg-c3)) 42%,
    color-mix(in oklch, var(--bg-c2) 82%, var(--bg-c1)) 68%,
    var(--bg-c0) 100%);
}

.plain-css-background--conic-gradient {
  background-image:
    radial-gradient(circle at var(--orbit-x) var(--orbit-y), color-mix(in oklch, var(--bg-c8) 50%, transparent) 0 12%, transparent 44%),
    conic-gradient(from var(--beam-angle) at var(--orbit-x) var(--orbit-y),
      var(--bg-c0) 0deg,
      var(--bg-c2) 44deg,
      var(--bg-c5) 112deg,
      var(--bg-c8) 178deg,
      var(--bg-c6) 238deg,
      var(--bg-c3) 304deg,
      var(--bg-c0) 360deg);
  background-blend-mode: screen, normal;
}

.sidebar {
  height: 100vh;
  overflow: auto;
  display: block;
  padding: 0 18px 24px;
  background: var(--sidebar);
  border-left: 1px solid var(--line);
}

.sidebar,
.sidebar * {
  font-size: 16px;
  font-weight: 400;
}

.control-section {
  border-top: 1px solid var(--line);
}

.control-section:first-child {
  border-top: 0;
}

.section-title {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 18px 0 12px;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  list-style: none;
  text-transform: none;
  user-select: none;
}

.section-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-layer-controls {
  display: grid;
  grid-template-columns: 38px 46px;
  gap: 5px;
  align-items: center;
}

.section-title::-webkit-details-marker {
  display: none;
}

.section-title::after {
  content: "+";
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--button-line-soft);
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.control-section[open] > .section-title::after {
  content: "-";
  color: var(--text);
}

.control-section:not([open]) > .section-title {
  padding-bottom: 18px;
}

.layer-only-title {
  cursor: default;
}

.layer-only-title::after {
  content: "";
  border-color: transparent;
}

.section-title:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.control,
.color-control,
.row,
.colors,
.palette-grid {
  border-top: 1px solid var(--line);
}

.control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 13px 0 15px;
  background: var(--clear);
}

.control.toggle {
  grid-template-columns: minmax(0, 1fr) auto;
}

label {
  font-weight: 400;
  font-size: 16px;
  line-height: 1.2;
  color: var(--text);
}

.value {
  min-width: 58px;
  color: var(--muted);
  font-size: 16px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--accent);
}

input[type="date"],
input[type="number"],
input[type="text"] {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--field-line);
  background: var(--clear);
  color: var(--text);
  padding: 6px 0;
  font: inherit;
  font-size: 16px;
}

select {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--field-line);
  border-radius: 0;
  background-color: var(--clear);
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-repeat: no-repeat;
  background-size: 6px 6px;
  color: var(--text);
  padding: 6px 36px 6px 10px;
  font: inherit;
  font-size: 16px;
}

input[type="text"] {
  font-family: sans-serif;
  font-size: 16px;
}

select {
  appearance: none;
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.layer-toggle,
.layer-solo {
  min-height: 22px;
  padding: 0 6px;
  border-color: var(--button-line-soft);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.layer-toggle[aria-pressed="true"] {
  color: var(--text);
}

.layer-toggle[aria-pressed="false"] {
  border-color: oklch(100% 0 0 / 0.10);
}

.layer-solo[aria-pressed="true"] {
  border-color: var(--text);
  background: oklch(100% 0 0 / 0.09);
  color: var(--text);
}

[data-layer-row].is-hidden .section-label,
[data-layer-row].is-suppressed .section-label {
  color: var(--muted);
}

.row,
.colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 13px 0 15px;
}

.palette-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 13px 0 15px;
}

.row.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.row.single {
  grid-template-columns: 1fr;
}

.row .control,
.colors .color-control {
  border-top: 0;
  padding: 0;
}

.color-control {
  display: grid;
  gap: 7px;
  padding: 13px 0 15px;
  background: var(--clear);
}

.color-control input {
  width: 100%;
  min-height: 32px;
  border: 1px solid oklch(100% 0 0 / 0.20);
  border-radius: 0;
  background: var(--clear);
  padding: 6px 7px;
}

.color-data {
  display: none;
}

button {
  appearance: none;
  min-height: 34px;
  border: 1px solid var(--button-line);
  border-radius: 0;
  padding: 8px 10px;
  color: var(--text);
  background: var(--clear);
  font-weight: 400;
  font-size: 16px;
}

button.secondary {
  border-color: var(--button-line-soft);
  color: var(--muted);
  background: var(--clear);
}

.palette-option {
  min-height: 64px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 9px;
  text-align: left;
  color: var(--text);
  border-color: var(--button-line-soft);
}

.palette-option[aria-pressed="true"] {
  border-color: var(--text);
  background: oklch(100% 0 0 / 0.075);
}

.palette-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: currentColor;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Toolcraft-inspired panel skin generated from `npx @pixel-point/toolcraft create`. */
.toolcraft-panel-surface {
  --floating-popup-surface-background: color-mix(in oklab, var(--popover) 75%, transparent);
  border-color: color-mix(in oklab, var(--border) 12%, transparent);
  background-color: var(--floating-popup-surface-background);
  color: var(--popover-foreground);
}

.sidebar.toolcraft-panel-surface {
  width: 300px;
  height: calc(100vh - 20px);
  align-self: start;
  justify-self: end;
  display: flex;
  flex-direction: column;
  margin: 10px 16px 10px 0;
  padding: 0;
  overflow: hidden auto;
  border: 1px solid color-mix(in oklab, var(--border) 12%, transparent);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--foreground) 4%, transparent), transparent 42%),
    color-mix(in oklab, var(--popover) 86%, transparent);
  box-shadow:
    0 18px 60px oklch(0% 0 0 / 0.42),
    inset 0 1px 0 color-mix(in oklab, var(--foreground) 10%, transparent);
  color: var(--popover-foreground);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklab, var(--foreground) 10%, transparent) transparent;
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
}

.sidebar.toolcraft-panel-surface::-webkit-scrollbar,
.sidebar.toolcraft-panel-surface *::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.sidebar.toolcraft-panel-surface::-webkit-scrollbar-track,
.sidebar.toolcraft-panel-surface *::-webkit-scrollbar-track,
.sidebar.toolcraft-panel-surface::-webkit-scrollbar-corner,
.sidebar.toolcraft-panel-surface *::-webkit-scrollbar-corner {
  background: transparent;
}

.sidebar.toolcraft-panel-surface::-webkit-scrollbar-thumb,
.sidebar.toolcraft-panel-surface *::-webkit-scrollbar-thumb {
  min-height: 2.75rem;
  border-radius: 999px;
  background-color: color-mix(in oklab, var(--foreground) 10%, transparent);
}

.sidebar.toolcraft-panel-surface,
.sidebar.toolcraft-panel-surface * {
  font-size: 13px;
  font-weight: 500;
}

.sidebar-panel-header {
  position: sticky;
  top: 0;
  z-index: 2;
  flex: 0 0 auto;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 8%, transparent);
  background: color-mix(in oklab, var(--popover) 90%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.sidebar-panel-header p {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .control-section {
  border-top: 1px solid color-mix(in oklab, var(--border) 8%, transparent);
  transition: background-color 150ms ease-out;
}

.sidebar .control-section:first-child,
.sidebar .control-section:first-of-type {
  border-top: 0;
}

.sidebar .control-section:hover {
  background-color: color-mix(in oklab, var(--foreground) 3%, transparent);
}

.sidebar .section-title {
  min-height: 36px;
  grid-template-columns: minmax(0, 1fr) auto 22px;
  gap: 8px;
  padding: 0 7px 0 12px;
  color: var(--foreground);
  letter-spacing: 0;
}

.sidebar .control-section:not([open]) > .section-title {
  padding-bottom: 0;
}

.sidebar .section-label {
  color: color-mix(in oklab, var(--foreground) 75%, transparent);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 0.875rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  transition: color 150ms ease-out;
}

.sidebar .section-title:hover .section-label,
.sidebar .control-section[open] > .section-title .section-label {
  color: var(--foreground);
}

.sidebar .section-title::after {
  content: "▾";
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: color-mix(in oklab, var(--foreground) 60%, transparent);
  font-size: 12px;
  line-height: 1;
  transition:
    background-color 150ms ease-out,
    color 150ms ease-out,
    transform 150ms ease-out;
}

.sidebar .section-title:hover::after {
  background: color-mix(in oklab, var(--foreground) 6%, transparent);
  color: var(--foreground);
}

.sidebar .control-section[open] > .section-title::after {
  content: "▴";
  color: var(--foreground);
}

.sidebar .layer-only-title::after {
  content: "";
  background: transparent;
}

.sidebar .section-title:focus-visible,
.sidebar :is(button, select, input):focus-visible {
  outline: 2px solid color-mix(in oklab, var(--accent) 75%, transparent);
  outline-offset: 2px;
}

.sidebar .section-layer-controls {
  grid-template-columns: repeat(2, max-content);
  gap: 4px;
}

.sidebar .control,
.sidebar .color-control {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  padding: 7px 12px;
  border-top: 0;
}

.sidebar details[open] > .control:first-of-type,
.sidebar details[open] > .color-control:first-of-type,
.sidebar details[open] > .palette-grid:first-of-type,
.sidebar details[open] > .row:first-of-type,
.sidebar details[open] > .colors:first-of-type {
  padding-top: 8px;
}

.sidebar details[open] > .control:last-child,
.sidebar details[open] > .color-control:last-child,
.sidebar details[open] > .palette-grid:last-child,
.sidebar details[open] > .row:last-child,
.sidebar details[open] > .colors:last-child {
  padding-bottom: 24px;
}

.sidebar label,
.sidebar .value {
  font-size: 0.75rem;
  line-height: 1rem;
}

.sidebar label {
  min-width: 0;
  color: color-mix(in oklab, var(--foreground) 62%, transparent);
}

.sidebar .value {
  min-width: 50px;
  color: color-mix(in oklab, var(--foreground) 55%, transparent);
  font-variant-numeric: tabular-nums;
}

.sidebar input[type="date"],
.sidebar input[type="number"],
.sidebar input[type="text"],
.sidebar select,
.sidebar .color-control input {
  min-height: 32px;
  border: 1px solid color-mix(in oklab, var(--foreground) 12%, transparent);
  border-radius: var(--radius-lg);
  background-color: color-mix(in oklab, var(--background) 78%, transparent);
  color: var(--foreground);
  padding: 6px 9px;
  font-size: 0.8125rem;
  line-height: 1.125rem;
  transition:
    border-color 150ms ease-out,
    background-color 150ms ease-out,
    box-shadow 150ms ease-out;
}

.sidebar select {
  padding-right: 30px;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px;
}

.sidebar input[type="date"]:hover,
.sidebar input[type="number"]:hover,
.sidebar input[type="text"]:hover,
.sidebar select:hover,
.sidebar .color-control input:hover {
  border-color: color-mix(in oklab, var(--foreground) 18%, transparent);
  background-color: color-mix(in oklab, var(--background) 66%, transparent);
}

.sidebar input[type="range"] {
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  accent-color: var(--accent);
}

.sidebar input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--foreground) 14%, transparent);
}

.sidebar input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  appearance: none;
  border: 1px solid color-mix(in oklab, var(--foreground) 28%, transparent);
  border-radius: 999px;
  background: var(--foreground);
  box-shadow: 0 2px 10px oklch(0% 0 0 / 0.34);
}

.sidebar input[type="range"]::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in oklab, var(--foreground) 14%, transparent);
}

.sidebar input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 1px solid color-mix(in oklab, var(--foreground) 28%, transparent);
  border-radius: 999px;
  background: var(--foreground);
  box-shadow: 0 2px 10px oklch(0% 0 0 / 0.34);
}

.sidebar input[type="checkbox"] {
  position: relative;
  width: 30px;
  height: 18px;
  margin: 0;
  appearance: none;
  border: 1px solid color-mix(in oklab, var(--foreground) 14%, transparent);
  border-radius: 999px;
  background: color-mix(in oklab, var(--foreground) 8%, transparent);
  transition:
    border-color 150ms ease-out,
    background-color 150ms ease-out;
}

.sidebar input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--foreground) 76%, transparent);
  transition: transform 150ms ease-out, background-color 150ms ease-out;
}

.sidebar input[type="checkbox"]:checked {
  border-color: color-mix(in oklab, var(--accent) 65%, var(--foreground) 15%);
  background: color-mix(in oklab, var(--accent) 34%, transparent);
}

.sidebar input[type="checkbox"]:checked::before {
  transform: translateX(12px);
  background: var(--foreground);
}

.sidebar button {
  min-height: 30px;
  border-color: color-mix(in oklab, var(--foreground) 14%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--foreground) 4%, transparent);
  color: var(--foreground);
  font-size: 0.8125rem;
  line-height: 1.125rem;
  transition:
    border-color 150ms ease-out,
    background-color 150ms ease-out,
    color 150ms ease-out,
    transform 80ms ease-out;
}

.sidebar button:hover {
  border-color: color-mix(in oklab, var(--foreground) 20%, transparent);
  background: color-mix(in oklab, var(--foreground) 8%, transparent);
}

.sidebar button.secondary,
.sidebar .layer-toggle,
.sidebar .layer-solo {
  color: color-mix(in oklab, var(--foreground) 58%, transparent);
}

.sidebar .layer-toggle,
.sidebar .layer-solo {
  min-height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-md);
  font-size: 0.6875rem;
  line-height: 0.875rem;
}

.sidebar .layer-toggle[aria-pressed="true"],
.sidebar .layer-solo[aria-pressed="true"] {
  border-color: color-mix(in oklab, var(--accent) 60%, var(--foreground) 18%);
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  color: var(--foreground);
}

.sidebar [data-layer-row].is-hidden .section-label,
.sidebar [data-layer-row].is-suppressed .section-label {
  color: color-mix(in oklab, var(--foreground) 42%, transparent);
}

.sidebar .row,
.sidebar .colors,
.sidebar .palette-grid {
  border-top: 0;
  padding: 8px 12px 18px;
}

.sidebar .row,
.sidebar .colors {
  gap: 8px;
}

.sidebar .palette-grid {
  gap: 8px;
}

.sidebar .row .control,
.sidebar .colors .color-control {
  padding: 0;
}

.sidebar .palette-option {
  min-height: 58px;
  border-color: color-mix(in oklab, var(--foreground) 12%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in oklab, var(--foreground) 4%, transparent);
  padding: 9px;
}

.sidebar .palette-option:hover {
  border-color: color-mix(in oklab, var(--foreground) 20%, transparent);
  background: color-mix(in oklab, var(--foreground) 7%, transparent);
}

.sidebar .palette-option[aria-pressed="true"] {
  border-color: color-mix(in oklab, var(--accent) 58%, var(--foreground) 22%);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
}

.sidebar .palette-name {
  font-size: 0.75rem;
  line-height: 1rem;
}

.floating-random-controls {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 12;
  display: grid;
  gap: 8px;
  min-width: 154px;
}

.floating-random-history {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.floating-random-controls button {
  background: oklch(0% 0 0 / 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.floating-random-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.floating-random-controls button:disabled:active {
  transform: none;
}

.floating-randomize {
  min-width: 126px;
}

body.share-mode .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.share-mode .canvas-shell {
  grid-column: 1 / -1;
}

body.share-mode .sidebar {
  display: none;
}

body.share-mode .floating-random-history {
  display: none;
}

body.share-mode .floating-randomize {
  min-width: 154px;
}

.palette-swatches {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  height: 18px;
}

.palette-swatch {
  min-width: 0;
  border: 1px solid oklch(100% 0 0 / 0.18);
}

button:active {
  transform: translateY(1px);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: oklch(0% 0 0 / 0.90);
  color: var(--text);
  border: 1px solid oklch(100% 0 0 / 0.20);
  border-radius: 0;
  padding: 9px 12px;
  font-size: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  white-space: nowrap;
}

.toast.show { opacity: 1; }

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .canvas-shell {
    min-height: 100vh;
  }

  .art-reflection-frame {
    width: min(100vw, calc(100vh * .818));
  }

  .sidebar.toolcraft-panel-surface {
    width: auto;
    height: auto;
    max-height: none;
    justify-self: stretch;
    margin: 12px;
  }
}
