:root {
  --surface-app: #f3f2ee;
  --surface-canvas: #f8f7f3;
  --ink-strong: #1d1f20;
  --ink-muted: #666a6b;
  --border-soft: rgba(29, 31, 32, 0.14);
  --panel-surface: rgba(250, 249, 246, 0.92);
  --panel-shadow: 0 10px 28px rgba(36, 38, 39, 0.08);
  --radius-panel: 14px;
  --space-xs: 6px;
  --space-sm: 10px;
  --space-md: 16px;
  --space-lg: 24px;
  --sidebar-width: 276px;
  --layers-panel-width: 288px;
  --debug-panel-width: 320px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-strong);
  background: var(--surface-app);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--surface-app);
}

button,
canvas,
input,
textarea {
  font: inherit;
}

.prototype-shell,
.canvas-stack {
  position: relative;
  width: 100%;
  height: 100%;
}

.prototype-shell {
  background: var(--surface-canvas);
}

.canvas-stack {
  overflow: hidden;
}

.canvas-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.canvas-scene {
  pointer-events: none;
}

.canvas-input {
  touch-action: none;
  cursor: grab;
  outline: none;
}


.canvas-input[data-active-drawing-tool="pen"][data-active-pointer-type="pen"][data-active-gesture="idle"][data-selection-modifier="inactive"][data-temporary-navigation="inactive"][data-stroke-editing="inactive"] {
  cursor: none;
}

.canvas-input[data-active-drawing-tool="hard-eraser"][data-active-gesture="idle"],
.canvas-input[data-active-drawing-tool="soft-eraser"][data-active-gesture="idle"],
.canvas-input[data-active-gesture="erase"] {
  cursor: none;
}

.canvas-input[data-active-gesture="idle"][data-hover-target="object"],
.canvas-input[data-active-gesture="idle"][data-hover-target="navigation-landmark"],
.canvas-input[data-active-gesture="navigation-label-press"] {
  cursor: pointer;
}

.canvas-input[data-active-gesture="idle"][data-hover-target="selected-object"],
.canvas-input[data-active-gesture="object-drag"] {
  cursor: move;
}

.canvas-input[data-active-gesture="idle"][data-selection-modifier="active"],
.canvas-input[data-active-gesture="selection-press"] {
  cursor: crosshair;
}

.canvas-input[data-active-gesture="pan"] {
  cursor: grabbing;
}

.canvas-input[data-active-gesture="marquee"] {
  cursor: crosshair;
}

.canvas-input[data-active-gesture="draw"] {
  cursor: crosshair;
}

.canvas-input[data-stroke-editing="active"][data-active-pointer-type="pen"][data-active-gesture="idle"],
.canvas-input[data-stroke-editing="active"][data-active-pointer-type="pen"][data-active-gesture="unsupported"] {
  cursor: crosshair;
}

.canvas-input[data-stroke-editing="active"][data-active-gesture="idle"][data-hover-target="stroke-edit-stroke"],
.canvas-input[data-active-gesture="stroke-edit-warp"] {
  cursor: move;
}

.canvas-input[data-eyedropper-active="true"][data-active-gesture="idle"] {
  cursor: none;
}

.first-project-onboarding {
  position: absolute;
  z-index: 1;
  top: 96px;
  left: 50%;
  display: grid;
  width: min(610px, calc(100vw - 48px));
  gap: 9px;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
}

.first-project-onboarding-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.01em;
}

.first-project-onboarding-heading button {
  padding: 5px 9px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--ink-strong);
  background: rgba(250, 249, 246, 0.94);
  box-shadow: 0 4px 14px rgba(36, 38, 39, 0.05);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}

.first-project-onboarding-heading button:hover {
  background: #ffffff;
}

.first-project-onboarding-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.first-project-onboarding-card {
  min-height: 112px;
  padding: 13px 14px 14px;
  border: 1px solid rgba(29, 31, 32, 0.11);
  border-radius: 13px;
  background: rgba(250, 249, 246, 0.9);
  box-shadow: 0 8px 24px rgba(36, 38, 39, 0.06);
  backdrop-filter: blur(12px);
}

.first-project-onboarding-number {
  display: inline-grid;
  width: 19px;
  height: 19px;
  margin-bottom: 9px;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 750;
}

.first-project-onboarding-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 720;
}

.first-project-onboarding-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.45;
}


.project-chrome-left,
.project-chrome-right,
.prototype-debug-dock {
  position: absolute;
  z-index: 2;
}

@media (max-width: 760px) {
  .first-project-onboarding {
    top: 84px;
    width: min(340px, calc(100vw - 32px));
  }

  .first-project-onboarding-grid {
    grid-template-columns: 1fr;
  }

  .first-project-onboarding-card {
    min-height: 0;
  }
}

.project-chrome-left {
  top: var(--space-md);
  left: var(--space-md);
  display: grid;
  width: min(var(--sidebar-width), calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  gap: 8px;
  overflow: auto;
}

.project-chrome-right {
  top: var(--space-md);
  right: var(--space-md);
  display: grid;
  width: min(var(--layers-panel-width), calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  gap: 6px;
  overflow: auto;
}

.project-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(250, 249, 246, 0.88);
  box-shadow: 0 6px 18px rgba(36, 38, 39, 0.06);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  user-select: none;
}

.project-brand {
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.01em;
}

.project-name {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prototype-debug-dock {
  bottom: var(--space-md);
  left: var(--space-md);
  width: min(var(--debug-panel-width), calc(100vw - 32px));
  max-height: min(70vh, 620px);
}

.prototype-debug {
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(250, 249, 246, 0.9);
  box-shadow: 0 6px 18px rgba(36, 38, 39, 0.06);
  backdrop-filter: blur(10px);
}

.prototype-debug-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.prototype-debug-title::-webkit-details-marker {
  display: none;
}

.prototype-debug-title::before {
  content: "▸";
  margin-right: -3px;
  color: var(--ink-muted);
  font-size: 9px;
}

.prototype-debug[open] .prototype-debug-title::before {
  content: "▾";
}

.prototype-debug-status {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.prototype-debug-body {
  display: grid;
  max-height: calc(min(70vh, 620px) - 36px);
  gap: 8px;
  padding: 0 8px 8px;
  overflow: auto;
}

.prototype-debug-info {
  padding: 10px 10px 8px;
  border-top: 1px solid var(--border-soft);
  pointer-events: none;
  user-select: none;
}

.prototype-kicker {
  margin: 0 0 4px;
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.prototype-title {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
}

.prototype-help {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.45;
}

.test-checklist {
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.62);
}

.test-checklist-title {
  padding: 9px 10px;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.test-checklist-title::-webkit-details-marker {
  display: none;
}

.test-checklist-title::after {
  float: right;
  color: var(--ink-muted);
  content: "Show";
  font-size: 9px;
  font-weight: 500;
}

.test-checklist[open] .test-checklist-title::after {
  content: "Hide";
}

.test-checklist-items {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px;
}

.test-checklist-item {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.4;
  cursor: pointer;
}

.test-checklist-item input {
  width: 13px;
  height: 13px;
  margin: 1px 0 0;
  accent-color: var(--ink-strong);
}

.test-checklist-item:has(input:checked) span {
  color: var(--ink-strong);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(29, 31, 32, 0.35);
}

.selection-context-controls {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 6px 5px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(250, 249, 246, 0.96);
  box-shadow: 0 8px 20px rgba(36, 38, 39, 0.12);
  color: var(--ink-strong);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.selection-context-controls[hidden] {
  display: none;
}

.selection-context-label {
  font-weight: 650;
}

.selection-context-button {
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink-strong);
  cursor: pointer;
}

.selection-context-button:hover {
  background: #f1f0ec;
}

.selection-context-button:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}

.selection-context-select {
  min-height: 28px;
  padding: 3px 24px 3px 7px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink-strong);
  font: inherit;
  cursor: pointer;
}

.selection-context-select:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}

.selection-context-rename-input {
  width: 180px;
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  outline: none;
  background: #ffffff;
  color: var(--ink-strong);
  font: inherit;
}

.selection-context-rename-input:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}


.prototype-actions {
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.62);
}

