﻿:root {
  color-scheme: light;
  --ink: #1d2433;
  --muted: #667085;
  --line: #d7dce5;
  --panel: #ffffff;
  --paper: #f4f6f8;
  --tool: #eef2f7;
  --active: #127c72;
  --active-dark: #0c5f58;
  --accent: #e7b95a;
  --danger: #c2413d;
  --shadow: 0 18px 50px rgba(31, 41, 55, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
input {
  font: inherit;
}

button,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

button:hover,
select:hover {
  border-color: #a8b2c1;
}

button.primary {
  border-color: var(--active);
  color: #fff;
  background: var(--active);
}

button.primary:hover {
  background: var(--active-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 3px solid #1f2937;
  background: var(--accent);
  box-shadow: inset -6px -6px 0 rgba(0, 0, 0, 0.1);
  font-weight: 900;
}

.brand h1,
.brand p,
.panel h2,
.workspace h2 {
  margin: 0;
}

.brand h1 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 22px;
  line-height: 1.1;
}

.app-version {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand p,
#canvasLabel,
.playback span {
  color: var(--muted);
  font-size: 13px;
}

.panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel h2,
.collapsible-panel summary,
.workspace h2 {
  font-size: 15px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-options,
.palette-options {
  position: relative;
  flex: 0 0 auto;
}

.options-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.collapsible-panel summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel summary::marker {
  content: "";
}

.options-button::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 -6px 0 var(--muted), 0 6px 0 var(--muted);
}

.options-button[aria-expanded="true"],
.options-button:hover {
  background: var(--tool);
}

.options-button[aria-expanded="true"]::before,
.options-button:hover::before {
  background: var(--ink);
  box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink);
}

.options-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 8px;
  min-width: 160px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(31, 41, 55, 0.16);
}

.options-menu[hidden] {
  display: none;
}

.palette-menu {
  min-width: 190px;
}

.palette-menu button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 8px;
  text-align: left;
}

.palette-menu button.active {
  border-color: var(--active);
  color: var(--active);
  background: #e6f5f3;
}

.palette-menu-preview {
  display: grid;
  grid-template-columns: repeat(4, 10px);
  gap: 2px;
}

