﻿/* SHAX Games - Colouring page styles */
:root {
  --background: #f8fafc;
  --foreground: #2C3E50;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --primary: #0D3B66;
  --primary-foreground: #fff;
  --border: #e2e8f0;
  --radius: 8px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-2xl: 16px;
  --ring: #0D3B66;
}

.btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  user-select: none;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover { opacity: 0.9; }
.btn-outline {
  background: var(--background);
  color: var(--foreground);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--muted); }
.btn-sm {
  height: 1.75rem;
  gap: 0.25rem;
  padding: 0 0.625rem;
  font-size: 0.8rem;
}
.btn-icon { flex-shrink: 0; }

.shax-coloring-wrap {
  padding: 0.75rem;
  min-height: 100vh;
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
}

.shax-coloring-page,
.shax-coloring-page.try-coloring-page {
  width: 100%;
  max-width: min(88rem, calc(100vw - 1.5rem)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 !important;
  flex: none !important;
  box-sizing: border-box;
}

.shax-coloring-app {
  width: 100%;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  overflow: clip;
  box-sizing: border-box;
}

/* ── App header ── */
.shax-app-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, #0D3B66 0%, #1a5278 100%);
  color: #fff;
  flex-wrap: wrap;
}

.shax-app-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}
.shax-app-brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}
.shax-app-tagline {
  margin: 0;
  font-size: 0.72rem;
  opacity: 0.85;
  line-height: 1.2;
}
.shax-app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 127, 0, 0.9);
  color: #fff;
  flex-shrink: 0;
}

.shax-page-picker {
  display: flex;
  gap: 0.35rem;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
}
.shax-page-picker::-webkit-scrollbar { display: none; }

.shax-page-picker [data-coloring-page] {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem 0.3rem 0.3rem;
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.shax-page-picker [data-coloring-page] img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}
.shax-page-picker [data-coloring-page].is-active {
  border-color: #FF7F00;
  background: rgba(255, 255, 255, 0.22);
}
.shax-page-picker [data-coloring-page]:hover {
  background: rgba(255, 255, 255, 0.18);
}

.shax-upload-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.shax-upload-toggle:hover,
.shax-upload-toggle.is-active {
  background: rgba(255, 127, 0, 0.25);
  border-color: #FF7F00;
}

