@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans/DMSans%5Bopsz,wght%5D.woff2") format("woff2-variations");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans/DMSans-Italic%5Bopsz,wght%5D.woff2") format("woff2-variations");
  font-weight: 100 1000;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans/DMSans-Thin.woff2") format("woff2");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans/DMSans-ExtraLight.woff2") format("woff2");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans/DMSans-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans/DMSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans/DMSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans/DMSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans/DMSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans/DMSans-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans/DMSans-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inconsolata";
  src: url("/assets/fonts/Inconsolata/Inconsolata-Thin.woff2") format("woff2");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inconsolata";
  src: url("/assets/fonts/Inconsolata/Inconsolata-ExtraLight.woff2") format("woff2");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inconsolata";
  src: url("/assets/fonts/Inconsolata/Inconsolata-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inconsolata";
  src: url("/assets/fonts/Inconsolata/Inconsolata-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inconsolata";
  src: url("/assets/fonts/Inconsolata/Inconsolata-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inconsolata";
  src: url("/assets/fonts/Inconsolata/Inconsolata-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inconsolata";
  src: url("/assets/fonts/Inconsolata/Inconsolata-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inconsolata";
  src: url("/assets/fonts/Inconsolata/Inconsolata-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inconsolata";
  src: url("/assets/fonts/Inconsolata/Inconsolata-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --color-interface-050: #f5f0ed;
  --color-interface-050: #f8f5f4;
  --color-interface-100: #efe9e6;
  --color-interface-200: #e0d5d0;
  --color-interface-300: #cabbb5;
  --color-interface-400: #b2a29c;
  --color-interface-500: #998985;
  --color-interface-600: #7f716e;
  --color-interface-700: #675b58;
  --color-interface-800: #5b4f4c;
  --color-interface-900: #483c39;
  --color-050: #f5f0ed;
  --color-050: #f8f5f4;
  --color-100: #efe9e6;
  --color-200: #e0d5d0;
  --color-300: #cabbb5;
  --color-400: #b2a29c;
  --color-500: #998985;
  --color-600: #7f716e;
  --color-700: #675b58;
  --color-800: #5b4f4c;
  --color-900: #483c39;
}
[data-color-type=page] {
  --color-050: #fff4ec;
  --color-100: #ffe6d6;
  --color-200: #ffd7c2;
  --color-300: #ffc7ac;
  --color-400: #ffb38f;
  --color-500: #ffa06f;
  --color-600: #ff8a50;
  --color-700: #ff8a50;
  --color-800: #ea733c;
  --color-900: #d96a30;
}
[data-color-type=elem] {
  --color-050: #f4f0ff;
  --color-100: #e7e1ff;
  --color-200: #dacfff;
  --color-300: #c7b8ff;
  --color-400: #b19cff;
  --color-500: #9a80ff;
  --color-600: #7136ff;
  --color-700: #6930f5;
  --color-800: #5d28e6;
  --color-900: #5223d6;
}
body,
html {
  padding: 0;
  margin: 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
}
input,
select {
  border: none;
  outline: none;
  border-radius: var(--border-radius);
}
button {
  background-color: transparent;
  border: none;
}
img {
  width: 100%;
}
:root {
  --color-browngray-050: #f5f3f0;
  --color-browngray-200: #d0c4ba;
  --color-txt: var(--color-interface-900);
  --color-panel-bg: var(--color-interface-050);
  --color-page-highlight: #ff8a50;
  --color-purple: #7136ff;
  --border-radius: 0.2rem;
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space: 1.5rem;
  --space-m: 2rem;
  --space-big: 3em;
  --curve: cubic-bezier(0.86, 0, 0.07, 1);
  --sans-serif: "DM Sans", sans-serif;
  --mono: "Inconsolata", monospace;
  --input-h: 26px;
  --input-w: 160px;
  --input-w-small: 45px;
  --label-w: 18ch;
  font-size: 14px;
  --panel-w: 540px;
  --panel-nav-h: 60px;
}
body {
  font-family: var(--sans-serif);
  color: var(--color-txt);
}
/* PagedJS print styles */
@page {
  size: A4;
  margin: 20mm 15mm 26mm 15mm;
}
h2 {
  break-before: page;
}
@page {
  @bottom-center {
    content: string(title);
  }
}
.chapter > h2 {
  string-set: title content(text);
}
select,
input[type=text],
input[type=number] {
  height: var(--input-h);
  border: 1px solid var(--color-interface-200);
  background-color: var(--color-interface-100);
  font-family: var(--sans-serif);
  color: var(--color-txt);
  font-size: 1rem;
  padding-left: 0.5ch;
}
.field {
  display: flex;
}
.field label {
  font-weight: 600;
  color: var(--color-800);
}
.field .input-with-unit {
  display: flex;
  gap: 0.3rem;
}
.field .unit-toggle {
  height: var(--input-h);
  display: flex;
  gap: 0.3rem;
  align-items: center;
}
.field .input-with-color {
  width: 100%;
}
.field .input-with-color .clr-field {
  width: 100%;
  display: grid;
  grid-template-columns: var(--input-h) 1fr;
  grid-gap: 1ch;
}
.field .input-with-color .clr-field button {
  grid-column: 1;
  position: relative;
  border-radius: var(--border-radius);
  cursor: pointer;
  pointer-events: auto;
}
.field .input-with-color .clr-field input {
  grid-column: 2;
}
.field {
  display: grid;
  grid-template-columns: var(--label-w) 1fr;
}
.field label {
  align-self: center;
}
.field-font {
  display: grid;
  grid-template-columns: var(--label-w) 1fr;
  grid-template-rows: var(--input-h) var(--input-h);
}
.field-font select {
  width: 100%;
}
.field-font .field-checkbox {
  grid-column: 2;
  padding-top: var(--space-xs);
}
.field-font .field-checkbox label {
  font-weight: 400;
  margin-left: 0.75ch;
  color: var(--color-txt);
}
.field-text-size input[type=number] {
  width: var(--input-w-small);
  padding-left: 0.75ch;
}
.field-text-size input[type=range] {
  flex-grow: 2;
  flex-shrink: 2;
}
.field-margin,
.field-size {
  display: inline-grid;
  width: calc(50% - 1ch);
  grid-template-columns: 6.5ch var(--input-w-small) 1fr;
  margin-bottom: var(--space-xs);
}
.field-margin input,
.field-size input {
  width: var(--input-w-small);
  padding-left: 0.75ch;
}
.field-margin:nth-of-type(odd),
.field-size:nth-of-type(odd) {
  margin-right: 2ch;
}
.checkbox-field {
  margin: calc(var(--space-xs) * 2) 0;
  grid-template-columns: 3ch 1fr;
}
.checkbox-field input {
  justify-self: left;
  margin: 0;
}
.field--view-only {
  opacity: 0.3;
}
/* Label with CSS tooltip */
.label-with-tooltip {
  text-decoration: underline dotted 1px var(--color-200);
  text-underline-offset: 2px;
  cursor: help;
  position: relative;
}
.label-with-tooltip::after {
  content: attr(data-css);
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  padding: 0.25rem 0.5rem;
  background: var(--color-interface-700);
  color: var(--color-interface-050);
  font-family: var(--mono);
  font-size: 0.75rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 10;
}
.label-with-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}
.number-input {
  position: relative;
}
.number-input input {
  padding-top: 0;
  padding-bottom: 0;
}
.number-input .spinner-buttons {
  height: var(--input-h);
  width: var(--input-h);
  display: flex;
  flex-direction: column;
  position: absolute;
  right: 0;
  top: 0;
}
.number-input .spinner-buttons button {
  height: calc(var(--input-h) * 0.5);
  cursor: pointer;
  padding: 0;
}
.number-input .spinner-buttons button svg {
  width: 10px;
  height: auto;
}
.number-input .spinner-buttons button svg path {
  fill: var(--color-interface-600);
}
.number-input .spinner-buttons button:hover svg path {
  fill: var(--color-interface-900);
}
.settings-section {
  margin: var(--space-m) 0;
}
.settings-section h2 {
  margin-bottom: var(--space);
  font-weight: 600;
  font-size: 1.4rem;
  border-bottom: 1px solid var(--color-200);
  color: var(--color-800);
}
.settings-section .infos {
  font-size: 0.8rem;
  color: var(--color-interface-400);
}
.settings-subsection:not(:last-child) {
  border-bottom: 1px solid var(--color-interface-100);
}
.settings-subsection {
  padding: var(--space-xs) 0;
}
.settings-subsection h3 {
  margin-top: calc(var(--space-xs) * 1.5);
  margin-bottom: calc(var(--space-xs) * 2);
  font-size: 1rem;
  font-weight: 600;
}
.unit-toggle button:not(.spinner-btn) {
  cursor: pointer;
  border: 1px solid var(--color-interface-400);
  color: var(--color-interface-400);
  background-color: var(--color-panel-bg);
  border-radius: var(--border-radius);
  padding: 0.1rem 0.3rem;
  height: calc(var(--input-h) * 0.75);
}
.unit-toggle button:not(.spinner-btn):not(.active):hover {
  background-color: var(--color-interface-100);
}
.unit-toggle button:not(.spinner-btn).active {
  color: var(--color-interface-050);
  background-color: var(--color-interface-500);
  cursor: auto;
}
#editor-panel .tabs .tab {
  color: var(--color-interface-600);
  font-size: 1rem;
  font-family: var(--sans-serif);
  height: var(--input-h);
  padding: 0 1ch;
  border: 1px solid currentColor;
  border-radius: calc(var(--input-h));
  font-weight: 500;
  background-color: var(--color-panel-bg);
}
#editor-panel .tabs .tab.active {
  background-color: var(--color-interface-400);
  border-color: var(--color-interface-400);
  color: var(--color-panel-bg);
}
#editor-panel .tabs .tab:not(.active):hover {
  cursor: pointer;
  background-color: var(--color-interface-100);
}
.settings-popup {
  position: fixed;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 10;
  width: 860px;
  max-height: 600px;
  display: flex;
  flex-direction: column;
}
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  background: #f9f9f9;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
  color: #666;
}
.popup-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.popup-controls {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background-color: var(--color-panel-bg);
}
.settings-subsection h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 600;
}
.inheritance-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: #666;
  transition: color 0.2s;
}
.inheritance-btn:hover {
  color: #333;
}
.inheritance-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}
.popup-css {
  flex: 1;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e0e0e0;
}
.css-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #e8e8e8;
  border-bottom: 1px solid #d0d0d0;
  font-size: 0.875rem;
  font-weight: 600;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: normal;
  color: #666;
}
.toggle input[type=checkbox] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 18px;
  background: #ccc;
  border-radius: 18px;
  transition: background 0.2s ease;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}