.palette-menu-preview span {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.tool-grid,
.select-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tool-grid button,
.select-controls button {
  min-width: 0;
  padding: 0 8px;
  white-space: nowrap;
}

.mode-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.mode-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.tool.active {
  border-color: var(--active);
  color: #fff;
  background: var(--active);
}

.select-shape.active {
  border-color: var(--active);
  color: var(--active);
  background: #e6f5f3;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--ink);
  white-space: nowrap;
}

.color-input {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.color-preview {
  display: block;
  height: 100%;
  min-height: 32px;
  border-radius: 5px;
  background: #2b2d42;
}

#customColorValue {
  padding-right: 8px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.recent-colors {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  min-height: 28px;
}

.recent-colors:empty {
  display: none;
}

.palette {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.swatch {
  aspect-ratio: 1;
  min-height: 28px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 0;
}

.swatch.active {
  outline: 3px solid var(--active);
  outline-offset: 2px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(29, 36, 51, 0.36);
}

.modal-backdrop[hidden] {
  display: none;
}

.color-dialog {
  display: grid;
  gap: 16px;
  width: min(440px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(31, 41, 55, 0.22);
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 17px;
}

.account-dialog,
.library-dialog {
  display: grid;
  gap: 16px;
  width: min(460px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(31, 41, 55, 0.22);
}

.library-dialog {
  width: min(680px, 100%);
}

.account-form {
  display: grid;
  gap: 12px;
}

.account-form label {
  display: grid;
  gap: 6px;
}

.account-form span,
.account-user-label,
.library-meta {
  color: var(--muted);
  font-size: 12px;
}

.account-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.account-form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
}

.library-list {
  display: grid;
  gap: 10px;
}

.library-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.library-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.library-thumb {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  background: #fff;
}

.library-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.library-title {
  min-width: 0;
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.library-rename-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  min-height: 26px;
  padding: 0;
}

.library-rename-button::before {
  content: "\270e";
  font-size: 13px;
  line-height: 1;
}

.library-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.wheel-editor {
  display: grid;
  grid-template-columns: minmax(0, 220px) 64px;
  justify-content: center;
  gap: 10px;
  align-items: center;
  padding-right: 18px;
}

.color-wheel-wrap {
  position: relative;
  width: min(220px, 68vw);
  aspect-ratio: 1;
}

#colorWheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  cursor: crosshair;
  touch-action: none;
}

.wheel-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.brightness-field {
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  align-items: start;
  gap: 4px;
  width: 64px;
  height: 220px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.brightness-field input {
  width: 28px;
  height: 198px;
  accent-color: var(--active);
  direction: rtl;
  writing-mode: vertical-lr;
}

.color-editor {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.dialog-color-preview {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #2b2d42;
}

.hex-field,
.rgb-controls label {
  display: grid;
  gap: 6px;
}

.hex-field span,
.rgb-controls span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.hex-field input,
.rgb-controls input[type="number"] {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.rgb-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.rgb-controls label {
  grid-template-columns: 1fr;
}

.dialog-actions {
  justify-content: end;
}

.template-list,
.helper-list {
  display: grid;
  gap: 8px;
}

.collapsible-panel {
  gap: 0;
}

.collapsible-panel[open] {
  gap: 12px;
}

.collapsible-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px;
  padding: 4px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.collapsible-panel summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
}

.collapsible-panel[open] summary::after {
  content: "-";
}

.helper-list {
  grid-template-columns: 1fr 1fr;
}

.ai-panel {
  display: grid;
  gap: 10px;
}

.ai-panel label {
  display: grid;
  gap: 6px;
}

.ai-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ai-panel [hidden] {
  display: none;
}

.ai-panel textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  line-height: 1.35;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  padding-top: 76px;
}

.topbar,
.timeline-band {
  background: #fff;
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 340px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
}

.project-heading {
  min-width: 0;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.project-title-row h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.size-dropdown-button {
  min-height: 28px;
  padding: 0 26px 0 10px;
  position: relative;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.size-dropdown-button::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  transform: translateY(-35%);
}

.size-dropdown-button[aria-expanded="true"]::after {
  border-top-color: var(--ink);
  transform: translateY(-35%) rotate(180deg);
}

.size-menu .topbar-menu-panel {
  left: 0;
  right: auto;
}

.title-edit-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  min-height: 28px;
  padding: 0;
}

.title-edit-button::before {
  content: "\270e";
  font-size: 14px;
  line-height: 1;
}

.topbar-actions,
.frame-actions,
.playback {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-actions {
  justify-content: flex-end;
  gap: 8px;
}

.project-origin-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 11px;
  font-weight: 800;
}

.project-origin-badge.online {
  color: #0f766e;
  border-color: #99f6e4;
  background: #ecfdf5;
}

.unsaved-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid #fbbf24;
  border-radius: 999px;
  color: #92400e;
  background: #fffbeb;
  font-size: 11px;
  font-weight: 800;
}

.topbar-menu {
  position: relative;
}

.menu-button {
  min-width: 84px;
  font-weight: 500;
}

#onlineMenuButton.online {
  border-color: #0f766e;
  color: #0f766e;
  background: #ecfdf5;
}

#onlineMenuButton.offline {
  color: var(--muted);
  background: #f8fafc;
}

.topbar-menu-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 8px;
  min-width: 160px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(31, 41, 55, 0.16);
}

.topbar-menu-panel[hidden] {
  display: none;
}

.topbar-menu-panel button {
  justify-content: center;
}

.wide-menu {
  min-width: 190px;
}

.menu-divider {
  display: block;
  height: 1px;
  background: var(--line);
}

.topbar-user-email {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stage-band {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 250px;
  gap: 24px;
  align-items: start;
  padding: 24px;
  min-height: 0;
}

.canvas-wrap {
  position: relative;
  display: grid;
  justify-items: center;
  align-items: start;
  min-height: 360px;
  padding-top: 0;
}

.canvas-busy-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--ink);
  background: rgba(248, 250, 252, 0.76);
  backdrop-filter: blur(2px);
  text-align: center;
}

.canvas-busy-overlay[hidden] {
  display: none;
}

.canvas-busy-overlay strong {
  font-size: 16px;
}

.canvas-busy-overlay span {
  color: var(--muted);
  font-size: 13px;
}

.busy-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid #dbe4ee;
  border-top-color: var(--active);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.canvas-ruler-shell {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: 22px auto;
  width: min(calc(70vh + 28px), 100%);
  max-width: 748px;
}

.ruler-corner {
  grid-column: 1;
  grid-row: 1;
}

.ruler {
  position: relative;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.top-ruler {
  grid-column: 2;
  grid-row: 1;
}

.left-ruler {
  grid-column: 1;
  grid-row: 2;
}

.ruler-label {
  position: absolute;
  font-variant-numeric: tabular-nums;
}

.top-ruler .ruler-label {
  bottom: 5px;
  transform: translateX(-50%);
}

.left-ruler .ruler-label {
  right: 6px;
  transform: translateY(-50%);
}

#pixelCanvas {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  image-rendering: pixelated;
  border: 1px solid #111827;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: crosshair;
  touch-action: none;
}