.shax-upload-panel {
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.shax-upload-panel[hidden] { display: none; }

[data-coloring-upload] { margin: 0; }
.shax-upload-intro {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  color: #64748b;
}
[data-upload-drop] {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  font-size: 0.85rem;
  color: #0D3B66;
  transition: border-color 0.2s, background 0.2s;
}
[data-upload-drop]:hover,
[data-upload-drop].is-dragover {
  border-color: #0D3B66;
  background: #fff;
}
[data-upload-error] { color: #C62828; font-size: 0.8rem; margin-top: 0.4rem; }
[data-upload-filename] { color: #558B2F; font-size: 0.8rem; margin-top: 0.4rem; font-weight: 500; }
[data-upload-input] { display: none; }

/* ── Workspace inside app card ── */
.shax-coloring-app .coloring-workspace {
  background: #fff;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.shax-coloring-app .coloring-stage {
  min-height: min(55vh, 480px);
}
.shax-coloring-app .coloring-top-bar {
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 0.75rem;
  gap: 0.5rem;
  flex-wrap: nowrap !important;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.shax-coloring-app .coloring-top-bar-main {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  overflow: hidden;
}
.shax-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.shax-shortcuts-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.3;
}
.shax-shortcuts-bar li {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
}
.shax-shortcuts-bar kbd {
  display: inline-flex;
  min-width: 1.15rem;
  justify-content: center;
  padding: 0.1rem 0.3rem;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f8fafc;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.2;
}
.shax-shortcut-sep {
  opacity: 0.5;
  margin: 0 0.05rem;
}
.shax-coloring-app .coloring-dock-tab[data-dock-tab="more"] {
  display: none;
}
.shax-coloring-app .coloring-top-actions {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  width: auto;
  max-width: 100%;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.35rem;
}
.shax-coloring-app .coloring-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.shax-coloring-app .coloring-btn-clear--desktop {
  flex-shrink: 0;
}
.shax-coloring-app .coloring-workspace.did-fill .coloring-canvas-stage {
  animation: none !important;
  transform: none !important;
}
.shax-coloring-app .coloring-canvas-stage {
  transform: none;
}
.shax-coloring-app .coloring-viewport,
.shax-coloring-app .coloring-viewport-inner {
  transition: none;
}
.shax-coloring-page .coloring-hint {
  display: none !important;
}

/* ── ReColour footer banner ── */
.shax-recolour-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: linear-gradient(90deg, #f0f7ee 0%, #fff8f0 100%);
  border-top: 1px solid #e2e8f0;
  font-size: 0.78rem;
  color: #475569;
  text-align: center;
  flex-wrap: wrap;
}
.shax-recolour-banner a {
  color: #0D3B66;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.shax-recolour-banner a:hover { color: #FF7F00; }
.shax-recolour-icon { font-size: 0.9rem; }

#fabBtn.fab {
  bottom: auto;
  top: 12px;
  right: 12px;
  z-index: 200;
  width: 48px;
  height: 48px;
  font-size: 22px;
}
body.coloring-focus-mode #fabBtn { opacity: 0.85; }

/* ── Mobile viewport full-screen modal ── */
.shax-fullscreen-toolbar-btn {
  display: none;
  flex-shrink: 0;
}

.shax-viewport-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background: #fff;
  overflow: hidden;
  touch-action: manipulation;
}
.shax-viewport-modal[hidden] {
  display: none !important;
}

.shax-viewport-modal-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: calc(0.45rem + env(safe-area-inset-top, 0px)) calc(0.65rem + env(safe-area-inset-right, 0px)) 0.45rem calc(0.65rem + env(safe-area-inset-left, 0px));
  background: linear-gradient(135deg, #0D3B66 0%, #1a5278 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.shax-fullscreen-exit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.shax-fullscreen-exit:active {
  transform: scale(0.97);
}

.shax-viewport-modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.shax-viewport-fullscreen {
  overflow: hidden;
  overscroll-behavior: none;
}
body.shax-viewport-fullscreen #fabBtn {
  display: none;
}
body.shax-viewport-fullscreen .coloring-modal {
  z-index: 950;
}

.shax-viewport-modal .coloring-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.shax-viewport-modal .coloring-canvas-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0.25rem;
  border: none;
  border-radius: 0;
  background: #fff;
}
.shax-viewport-modal .coloring-viewport {
  flex: 1;
  min-height: 0;
  max-height: none;
  width: 100%;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shax-viewport-modal .coloring-viewport-inner {
  width: 100%;
  height: 100%;
  min-height: 100%;
  align-items: center;
  justify-content: center;
}
.shax-viewport-modal .coloring-canvas {
  max-width: 100%;
  max-height: 100%;
}
.shax-viewport-modal .coloring-dock {
  flex-shrink: 0;
  position: static;
  margin-top: 0;
  max-height: min(42vh, 16rem);
  overflow-y: auto;
  border-top: 1px solid oklch(0.9 0.02 95 / 0.85);
  padding-bottom: calc(0.625rem + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 767px) {
  .shax-fullscreen-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
  }
  .shax-fullscreen-toolbar-btn .coloring-btn-label {
    display: inline !important;
  }
  body.shax-viewport-fullscreen .shax-fullscreen-toolbar-btn {
    visibility: hidden;
    pointer-events: none;
  }
}

@media (max-width: 640px) {
  .shax-coloring-wrap { padding: 0.5rem; }
  .shax-app-header { padding: 0.55rem 0.75rem; gap: 0.5rem; }
  .shax-app-brand h1 { font-size: 0.95rem; }
  .shax-upload-toggle-label { display: none; }
  .shax-page-picker { order: 3; width: 100%; }
  .shax-shortcuts-bar { display: none; }
  .shax-coloring-app .coloring-top-bar {
    flex-wrap: wrap !important;
    justify-content: flex-end;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .shax-shortcuts-bar {
    font-size: 0.68rem;
    gap: 0.15rem 0.4rem;
  }
  .shax-shortcuts-bar li:nth-child(n+5) {
    display: none;
  }
}

/* Override Colour Book full-bleed desktop rules that left-align the page */
@media (min-width: 1024px) {
  .shax-coloring-wrap .shax-coloring-page.try-coloring-page:has(.coloring-workspace) {
    display: block !important;
    max-width: min(88rem, calc(100vw - 1.5rem)) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    flex: none !important;
  }

  .shax-coloring-app .coloring-workspace {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    grid-template-columns: min(13rem, 22vw) minmax(0, 1fr);
  }

  .shax-coloring-app .coloring-top-bar {
    flex-wrap: nowrap !important;
  }

  .shax-coloring-app .coloring-stage {
    min-height: min(60vh, 560px);
    min-width: 0;
    overflow: hidden;
  }

  .shax-coloring-app .coloring-canvas-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .shax-coloring-app .coloring-canvas-overlays {
    right: 0.5rem;
    top: 0.5rem;
  }
}

@media (min-width: 1024px) and (max-width: 1280px) {
  .shax-coloring-app .coloring-btn-label {
    display: none;
  }

  .shax-coloring-app .coloring-actions .btn {
    min-width: 2.25rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .shax-coloring-app .coloring-workspace {
    grid-template-columns: min(11.5rem, 20vw) minmax(0, 1fr);
  }
}
.try-coloring-page {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
}

@media (min-width: 768px) {
  .try-coloring-page {
    max-width: 56rem;
    padding: 2.5rem 1.5rem 3rem;
  }
}

@media (min-width: 1024px) {
  .try-coloring-page {
    max-width: min(80rem, 96vw);
    padding: 1.75rem 1.5rem 2.5rem;
  }

  .try-coloring-page .page-hero {
    margin-bottom: 1.25rem;
  }

  .try-coloring-page .page-hero h1 {
    font-size: clamp(1.625rem, 2.5vw, 2rem);
  }

  .try-coloring-page .page-hero-desc {
    margin-top: 0.5rem;
    font-size: 1rem;
  }

  .try-coloring-cta {
    margin-top: 2rem;
  }
}

@media (min-width: 640px) and (max-width: 767px) {
  .try-coloring-page {
    padding: 2.75rem 1.5rem 3.5rem;
  }
}

.try-coloring-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
}

.try-coloring-empty-title {
  margin: 0;
  font-family: var(--font-heading), var(--font-sans), sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
}

.try-coloring-empty-text {
  margin: 0;
  max-width: 28rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.try-coloring-picker {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  margin: 0 0 1.25rem;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.try-coloring-picker-item {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-items: center;
  gap: 0.375rem;
  width: 5.5rem;
  padding: 0.5rem;
  border: 1px solid oklch(0.9 0.02 95 / 0.8);
  border-radius: 0.875rem;
  background: oklch(1 0 0 / 0.75);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.try-coloring-picker-item img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 0.5rem;
  background: #fff;
}

.try-coloring-picker-item.is-active {
  border-color: oklch(0.62 0.16 35 / 0.45);
  box-shadow: 0 0 0 2px oklch(0.62 0.16 35 / 0.15);
  color: var(--foreground);
}

/* Mobile: compact hero */
@media (max-width: 767px) {
  .try-coloring-page .page-hero {
    margin-bottom: 0.75rem;
  }

  .try-coloring-page .page-hero h1 {
    font-size: 1.375rem;
  }

  .try-coloring-page .page-hero-desc {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .try-coloring-page .page-hero-badge {
    font-size: 0.6875rem;
  }
}

.coloring-workspace {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.75rem;
}

@media (min-width: 640px) {
  .coloring-workspace {
    padding: 1.25rem 1.5rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .coloring-workspace {
    padding: 0.875rem 1rem 1rem;
  }
}

.coloring-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.coloring-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.625rem;
}

.coloring-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.coloring-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid oklch(0.9 0.02 95);
  border-radius: 0.625rem;
  background: #fff;
  color: var(--muted-foreground);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.coloring-icon-btn[aria-pressed="true"] {
  border-color: oklch(0.62 0.16 35 / 0.35);
  background: oklch(0.62 0.16 35 / 0.1);
  color: var(--foreground);
}

.coloring-page-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.coloring-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.coloring-share-wrap {
  position: relative;
}

.coloring-share-menu {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  z-index: 40;
  width: min(17.5rem, calc(100vw - 1.5rem));
  padding: 0.625rem;
  border: 1px solid oklch(0.9 0.02 95 / 0.9);
  border-radius: 0.875rem;
  background: oklch(0.995 0.004 95);
  box-shadow:
    0 10px 28px oklch(0.2 0.02 45 / 0.12),
    0 2px 8px oklch(0.2 0.02 45 / 0.06);
}

.coloring-share-menu[hidden] {
  display: none !important;
}

.coloring-share-menu-heading {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.coloring-share-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.375rem;
}

.coloring-share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3125rem;
  min-width: 0;
  padding: 0.375rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  background: transparent;
  font: inherit;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.coloring-share-btn:hover {
  background: oklch(0.96 0.015 95);
}

.coloring-share-btn:focus-visible {
  outline: 2px solid oklch(0.62 0.16 35 / 0.55);
  outline-offset: 2px;
}

.coloring-share-btn[hidden] {
  display: none !important;
}

.coloring-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 9999px;
  color: #fff;
}

.coloring-share-icon--native {
  background: oklch(0.55 0.12 250);
}

.coloring-share-icon--facebook {
  background: #1877f2;
}

.coloring-share-icon--x {
  background: #0f1419;
}

.coloring-share-icon--whatsapp {
  background: #25d366;
}

.coloring-share-icon--pinterest {
  background: #e60023;
}

.coloring-share-icon--email {
  background: oklch(0.52 0.04 250);
}

.coloring-share-icon--link {
  background: oklch(0.62 0.16 35);
}

.coloring-share-icon--image {
  background: oklch(0.48 0.12 300);
}

.coloring-stage {
  flex: 1;
  min-height: 0;
}

.coloring-dock {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 0.625rem;
}

.coloring-dock-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.coloring-recent {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.125rem;
  -webkit-overflow-scrolling: touch;
}

.coloring-recent[hidden] {
  display: none !important;
}

.coloring-recent::before {
  content: 'Recent';
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}

.coloring-palette-strip {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.125rem;
}

.coloring-palette {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

@media (min-width: 768px) {
  .coloring-palette {
    display: flex;
    flex-direction: column;
  }
}

.coloring-tool-group {
  display: inline-flex;
  padding: 0.25rem;
  border: 1px solid oklch(0.9 0.02 95 / 0.85);
  border-radius: 0.75rem;
  background: oklch(0.99 0.005 95);
  gap: 0.125rem;
}

.coloring-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.4375rem 0.625rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.coloring-tool-btn:hover {
  background: oklch(0.96 0.015 95);
  color: var(--foreground);
}

.coloring-tool-btn.is-active {
  border-color: oklch(0.62 0.16 35 / 0.3);
  background: oklch(0.62 0.16 35 / 0.1);
  color: var(--foreground);
}

.coloring-tool-btn.is-return-tool {
  border-color: oklch(0.62 0.16 35 / 0.22);
  box-shadow: inset 0 0 0 1px oklch(0.62 0.16 35 / 0.12);
  color: var(--foreground);
}

.coloring-tool-btn[data-tool="move"].is-active {
  border-color: oklch(0.55 0.12 250 / 0.35);
  background: oklch(0.55 0.12 250 / 0.12);
}

.coloring-tool-btn:focus-visible,
.coloring-zoom-btn:focus-visible,
.coloring-size-btn:focus-visible,
.coloring-swatch:focus-visible,
.coloring-rgb-channel input[type="range"]:focus-visible,
.coloring-rgb-preview:focus-visible,
.coloring-icon-btn:focus-visible {
  outline: 2px solid oklch(0.62 0.16 35 / 0.55);
  outline-offset: 2px;
}

.coloring-tool-label {
  display: none;
}

@media (min-width: 768px) {
  .coloring-tool-label {
    display: inline;
  }

  .coloring-tool-btn {
    min-width: auto;
    padding: 0.4375rem 0.75rem;
  }
}

.coloring-brush-sizes {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.coloring-brush-sizes[hidden] {
  display: none !important;
}

.coloring-brush-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

.coloring-size-btn {
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.5rem;
  border: 1px solid oklch(0.9 0.02 95);
  border-radius: 0.5rem;
  background: #fff;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted-foreground);
  cursor: pointer;
}

.coloring-size-btn.is-active {
  border-color: oklch(0.62 0.16 35 / 0.35);
  background: oklch(0.62 0.16 35 / 0.1);
  color: var(--foreground);
}

.coloring-zoom {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  padding: 0.25rem;
  border: 1px solid oklch(0.9 0.02 95 / 0.85);
  border-radius: 0.75rem;
  background: oklch(0.99 0.005 95);
}

.coloring-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
}

.coloring-zoom-btn:hover {
  background: oklch(0.96 0.015 95);
  color: var(--foreground);
}

.coloring-zoom-label {
  min-width: 3rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.coloring-zoom-reset {
  padding: 0 0.625rem;
}

.coloring-viewport {
  position: relative;
  width: 100%;
  min-height: 12rem;
  max-height: min(78vh, 900px);
  overflow: hidden;
  border-radius: 0.625rem;
  background: oklch(0.96 0.01 95);
  touch-action: none;
  outline: none;
}

@media (min-width: 768px) {
  .coloring-canvas-wrap {
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
  }

  .coloring-viewport {
    width: min(var(--coloring-frame-w, 100%), 100%);
    height: var(--coloring-frame-h, auto);
    min-height: 0;
    max-height: none;
    margin-inline: auto;
  }

  .coloring-viewport-inner {
    min-height: 0;
    width: 100%;
    height: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
  }

  .coloring-canvas {
    width: auto !important;
    max-width: 100%;
    height: auto !important;
  }
}

.coloring-viewport.tool-fill,
.coloring-viewport.tool-eraser {
  cursor: crosshair;
}

.coloring-viewport.tool-brush,
.coloring-viewport.tool-blend {
  cursor: crosshair;
}

.coloring-viewport.tool-move {
  cursor: grab;
}

.coloring-viewport.tool-move:active {
  cursor: grabbing;
}

.coloring-viewport-inner {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  min-height: 100%;
  padding: 0.5rem;
  transform-origin: center center;
  will-change: transform;
}

.coloring-canvas-stage {
  position: relative;
  flex-shrink: 0;
}

.coloring-swatch,
.coloring-swatch-recent {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 2px solid oklch(0.9 0.02 95);
  border-radius: 9999px;
  background: var(--swatch-color);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px oklch(0.2 0.02 45 / 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.coloring-swatch:hover {
  transform: scale(1.06);
}

.coloring-swatch.is-active {
  box-shadow:
    inset 0 0 0 1px oklch(0.2 0.02 45 / 0.12),
    0 0 0 3px oklch(0.62 0.16 35 / 0.25);
  transform: scale(1.08);
}

.coloring-rgb-picker {
  padding: 0.5rem;
  border: 1px solid oklch(0.9 0.02 95 / 0.85);
  border-radius: 0.75rem;
  background: oklch(0.995 0.004 95);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.coloring-rgb-picker.is-active {
  border-color: oklch(0.62 0.16 35 / 0.35);
  box-shadow: inset 0 0 0 1px oklch(0.62 0.16 35 / 0.12);
}

.coloring-rgb-preview-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.coloring-rgb-preview {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid oklch(0.9 0.02 95);
  border-radius: 9999px;
  background: #ff1744;
  box-shadow: inset 0 0 0 1px oklch(0.2 0.02 45 / 0.08);
  cursor: pointer;
}

.coloring-rgb-hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--foreground);
}

.coloring-rgb-sliders {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.coloring-rgb-channel {
  display: grid;
  grid-template-columns: 1.125rem 1fr 2.25rem;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted-foreground);
}

.coloring-rgb-label {
  text-align: center;
}

.coloring-rgb-value {
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: right;
  color: var(--foreground);
}

.coloring-rgb-channel input[type="range"] {
  width: 100%;
  height: 0.375rem;
  margin: 0;
  border-radius: 9999px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: oklch(0.92 0.02 95);
}

.coloring-rgb-channel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid oklch(1 0 0);
  border-radius: 9999px;
  box-shadow: 0 1px 3px oklch(0.2 0.02 45 / 0.2);
  cursor: pointer;
}

.coloring-rgb-channel input[type="range"]::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border: 2px solid oklch(1 0 0);
  border-radius: 9999px;
  box-shadow: 0 1px 3px oklch(0.2 0.02 45 / 0.2);
  cursor: pointer;
}

.coloring-rgb-channel[data-channel="r"] input[type="range"] {
  accent-color: #ff1744;
  background: linear-gradient(to right, #000, #f00);
}

.coloring-rgb-channel[data-channel="g"] input[type="range"] {
  accent-color: #00e676;
  background: linear-gradient(to right, #000, #0f0);
}

.coloring-rgb-channel[data-channel="b"] input[type="range"] {
  accent-color: #2962ff;
  background: linear-gradient(to right, #000, #00f);
}

.coloring-canvas-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 1rem;
  background: oklch(0.98 0.01 95);
  border: 1px solid oklch(0.9 0.02 95 / 0.8);
  position: relative;
}

@media (min-width: 1024px) {
  .coloring-canvas-wrap {
    padding: 0.375rem;
  }
}

.coloring-workspace.is-loading .coloring-canvas {
  opacity: 0.35;
}

.coloring-workspace.did-fill .coloring-canvas-stage {
  animation: coloring-fill-flash 0.18s ease;
}

@keyframes coloring-fill-flash {
  0% { transform: scale(1); }
  50% { transform: scale(1.008); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .coloring-workspace.did-fill .coloring-canvas-stage {
    animation: none;
  }

  .coloring-loading-spinner {
    animation: none;
  }
}

.coloring-loading,
.coloring-filling {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  border-radius: 0.5rem;
  background: oklch(1 0 0 / 0.72);
}

.coloring-loading[hidden],
.coloring-filling[hidden] {
  display: none !important;
}

.coloring-filling {
  background: oklch(1 0 0 / 0.45);
  pointer-events: none;
}

.coloring-loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid oklch(0.9 0.02 95);
  border-top-color: var(--primary);
  border-radius: 9999px;
  animation: coloring-spin 0.75s linear infinite;
}

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

.coloring-loading-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.coloring-pack-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.875rem;
  border: 1px dashed oklch(0.62 0.16 35 / 0.25);
  background: oklch(0.99 0.02 85 / 0.65);
}

.coloring-pack-cta[hidden] {
  display: none !important;
}

.coloring-pack-cta p {
  margin: 0;
  flex: 1;
  min-width: 12rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.coloring-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 2px 12px oklch(0.2 0.02 45 / 0.08);
  touch-action: none;
  cursor: crosshair;
}

@media (min-width: 1024px) {
  .coloring-canvas {
    box-shadow: 0 4px 24px oklch(0.2 0.02 45 / 0.08);
  }
}

.coloring-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted-foreground);
  text-align: center;
}

.try-coloring-cta {
  margin-top: 2.5rem;
}

.try-coloring-cta .cta-band {
  padding: 2rem 1.5rem;
  border-radius: 1.5rem;
  border: 1px solid oklch(0.9 0.02 95 / 0.6);
  background: linear-gradient(135deg, oklch(0.99 0.02 85), oklch(1 0 0 / 0.92));
  text-align: center;
}

.try-coloring-cta .cta-band h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading), var(--font-sans), sans-serif;
  font-size: 1.375rem;
  font-weight: 600;
}

.try-coloring-cta .cta-band p {
  margin: 0 0 1.25rem;
  color: var(--muted-foreground);
}

/* Mobile dock â sticky bottom toolbar */
@media (max-width: 767px) {
  .try-coloring-page {
    padding-bottom: 0.5rem;
  }

  .coloring-workspace {
    padding: 0.625rem 0.625rem 0;
  }

  .coloring-viewport {
    max-height: none;
    min-height: 10rem;
  }

  .coloring-dock {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin-top: 0.5rem;
    padding: 0.625rem 0.625rem calc(0.625rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid oklch(0.9 0.02 95 / 0.85);
    background: oklch(0.99 0.005 95 / 0.96);
    backdrop-filter: blur(8px);
  }

  .coloring-dock-row {
    flex-direction: column;
    align-items: stretch;
  }

  .coloring-tool-group {
    justify-content: space-between;
    width: 100%;
  }

  .coloring-tool-btn {
    flex: 1;
  }

  .coloring-zoom {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .coloring-btn-label {
    display: none;
  }

  .coloring-actions .btn {
    min-width: 2.75rem;
    padding-left: 0.625rem;
    padding-right: 0.625rem;
  }

  .coloring-top-bar {
    margin-bottom: 0.375rem;
  }
}

@media (min-width: 768px) {
  .coloring-btn-label {
    display: inline;
  }
}

/* Focus mode â immersive colouring */
body.coloring-focus-mode {
  overflow: hidden;
}

body.coloring-focus-mode .storefront-content > header,
body.coloring-focus-mode .storefront-content > footer,
body.coloring-focus-mode .try-coloring-page .page-hero,
body.coloring-focus-mode .try-coloring-cta,
body.coloring-focus-mode .try-coloring-picker,
body.coloring-focus-mode .coloring-pack-cta,
body.coloring-focus-mode .storefront-page .storefront-content::before {
  display: none !important;
}

body.coloring-focus-mode .try-coloring-page {
  max-width: none;
  padding: 0;
  margin: 0;
}

body.coloring-focus-mode .try-coloring-main {
  padding: 0 !important;
}

body.coloring-focus-mode .coloring-workspace {
  min-height: 100dvh;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

body.coloring-focus-mode .coloring-viewport {
  max-height: none;
  flex: 1;
  border-radius: 0.375rem;
}

body.coloring-focus-mode .coloring-stage {
  display: flex;
  flex-direction: column;
  flex: 1;
}

body.coloring-focus-mode .coloring-canvas-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: none;
  background: transparent;
  margin: 0;
  padding: 0.25rem;
}

body.coloring-focus-mode .coloring-hint {
  font-size: 0.6875rem;
  padding: 0 0.5rem;
}

/* ââ Desktop studio layout (1024px+) ââ */
@media (min-width: 1024px) {
  .try-coloring-main {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 4.25rem);
  }

  .try-coloring-page:has(.coloring-workspace) {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0.625rem 1.25rem 0.75rem;
  }

  .try-coloring-page:has(.coloring-workspace) .page-hero,
  .try-coloring-page:has(.coloring-workspace) .try-coloring-cta {
    display: none;
  }

  .try-coloring-page:has(.coloring-workspace) .try-coloring-picker {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
  }

  .try-coloring-page:has(.coloring-workspace) .try-coloring-picker-item {
    width: 4.75rem;
    padding: 0.375rem;
    font-size: 0.625rem;
  }

  .try-coloring-page:has(.coloring-workspace) .try-coloring-picker-item img {
    width: 3.75rem;
    height: 3.75rem;
  }

  body:has(.try-coloring-page .coloring-workspace) .storefront-content > footer {
    display: none;
  }

  .coloring-workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 13.75rem minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "topbar topbar"
      "sidebar stage"
      "pack pack";
    gap: 0.625rem 1rem;
    padding: 0.75rem 1rem;
    overflow: hidden;
  }

  .coloring-top-bar {
    grid-area: topbar;
    flex-wrap: nowrap;
    align-items: center;
    margin-bottom: 0;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid oklch(0.9 0.02 95 / 0.75);
  }

  .coloring-top-bar-main {
    flex: 1;
    min-width: 0;
  }

  .coloring-page-title {
    font-size: 1.0625rem;
  }

  .coloring-hint--inline {
    display: block;
    margin: 0.125rem 0 0;
    font-size: 0.75rem;
    text-align: left;
    color: var(--muted-foreground);
  }

  .coloring-hint--below {
    display: none;
  }

  .coloring-focus-btn {
    display: none;
  }

  .coloring-body {
    display: contents;
  }

  .coloring-dock {
    grid-area: sidebar;
    margin: 0;
    padding: 0.625rem;
    border-radius: 0.875rem;
    border: 1px solid oklch(0.9 0.02 95 / 0.85);
    background: oklch(0.99 0.005 95);
    overflow-y: auto;
    overflow-x: hidden;
    gap: 0.75rem;
  }

  .coloring-dock-section {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
  }

  .coloring-dock-heading {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted-foreground);
  }

  .coloring-tool-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 0.25rem;
  }

  .coloring-tool-btn {
    flex-direction: column;
    min-height: 3rem;
    padding: 0.375rem 0.25rem;
    font-size: 0.6875rem;
    gap: 0.125rem;
  }

  .coloring-tool-label {
    display: inline;
  }

  .coloring-size-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.375rem;
  }

  .coloring-size-btn {
    width: 100%;
  }

  .coloring-zoom {
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }

  .coloring-dock-colours {
    flex: 1;
    min-height: 0;
  }

  .coloring-recent {
    flex-wrap: wrap;
    overflow: visible;
  }

  .coloring-recent::before {
    width: 100%;
    margin-bottom: 0.125rem;
  }

  .coloring-palette-strip {
    overflow: visible;
  }

  .coloring-palette {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .coloring-palette-group-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .coloring-swatch,
  .coloring-swatch-recent {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    box-shadow:
      inset 0 0 0 1px oklch(0.2 0.02 45 / 0.1),
      0 1px 2px oklch(0.2 0.02 45 / 0.06);
  }

  .coloring-stage {
    grid-area: stage;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
  }

  .coloring-canvas-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0.5rem;
    border: none;
    background: transparent;
  }

  .coloring-viewport {
    flex-shrink: 0;
  }

  .coloring-pack-cta {
    grid-area: pack;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .coloring-pack-cta p {
    min-width: 0;
    font-size: 0.75rem;
  }
}