.prototype-actions-title {
  padding: 9px 10px;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.prototype-actions-title::-webkit-details-marker {
  display: none;
}

.prototype-actions-title::after {
  float: right;
  color: var(--ink-muted);
  content: "Show";
  font-size: 9px;
  font-weight: 500;
}

.prototype-actions[open] .prototype-actions-title::after {
  content: "Hide";
}

.prototype-actions-body {
  padding: 0 10px 10px;
}

.prototype-action-button {
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink-strong);
  cursor: pointer;
  font-size: 10px;
}

.prototype-action-button:hover {
  background: #f1f0ec;
}

.prototype-action-button:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}

.canvas-text-editor-root {
  position: absolute;
  z-index: 4;
}

.canvas-text-editor-root[hidden] {
  display: none;
}

.canvas-text-editor {
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  resize: none;
  overflow: hidden;
  border: 1px solid rgba(32, 34, 35, 0.32);
  border-radius: 6px;
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-strong);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  caret-color: var(--ink-strong);
}

.canvas-text-editor[data-text-kind="plain"] {
  padding: 6px 8px;
  background: rgba(248, 247, 243, 0.92);
}

.canvas-text-editor[data-text-kind="sticky"] {
  padding: 12px;
  border-radius: 9px;
  background: #c29a6b;
  color: #30241d;
}

.navigation-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(250, 249, 246, 0.9);
  box-shadow: 0 8px 22px rgba(36, 38, 39, 0.07);
  backdrop-filter: blur(10px);
}

.navigation-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.navigation-panel-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.navigation-panel-toggle,
.navigation-overview-button,
.navigation-previous-button,
.navigation-add-current-button,
.navigation-landmark-item,
.navigation-landmark-menu-button,
.navigation-landmark-menu-action,
.navigation-save-button,
.navigation-cancel-button {
  min-height: 28px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink-strong);
  cursor: pointer;
}

.navigation-panel-toggle {
  padding: 4px 8px;
  font-size: 10px;
}

.navigation-panel-body {
  display: grid;
  gap: 8px;
}

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

.navigation-primary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.84fr);
  gap: 6px;
}

.navigation-overview-button,
.navigation-previous-button,
.navigation-add-current-button {
  width: 100%;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 620;
}

.navigation-add-current-button {
  color: var(--ink-muted);
  font-weight: 600;
}

.navigation-overview-button[data-active="true"],
.navigation-landmark-item[data-active="true"] {
  border-color: rgba(29, 31, 32, 0.34);
  background: #eceae4;
}

.navigation-overview-button:disabled,
.navigation-previous-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.navigation-empty-state {
  margin: 0;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.4;
}

.navigation-landmark-list {
  display: grid;
  gap: 5px;
}

.navigation-landmark-row {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 30px;
  gap: 4px;
  align-items: center;
}

.navigation-landmark-drag {
  display: grid;
  place-items: center;
  min-height: 28px;
  color: rgba(29, 31, 32, 0.35);
  font-size: 9px;
  letter-spacing: -2px;
  cursor: grab;
  user-select: none;
}

.navigation-landmark-drag:active {
  cursor: grabbing;
}

.navigation-landmark-item {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.navigation-landmark-menu-button {
  width: 30px;
  padding: 3px;
  color: var(--ink-muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.navigation-landmark-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 4px);
  right: 0;
  display: grid;
  min-width: 154px;
  gap: 3px;
  padding: 5px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(250, 249, 246, 0.98);
  box-shadow: 0 10px 24px rgba(36, 38, 39, 0.12);
}

.navigation-landmark-menu-action {
  min-height: 27px;
  padding: 5px 7px;
  text-align: left;
  font-size: 9px;
}

.navigation-landmark-menu-action[data-destructive="true"] {
  color: #7a2d25;
}

.navigation-naming {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

.navigation-naming[hidden] {
  display: none;
}

.navigation-naming-label {
  display: grid;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 650;
}

.navigation-name-input {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: var(--ink-strong);
  font-size: 11px;
}

.navigation-name-input:focus {
  border-color: rgba(32, 34, 35, 0.42);
}

.navigation-naming-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.navigation-save-button,
.navigation-cancel-button {
  padding: 5px 8px;
  font-size: 10px;
}

.navigation-panel-toggle:hover,
.navigation-overview-button:hover:not(:disabled),
.navigation-previous-button:hover:not(:disabled),
.navigation-add-current-button:hover,
.navigation-landmark-item:hover,
.navigation-landmark-menu-button:hover,
.navigation-landmark-menu-action:hover,
.navigation-save-button:hover,
.navigation-cancel-button:hover {
  background: #f1f0ec;
}

.navigation-panel-toggle:focus-visible,
.navigation-overview-button:focus-visible,
.navigation-previous-button:focus-visible,
.navigation-add-current-button:focus-visible,
.navigation-landmark-item:focus-visible,
.navigation-landmark-menu-button:focus-visible,
.navigation-landmark-menu-action:focus-visible,
.navigation-save-button:focus-visible,
.navigation-cancel-button:focus-visible,
.navigation-name-input:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}


.canvas-input[data-temporary-navigation="active"] {
  cursor: crosshair;
}

.canvas-input[data-active-gesture="temporary-navigation"],
.canvas-input[data-active-gesture="temporary-selection-transform"] {
  cursor: grabbing;
}

.layer-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(250, 249, 246, 0.9);
  box-shadow: 0 8px 22px rgba(36, 38, 39, 0.07);
  backdrop-filter: blur(10px);
}

.layer-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.layer-panel-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.layer-panel-toggle,
.layer-add-button,
.layer-drag-handle,
.layer-group-drag-handle,
.layer-active-button,
.layer-visibility-button,
.layer-lock-button,
.layer-select-contents-button {
  min-height: 28px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink-strong);
  cursor: pointer;
}

.layer-panel-toggle {
  padding: 4px 8px;
  font-size: 10px;
}

.layer-panel-body {
  display: grid;
  gap: 8px;
}

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

.layer-list {
  display: grid;
  gap: 5px;
}

.layer-section {
  display: grid;
  gap: 4px;
}

.layer-row {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto auto;
  gap: 5px;
  align-items: center;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 9px;
}

.layer-row[data-active="true"] {
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.72);
}

.layer-row[data-visible="false"] {
  opacity: 0.55;
}

.layer-row[data-locked="true"] .layer-name-input {
  opacity: 0.72;
}

.layer-row[data-drop-placement="before"]::before,
.layer-row[data-drop-placement="after"]::after {
  position: absolute;
  right: 4px;
  left: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-strong);
  content: "";
}

.layer-row[data-drop-placement="before"]::before {
  top: -4px;
}

.layer-row[data-drop-placement="after"]::after {
  bottom: -4px;
}

.layer-drag-handle {
  padding: 0;
  color: var(--ink-muted);
  cursor: grab;
  font-size: 12px;
  letter-spacing: -0.16em;
}

.layer-drag-handle:active {
  cursor: grabbing;
}

.layer-name-input {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  outline: none;
  background: transparent;
  color: var(--ink-strong);
  font-size: 11px;
}

.layer-name-input:hover,
.layer-name-input:focus {
  border-color: var(--border-soft);
  background: #ffffff;
}

.layer-active-button,
.layer-visibility-button,
.layer-lock-button {
  padding: 4px 7px;
  font-size: 9px;
}

