:root {
  color-scheme: light;
  --bg: #eef6ef;
  --surface: #fbfff9;
  --surface-2: #f5fbf4;
  --ink: #14251d;
  --muted: #6d7f73;
  --line: #d7e6d9;
  --line-strong: #a9cbb4;
  --green-900: #0c2f23;
  --green-800: #164735;
  --green-700: #1e684f;
  --green-600: #248761;
  --green-500: #30a873;
  --green-200: #cbead2;
  --green-100: #e5f6e7;
  --cream: #fff7e6;
  --coral: #d96d4d;
  --shadow: 0 18px 50px rgba(11, 45, 31, 0.13);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(238, 246, 239, 0.96), rgba(245, 251, 244, 0.98)),
    repeating-linear-gradient(90deg, rgba(36, 135, 97, 0.04) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(36, 135, 97, 0.04) 0 1px, transparent 1px 28px);
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

.topbar {
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(90deg, var(--green-900), var(--green-800));
  color: white;
  box-shadow: 0 8px 24px rgba(12, 47, 35, 0.22);
  position: sticky;
  top: 0;
  z-index: 5;
}

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

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
  max-width: 42vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.brand-mark span {
  border-radius: 999px;
  background: var(--green-200);
  box-shadow: inset 0 0 0 3px rgba(12, 47, 35, 0.24);
}

.brand-mark span:nth-child(2) {
  background: #f5db73;
}

.brand-mark span:nth-child(3) {
  background: #74c5ef;
}