@media (max-width: 1023px) {
  .coloring-hint--inline {
    display: none;
  }
}

/* ââ Coloring enhancements ââ */
.coloring-share-tip {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--muted-foreground);
}

.coloring-share-icon--instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.coloring-overflow-wrap {
  position: relative;
  display: none;
}

.coloring-overflow-menu {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  z-index: 40;
  min-width: 10.5rem;
  padding: 0.375rem;
  border: 1px solid oklch(0.9 0.02 95 / 0.9);
  border-radius: 0.75rem;
  background: oklch(0.995 0.004 95);
  box-shadow: 0 8px 24px oklch(0.2 0.02 45 / 0.12);
}

.coloring-overflow-menu[hidden] {
  display: none !important;
}

.coloring-overflow-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
  text-align: left;
}

.coloring-overflow-item:hover {
  background: oklch(0.96 0.015 95);
}

.coloring-overflow-item[hidden] {
  display: none !important;
}

.coloring-btn-clear--desktop {
  display: none;
}

.coloring-dock-tabs {
  display: none;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 0.625rem;
  background: oklch(0.96 0.012 95);
}

.coloring-dock-tab {
  flex: 1;
  min-height: 2.25rem;
  padding: 0.375rem 0.5rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted-foreground);
  cursor: pointer;
}