.layer-opacity-control {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: auto minmax(70px, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 24px;
  padding: 1px 2px 0;
}

.layer-opacity-label {
  min-width: 64px;
  color: var(--ink-muted);
  font-size: 9px;
  white-space: nowrap;
}

.layer-opacity-slider {
  width: 100%;
  min-width: 70px;
  accent-color: var(--ink-strong);
}

.layer-management-actions {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.layer-select-contents-button,
.layer-duplicate-button,
.layer-merge-down-button,
.layer-delete-button {
  min-width: 0;
  padding: 4px 7px;
  font-size: 9px;
  white-space: nowrap;
}

.layer-delete-button {
  color: #6f3232;
}

.layer-group-list {
  display: grid;
  gap: 3px;
  padding: 0 5px 0 38px;
}

.layer-group-row {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 28px;
  padding: 4px 5px 4px 8px;
  border-left: 1px solid var(--border-soft);
  color: var(--ink-muted);
}

.layer-group-row[data-drop-placement="before"]::before,
.layer-group-row[data-drop-placement="after"]::after {
  position: absolute;
  right: 2px;
  left: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-strong);
  content: "";
}

.layer-group-row[data-drop-placement="before"]::before {
  top: -2px;
}

.layer-group-row[data-drop-placement="after"]::after {
  bottom: -2px;
}

.layer-group-drag-handle {
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: grab;
  font-size: 10px;
  letter-spacing: -0.16em;
}

.layer-group-drag-handle:active {
  cursor: grabbing;
}

.layer-group-main {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.layer-group-name-input {
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
  background: transparent;
  color: var(--ink-strong);
  font-size: 9px;
}

.layer-group-name-input:hover,
.layer-group-name-input:focus {
  border-color: var(--border-soft);
  background: #ffffff;
}

.layer-group-count {
  overflow: hidden;
  padding-left: 4px;
  color: var(--ink-muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-group-select-button {
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink-strong);
  cursor: pointer;
  font-size: 9px;
}

.layer-group-select-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.layer-active-button:disabled,
.layer-visibility-button:disabled,
.layer-lock-button:disabled,
.layer-select-contents-button:disabled,
.layer-duplicate-button:disabled,
.layer-merge-down-button:disabled,
.layer-delete-button:disabled {
  cursor: default;
  opacity: 0.58;
}

.layer-add-button {
  width: 100%;
  padding: 5px 8px;
  font-size: 10px;
}

.layer-panel-toggle:hover,
.layer-add-button:hover,
.layer-drag-handle:hover,
.layer-group-drag-handle:hover,
.layer-active-button:hover:not(:disabled),
.layer-visibility-button:hover:not(:disabled),
.layer-lock-button:hover:not(:disabled),
.layer-select-contents-button:hover:not(:disabled),
.layer-duplicate-button:hover:not(:disabled),
.layer-merge-down-button:hover:not(:disabled),
.layer-delete-button:hover:not(:disabled),
.layer-group-select-button:hover:not(:disabled) {
  background: #f1f0ec;
}

.layer-panel-toggle:focus-visible,
.layer-add-button:focus-visible,
.layer-drag-handle:focus-visible,
.layer-group-drag-handle:focus-visible,
.layer-active-button:focus-visible,
.layer-visibility-button:focus-visible,
.layer-lock-button:focus-visible,
.layer-select-contents-button:focus-visible,
.layer-duplicate-button:focus-visible,
.layer-merge-down-button:focus-visible,
.layer-delete-button:focus-visible,
.layer-opacity-slider:focus-visible,
.layer-group-select-button:focus-visible,
.layer-name-input:focus-visible,
.layer-group-name-input:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}


/* CP9A Pen-only ink foundation controls */
.pen-tools-root {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.pen-tool-panel {
  position: fixed;
  bottom: 16px;
  left: 50%;
  display: flex;
  width: max-content;
  max-width: calc(100vw - 48px);
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 5px 6px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(250, 249, 246, 0.95);
  box-shadow: 0 8px 22px rgba(36, 38, 39, 0.09);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
  pointer-events: auto;
  user-select: none;
}

.pen-tool-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0;
  cursor: grab;
}

.pen-tool-header:active {
  cursor: grabbing;
}

.pen-tool-identity {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 2px;
}

.pen-tool-title {
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.pen-tool-active {
  display: none;
}

.pen-tool-collapse,
.pen-tools-restore {
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--ink-strong);
  cursor: pointer;
}

.pen-tool-collapse {
  min-height: 27px;
  padding: 3px 7px;
  border-radius: 7px;
  font-size: 8px;
}

.pen-size-row {
  display: flex;
  flex: 0 1 170px;
  width: 170px;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 3px 7px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.pen-size-label {
  flex: 0 0 auto;
  min-width: 43px;
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 650;
}

.pen-size-slider {
  width: 100%;
  min-width: 76px;
  accent-color: var(--ink-strong);
  touch-action: none;
}

.pen-tools-restore {
  position: fixed;
  bottom: 16px;
  left: 50%;
  display: none;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 9px;
  transform: translateX(-50%);
  pointer-events: auto;
  font-size: 10px;
  font-weight: 650;
}

.pen-tools-root.pen-tools-collapsed .pen-tool-panel {
  display: none;
}

.pen-tools-root.pen-tools-collapsed .pen-tools-restore {
  display: block;
}

@media (max-width: 1100px) {
  .pen-tool-panel {
    max-width: calc(100vw - 32px);
    gap: 4px;
    padding: 5px;
  }

  .pen-tool-title {
    display: none;
  }
}

/* CP9B Pen + eraser foundation controls */
.drawing-tool-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.drawing-tool-button {
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-strong);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.drawing-tool-button[data-active="true"] {
  border-color: rgba(32, 34, 35, 0.48);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(32, 34, 35, 0.10);
}

.drawing-tool-button:hover {
  background: #f1f0ec;
}

.drawing-tool-button:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}

.drawing-tool-note {
  display: none;
}

/* CP9D.2 per-brush colour, recent colours and canvas-visible eyedropper */
.brush-colour-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 0 0 6px;
  border-left: 1px solid var(--border-soft);
}

.brush-colour-heading {
  display: flex;
  align-items: center;
  gap: 4px;
}

.brush-colour-label {
  display: none;
}

.brush-colour-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.brush-colour-button {
  width: 28px;
  height: 28px;
  padding: 2px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px #ffffff;
  cursor: pointer;
}

.brush-colour-button[aria-expanded="true"] {
  border-color: rgba(32, 34, 35, 0.48);
}

.brush-colour-picker {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 2;
  display: grid;
  width: 220px;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 32px rgba(36, 38, 39, 0.12);
}

.brush-colour-field,
.brush-hue-field {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(32, 34, 35, 0.18);
  border-radius: 7px;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.brush-colour-field {
  height: 92px;
  background-image:
    linear-gradient(to top, #000000, transparent),
    linear-gradient(to right, #ffffff, transparent);
}

.brush-hue-field {
  height: 14px;
  background: linear-gradient(
    to right,
    #ff0000 0%,
    #ffff00 16.666%,
    #00ff00 33.333%,
    #00ffff 50%,
    #0000ff 66.666%,
    #ff00ff 83.333%,
    #ff0000 100%
  );
}

.brush-colour-field-marker,
.brush-hue-marker {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.brush-colour-field-marker {
  width: 11px;
  height: 11px;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(32, 34, 35, 0.72);
}

.brush-hue-marker {
  top: 50%;
  width: 4px;
  height: 18px;
  border: 1px solid #ffffff;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(32, 34, 35, 0.55);
  background: transparent;
}

.brush-colour-hex-hint {
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.brush-colour-hex-input {
  width: 100%;
  min-width: 0;
  height: 28px;
  box-sizing: border-box;
  padding: 5px 7px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink-strong);
  font: inherit;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  outline: none;
}

.brush-colour-hex-input:focus {
  border-color: rgba(32, 34, 35, 0.48);
  box-shadow: 0 0 0 1px rgba(32, 34, 35, 0.08);
}

.brush-colour-hex-input[aria-invalid="true"] {
  border-color: rgba(32, 34, 35, 0.5);
  background: rgba(32, 34, 35, 0.035);
}

.brush-eyedropper-button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-strong);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}



.brush-eyedropper-button[data-active="true"] {
  border-color: rgba(32, 34, 35, 0.48);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(32, 34, 35, 0.10);
}

.recent-colours {
  display: flex;
  min-height: 0;
  align-items: center;
  gap: 3px;
}

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

.recent-colour-swatch {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(32, 34, 35, 0.22);
  border-radius: 6px;
  cursor: pointer;
}

.recent-colour-swatch:hover,
.brush-eyedropper-button:hover {
  box-shadow: inset 0 0 0 1px rgba(32, 34, 35, 0.16);
}

/* CP9D.1 deliberate post-stroke Smooth Line controls */
.smooth-line-control {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 0 0 6px;
  border-left: 1px solid var(--border-soft);
}

.smooth-line-heading {
  display: flex;
  align-items: center;
  gap: 5px;
}

.smooth-line-toggle {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-strong);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.smooth-line-toggle[data-active="true"] {
  border-color: rgba(32, 34, 35, 0.48);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(32, 34, 35, 0.10);
}

.smooth-line-value {
  color: var(--ink-muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.smooth-line-slider {
  width: 92px;
  accent-color: var(--ink-strong);
}

.smooth-line-note {
  display: none;
}

/* Drawing tool grouping */
.drawing-tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.drawing-tool-group + .drawing-tool-group {
  padding-left: 6px;
  border-left: 1px solid var(--border-soft);
}

.drawing-tool-group-label {
  display: none;
}

/* CP10C separate temporary drawing guides */
.guide-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(250, 249, 246, 0.9);
  box-shadow: 0 8px 22px rgba(36, 38, 39, 0.07);
  backdrop-filter: blur(10px);
}

.guide-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guide-panel-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.guide-panel-toggle,
.guide-tool-button,
.guide-dismiss-button {
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--ink-strong);
  cursor: pointer;
}

.guide-panel-toggle {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
}

.guide-panel-body {
  display: grid;
  gap: 7px;
}

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

.guide-tool-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.guide-tool-button {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 650;
}

.guide-tool-button[data-active="true"] {
  border-color: rgba(32, 34, 35, 0.48);
  box-shadow: inset 0 0 0 1px rgba(32, 34, 35, 0.10);
}

.guide-dismiss-button {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 650;
}

.guide-panel-toggle:hover,
.guide-tool-button:hover,
.guide-dismiss-button:hover {
  background: #f1f0ec;
}

.guide-panel-toggle:focus-visible,
.guide-tool-button:focus-visible,
.guide-dismiss-button:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}

.guide-panel-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.35;
}


/* CP10D.1 separate project canvas-grid block */
.canvas-grid-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(250, 249, 246, 0.9);
  box-shadow: 0 8px 22px rgba(36, 38, 39, 0.07);
  backdrop-filter: blur(10px);
}