.brand-mark span:nth-child(4) {
  background: #ec7f7f;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button,
.ghost-button,
.wide-button,
.text-button,
.tool-button {
  border: 0;
  border-radius: var(--radius);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary-button,
.wide-button {
  color: white;
  background: var(--green-600);
  box-shadow: 0 10px 24px rgba(36, 135, 97, 0.28);
}

.primary-button:not(:disabled):hover,
.wide-button:not(:disabled):hover {
  background: var(--green-700);
  transform: translateY(-1px);
}

.primary-button,
.ghost-button {
  min-height: 40px;
  padding: 0 16px;
}

.action-button {
  position: relative;
  overflow: hidden;
  min-width: 84px;
  font-weight: 750;
  letter-spacing: 0;
}

.action-button:disabled {
  opacity: 1;
  color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.action-button.is-ready {
  color: white;
  border-color: rgba(255, 255, 255, 0.25);
}

.action-button.is-ready::before {
  content: "";
  position: absolute;
  inset: 4px auto auto 6px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #bdf4ca;
  box-shadow: 0 0 12px rgba(189, 244, 202, 0.9);
}

.action-button:not(:disabled):active {
  transform: translateY(1px) scale(0.98);
}

.action-button.is-confirming {
  animation: action-confirm 520ms ease;
}

@keyframes action-confirm {
  0% {
    box-shadow: 0 0 0 0 rgba(189, 244, 202, 0.55), 0 10px 24px rgba(36, 135, 97, 0.28);
  }
  55% {
    box-shadow: 0 0 0 8px rgba(189, 244, 202, 0), 0 16px 34px rgba(36, 135, 97, 0.34);
  }
  100% {
    box-shadow: 0 10px 24px rgba(36, 135, 97, 0.28);
  }
}

.ghost-button {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.ghost-button:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.18);
}

.guide-button {
  min-height: 40px;
  padding: 0 14px;
  color: #d8f4df;
  border: 1px solid rgba(189, 244, 202, 0.24);
  background: rgba(189, 244, 202, 0.1);
  font-weight: 750;
}

.guide-button:hover {
  color: white;
  background: rgba(189, 244, 202, 0.18);
}

.text-button {
  padding: 0;
  color: var(--green-700);
  background: transparent;
  font-size: 13px;
}

.text-button:hover {
  color: var(--green-900);
}

.workspace {
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr) 320px;
  gap: 18px;
  padding: 18px;
  min-height: calc(100vh - 72px);
}

.side-panel,
.stage-panel {
  min-width: 0;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-section,
.stage-panel {
  background: rgba(251, 255, 249, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-section {
  padding: 16px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

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

.drop-zone {
  min-height: 138px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(203, 234, 210, 0.66), rgba(255, 247, 230, 0.56)),
    var(--surface-2);
  color: var(--green-900);
  text-align: center;
}

.drop-zone.is-dragging {
  border-color: var(--green-600);
  background: var(--green-100);
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: white;
  color: var(--green-700);
  box-shadow: 0 8px 20px rgba(12, 47, 35, 0.14);
}

svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-zone strong,
.drop-zone small {
  display: block;
}

.drop-zone small {
  color: var(--muted);
  font-size: 12px;
}

.source-preview {
  margin-top: 12px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background-color: var(--surface-2);
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.source-preview.is-empty {
  display: none;
}

.field,
.slider-field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.field span,
.slider-field label,
.switch-row span,
.zoom-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field select {
  min-height: 38px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  outline: none;
}

.field input:focus,
.field select:focus,
.slider-field input:focus,
.zoom-control input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(48, 168, 115, 0.14);
}

.compact-field {
  margin-bottom: 10px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.switch-row {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(215, 230, 217, 0.72);
}

.label-with-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.info-dot,
.tool-info {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--green-600);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.switch-row input {
  appearance: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cfded2;
  position: relative;
  transition: background 160ms ease;
}

.switch-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 6px rgba(20, 37, 29, 0.18);
  transition: transform 160ms ease;
}

.switch-row input:checked {
  background: var(--green-600);
}

.switch-row input:checked::after {
  transform: translateX(18px);
}

.slider-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

input[type="range"] {
  accent-color: var(--green-600);
}

.toggle-list {
  margin: 8px 0 14px;
}

.wide-button {
  width: 100%;
  min-height: 44px;
  font-weight: 700;
}

.wide-button + .wide-button {
  margin-top: 10px;
}

.secondary-action {
  color: var(--green-800);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

.secondary-action:hover {
  color: white;
  background: var(--green-700);
}

.stage-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.stage-toolbar {
  min-height: 62px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 251, 244, 0.92);
}

.tool-group {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.tool-button {
  min-width: 34px;
  min-height: 34px;
  display: inline-grid;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--green-800);
  background: transparent;
  line-height: 1;
}

.tool-button[data-tool] {
  flex: 0 0 auto;
  grid-template-columns: 19px max-content 15px;
  grid-template-rows: 40px;
  min-width: 92px;
  height: 40px;
  padding: 0 8px;
  white-space: nowrap;
}

.tool-button[data-tool] svg,
.tool-button[data-tool] .tool-label,
.tool-button[data-tool] .tool-info {
  grid-row: 1;
  align-self: center;
  justify-self: center;
}

.tool-button[data-tool] svg {
  display: block;
  width: 19px;
  height: 19px;
}

.tool-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  line-height: 1;
}

.tool-info {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  background: rgba(36, 135, 97, 0.88);
  font-size: 10px;
  writing-mode: horizontal-tb;
  line-height: 1;
}

.tip-bubble {
  position: fixed;
  z-index: 60;
  left: var(--tip-x, 0);
  top: var(--tip-y, 0);
  max-width: min(260px, calc(100vw - 28px));
  padding: 8px 10px;
  border-radius: 8px;
  color: white;
  background: var(--green-900);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
}

.tip-bubble.is-hidden {
  display: none;
}

.tool-button:hover,
.tool-button.is-active {
  background: var(--green-100);
  color: var(--green-900);
}

.zoom-control {
  margin-left: auto;
  display: grid;
  grid-template-columns: auto minmax(110px, 180px) 26px;
  align-items: center;
  gap: 10px;
}

.zoom-control output,
.slider-field output {
  color: var(--green-700);
  font-variant-numeric: tabular-nums;
}

.canvas-shell {
  position: relative;
  min-height: 0;
  overflow: auto;
  background:
    linear-gradient(45deg, rgba(218, 234, 218, 0.5) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(218, 234, 218, 0.5) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(218, 234, 218, 0.5) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(218, 234, 218, 0.5) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.canvas-shell canvas {
  display: block;
  margin: 28px auto;
  background: white;
  box-shadow: 0 20px 50px rgba(20, 37, 29, 0.16);
  border-radius: 4px;
}

.canvas-shell.is-empty canvas {
  display: none;
}

.empty-canvas {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--green-900);
  text-align: center;
}

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

.canvas-shell:not(.is-empty) .empty-canvas {
  display: none;
}

.stage-status {
  min-height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  background: rgba(245, 251, 244, 0.92);
}

.palette-section {
  min-height: 330px;
}

.active-color {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  margin-bottom: 12px;
}

.active-color strong,
.active-color small {
  display: block;
}

.active-color small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.active-swatch {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(20, 37, 29, 0.16);
  background: repeating-linear-gradient(45deg, #eef3ef 0 6px, #ffffff 6px 12px);
}

.selection-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--green-100);
  margin-bottom: 12px;
}

.selection-panel.is-disabled {
  background: white;
}

.selection-panel strong,
.selection-panel span {
  display: block;
}

.selection-panel strong {
  font-size: 13px;
}

.selection-panel span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.selection-actions {
  display: flex;
  gap: 6px;
}

.mini-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--green-600);
  border-radius: 7px;
  color: white;
  background: var(--green-600);
  font-size: 12px;
  font-weight: 700;
}

.mini-button.secondary {
  color: var(--green-800);
  border-color: var(--line-strong);
  background: white;
}

.mini-button:hover {
  filter: brightness(0.96);
}

.cell-info-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  margin-bottom: 12px;
}

.cell-info-panel strong,
.cell-info-panel small {
  display: block;
}

.cell-info-panel strong {
  font-size: 13px;
}