.toggle input[type=checkbox]:checked + .toggle-switch {
  background: #61afef;
}
.toggle input[type=checkbox]:checked + .toggle-switch::after {
  transform: translateX(18px);
}
.readonly {
  flex: 1;
  margin: 0;
  padding: 0.75rem;
  background: #1e1e1e;
  color: #abb2bf;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-y: auto;
  white-space: pre-wrap;
}
.popup-css textarea {
  flex: 1;
  width: 100%;
  background: #1e1e1e;
  color: #abb2bf;
  border: none;
  padding: 0.75rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  resize: none;
  outline: none;
}

/* Base print styles for content sections */
.narrative-cover,
.geoformat,
.chapitre,
.carte {
  break-before: page;
}
.narrative-cover .cover-image,
.geoformat .cover-image {
  max-width: 100%;
  height: auto;
}
.narrative-cover h1 {
  margin-top: 1rem;
}
.narrative-cover .author {
  font-style: italic;
  color: #666;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.tag {
  background: #f0f0f0;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

/* Block styles */
.block-image img {
  max-width: 100%;
  height: auto;
}
.block-quote {
  border-left: 3px solid #ccc;
  padding-left: 1rem;
  margin-left: 0;
  font-style: italic;
}
.block-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #666;
}
.block-video .video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}
.block-video .video-embed iframe,
.block-video .video-embed video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.block-map {
  background: #f5f5f5;
  padding: 2rem;
  text-align: center;
  border: 1px dashed #ccc;
}
.clr-picker {
  display: none;
  flex-wrap: wrap;
  position: absolute;
  width: 200px;
  z-index: 1000;
  border-radius: 10px;
  background-color: #fff;
  justify-content: flex-end;
  direction: ltr;
  box-shadow: 0 0 5px rgba(0,0,0,.05), 0 5px 20px rgba(0,0,0,.1);
  -moz-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}