.canvas-grid-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.canvas-grid-panel-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.canvas-grid-panel-toggle,
.canvas-grid-button {
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--ink-strong);
  cursor: pointer;
}

.canvas-grid-panel-toggle {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
}

.canvas-grid-panel-body {
  display: grid;
  gap: 7px;
}

.canvas-grid-panel-body[hidden] {
  display: none;
}

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

.canvas-grid-button {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 650;
}

.canvas-grid-button[data-active="true"] {
  border-color: rgba(32, 34, 35, 0.48);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(32, 34, 35, 0.10);
}

.canvas-grid-panel-toggle:hover,
.canvas-grid-button:hover {
  background: #f1f0ec;
}

.canvas-grid-panel-toggle:focus-visible,
.canvas-grid-button:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}

.canvas-grid-panel-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.35;
}


/* CP11A image import */
.image-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(250, 249, 246, 0.9);
  box-shadow: 0 8px 22px rgba(36, 38, 39, 0.07);
  backdrop-filter: blur(10px);
}

.image-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.image-panel-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.image-panel-toggle,
.image-import-button {
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--ink-strong);
  cursor: pointer;
}

.image-panel-toggle {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
}

.image-panel-body {
  display: grid;
  gap: 7px;
}

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

.image-import-button {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 650;
}

.image-panel-toggle:hover,
.image-import-button:hover { background: #f1f0ec; }

.image-panel-toggle:focus-visible,
.image-import-button:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}

.image-file-input { display: none; }

.image-panel-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.35;
}

.canvas-input[data-image-drag-active="true"] {
  outline: 2px dashed rgba(32, 34, 35, 0.38);
  outline-offset: -10px;
}

/* CP11B multi-image import choice */
.image-batch-choice {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
}

.image-batch-choice[hidden] { display: none; }

.image-batch-title {
  margin: 0;
  color: var(--ink-strong);
  font-size: 9px;
  font-weight: 700;
}

.image-batch-name-label {
  display: grid;
  gap: 4px;
  color: var(--ink-muted);
  font-size: 8px;
}

.image-batch-name-input {
  min-width: 0;
  width: 100%;
  height: 29px;
  padding: 5px 7px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  outline: none;
  background: #ffffff;
  color: var(--ink-strong);
  font: inherit;
  font-size: 10px;
}

.image-batch-name-input:focus {
  border-color: rgba(32, 34, 35, 0.42);
}

.image-batch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.image-batch-action,
.image-batch-cancel {
  min-height: 31px;
  padding: 5px 7px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink-strong);
  cursor: pointer;
  font-size: 8px;
  line-height: 1.2;
}

.image-batch-action-primary {
  background: var(--ink-strong);
  color: #ffffff;
  border-color: var(--ink-strong);
}

.image-batch-cancel {
  min-height: 25px;
  justify-self: start;
  padding: 3px 7px;
  background: transparent;
  color: var(--ink-muted);
}

.image-batch-action:hover,
.image-batch-cancel:hover { background: #f1f0ec; }

.image-batch-action-primary:hover { background: #353738; }

.image-batch-action:focus-visible,
.image-batch-cancel:focus-visible,
.image-batch-name-input:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}

/* CP13 Project Notes ------------------------------------------------------- */
.project-notes-panel {
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-panel);
  background: var(--panel-surface);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(12px);
}

.project-notes-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
}

.project-notes-title {
  margin: 0;
  font-size: 12px;
  font-weight: 750;
}

.project-notes-header-button,
.project-note-new-button,
.project-note-delete-button,
.project-note-format-button,
.project-note-sticky-button,
.project-notes-expanded-close {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink-strong);
  cursor: pointer;
}

.project-notes-header-button {
  min-height: 27px;
  padding: 4px 7px;
  font-size: 9px;
}

.project-notes-body {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
  border-top: 1px solid var(--border-soft);
}

.project-note-list {
  display: grid;
  gap: 6px;
  padding-top: 9px;
}

.project-note-list-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.project-note-bridge-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.project-note-new-button {
  min-height: 29px;
  padding: 5px 7px;
  font-size: 9px;
  font-weight: 650;
}

.project-note-list-items {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.project-note-list-item {
  min-width: 94px;
  max-width: 150px;
  min-height: 30px;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 620;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.project-note-list-item[data-selected="true"] {
  border-color: rgba(29, 31, 32, 0.42);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-strong);
}

.project-note-editor {
  display: grid;
  gap: 7px;
}

.project-note-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.project-note-title-input {
  min-width: 0;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-strong);
  font-size: 10px;
  font-weight: 700;
}

.project-note-delete-button {
  padding: 5px 7px;
  color: #9a625f;
  font-size: 9px;
}

.project-note-format-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.project-note-format-button {
  min-height: 26px;
  padding: 4px;
  font-size: 8px;
}

.project-note-content-editor {
  min-height: 180px;
  max-height: 285px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  outline: none;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink-strong);
  font-size: 11px;
  line-height: 1.5;
  white-space: normal;
}

.project-note-content-editor:focus,
.project-note-title-input:focus {
  border-color: rgba(29, 31, 32, 0.45);
}

.project-note-content-editor p,
.project-note-content-editor h2,
.project-note-content-editor h3,
.project-note-content-editor ul,
.project-note-content-editor ol {
  margin: 0 0 0.65em;
}

.project-note-content-editor h2 {
  font-size: 1.35em;
}

.project-note-content-editor h3 {
  font-size: 1.12em;
}

.project-note-content-editor ul,
.project-note-content-editor ol {
  padding-left: 1.55em;
}

.project-note-content-editor ul[data-checklist="true"] {
  padding-left: 0;
  list-style: none;
}

.project-note-content-editor ul[data-checklist="true"] > li {
  position: relative;
  padding-left: 24px;
}

.project-note-content-editor ul[data-checklist="true"] > li::before {
  position: absolute;
  top: 0;
  left: 2px;
  content: "☐";
  color: var(--ink-muted);
  cursor: pointer;
}

.project-note-content-editor ul[data-checklist="true"] > li[data-checked="true"]::before {
  content: "☑";
  color: var(--ink-strong);
}