.preview-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

#previewCanvas {
  width: 192px;
  height: 192px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg, #e8edf3 25%, transparent 25%),
    linear-gradient(-45deg, #e8edf3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8edf3 75%),
    linear-gradient(-45deg, transparent 75%, #e8edf3 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.playback label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  width: 190px;
}

.status-line {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.nudge-pad {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 60px);
  grid-template-areas:
    "copy up paste"
    "left ok right"
    "undo down clear";
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.nudge-pad button {
  position: relative;
  z-index: 1;
}

.nudge-pad [data-nudge],
#commitSelectionMove {
  border-color: #b7c4d2;
  background: #eef3f7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.nudge-pad [data-nudge="up"] {
  grid-area: up;
}

#copyButton {
  grid-area: copy;
}

#pasteButton {
  grid-area: paste;
}

.nudge-pad [data-nudge="left"] {
  grid-area: left;
}

#commitSelectionMove {
  grid-area: ok;
}

.nudge-pad [data-nudge="right"] {
  grid-area: right;
}

.nudge-pad [data-nudge="down"] {
  grid-area: down;
}

#undoButton {
  grid-area: undo;
}

#clearFrame {
  grid-area: clear;
}

.timeline-band {
  min-width: 0;
  overflow: hidden;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.timeline {
  display: flex;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 4px;
}

.frame-tile {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 82px;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 8px;
  background: var(--tool);
  cursor: pointer;
}

.frame-tile.active {
  border-color: var(--active);
  background: #e6f5f3;
}

.frame-tile canvas {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  background: #fff;
}

.frame-tile span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow-y: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    padding-top: 0;
  }

  .topbar {
    position: sticky;
    right: auto;
    left: auto;
  }

  .stage-band {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    grid-template-columns: auto minmax(190px, 1fr);
    align-items: start;
  }
}

@media (max-width: 560px) {
  body {
    min-width: 320px;
  }

  button,
  select {
    min-height: 42px;
  }

  .brand {
    min-height: 48px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand h1 {
    font-size: 19px;
  }

  .brand p {
    font-size: 12px;
  }

  .panel {
    gap: 10px;
    padding: 12px;
  }

  .tool-grid,
  .select-controls {
    gap: 6px;
  }

  .tool-grid button,
  .select-controls button {
    padding: 0 6px;
    font-size: 15px;
  }

  .palette {
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
  }

  .swatch {
    min-height: 32px;
  }

  .color-dialog {
    padding: 14px;
  }

  .wheel-editor {
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 6px;
    padding-right: 8px;
  }

  .color-wheel-wrap {
    width: min(220px, 62vw);
  }

  .brightness-field input {
    width: 28px;
    height: 150px;
  }

  .brightness-field {
    width: 54px;
    height: 172px;
  }

  .color-editor {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .dialog-color-preview {
    min-height: 76px;
  }

  .rgb-controls {
    gap: 8px;
  }

  .topbar,
  .timeline-head {
    align-items: stretch;
  }

  .topbar {
    min-height: 0;
    padding: 12px 14px;
  }

  .topbar h2 {
    font-size: 16px;
  }

  .topbar-actions,
  .frame-actions {
    display: flex;
    gap: 8px;
  }

  .menu-button {
    min-width: 72px;
  }

  .topbar-user-email {
    max-width: 150px;
  }

  .stage-band,
  .timeline-band,
  .sidebar {
    padding: 10px;
  }

  .sidebar {
    gap: 10px;
  }

  .stage-band {
    gap: 14px;
    padding-top: 10px;
  }

  .canvas-wrap {
    min-height: 0;
  }

  .canvas-ruler-shell {
    grid-template-columns: 22px minmax(0, 1fr);
    grid-template-rows: 18px auto;
    width: calc(100vw - 20px);
    max-width: none;
  }

  .ruler {
    font-size: 9px;
  }

  .left-ruler .ruler-label {
    right: 4px;
  }

  .preview-panel {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #previewCanvas {
    width: min(160px, 48vw);
    height: min(160px, 48vw);
  }

  .playback label {
    width: 100%;
  }

  .nudge-pad {
    grid-template-columns: repeat(3, minmax(54px, 1fr));
    max-width: 240px;
  }

  .timeline-band {
    padding-top: 12px;
  }

  .timeline {
    gap: 8px;
  }

  .frame-tile {
    min-width: 72px;
    padding: 6px;
  }

  .frame-tile canvas {
    width: 48px;
    height: 48px;
  }
}