.coloring-dock-tab.is-active {
  background: #fff;
  color: var(--foreground);
  box-shadow: 0 1px 3px oklch(0.2 0.02 45 / 0.08);
}

.coloring-dock-panel[hidden] {
  display: none !important;
}

.coloring-palette-group {
  margin-bottom: 0.5rem;
}

.coloring-palette-group-label {
  margin: 0 0 0.3125rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.coloring-palette-group-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.375rem;
}

.coloring-palette-group-grid .coloring-swatch {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.coloring-rgb-details {
  margin-top: 0.5rem;
}

.coloring-rgb-details[open] .coloring-rgb-summary {
  margin-bottom: 0.375rem;
}

.coloring-rgb-summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.coloring-rgb-summary::-webkit-details-marker {
  display: none;
}

.coloring-rgb-details .coloring-rgb-picker {
  margin-top: 0;
}

.coloring-slider-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.coloring-slider-row input[type="range"] {
  width: 100%;
  accent-color: oklch(0.62 0.16 35);
}

.coloring-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
}

.coloring-view-control-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.coloring-before-after-btn[aria-pressed="true"] {
  border-color: oklch(0.62 0.16 35 / 0.35);
  background: oklch(0.62 0.16 35 / 0.1);
}

.coloring-more-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.coloring-shortcuts-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.coloring-shortcuts-list li {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.1875rem 0;
}