.project-note-content-editor ul[data-checklist="true"] > li[data-checked="true"] {
  color: var(--ink-muted);
  text-decoration: line-through;
}

.project-note-sticky-button {
  min-height: 29px;
  padding: 5px 8px;
  font-size: 8px;
}

.project-note-sticky-button:disabled {
  opacity: 0.42;
  cursor: default;
}

.project-note-drag-hint {
  margin: 0;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.35;
}

.project-note-content-editor[data-dragging-selection="true"] {
  cursor: grabbing;
}

.project-note-content-editor::selection {
  background: rgba(194, 154, 107, 0.38);
}

.project-note-selection-drag-preview {
  position: fixed;
  top: -1000px;
  left: -1000px;
  z-index: 9999;
  width: max-content;
  max-width: 180px;
  padding: 9px 11px;
  border: 1px solid rgba(58, 43, 31, 0.22);
  border-radius: 8px;
  background: #c29a6b;
  box-shadow: 0 8px 18px rgba(58, 43, 31, 0.16);
  color: #30241d;
  font-size: 10px;
  line-height: 1.35;
  white-space: normal;
}

.project-notes-status {
  margin: 0;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.4;
}

.project-notes-expanded-root {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(243, 242, 238, 0.9);
  backdrop-filter: blur(14px);
}

.project-notes-expanded-root[hidden] {
  display: none;
}

.project-notes-expanded {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  background: #f8f7f3;
}

.project-notes-expanded-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.project-notes-expanded-heading {
  display: grid;
  gap: 2px;
}

.project-notes-expanded-heading span {
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.project-notes-expanded-heading strong {
  font-size: 14px;
}

.project-notes-expanded-close {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 10px;
}

.project-notes-expanded-content {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  justify-content: center;
  min-height: 0;
  gap: 24px;
  padding: 24px;
  overflow: hidden;
}

.project-note-list-expanded {
  align-content: start;
  min-height: 0;
  padding: 0;
}

.project-note-list-expanded .project-note-list-items {
  display: grid;
  align-content: start;
  overflow: auto;
}

.project-note-list-expanded .project-note-list-item {
  width: 100%;
  max-width: none;
}

.project-note-editor-expanded {
  min-height: 0;
  align-content: start;
}

.project-note-editor-expanded .project-note-content-editor {
  min-height: min(62vh, 620px);
  max-height: calc(100vh - 220px);
  padding: 22px 26px;
  font-size: 15px;
  line-height: 1.65;
}

.project-note-editor-expanded .project-note-format-toolbar {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.project-notes-header-button:hover,
.project-note-new-button:hover,
.project-note-delete-button:hover,
.project-note-format-button:hover,
.project-note-sticky-button:not(:disabled):hover,
.project-notes-expanded-close:hover {
  border-color: rgba(29, 31, 32, 0.34);
  background: rgba(255, 255, 255, 0.94);
}

.project-notes-header-button:focus-visible,
.project-note-new-button:focus-visible,
.project-note-delete-button:focus-visible,
.project-note-format-button:focus-visible,
.project-note-sticky-button:focus-visible,
.project-notes-expanded-close:focus-visible,
.project-note-list-item:focus-visible {
  outline: 2px solid rgba(29, 31, 32, 0.45);
  outline-offset: 2px;
}

.cp14a-validation-card {
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
}

.cp14a-validation-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.cp14a-validation-button {
  margin-top: 9px;
  font-weight: 700;
}

.cp14a-validation-button:disabled {
  opacity: 0.58;
  cursor: progress;
}

.cp14a-validation-status {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.45;
}

.cp14a-validation-status[data-result="passed"] {
  color: #466c57;
  font-weight: 650;
}

.cp14a-validation-status[data-result="failed"] {
  color: #8d4c48;
  font-weight: 650;
}

.cp14a-validation-diagnostics {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.cp14a-validation-diagnostics[hidden],
.cp14a-validation-report[hidden] {
  display: none;
}

.cp14a-validation-timeline {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(245, 244, 240, 0.9);
}

.cp14a-validation-stage {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 7px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.66);
}

.cp14a-validation-stage:last-child {
  border-bottom: 0;
}

.cp14a-validation-stage-marker {
  width: 8px;
  height: 8px;
  margin-top: 3px;
  border: 1px solid rgba(29, 31, 32, 0.3);
  border-radius: 50%;
  background: transparent;
}

.cp14a-validation-stage[data-status="running"] .cp14a-validation-stage-marker {
  border-color: rgba(29, 31, 32, 0.6);
  animation: cp14a-validation-pulse 0.8s ease-in-out infinite alternate;
}

.cp14a-validation-stage[data-status="passed"] .cp14a-validation-stage-marker {
  border-color: #466c57;
  background: #466c57;
}

.cp14a-validation-stage[data-status="failed"] .cp14a-validation-stage-marker {
  border-color: #8d4c48;
  background: #8d4c48;
}

.cp14a-validation-stage-copy {
  min-width: 0;
}

.cp14a-validation-stage-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 7px;
  font-size: 9px;
}

.cp14a-validation-stage-time {
  flex: 0 0 auto;
  color: var(--ink-muted);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.cp14a-validation-stage p {
  margin: 2px 0 0;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.4;
}

.cp14a-validation-report {
  display: grid;
  gap: 8px;
  padding-top: 1px;
}

.cp14a-validation-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-size: 9px;
}

.cp14a-validation-result-header[data-result="passed"] {
  border-color: rgba(70, 108, 87, 0.35);
  background: rgba(70, 108, 87, 0.07);
  color: #3e654f;
}

.cp14a-validation-result-header[data-result="failed"] {
  border-color: rgba(141, 76, 72, 0.35);
  background: rgba(141, 76, 72, 0.07);
  color: #824641;
}

.cp14a-validation-result-header span {
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.cp14a-validation-fingerprints,
.cp14a-validation-transient {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.cp14a-validation-key-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink-muted);
  font-size: 8px;
}

.cp14a-validation-key-value:last-child {
  border-bottom: 0;
}

.cp14a-validation-key-value strong {
  color: var(--ink-strong);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.cp14a-validation-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.cp14a-validation-count {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.56);
}

.cp14a-validation-count strong {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.cp14a-validation-count span {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp14a-validation-subheading {
  margin: 2px 0 -2px;
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cp14a-validation-checks {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.cp14a-validation-check {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 8px;
}

.cp14a-validation-check:last-child {
  border-bottom: 0;
}

.cp14a-validation-check-marker {
  font-weight: 800;
}

.cp14a-validation-check[data-passed="true"] .cp14a-validation-check-marker {
  color: #466c57;
}

.cp14a-validation-check[data-passed="false"] .cp14a-validation-check-marker {
  color: #8d4c48;
}

.cp14a-validation-check code {
  color: var(--ink-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 7px;
}

.cp14a-validation-failure {
  padding: 8px 9px;
  border: 1px solid rgba(141, 76, 72, 0.35);
  border-radius: 8px;
  background: rgba(141, 76, 72, 0.07);
  color: #824641;
  font-size: 8px;
}

.cp14a-validation-failure p {
  margin: 4px 0 0;
  line-height: 1.4;
}

@keyframes cp14a-validation-pulse {
  from { opacity: 0.35; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.05); }
}

/* CP14B durable browser persistence */
.project-identity {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.project-library-back {
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
}

.project-library-back:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-strong);
}

.project-library-back:disabled {
  cursor: wait;
  opacity: 0.65;
}

.project-save-status {
  min-width: 48px;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.project-save-status[data-save-phase="saved"] {
  color: #466c57;
}

.project-save-status[data-save-phase="failed"] {
  color: #8d4c48;
}

.project-save-status[data-save-phase="saving"],
.project-save-status[data-save-phase="dirty"],
.project-save-status[data-save-phase="initialising"] {
  color: #6d6040;
}

.cp14b-save-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.7);
}

.cp14b-save-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(245, 244, 240, 0.9);
}

.cp14b-save-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.66);
  font-size: 8px;
  line-height: 1.4;
}

.cp14b-save-row:last-child {
  border-bottom: 0;
}

.cp14b-save-row > span {
  color: var(--ink-muted);
}