.clr-picker.clr-open,
.clr-picker[data-inline="true"] {
  display: flex;
}

.clr-picker[data-inline="true"] {
  position: relative;
}

.clr-gradient {
  position: relative;
  width: 100%;
  height: 100px;
  margin-bottom: 15px;
  border-radius: 3px 3px 0 0;
  background-image: linear-gradient(rgba(0,0,0,0), #000), linear-gradient(90deg, #fff, currentColor);
  cursor: pointer;
}

.clr-marker {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 1px solid #fff;
  border-radius: 50%;
  background-color: currentColor;
  cursor: pointer;
}

.clr-picker input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 16px;
}

.clr-picker input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  -webkit-appearance: none;
}

.clr-picker input[type="range"]::-moz-range-track {
  width: 100%;
  height: 16px;
  border: 0;
}

.clr-picker input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
}

.clr-hue {
  background-image: linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);
}

.clr-hue,
.clr-alpha {
  position: relative;
  width: calc(100% - 40px);
  height: 8px;
  margin: 5px 20px;
  border-radius: 4px;
}

.clr-alpha span {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background-image: linear-gradient(90deg, rgba(0,0,0,0), currentColor);
}

.clr-hue input[type="range"],
.clr-alpha input[type="range"] {
  position: absolute;
  width: calc(100% + 32px);
  height: 16px;
  left: -16px;
  top: -4px;
  margin: 0;
  background-color: transparent;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.clr-hue div,
.clr-alpha div {
  position: absolute;
  width: 16px;
  height: 16px;
  left: 0;
  top: 50%;
  margin-left: -8px;
  transform: translateY(-50%);
  border: 2px solid #fff;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 1px #888;
  pointer-events: none;
}

.clr-alpha div:before {
  content: '';
  position: absolute;
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  border-radius: 50%;
  background-color: currentColor;
}

.clr-format {
  display: none;
  order: 1;
  width: calc(100% - 40px);
  margin: 0 20px 20px;
}

.clr-segmented {
  display: flex;
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 15px;
  box-sizing: border-box;
  color: #999;
  font-size: 12px;
}

.clr-segmented input,
.clr-segmented legend {
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
}

.clr-segmented label {
  flex-grow: 1;
  margin: 0;
  padding: 4px 0;
  font-size: inherit;
  font-weight: normal;
  line-height: initial;
  text-align: center;
  cursor: pointer;
}

.clr-segmented label:first-of-type {
  border-radius: 10px 0 0 10px;
}

.clr-segmented label:last-of-type {
  border-radius: 0 10px 10px 0;
}

.clr-segmented input:checked + label {
  color: #fff;
  background-color: #666;
}

.clr-swatches {
  order: 2;
  width: calc(100% - 32px);
  margin: 0 16px;
}

.clr-swatches div {
  display: flex;
  flex-wrap: wrap;
  padding-bottom: 12px;
  justify-content: center;
}

.clr-swatches button {
  position: relative;
  width: 20px;
  height: 20px;
  margin: 0 4px 6px 4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  text-indent: -1000px;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.clr-swatches button:after {
  content: '';
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  border-radius: inherit;
  background-color: currentColor;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}

input.clr-color {
  order: 1;
  width: calc(100% - 80px);
  height: 32px;
  margin: 15px 20px 20px auto;
  padding: 0 10px;
  border: 1px solid #ddd;
  border-radius: 16px;
  color: #444;
  background-color: #fff;
  font-family: sans-serif;
  font-size: 14px;
  text-align: center;
  box-shadow: none;
}

input.clr-color:focus {
  outline: none;
  border: 1px solid #1e90ff;
}

.clr-close,
.clr-clear {
  display: none;
  order: 2;
  height: 24px;
  margin: 0 20px 20px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background-color: #666;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}

.clr-close {
  display: block;
  margin: 0 20px 20px auto;
}

.clr-preview {
  position: relative;
  width: 32px;
  height: 32px;
  margin: 15px 0 20px 20px;
  border-radius: 50%;
  overflow: hidden;
}

.clr-preview:before,
.clr-preview:after {
  content: '';
  position: absolute;
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  border: 1px solid #fff;
  border-radius: 50%;
}

.clr-preview:after {
  border: 0;
  background-color: currentColor;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}

.clr-preview button {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  outline-offset: -2px;
  background-color: transparent;
  text-indent: -9999px;
  cursor: pointer;
  overflow: hidden;
}

.clr-marker,
.clr-hue div,
.clr-alpha div,
.clr-color {
  box-sizing: border-box;
}

.clr-field {
  display: inline-block;
  position: relative;
  color: transparent;
}

.clr-field input {
  margin: 0;
  direction: ltr;
}

.clr-field.clr-rtl input {
  text-align: right;
}

.clr-field button {
  position: absolute;
  width: 30px;
  height: 100%;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  text-indent: -1000px;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}

.clr-field.clr-rtl button {
  right: auto;
  left: 0;
}

.clr-field button:after {
  content: '';
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  border-radius: inherit;
  background-color: currentColor;
  box-shadow: inset 0 0 1px rgba(0,0,0,.5);
}

.clr-alpha,
.clr-alpha div,
.clr-swatches button,
.clr-preview:before,
.clr-field button {
  background-image: repeating-linear-gradient(45deg, #aaa 25%, transparent 25%, transparent 75%, #aaa 75%, #aaa), repeating-linear-gradient(45deg, #aaa 25%, #fff 25%, #fff 75%, #aaa 75%, #aaa);
  background-position: 0 0, 4px 4px;
  background-size: 8px 8px;
}

.clr-marker:focus {
  outline: none;
}

.clr-keyboard-nav .clr-marker:focus,
.clr-keyboard-nav .clr-hue input:focus + div,
.clr-keyboard-nav .clr-alpha input:focus + div,
.clr-keyboard-nav .clr-segmented input:focus + label {
  outline: none;
  box-shadow: 0 0 0 2px #1e90ff, 0 0 2px 2px #fff;
}

.clr-picker[data-alpha="false"] .clr-alpha {
  display: none;
}

.clr-picker[data-minimal="true"] {
  padding-top: 16px;
}

.clr-picker[data-minimal="true"] .clr-gradient,
.clr-picker[data-minimal="true"] .clr-hue,
.clr-picker[data-minimal="true"] .clr-alpha,
.clr-picker[data-minimal="true"] .clr-color,
.clr-picker[data-minimal="true"] .clr-preview {
  display: none;
}

/** Dark theme **/

.clr-dark {
  background-color: #444;
}

.clr-dark .clr-segmented {
  border-color: #777;
}

.clr-dark .clr-swatches button:after {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}

.clr-dark input.clr-color {
  color: #fff;
  border-color: #777;
  background-color: #555;
}

.clr-dark input.clr-color:focus {
  border-color: #1e90ff;
}

.clr-dark .clr-preview:after {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}

.clr-dark .clr-alpha,
.clr-dark .clr-alpha div,
.clr-dark .clr-swatches button,
.clr-dark .clr-preview:before {
  background-image: repeating-linear-gradient(45deg, #666 25%, transparent 25%, transparent 75%, #888 75%, #888), repeating-linear-gradient(45deg, #888 25%, #444 25%, #444 75%, #888 75%, #888);
}

/** Polaroid theme **/

.clr-picker.clr-polaroid {
  border-radius: 6px;
  box-shadow: 0 0 5px rgba(0,0,0,.1), 0 5px 30px rgba(0,0,0,.2);
}

.clr-picker.clr-polaroid:before {
  content: '';
  display: block;
  position: absolute;
  width: 16px;
  height: 10px;
  left: 20px;
  top: -10px;
  border: solid transparent;
  border-width: 0 8px 10px 8px;
  border-bottom-color: currentColor;
  box-sizing: border-box;
  color: #fff;
  filter: drop-shadow(0 -4px 3px rgba(0,0,0,.1));
  pointer-events: none;
}

.clr-picker.clr-polaroid.clr-dark:before {
  color: #444;
}

.clr-picker.clr-polaroid.clr-left:before {
  left: auto;
  right: 20px;
}

.clr-picker.clr-polaroid.clr-top:before {
  top: auto;
  bottom: -10px;
  transform: rotateZ(180deg);
}

.clr-polaroid .clr-gradient {
  width: calc(100% - 20px);
  height: 120px;
  margin: 10px;
  border-radius: 3px;
}

.clr-polaroid .clr-hue,
.clr-polaroid .clr-alpha {
  width: calc(100% - 30px);
  height: 10px;
  margin: 6px 15px;
  border-radius: 5px;
}

.clr-polaroid .clr-hue div,
.clr-polaroid .clr-alpha div {
  box-shadow: 0 0 5px rgba(0,0,0,.2);
}

.clr-polaroid .clr-format {
  width: calc(100% - 20px);
  margin: 0 10px 15px;
}

.clr-polaroid .clr-swatches {
  width: calc(100% - 12px);
  margin: 0 6px;
}
.clr-polaroid .clr-swatches div {
  padding-bottom: 10px;
}

.clr-polaroid .clr-swatches button {
  width: 22px;
  height: 22px;
}

.clr-polaroid input.clr-color {
  width: calc(100% - 60px);
  margin: 10px 10px 15px auto;
}

.clr-polaroid .clr-clear {
  margin: 0 10px 15px 10px;
}

.clr-polaroid .clr-close {
  margin: 0 10px 15px auto;
}

.clr-polaroid .clr-preview {
  margin: 10px 0 15px 10px;
}

/** Large theme **/

.clr-picker.clr-large {
  width: 275px;
}

.clr-large .clr-gradient {
  height: 150px;
}

.clr-large .clr-swatches button {
  width: 22px;
  height: 22px;
}

/** Pill (horizontal) theme **/

.clr-picker.clr-pill {
  width: 380px;
  padding-left: 180px;
  box-sizing: border-box;
}

.clr-pill .clr-gradient {
  position: absolute;
  width: 180px;
  height: 100%;
  left: 0;
  top: 0;
  margin-bottom: 0;
  border-radius: 3px 0 0 3px;
}

.clr-pill .clr-hue {
  margin-top: 20px;
}
.subsection-header[data-v-6800f72a] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.subsection-header h3[data-v-6800f72a] {
  margin: 0;
}
.link-button[data-v-6800f72a] {
  background: none;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 4px;
  padding: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  width: 24px;
  height: 24px;
}
.link-button svg[data-v-6800f72a] {
  width: 16px;
  height: 16px;
  color: var(--color-text-secondary, #666);
}
.link-button[data-v-6800f72a]:hover {
  background: var(--color-hover, #f0f0f0);
}
.link-button.active[data-v-6800f72a] {
  background: var(--color-primary, #007bff);
  border-color: var(--color-primary, #007bff);
}
.link-button.active svg[data-v-6800f72a] {
  color: white;
}

.css-import[data-v-d40e92e3] {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #21252b;
  border: 2px dashed transparent;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}
.css-import.is-dragging[data-v-d40e92e3] {
  border-color: #61afef;
  background: #2c313c;
}
.import-button[data-v-d40e92e3] {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #2c313c;
  color: #abb2bf;
  border: 1px solid #3e4451;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.import-button[data-v-d40e92e3]:hover {
  background: #3e4451;
  border-color: #61afef;
  color: #61afef;
}
.import-button svg[data-v-d40e92e3] {
  width: 1rem;
  height: 1rem;
}
.import-hint[data-v-d40e92e3] {
  font-size: 0.75rem;
  color: #5c6370;
  font-style: italic;
}
.import-error[data-v-d40e92e3] {
  font-size: 0.75rem;
  color: #e06c75;
  background: rgba(224, 108, 117, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}
pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em
}
code.hljs {
  padding: 3px 5px
}
/*

Atom One Dark by Daniel Gamage
Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax

base:    #282c34
mono-1:  #abb2bf
mono-2:  #818896
mono-3:  #5c6370
hue-1:   #56b6c2
hue-2:   #61aeee
hue-3:   #c678dd
hue-4:   #98c379
hue-5:   #e06c75
hue-5-2: #be5046
hue-6:   #d19a66
hue-6-2: #e6c07b

*/
.hljs {
  color: #abb2bf;
  background: #282c34
}
.hljs-comment,
.hljs-quote {
  color: #5c6370;
  font-style: italic
}
.hljs-doctag,
.hljs-keyword,
.hljs-formula {
  color: #c678dd
}
.hljs-section,
.hljs-name,
.hljs-selector-tag,
.hljs-deletion,
.hljs-subst {
  color: #e06c75
}
.hljs-literal {
  color: #56b6c2
}
.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta .hljs-string {
  color: #98c379
}
.hljs-attr,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-number {
  color: #d19a66
}
.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-id,
.hljs-title {
  color: #61aeee
}
.hljs-built_in,
.hljs-title.class_,
.hljs-class .hljs-title {
  color: #e6c07b
}
.hljs-emphasis {
  font-style: italic
}
.hljs-strong {
  font-weight: bold
}
.hljs-link {
  text-decoration: underline
}
#stylesheet-viewer[data-v-3419ab03] {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #282c34;
  color: #fff;
  gap: 1rem;
  overflow-y: auto;
}
.css-section[data-v-3419ab03] {
  display: flex;
  flex-direction: column;
  background: #21252b;
  border-radius: 0.25rem;
  overflow: hidden;
}
.custom-section[data-v-3419ab03] {
  flex: 1;
  min-height: 300px;
}
.section-header[data-v-3419ab03] {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #2c313c;
  cursor: pointer;
  user-select: none;
}
.css-section.custom-section .section-header[data-v-3419ab03] {
  cursor: default;
}
h3[data-v-3419ab03] {
  margin: 0;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.toggle[data-v-3419ab03] {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #abb2bf;
  position: relative;
}
.toggle-label[data-v-3419ab03] {
  user-select: none;
}
.toggle input[type='checkbox'][data-v-3419ab03] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch[data-v-3419ab03] {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  background: #4a5568;
  border-radius: 20px;
  transition: background 0.2s ease;
}
.toggle-switch[data-v-3419ab03]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}
.toggle input[type='checkbox']:checked + .toggle-switch[data-v-3419ab03] {
  background: #61afef;
}
.toggle input[type='checkbox']:checked + .toggle-switch[data-v-3419ab03]::after {
  transform: translateX(20px);
}
.expand-icon[data-v-3419ab03] {
  width: 1.25rem;
  height: 1.25rem;
  color: #abb2bf;
  transition: transform 0.2s ease;
}
.expand-icon.expanded[data-v-3419ab03] {
  transform: rotate(180deg);
}
.section-content[data-v-3419ab03] {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.readonly[data-v-3419ab03] {
  margin: 0;
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #1e1e1e;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}
.readonly code[data-v-3419ab03] {
  background: transparent;
}
textarea[data-v-3419ab03] {
  width: 100%;
  flex: 1;
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  background: #1e1e1e;
  color: #abb2bf;
  border: none;
  padding: 1rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: none;
  outline: none;
}
textarea[data-v-3419ab03]::placeholder {
  color: #5c6370;
  font-style: italic;
}
.export-button[data-v-3419ab03] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  background: #2c313c;
  color: #abb2bf;
  border: 1px solid #3e4451;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.export-button[data-v-3419ab03]:hover {
  background: #3e4451;
  border-color: #61afef;
  color: #61afef;
}
.export-button svg[data-v-3419ab03] {
  width: 1.25rem;
  height: 1.25rem;
}
#editor-panel[data-v-ca3899ea] {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--panel-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 2;
  pointer-events: none;
}
nav[data-v-ca3899ea] {
  position: absolute;
  margin: 1.5rem 0 0 2rem;
  display: flex;
  gap: 0.5rem;
  z-index: 2;
  pointer-events: all;
}
.close-button[data-v-ca3899ea] {
  position: absolute;
  top: 1.5rem;
  right: 1rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  padding: 0.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  pointer-events: all;
  color: var(--color-interface-300);
  transition: color 0.2s ease;
}
.close-button[data-v-ca3899ea]:hover {
  color: var(--color-browngray-100);
}
.close-button svg[data-v-ca3899ea] {
  width: 100%;
  height: 100%;
}
.tab-content[data-v-ca3899ea] {
  flex: 1;
  overflow: hidden;
  position: relative;
  left: calc(var(--panel-w) * -1);
  background-color: var(--color-panel-bg);
  box-shadow: -5px 0px 12px;
  transition: left 0.3s var(--curve);
  pointer-events: all;
}
.tab-content.open[data-v-ca3899ea] {
  left: 0rem;
}
.tab-panel[data-v-ca3899ea] {
  height: calc(100% - var(--panel-nav-h) * 2);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 2em;
  margin-top: var(--panel-nav-h);
}
/* ElementPopup-specific styles (purple theme) */
.element-label[data-v-93294fa6] {
  background: var(--color-purple);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
}
.instance-count[data-v-93294fa6] {
  color: var(--color-purple);
  font-size: 0.875rem;
}

/* PagePopup-specific styles (orange theme) */
.page-label[data-v-52b2e5fd] {
  background: var(--color-page-highlight);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
}
.page-name[data-v-52b2e5fd] {
  font-weight: 600;
  font-size: 0.875rem;
}
.page-count[data-v-52b2e5fd] {
  color: var(--color-page-highlight);
  font-size: 0.875rem;
}
.margin-grid[data-v-52b2e5fd] {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.preview-loader[data-v-5a65dd8d] {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1000;
  pointer-events: none;
  transition: all 0.2s ease-in-out var(--curve);
}
.spinner[data-v-5a65dd8d] {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-block;
  border-top: 3px solid #000;
  border-right: 3px solid transparent;
  box-sizing: border-box;
  animation: rotation-5a65dd8d 1s linear infinite;
}
@keyframes rotation-5a65dd8d {
0% {
    transform: rotate(0deg);
}
100% {
    transform: rotate(360deg);
}
}

.save-button-wrapper[data-v-754dc51a] {
  position: fixed;
  top: 2rem;
  right: 5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}
.save-btn[data-v-754dc51a] {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: var(--color-interface-300, #ccc);
  color: white;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  position: relative;
}
.save-btn.has-changes[data-v-754dc51a] {
  background: var(--color-page-highlight, #ff8a50);
  cursor: pointer;
}
.save-btn.has-changes[data-v-754dc51a]:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.save-btn.is-saving[data-v-754dc51a] {
  cursor: wait;
}
.save-btn.has-error[data-v-754dc51a] {
  background: #e74c3c;
}
.save-btn.save-success[data-v-754dc51a] {
  background: #2ecc71;
}
.save-icon[data-v-754dc51a],
.success-icon[data-v-754dc51a] {
  width: 1.5rem;
  height: 1.5rem;
}
.spinner[data-v-754dc51a] {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border-top: 2px solid white;
  border-right: 2px solid transparent;
  animation: rotation-754dc51a 1s linear infinite;
}
@keyframes rotation-754dc51a {
0% {
    transform: rotate(0deg);
}
100% {
    transform: rotate(360deg);
}
}
.last-saved[data-v-754dc51a] {
  font-size: 0.75rem;
  color: var(--color-interface-600, #666);
  background: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}
.error-tooltip[data-v-754dc51a] {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: #e74c3c;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  max-width: 15rem;
  word-wrap: break-word;
  white-space: normal;
}

.preview-frame {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  border: none;
  margin-left: 0;
  transform: scale(1) translateY(0);
  height: 100vh;
  transition: all 0.2s ease-in-out var(--curve);
}
.preview-frame.shifted {
  margin-left: 17.55rem;
  transform: scale(0.65) translateY(-40vh);
  height: 155vh;
}
.preview-frame:nth-of-type(1) {
  z-index: 1;
  opacity: 1;
}
.preview-frame:nth-of-type(2) {
  z-index: 0;
  opacity: 0;
}
.print-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: var(--color-page-highlight);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  z-index: 1000;
}
.print-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.print-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Coloris button - ensure it's clickable and visible */
:deep(.clr-field button) {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  z-index: 1;
}

/* Hide UI elements when printing */
@media print {
#editor-panel,
  #element-popup,
  #page-popup,
  .preview-loader,
  .print-btn {
    display: none !important;
}
.preview-frame {
    position: static !important;
    margin-left: 0 !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
}
.preview-frame:not(:first-of-type) {
    display: none !important;
}
}