.coloring-shortcuts-list kbd {
  display: inline-flex;
  min-width: 1.25rem;
  justify-content: center;
  padding: 0.125rem 0.3125rem;
  border: 1px solid oklch(0.88 0.02 95);
  border-radius: 0.3125rem;
  background: oklch(0.98 0.008 95);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--foreground);
}

.coloring-canvas-overlays {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}

.coloring-color-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.3125rem 0.5625rem 0.3125rem 0.3125rem;
  border: 1px solid oklch(0.9 0.02 95 / 0.9);
  border-radius: 9999px;
  background: oklch(0.995 0.004 95 / 0.94);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px oklch(0.2 0.02 45 / 0.08);
  pointer-events: auto;
  cursor: pointer;
}

.coloring-color-chip-swatch {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 9999px;
  border: 1px solid oklch(0.2 0.02 45 / 0.12);
}

.coloring-color-chip-hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.coloring-progress {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  pointer-events: none;
}

.coloring-progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.coloring-progress-track {
  stroke: oklch(0.92 0.02 95);
}

.coloring-progress-fill {
  stroke: oklch(0.62 0.16 35);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s ease;
}

.coloring-progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 800;
  color: var(--foreground);
}

.coloring-brush-cursor {
  position: absolute;
  margin: -9999px 0 0 -9999px;
  border: 2px solid oklch(0.2 0.02 45 / 0.55);
  border-radius: 9999px;
  pointer-events: none;
  z-index: 4;
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.65);
}