.cp14b-save-row > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.cp14b-save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cp14c-recovery-issues {
  margin: 12px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.cp14c-recovery-issues[hidden] { display: none; }

#cp14c-recovery-card[data-recovery-status="recovered"],
#cp14c-recovery-card[data-recovery-status="warning"] {
  border-color: rgba(154, 112, 38, 0.45);
}

#cp14c-recovery-card[data-recovery-status="blocked"],
#cp14c-recovery-card[data-recovery-status="failed"] {
  border-color: rgba(143, 55, 55, 0.5);
}

/* CP15A Library + safe multi-Project lifecycle */
.project-library-shell {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: clamp(24px, 4vw, 56px);
  background: var(--surface-app);
}

.project-library-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, 100%);
  margin: 0 auto 28px;
}

.project-library-brand {
  margin: 0 0 5px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.02em;
}

.project-library-header h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 660;
  letter-spacing: -0.04em;
}

.project-library-intro {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.project-library-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-library-open-backup-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(29, 31, 32, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink-strong);
  font: inherit;
  font-size: 12px;
  font-weight: 640;
  cursor: pointer;
}

.project-library-open-backup-button:hover:not(:disabled) {
  background: rgba(29, 31, 32, 0.06);
}

.project-library-open-backup-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.project-library-new-button,
.project-library-create-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(29, 31, 32, 0.2);
  border-radius: 10px;
  background: var(--ink-strong);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.project-library-create-row {
  width: min(1180px, 100%);
  margin: 0 auto 24px;
}

.project-library-create {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px 14px;
  width: min(760px, 100%);
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(250, 249, 246, 0.92);
  box-shadow: var(--panel-shadow);
}

.project-library-create label {
  grid-column: 1 / -1;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
}

.project-library-create input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(29, 31, 32, 0.22);
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--ink-strong);
  font-size: 14px;
}

.project-library-create input:focus {
  border-color: rgba(29, 31, 32, 0.5);
  box-shadow: 0 0 0 3px rgba(29, 31, 32, 0.06);
}

.project-library-create-actions {
  display: flex;
  gap: 8px;
}

.project-library-create-actions button:first-child {
  background: transparent;
  color: var(--ink-muted);
}

.project-library-create-actions button:disabled {
  cursor: default;
  opacity: 0.4;
}

.project-library-toolbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 360px) auto;
  align-items: center;
  gap: 12px;
  width: min(1180px, 100%);
  margin: 0 auto 18px;
}

.project-library-section-tabs,
.project-library-view-toggle {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(250, 249, 246, 0.78);
}

.project-library-section-tabs button,
.project-library-view-toggle button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.project-library-section-tabs button[aria-selected="true"],
.project-library-view-toggle button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink-strong);
  box-shadow: 0 1px 4px rgba(29, 31, 32, 0.08);
}

.project-library-search {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  outline: none;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-strong);
  font: inherit;
  font-size: 11px;
}

.project-library-search:focus {
  border-color: rgba(29, 31, 32, 0.38);
  box-shadow: 0 0 0 3px rgba(29, 31, 32, 0.05);
}

.project-library-content {
  width: min(1180px, 100%);
  min-height: 320px;
  margin: 0 auto;
}

.project-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.project-library-card {
  position: relative;
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 15px;
  background: rgba(250, 249, 246, 0.9);
  box-shadow: 0 7px 22px rgba(36, 38, 39, 0.05);
  color: inherit;
  text-align: left;
  cursor: default;
  transition: transform 130ms ease, box-shadow 130ms ease, border-color 130ms ease;
}

.project-library-card:hover {
  transform: translateY(-2px);
  border-color: rgba(29, 31, 32, 0.24);
  box-shadow: 0 12px 30px rgba(36, 38, 39, 0.09);
}

.project-library-card-open {
  display: grid;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.project-library-card-open:disabled {
  cursor: default;
}

.project-library-card[data-archived="true"] {
  opacity: 0.82;
}

.project-library-card-preview {
  display: grid;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  place-items: center;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-canvas);
}

.project-library-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-library-card-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background-image: radial-gradient(circle at 1px 1px, rgba(29, 31, 32, 0.13) 1px, transparent 0);
  background-size: 18px 18px;
}

.project-library-card-placeholder span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  background: rgba(250, 249, 246, 0.88);
  color: var(--ink-muted);
  font-size: 16px;
  font-weight: 700;
}

.project-library-card-copy {
  display: grid;
  gap: 4px;
  padding: 12px 13px 14px;
}

.project-library-card-copy strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-library-card-copy span {
  color: var(--ink-muted);
  font-size: 10px;
}

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

.project-library-list-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 72px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(250, 249, 246, 0.9);
}

.project-library-list-open {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.project-library-list-open:disabled {
  cursor: default;
}

.project-library-list-preview {
  display: grid;
  width: 78px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface-canvas);
}

.project-library-list-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-library-list-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.project-library-list-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-library-list-copy span {
  color: var(--ink-muted);
  font-size: 9px;
}

.project-library-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
}

.project-library-list-row > .project-library-actions {
  position: relative;
  top: auto;
  right: auto;
  margin-right: 8px;
}

.project-library-actions summary {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(250, 249, 246, 0.94);
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.project-library-actions summary::-webkit-details-marker {
  display: none;
}

.project-library-actions[open] summary {
  color: var(--ink-strong);
}

.project-library-actions-menu {
  position: absolute;
  top: 34px;
  right: 0;
  display: grid;
  min-width: 150px;
  overflow: hidden;
  padding: 4px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px rgba(29, 31, 32, 0.14);
}

.project-library-actions-menu button {
  min-height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-strong);
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.project-library-actions-menu button:hover:not(:disabled) {
  background: rgba(29, 31, 32, 0.06);
}

.project-library-actions-menu button.danger {
  color: #824641;
}

.project-library-actions-menu button:disabled {
  cursor: wait;
  opacity: 0.45;
}

.project-name-edit {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}

.project-library-empty {
  display: grid;
  min-height: 300px;
  place-content: center;
  gap: 7px;
  color: var(--ink-muted);
  text-align: center;
}

.project-library-empty strong {
  color: var(--ink-strong);
  font-size: 16px;
}

.project-library-error {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
  padding: 10px 12px;
  border: 1px solid rgba(141, 76, 72, 0.28);
  border-radius: 10px;
  background: rgba(141, 76, 72, 0.06);
  color: #824641;
  font-size: 11px;
}

.project-library-notice {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
  padding: 10px 12px;
  border: 1px solid rgba(53, 91, 72, 0.22);
  border-radius: 10px;
  background: rgba(53, 91, 72, 0.06);
  color: #3f6955;
  font-size: 11px;
}

.project-library-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, 100%);
  margin: 34px auto 0;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--ink-muted);
  font-size: 9px;
}

@media (max-width: 620px) {
  .project-library-toolbar {
    grid-template-columns: 1fr;
  }

  .project-library-section-tabs,
  .project-library-view-toggle {
    justify-self: start;
  }

  .project-library-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-library-create {
    grid-template-columns: 1fr;
  }

  .project-library-create-actions,
  .project-library-footer {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* CP15B Project management dialogs */
.project-management-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(29, 31, 32, 0.24);
  backdrop-filter: blur(2px);
}

.project-management-dialog {
  width: min(430px, 100%);
  padding: 22px;
  border: 1px solid rgba(29, 31, 32, 0.16);
  border-radius: 16px;
  background: rgba(250, 249, 246, 0.99);
  box-shadow: 0 24px 70px rgba(29, 31, 32, 0.2);
}

.project-management-dialog-kicker {
  margin: 0 0 6px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-management-dialog h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 660;
  letter-spacing: -0.025em;
}

.project-management-dialog-copy {
  margin: 8px 0 18px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

.project-management-dialog form {
  display: grid;
  gap: 8px;
}

.project-management-dialog label {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
}

.project-management-dialog input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(29, 31, 32, 0.22);
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--ink-strong);
  font-size: 14px;
}

.project-management-dialog input:focus {
  border-color: rgba(29, 31, 32, 0.5);
  box-shadow: 0 0 0 3px rgba(29, 31, 32, 0.06);
}

.project-management-dialog input:disabled {
  opacity: 0.65;
}

