:root {
  --md-sys-color-primary: #6750a4;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #eaddff;
  --md-sys-color-on-primary-container: #21005d;
  --md-sys-color-secondary: #625b71;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #e8def8;
  --md-sys-color-on-secondary-container: #1d192b;
  --md-sys-color-tertiary: #7d5260;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #ffd8e4;
  --md-sys-color-surface: #fef7ff;
  --md-sys-color-surface-container: #f3edf7;
  --md-sys-color-surface-container-high: #ece6f0;
  --md-sys-color-surface-container-highest: #e6e0e9;
  --md-sys-color-on-surface: #1d1b20;
  --md-sys-color-on-surface-variant: #49454f;
  --md-sys-color-outline: #79747e;
  --md-sys-color-outline-variant: #cac4d0;
  --md-sys-color-shadow: rgba(29, 27, 32, 0.16);
  --toolbar-width: 80px;
  --toolbar-gap: 10px;
  --page-padding: 12px;
  --header-height: 72px;
  --motion-standard: 180ms cubic-bezier(0.2, 0, 0, 1);
}

html,
body {
  background: linear-gradient(180deg, #f8f3ff 0%, #efe7f5 100%);
  color: var(--md-sys-color-on-surface);
}

body#pathprintEdition {
  padding-top: calc(var(--header-height) + 8px);
  overflow-x: hidden;
}

.close-header-mobile {
  height: var(--header-height);
  padding: 0 16px 0 calc(var(--toolbar-width) + 32px);
  background: rgba(236, 230, 240, 0.94);
  background-image: none;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(29, 27, 32, 0.08);
}

.branding-h1-50-pathprint {
  text-align: left;
  font-size: 1.4rem;
  letter-spacing: 0.01em;
  color: var(--md-sys-color-on-surface);
}

.pathprint-highlight {
  background: transparent;
  color: var(--md-sys-color-primary);
  padding: 0;
  font-weight: bold;
}

.workshops-text {
  background: transparent;
  color: var(--md-sys-color-secondary);
  font-family: cursive, sans-serif;
  text-transform: uppercase;
  font-weight: bold;
}

.pathprint-edition {
  margin-right: 0;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-radius: 999px;
  letter-spacing: 0.12em;
  padding: 0.12rem 0.5rem;
}

.language-switch select {
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
}

#toolbar-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: 0 8px 16px rgba(103, 80, 164, 0.28);
  transition: transform var(--motion-standard), box-shadow var(--motion-standard), background var(--motion-standard);
}

#toolbar-toggle:active,
#toolbar-toggle.is-pressed {
  transform: scale(0.96);
  box-shadow: 0 4px 10px rgba(103, 80, 164, 0.22);
}

#side-toolbar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--toolbar-width);
  padding: 12px 0 16px;
  background: var(--md-sys-color-surface-container);
  border-right: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: 8px 0 24px rgba(29, 27, 32, 0.08);
  overflow-y: auto;
  z-index: 950;
  transition: transform var(--motion-standard);
}

body.toolbar-collapsed #side-toolbar {
  transform: translateX(calc(-1 * var(--toolbar-width)));
}

.toolbar-section {
  padding: 0 0 14px;
}

.toolbar-section + .toolbar-section {
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding-top: 14px;
}

.toolbar-section h2 {
  margin: 0 0 10px;
  padding: 0 8px;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
}

.toolbar-section__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 0 10px;
  padding: 0 8px;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
}

.toolbar-section__title .material-symbols-rounded {
  font-size: 16px;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
}

.toolbar-grid,
.toolbar-stack {
  display: grid;
  justify-items: center;
  gap: var(--toolbar-gap);
}

.toolbar-grid {
  grid-template-columns: 1fr;
}

.toolbar-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  box-shadow: inset 0 0 0 1px var(--md-sys-color-outline-variant);
  transition: transform var(--motion-standard), background var(--motion-standard), box-shadow var(--motion-standard), color var(--motion-standard);
  font: inherit;
  font-size: 0.7rem;
  line-height: 1;
}

.toolbar-button .material-symbols-rounded {
  font-size: 22px;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.toolbar-button:hover,
.toolbar-button:focus-visible {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  box-shadow: inset 0 0 0 1px transparent, 0 0 0 3px rgba(103, 80, 164, 0.14);
  outline: none;
}

.toolbar-button:active,
.toolbar-button.is-pressed {
  transform: scale(0.95);
}

.toolbar-button.is-active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: inset 0 0 0 1px rgba(33, 0, 93, 0.08);
}

.toolbar-button--swatch {
  font-weight: 600;
}

.md-icon-button {
  width: 48px;
  height: 48px;
}

.pathprint-main {
  margin-left: var(--toolbar-width);
  width: calc(100vw - var(--toolbar-width));
  padding: var(--page-padding);
  transition: margin-left var(--motion-standard), width var(--motion-standard);
  box-sizing: border-box;
}

body.toolbar-collapsed .pathprint-main {
  margin-left: 0;
  width: 100vw;
}

.canvas-shell {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
}

.canvas-stage {
  width: min(841px, calc(100vw - var(--toolbar-width) - (var(--page-padding) * 2)));
  max-width: 100%;
  margin: 0 auto;
}

#mainCanvas.pathpaint-canvas-container {
  width: 100%;
  border-radius: 0;
  background-color: transparent;
  background-repeat: repeat;
  background-image: none;
  box-shadow: 0 16px 36px var(--md-sys-color-shadow);
}

body.toolbar-collapsed .canvas-stage {
  width: min(841px, calc(100vw - (var(--page-padding) * 2)));
}

#mainCanvas.pathpaint-canvas-container canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  background-color: transparent;
  border: 5px groove #00FF00;
  animation: canvas-border-cycle 12s linear infinite;
}

@keyframes canvas-border-cycle {
  0% {
    border-color: #00FF00;
  }
  25% {
    border-color: #FF00CC;
  }
  50% {
    border-color: #00FFFF;
  }
  75% {
    border-color: #FFFF00;
  }
  100% {
    border-color: #00FF00;
  }
}

.canvas-guides {
  position: absolute;
  inset: 0;
  border-radius: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion-standard);
}

.canvas-guides.is-visible {
  opacity: 1;
}

.canvas-guides__svg {
  width: 100%;
  height: 100%;
  display: block;
}

.save-feedback {
  position: fixed;
  right: 12px;
  bottom: 12px;
  margin: 0;
  max-width: min(320px, calc(100vw - 24px));
  background: #dff6dd;
  color: #1f4d1b;
  border: 1px solid rgba(31, 77, 27, 0.12);
  box-shadow: 0 12px 28px rgba(29, 27, 32, 0.12);
}

.save-feedback.is-error {
  background: #ffd9de;
  color: #410e0b;
}

@media (max-width: 920px) {
  .branding-h1-50-pathprint {
    font-size: 1.1rem;
  }
}

@media (max-width: 680px) {
  .close-header-mobile {
    padding-left: 72px;
    padding-right: 12px;
  }

  .language-switch {
    padding: 0;
  }

  .toolbar-section h2 {
    font-size: 0.54rem;
  }

  .canvas-stage {
    width: calc(100vw - var(--toolbar-width) - (var(--page-padding) * 2));
  }
}