.cell-info-panel small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.cell-info-swatch {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(20, 37, 29, 0.16);
  background: repeating-linear-gradient(45deg, #eef3ef 0 6px, #ffffff 6px 12px);
}

.cell-info-panel:not(.is-empty) {
  background: linear-gradient(90deg, #ffffff, var(--green-100));
}

.color-grid {
  max-height: 316px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 7px;
  padding-right: 4px;
}

.color-chip {
  min-height: 46px;
  border: 1px solid rgba(20, 37, 29, 0.11);
  border-radius: 7px;
  display: grid;
  align-content: end;
  padding: 6px;
  text-align: left;
  color: var(--chip-text, #122016);
  background: var(--chip-bg);
  box-shadow: inset 0 -22px 24px rgba(255, 255, 255, 0.24);
  font-size: 11px;
  font-weight: 800;
  text-shadow: var(--chip-shadow, none);
}

.color-chip.is-selected {
  outline: 3px solid rgba(36, 135, 97, 0.32);
  border-color: var(--green-700);
}

.stats-list {
  max-height: 390px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.stat-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.stat-swatch {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(20, 37, 29, 0.14);
  background: var(--swatch);
}

.stat-main {
  min-width: 0;
}

.stat-main strong {
  display: block;
  font-size: 13px;
}

.stat-main span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-count {
  color: var(--green-800);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 285px;
  overflow: auto;
}

.history-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  text-align: left;
}

.history-thumb {
  width: 54px;
  height: 44px;
  border-radius: 6px;
  background-color: var(--green-100);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(20, 37, 29, 0.12);
}

.history-item strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  min-height: 64px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(245, 251, 244, 0.72);
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 20%, rgba(203, 234, 210, 0.9), transparent 32%),
    linear-gradient(145deg, rgba(12, 47, 35, 0.96), rgba(30, 104, 79, 0.94));
  transition: opacity 280ms ease, visibility 280ms ease;
}

.welcome-overlay.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.celebration-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.welcome-card {
  position: relative;
  width: min(430px, 100%);
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(251, 255, 249, 0.96);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.welcome-mark {
  width: 132px;
  height: 34px;
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.welcome-mark span {
  border-radius: 999px;
  background: var(--green-600);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.3), 0 8px 18px rgba(12, 47, 35, 0.18);
}

.welcome-mark span:nth-child(2) {
  background: #f5db73;
}

.welcome-mark span:nth-child(3) {
  background: #74c5ef;
}

.welcome-mark span:nth-child(4) {
  background: #ec7f7f;
}

.welcome-mark span:nth-child(5) {
  background: #ac7bde;
}

.welcome-card p {
  margin: 0 0 8px;
  color: var(--green-700);
  font-size: 13px;
  font-weight: 800;
}

.welcome-card h1 {
  margin: 0 0 24px;
  color: var(--green-900);
  font-size: 28px;
  line-height: 1.18;
}

.welcome-field {
  display: grid;
  gap: 8px;
  text-align: left;
}

.welcome-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.welcome-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  color: var(--green-900);
  background: white;
}

.welcome-field input:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 4px rgba(48, 168, 115, 0.15);
}

.welcome-button {
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--green-600);
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(36, 135, 97, 0.24);
}

.welcome-button:hover {
  background: var(--green-700);
}

.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 28;
  background: rgba(12, 47, 35, 0.42);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.guide-overlay.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.guide-spotlight {
  position: fixed;
  left: var(--guide-x, 22px);
  top: var(--guide-y, 82px);
  width: var(--guide-w, 240px);
  height: var(--guide-h, 120px);
  border: 3px solid #bdf4ca;
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px rgba(12, 47, 35, 0.44),
    0 0 0 8px rgba(189, 244, 202, 0.18),
    0 18px 44px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  transition: left 220ms ease, top 220ms ease, width 220ms ease, height 220ms ease;
}

.guide-coach {
  position: fixed;
  left: var(--coach-x, 24px);
  top: var(--coach-y, 120px);
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  transition: left 220ms ease, top 220ms ease;
}

.guide-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-800);
  background: white;
}

.guide-close:hover {
  background: var(--green-100);
}

.guide-kicker {
  margin: 0 0 8px;
  color: var(--green-700);
  font-size: 13px;
  font-weight: 850;
}

.guide-coach h2 {
  margin: 0 42px 10px 0;
  color: var(--green-900);
  font-size: 21px;
  line-height: 1.2;
}

.guide-body {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.guide-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.guide-nav {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--green-600);
  font-weight: 800;
}

.guide-nav:hover {
  background: var(--green-700);
}

.guide-nav.secondary {
  color: var(--green-800);
  border: 1px solid var(--line-strong);
  background: white;
}

.guide-nav.secondary:hover {
  background: var(--green-100);
}

.guide-nav:disabled {
  color: var(--muted);
  background: #edf4ee;
  border: 1px solid var(--line);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 288px minmax(0, 1fr);
  }

  .right-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .topbar {
    height: auto;
    min-height: 72px;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions button {
    flex: 1;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .right-panel {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .stage-panel {
    min-height: 70vh;
  }

  .brand strong {
    max-width: 72vw;
  }

  .stage-toolbar {
    flex-wrap: nowrap;
  }

  .zoom-control {
    flex: 0 0 220px;
    margin-left: 0;
    grid-template-columns: auto minmax(120px, 1fr) 26px;
  }
}