.coloring-viewport.tool-eyedropper {
  cursor: crosshair;
}

.coloring-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.coloring-modal[hidden] {
  display: none !important;
}

.coloring-modal-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.15 0.02 45 / 0.45);
}

.coloring-modal-card {
  position: relative;
  width: min(100%, 22rem);
  padding: 1.125rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 16px 40px oklch(0.2 0.02 45 / 0.18);
}

.coloring-modal-title {
  margin: 0 0 0.375rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.coloring-modal-text {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.coloring-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.coloring-coach {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
}

.coloring-coach[hidden] {
  display: none !important;
}

.coloring-coach-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.15 0.02 45 / 0.35);
}

.coloring-coach-card {
  position: relative;
  width: min(100%, 24rem);
  padding: 1rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 12px 32px oklch(0.2 0.02 45 / 0.16);
}

.coloring-coach-step {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.coloring-coach-dots {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.coloring-coach-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 9999px;
  background: oklch(0.88 0.02 95);
}

.coloring-coach-dot.is-active {
  background: oklch(0.62 0.16 35);
}

.coloring-coach-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

@media (max-width: 767px) {
  .coloring-overflow-wrap {
    display: block;
  }

  .coloring-btn-undo,
  .coloring-btn-redo,
  .coloring-btn-clear--desktop,
  .coloring-focus-btn {
    display: none;
  }

  .coloring-dock-tabs {
    display: flex;
  }

  .coloring-dock > .coloring-dock-section:not(.coloring-dock-panel *) {
    display: none;
  }

  .coloring-dock {
    max-height: min(52vh, 28rem);
    overflow-y: auto;
  }

  .coloring-palette {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .coloring-palette-group-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 768px) {
  .coloring-btn-clear--desktop {
    display: inline-flex;
  }

  .coloring-shortcuts-hint {
    display: block;
  }
}

@media (min-width: 1024px) {
  .coloring-tool-group {
    grid-template-columns: repeat(3, 1fr);
  }

  .coloring-dock-tabs {
    display: none;
  }

  .coloring-dock-panel {
    display: contents;
  }

  .coloring-dock-panel[hidden] {
    display: contents !important;
  }

  .coloring-dock-colours,
  .coloring-rgb-details,
  .coloring-shortcuts-hint,
  .coloring-more-actions {
    /* panels visible in sidebar flow on desktop via dock structure */
  }
}

@media (prefers-reduced-motion: reduce) {
  .coloring-progress-fill {
    transition: none;
  }

  .coloring-viewport-inner {
    transition: none !important;
  }
}

.coloring-viewport-inner {
  transition: transform 0.12s ease;
}