.project-management-dialog-error {
  margin: 2px 0 0;
  color: #824641;
  font-size: 10px;
  line-height: 1.4;
}

.project-management-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.project-management-dialog-actions button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(29, 31, 32, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-strong);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.project-management-dialog-actions button.primary {
  border-color: var(--ink-strong);
  background: var(--ink-strong);
  color: #fff;
}

.project-management-dialog-actions button.danger {
  border-color: rgba(130, 70, 65, 0.32);
  background: #824641;
  color: #fff;
}

.project-management-dialog-actions button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.project-management-dialog-actions button:disabled {
  cursor: default;
  opacity: 0.45;
  transform: none;
}

.project-management-dialog-danger {
  border-color: rgba(130, 70, 65, 0.22);
}

@media (max-width: 560px) {
  .project-management-dialog-backdrop {
    padding: 16px;
  }

  .project-management-dialog {
    padding: 18px;
  }

  .project-management-dialog-actions {
    flex-direction: column-reverse;
  }

  .project-management-dialog-actions button {
    width: 100%;
  }
}

/* CP15D Books Foundation + focused page workspace */
.book-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(250, 249, 246, 0.9);
  box-shadow: 0 8px 22px rgba(36, 38, 39, 0.07);
  backdrop-filter: blur(10px);
}

.book-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.book-panel-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.book-panel-toggle,
.book-create-button,
.book-format-button,
.book-format-cancel,
.book-workspace-back,
.book-workspace-rename,
.book-workspace-footer button {
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--ink-strong);
  cursor: pointer;
}

.book-panel-toggle {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
}

.book-panel-body {
  display: grid;
  gap: 7px;
}

.book-panel-body[hidden],
.book-format-chooser[hidden],
.book-page-delete-dialog[hidden] {
  display: none;
}

.book-create-button {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 650;
}

.book-format-chooser {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.76);
}

.book-format-prompt,
.book-panel-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.35;
}

.book-format-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.book-format-button,
.book-format-cancel {
  min-height: 30px;
  padding: 5px 6px;
  border-radius: 7px;
  font-size: 9px;
}

.book-format-cancel {
  justify-self: start;
  border-color: transparent;
  background: transparent;
  color: var(--ink-muted);
}

.layer-row[data-role="book"] .layer-name-input {
  cursor: default;
  color: var(--ink-muted);
}

.book-workspace-host {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.book-workspace-root {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.book-workspace-header {
  position: absolute;
  top: 16px;
  left: 50%;
  display: grid;
  grid-template-columns: auto minmax(140px, 260px) auto auto auto;
  gap: 8px;
  align-items: center;
  max-width: calc(100vw - var(--book-right-rail-space, 0px) - 48px);
  padding: 7px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(250, 249, 246, 0.94);
  box-shadow: 0 8px 22px rgba(36, 38, 39, 0.08);
  transform: translateX(-50%);
  pointer-events: auto;
  backdrop-filter: blur(10px);
}

.book-workspace-back {
  min-height: 29px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 9px;
}

.book-workspace-rename {
  min-height: 29px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 9px;
}

.book-workspace-title {
  min-width: 0;
  width: 100%;
  height: 29px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  outline: none;
  background: transparent;
  color: var(--ink-strong);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.book-workspace-title:hover,
.book-workspace-title:focus {
  border-color: var(--border-soft);
  background: #ffffff;
}

.book-workspace-page-label {
  color: var(--ink-muted);
  font-size: 9px;
  white-space: nowrap;
}

.book-workspace-footer {
  position: absolute;
  bottom: 70px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: min(720px, calc(100vw - var(--book-right-rail-space, 0px) - 48px));
  padding: 6px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(250, 249, 246, 0.94);
  box-shadow: 0 8px 22px rgba(36, 38, 39, 0.08);
  transform: translateX(-50%);
  pointer-events: auto;
  backdrop-filter: blur(10px);
}

.book-workspace-footer button {
  min-width: 29px;
  min-height: 29px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 9px;
}

.book-workspace-footer button:disabled {
  cursor: default;
  opacity: 0.5;
}

.book-page-strip {
  display: flex;
  max-width: min(420px, 42vw);
  gap: 4px;
  overflow-x: auto;
  padding: 1px;
}

.book-page-strip-button {
  flex: 0 0 auto;
}

.book-page-strip-button[data-active="true"] {
  border-color: rgba(32, 34, 35, 0.48);
  box-shadow: inset 0 0 0 1px rgba(32, 34, 35, 0.1);
}

.book-page-delete {
  margin-left: 3px;
  color: #6f3232;
}

.book-page-delete-dialog {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(36, 38, 39, 0.16);
  pointer-events: auto;
}

.book-page-delete-dialog-card {
  display: grid;
  width: min(340px, calc(100vw - 32px));
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: #faf9f6;
  box-shadow: 0 16px 48px rgba(36, 38, 39, 0.16);
}

.book-page-delete-dialog-card strong {
  font-size: 12px;
}

.book-page-delete-dialog-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.45;
}

.book-page-delete-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.book-page-delete-confirm {
  color: #6f3232;
}

.book-panel-toggle:hover,
.book-create-button:hover,
.book-format-button:hover,
.book-format-cancel:hover,
.book-workspace-back:hover,
.book-workspace-rename:hover,
.book-workspace-footer button:hover:not(:disabled) {
  background: #f1f0ec;
}

.book-panel-toggle:focus-visible,
.book-create-button:focus-visible,
.book-format-button:focus-visible,
.book-format-cancel:focus-visible,
.book-workspace-back:focus-visible,
.book-workspace-rename:focus-visible,
.book-workspace-title:focus-visible,
.book-workspace-footer button:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}

body[data-pencil-workspace="book"] .project-chrome-left,
body[data-pencil-workspace="book"] .book-panel-root,
body[data-pencil-workspace="book"] .project-notes-expanded-root,
body[data-pencil-workspace="book"] .first-project-onboarding,
body[data-pencil-workspace="book"] .prototype-debug-dock {
  display: none;
}

@media (max-width: 900px) {
  .book-workspace-header,
  .book-workspace-footer {
    max-width: calc(100vw - var(--book-right-rail-space, 0px) - 24px);
  }
}

/* CP17J — pre-real-use friction reduction ---------------------------------- */
.layer-panel:has(> .layer-panel-body[hidden]),
.book-panel:has(> .book-panel-body[hidden]),
.image-panel:has(> .image-panel-body[hidden]),
.guide-panel:has(> .guide-panel-body[hidden]),
.canvas-grid-panel:has(> .canvas-grid-panel-body[hidden]) {
  gap: 0;
  padding: 6px 8px;
  border-radius: 10px;
  box-shadow: 0 5px 14px rgba(36, 38, 39, 0.05);
}

.layer-panel:has(> .layer-panel-body[hidden]) .layer-panel-header,
.book-panel:has(> .book-panel-body[hidden]) .book-panel-header,
.image-panel:has(> .image-panel-body[hidden]) .image-panel-header,
.guide-panel:has(> .guide-panel-body[hidden]) .guide-panel-header,
.canvas-grid-panel:has(> .canvas-grid-panel-body[hidden]) .canvas-grid-panel-header {
  min-height: 24px;
}

.layer-panel:has(> .layer-panel-body[hidden]) .layer-panel-toggle,
.book-panel:has(> .book-panel-body[hidden]) .book-panel-toggle,
.image-panel:has(> .image-panel-body[hidden]) .image-panel-toggle,
.guide-panel:has(> .guide-panel-body[hidden]) .guide-panel-toggle,
.canvas-grid-panel:has(> .canvas-grid-panel-body[hidden]) .canvas-grid-panel-toggle {
  min-height: 24px;
  padding: 3px 7px;
  font-size: 9px;
}

body[data-pencil-workspace="book"] {
  --book-right-rail-space: calc(var(--layers-panel-width) + 32px);
}

body[data-pencil-workspace="book"] .book-workspace-header,
body[data-pencil-workspace="book"] .book-workspace-footer,
body[data-pencil-workspace="book"] .pen-tool-panel,
body[data-pencil-workspace="book"] .pen-tools-restore {
  left: calc((100vw - var(--book-right-rail-space)) / 2);
}

body[data-pencil-workspace="book"] .pen-tool-panel {
  max-width: calc(100vw - var(--book-right-rail-space) - 32px);
}

/* CP17B — focused read-only Export composition + authoritative preview */
.project-export-entry {
  display: grid;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(250, 249, 246, 0.88);
  box-shadow: 0 6px 18px rgba(36, 38, 39, 0.06);
  backdrop-filter: blur(10px);
}

.project-export-button {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(29, 31, 32, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-strong);
  font: inherit;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
}

.project-export-button:hover,
.project-export-button[data-active="true"] {
  background: rgba(29, 31, 32, 0.08);
}

.project-name-edit:disabled {
  cursor: default;
  opacity: 0.58;
}

.export-panel-root {
  position: fixed;
  z-index: 7;
  pointer-events: auto;
}

.export-panel-root[data-placement="project"] {
  top: var(--export-panel-top, 96px);
  left: var(--export-panel-left, 16px);
  width: var(--export-panel-width, min(var(--sidebar-width), calc(100vw - 32px)));
}

.export-panel-root[data-placement="book"],
body[data-pencil-workspace="book"] .export-panel-root {
  top: 70px;
  right: 18px;
  width: min(330px, calc(100vw - 40px));
}

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

.export-panel {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(250, 249, 246, 0.96);
  box-shadow: 0 12px 34px rgba(29, 31, 32, 0.15);
  backdrop-filter: blur(12px);
}

.export-panel-root[data-placement="project"] .export-panel {
  max-height: calc(100vh - var(--export-panel-top, 96px) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  box-shadow: 0 10px 24px rgba(29, 31, 32, 0.11);
}

.export-panel-root[data-placement="book"] .export-panel,
body[data-pencil-workspace="book"] .export-panel-root .export-panel {
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.export-panel-header,
.export-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.export-panel-header > div {
  display: grid;
  gap: 2px;
}

.export-panel-header strong {
  color: var(--ink-strong);
  font-size: 12px;
}

.export-panel-kicker,
.export-panel-section-title,
.export-panel-footer {
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.export-panel-close,
.export-panel-next,
.export-panel-export,
.export-scope-button,
.export-preset-button,
.export-png-option-button {
  border: 1px solid rgba(29, 31, 32, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-strong);
  font: inherit;
  cursor: pointer;
}

.export-panel-close {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 9px;
}

.export-panel-section {
  display: grid;
  gap: 6px;
}

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

.export-scope-button {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 9px;
  font-weight: 650;
}

.export-scope-button[data-selected="true"],
.export-preset-button[data-selected="true"],
.export-png-option-button[data-selected="true"] {
  border-color: rgba(29, 31, 32, 0.42);
  background: rgba(29, 31, 32, 0.09);
}

.export-scope-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.export-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.export-preset-button {
  min-height: 28px;
  padding: 4px 5px;
  font-size: 8px;
  font-weight: 650;
}

.export-panel-help {
  margin: 0;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.45;
}

.export-panel-scope-summary {
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(29, 31, 32, 0.04);
}

.export-panel-footer {
  padding-top: 2px;
  letter-spacing: 0.03em;
  text-transform: none;
}

.export-panel-next {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 8px;
}

.export-panel-export {
  min-height: 28px;
  padding: 4px 10px;
  border-color: rgba(29, 31, 32, 0.34);
  background: #202223;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
}

.export-panel-next:disabled,
.export-panel-export:disabled {
  cursor: default;
  opacity: 0.48;
}

.export-panel-footer-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.export-png-section {
  padding-top: 2px;
}

.export-png-option-label {
  color: var(--ink-muted);
  font-size: 8px;
  font-weight: 650;
}

.export-png-option-grid {
  display: grid;
  gap: 5px;
}

.export-png-background-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.export-png-resolution-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.export-png-option-button {
  min-height: 27px;
  padding: 4px 5px;
  font-size: 8px;
  font-weight: 650;
}

.export-png-dimensions {
  padding: 6px 7px;
  border-radius: 7px;
  background: rgba(29, 31, 32, 0.035);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.export-png-unavailable,
.export-png-message {
  padding: 6px 7px;
  border-radius: 7px;
  background: rgba(29, 31, 32, 0.04);
}

.canvas-input[data-export-mode="active"] {
  cursor: grab;
}

.canvas-input[data-export-mode="active"][data-active-gesture="export-pan"] {
  cursor: grabbing;
}

.canvas-input[data-export-mode="active"][data-hover-target="export-frame"],
.canvas-input[data-export-mode="active"][data-active-gesture="export-frame"] {
  cursor: move;
}

body[data-pencil-export-mode="active"] .selection-context-controls,
body[data-pencil-export-mode="active"] .canvas-text-editor-root {
  visibility: hidden;
}
.project-identity {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}


body[data-pencil-export-mode="active"] .project-chrome-right,
body[data-pencil-export-mode="active"] .pen-tools-root,
body[data-pencil-export-mode="active"] .project-notes-panel-root,
body[data-pencil-export-mode="active"] .project-notes-expanded-root,
body[data-pencil-export-mode="active"] .prototype-debug-dock,
body[data-pencil-export-mode="active"] .first-project-onboarding {
  display: none;
}

body[data-pencil-export-mode="active"] .project-chrome-left {
  max-height: calc(100vh - 32px);
}

body[data-pencil-export-mode="active"] .navigation-panel-root {
  display: block;
}

.export-preview-dialog {
  position: fixed;
  z-index: 12;
  inset: 28px 36px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(29, 31, 32, 0.16);
  border-radius: 14px;
  background: rgba(245, 244, 240, 0.985);
  box-shadow: 0 24px 70px rgba(29, 31, 32, 0.24);
  backdrop-filter: blur(18px);
}

.export-preview-header,
.export-preview-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.export-preview-header > div {
  display: grid;
  gap: 2px;
}

.export-preview-header strong {
  font-size: 13px;
}

.export-preview-back,
.export-preview-page-button {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(29, 31, 32, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink-strong);
  font: inherit;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
}

.export-preview-page-button:disabled {
  opacity: 0.4;
  cursor: default;
}

.export-preview-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: auto;
  padding: 18px;
  border-radius: 11px;
  background: #deddd8;
}

.export-preview-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: #ffffff;
  box-shadow: 0 10px 34px rgba(29, 31, 32, 0.16);
}

.export-preview-canvas[data-background="transparent"] {
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, #ecebe7 25%, transparent 25%),
    linear-gradient(-45deg, #ecebe7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ecebe7 75%),
    linear-gradient(-45deg, transparent 75%, #ecebe7 75%);
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
}

.export-preview-note {
  width: min(760px, 100%);
  min-height: min(760px, 100%);
  padding: 54px 60px;
  background: #ffffff;
  box-shadow: 0 10px 34px rgba(29, 31, 32, 0.16);
  color: #202223;
}

.export-preview-note h1 {
  margin: 0 0 26px;
  font-size: 28px;
}

.export-preview-note-content {
  font-size: 15px;
  line-height: 1.6;
}

.export-preview-note-content h2 { font-size: 21px; }
.export-preview-note-content h3 { font-size: 17px; }
.export-preview-note-content p { margin: 0 0 12px; }

.export-preview-pager {
  justify-content: center;
  color: var(--ink-muted);
  font-size: 9px;
}

.export-preview-footer,
.export-preview-empty {
  color: var(--ink-muted);
  font-size: 9px;
  text-align: center;
}

.book-workspace-export {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(32, 34, 35, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #202223;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
}

.book-workspace-export:hover {
  background: #f1f0ec;
}

.book-workspace-export:focus-visible {
  outline: 2px solid rgba(32, 34, 35, 0.35);
  outline-offset: 2px;
}

body[data-pencil-export-mode="active"] .book-workspace-host {
  display: none;
}

/* CP17D PDF & document export */
.export-panel-export-secondary {
  border-color: rgba(29, 31, 32, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-strong);
}

.export-pdf-section {
  padding-top: 2px;
}

.export-pdf-summary {
  padding: 6px 7px;
  border-radius: 7px;
  background: rgba(29, 31, 32, 0.035);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.export-panel-footer-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
