:root {
  color-scheme: light;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --builder-ink: #1f2528;
  --builder-muted: #6f777b;
  --builder-line: #dfe3e5;
  --builder-soft: #f5f6f6;
  --builder-accent: #3c88af;
  --builder-accent-hover: #2f718f;
  --builder-focus: rgba(73, 186, 242, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #e9edef;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--builder-ink);
  background: #e9edef;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
[contenteditable="true"]:focus-visible {
  outline: 3px solid var(--builder-focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.theme-builder-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(330px, 380px) minmax(0, 1fr);
}

.builder-panel {
  position: relative;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-right: 1px solid var(--builder-line);
  box-shadow: 8px 0 30px rgba(35, 43, 48, 0.06);
}

.builder-intro {
  padding: 26px 28px 18px;
}

.builder-intro h1 {
  max-width: 300px;
  margin: 0 0 8px;
  font-size: clamp(27px, 2.6vw, 34px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.builder-intro p {
  margin: 0;
  color: var(--builder-muted);
  font-size: 14px;
  line-height: 1.55;
}

.theme-name-field {
  padding: 0 28px 18px;
}

.theme-name-field label,
.hex-field label {
  display: block;
  margin-bottom: 7px;
  color: #5e666a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.theme-name-field input,
.hex-field input {
  width: 100%;
  border: 1px solid #ccd2d5;
  border-radius: 9px;
  background: #fff;
  color: var(--builder-ink);
}

.theme-name-field input {
  height: 42px;
  padding: 0 12px;
  font-weight: 600;
}

.field-hint {
  display: block;
  min-height: 16px;
  margin-top: 6px;
  color: #8a9195;
  font-size: 10px;
}

.field-hint.is-warning {
  color: #c65d20;
}

.color-editor {
  margin: 0 20px 16px;
  padding: 16px;
  border: 1px solid #dbe2e5;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(247, 249, 250, 0.94)),
    #f8fafb;
  box-shadow: 0 8px 24px rgba(31, 50, 60, 0.08);
}

.editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #7b8488;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.editor-heading h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.text-button {
  padding: 3px 0;
  border: 0;
  color: var(--builder-accent);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.picker-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

.color-well {
  position: relative;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid #cbd2d6;
  border-radius: 12px;
  background:
    linear-gradient(45deg, #eee 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(45deg, transparent 75%, #eee 75%) 0 0 / 12px 12px,
    linear-gradient(45deg, transparent 75%, #eee 75%) 6px -6px / 12px 12px,
    linear-gradient(45deg, #eee 25%, #fff 25%) 6px 6px / 12px 12px;
  cursor: pointer;
}

.color-well input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.color-well span {
  position: absolute;
  inset: 5px;
  border-radius: 8px;
  background: var(--active-color, #fff);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.hex-field input {
  height: 40px;
  padding: 0 11px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.hex-field input[aria-invalid="true"] {
  border-color: #e05a62;
  box-shadow: 0 0 0 3px rgba(224, 90, 98, 0.12);
}

.quick-colors {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
  margin-top: 13px;
}

.quick-color {
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  background: var(--quick-color);
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.quick-color:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 9px rgba(20, 30, 36, 0.18);
}

.control-groups {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid #eef0f1;
}

.control-group {
  border-bottom: 1px solid #eef0f1;
}

.group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 24px;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.group-toggle:hover {
  background: #fafbfb;
}

.group-toggle strong,
.group-toggle small {
  display: block;
}

.group-toggle strong {
  font-size: 13px;
}

.group-toggle small {
  margin-top: 3px;
  color: #8a9195;
  font-size: 10px;
  line-height: 1.35;
}

.group-chevron {
  color: #8a9195;
  transition: transform 0.18s ease;
}

.group-toggle[aria-expanded="false"] .group-chevron {
  transform: rotate(-90deg);
}

.group-controls {
  padding: 0 12px 10px;
}

.color-control {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.color-control:hover {
  background: #f6f8f8;
}

.color-control[aria-pressed="true"] {
  border-color: #bde2f4;
  background: #edf8fd;
}

.control-swatch {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: var(--swatch);
}

.control-copy {
  min-width: 0;
}

.control-copy strong,
.control-copy small {
  display: block;
}

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

.control-copy small {
  margin-top: 2px;
  overflow: hidden;
  color: #90979a;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-control code {
  color: #6d767a;
  font-size: 10px;
}

.builder-actions {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--builder-line);
  background: rgba(255, 255, 255, 0.96);
}

.primary-button,
.secondary-button,
.stage-button {
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 0;
  color: #fff;
  background: var(--builder-accent);
  box-shadow: 0 7px 18px rgba(60, 136, 175, 0.24);
}

.primary-button:hover {
  background: var(--builder-accent-hover);
}

.secondary-button {
  width: 100%;
  height: 34px;
  margin-top: 10px;
  border: 1px solid #d5dade;
  color: #667075;
  background: #fff;
  font-size: 11px;
}

.secondary-button:hover {
  background: #f7f8f8;
}

.builder-actions p {
  margin: 8px 0 0;
  color: #8b9296;
  font-size: 10px;
  text-align: center;
}

.preview-stage {
  min-width: 0;
  min-height: 100vh;
  padding: 30px clamp(24px, 4vw, 58px) 34px;
  background:
    radial-gradient(circle at 82% 0%, rgba(255, 255, 255, 0.7), transparent 28%),
    #e9edef;
}

.preview-stage-header {
  max-width: 1180px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 18px;
}

.preview-stage-header h2 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: -0.03em;
}

.preview-stage-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-hint {
  color: #778084;
  font-size: 11px;
}

.stage-button {
  padding: 8px 14px;
  border: 1px solid #cbd3d6;
  color: #4f5c62;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.preview-wrap {
  max-width: 1180px;
  margin: 0 auto;
}

.workflowy-demo {
  position: relative;
  height: min(74vh, 760px);
  min-height: 590px;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  overflow: hidden;
  color: var(--wf-text-primary);
  background: var(--wf-background-primary);
  border: 1px solid rgba(71, 85, 92, 0.18);
  border-radius: 16px;
  box-shadow:
    0 28px 70px rgba(45, 58, 64, 0.16),
    0 2px 6px rgba(45, 58, 64, 0.08);
  isolation: isolate;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.surface-focus {
  animation: surface-pulse 0.9s ease;
}

.theme-preview-target {
  outline: 2px solid rgba(73, 186, 242, 0.78);
  outline-offset: 2px;
}

[data-surface].theme-preview-target,
.wf-main.theme-preview-target {
  outline-offset: -3px;
}

.bullet.theme-preview-target {
  border-radius: 50%;
}

@keyframes surface-pulse {
  0%,
  100% {
    box-shadow: none;
  }
  45% {
    box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--wf-text-tint) 70%, white);
  }
}

.demo-left-bar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 9px;
  color: var(--wf-text-primary);
  background: var(--wf-background-primary);
  border-right: 1px solid var(--wf-border-primary);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.demo-brand {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 4px 8px 10px;
}

.demo-brand-glyph {
  position: relative;
  width: 26px;
  height: 22px;
  display: block;
}

.demo-brand-glyph i {
  position: absolute;
  left: 5px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--wf-text-secondary);
}

.demo-brand-glyph i::before {
  position: absolute;
  top: -2px;
  left: -5px;
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: var(--wf-text-secondary);
}

.demo-brand-glyph i:nth-child(1) {
  top: 3px;
}

.demo-brand-glyph i:nth-child(2) {
  top: 10px;
  width: 14px;
}

.demo-brand-glyph i:nth-child(3) {
  top: 17px;
  width: 10px;
}

.demo-nav {
  display: grid;
  gap: 2px;
}

.demo-nav-item {
  width: 100%;
  height: 34px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: var(--wf-text-secondary);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 11px;
}

.demo-nav-label {
  grid-template-columns: minmax(0, 1fr);
}

.demo-nav-item:hover,
.demo-nav-item.is-active {
  color: var(--wf-text-primary);
  background: var(--wf-background-secondary);
}

.demo-nav-heading {
  display: flex;
  align-items: center;
  margin: 22px 9px 6px;
  color: var(--wf-text-tertiary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-spaces .demo-nav-item {
  color: var(--wf-text-primary);
}

.demo-new-node {
  width: calc(100% - 12px);
  height: 31px;
  margin: 17px 6px 0;
  border: 0;
  border-radius: 999px;
  color: var(--wf-text-secondary);
  background: var(--wf-background-secondary);
  cursor: pointer;
  font-size: 10px;
}

.demo-new-node:hover {
  color: var(--wf-text-primary);
  background: var(--wf-background-tertiary);
}

.demo-app {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--wf-background-primary);
}

.demo-header {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 11px;
  color: var(--wf-text-primary);
  background: var(--wf-background-primary);
  border-bottom: 1px solid var(--wf-border-primary);
  flex-shrink: 0;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.demo-history {
  display: flex;
  gap: 2px;
}

.header-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--wf-text-primary);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

.header-btn:hover,
.header-btn.cursor-hover {
  color: var(--wf-text-secondary);
  background: var(--wf-background-secondary);
}

.header-btn.disabled {
  opacity: 0.34;
  cursor: default;
}

.demo-header-spacer {
  flex: 1;
}

.breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  color: var(--wf-text-secondary);
  font-size: 11px;
}

.breadcrumb-item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.breadcrumb-item.active {
  color: var(--wf-text-primary);
  font-weight: 600;
  cursor: default;
}

.breadcrumb-separator {
  color: var(--wf-text-tertiary);
}

.workflowy-demo .main {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 36px clamp(38px, 6vw, 80px);
  color: var(--wf-text-primary);
  background: var(--wf-background-primary);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.demo-outline-center {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(48px, 8vh, 76px);
}

.workflowy-demo .page-title {
  margin: 0 0 24px;
  color: var(--wf-text-primary);
  font-size: 26px;
  line-height: 1.3;
  outline: none;
}

.workflowy-demo .page-title:empty::before {
  content: "Untitled";
  color: var(--wf-text-tertiary);
}

.workflowy-demo .outliner {
  position: relative;
  color: var(--wf-text-primary);
  font-size: 14px;
  line-height: 1.5;
  user-select: text;
}

.workflowy-demo .outline-item {
  position: relative;
}

.workflowy-demo .item-row {
  position: relative;
  min-height: 28px;
  display: flex;
  align-items: flex-start;
  padding: 3px 0;
  border-radius: 5px;
}

.workflowy-demo .item-row:hover {
  background: color-mix(in srgb, var(--wf-background-tertiary) 38%, transparent);
}

.workflowy-demo .item-row.preview-hover-surface {
  background: color-mix(in srgb, var(--wf-background-tertiary) 62%, transparent);
}

.workflowy-demo .item-row.preview-selected-item {
  background: var(--wf-background-selected);
}

.workflowy-demo .collapse-btn {
  position: absolute;
  top: 4px;
  left: -22px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--wf-text-tertiary);
  cursor: pointer;
}

.workflowy-demo .collapse-btn svg {
  width: 14px;
  height: 14px;
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

.workflowy-demo .collapse-btn.collapsed svg {
  transform: rotate(0);
}

.workflowy-demo .bullet {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: -1px;
  margin-left: -8px;
  cursor: pointer;
}

.workflowy-demo .bullet::after {
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: var(--wf-text-secondary);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.workflowy-demo .bullet:hover::after,
.workflowy-demo .bullet.cursor-hover::after {
  box-shadow: 0 0 0 5px var(--wf-border-primary);
}

.workflowy-demo .bullet.collapsed-with-children::after {
  box-shadow: 0 0 0 5px var(--wf-border-primary);
}

.workflowy-demo .item-content {
  min-width: 0;
  flex: 1;
  outline: none;
  overflow-wrap: anywhere;
}

.workflowy-demo .item-content:empty::before {
  content: attr(data-placeholder);
  color: var(--wf-text-tertiary);
}

.workflowy-demo .children {
  position: relative;
  padding-left: 32px;
}

.workflowy-demo .children::before {
  position: absolute;
  top: 0;
  bottom: 8px;
  left: 2px;
  width: 1px;
  content: "";
  background: var(--wf-border-primary);
}

.workflowy-demo .children.preview-divider::before {
  width: 3px;
}

.workflowy-demo .children.collapsed {
  display: none;
}

.workflowy-demo .outline-item.completed .item-content {
  color: var(--wf-text-completed);
  text-decoration: line-through;
}

.workflowy-demo .tag {
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--wf-text-tint);
  background: color-mix(in srgb, var(--wf-background-tint) 14%, transparent);
}

.workflowy-demo .search-match {
  padding: 1px 3px;
  border-radius: 3px;
  color: inherit;
  background: var(--wf-background-found);
}

.workflowy-demo ::selection {
  color: var(--wf-text-primary);
  background: var(--wf-background-selected);
}

.workflowy-demo .add-item-btn {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-top: 8px;
  margin-left: -8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--wf-text-tertiary);
  background: transparent;
  cursor: pointer;
}

.workflowy-demo .add-item-btn:hover {
  color: var(--wf-text-secondary);
  background: var(--wf-background-secondary);
}

.workflowy-demo .add-item-btn.preview-soft-surface {
  color: var(--wf-text-secondary);
  background: var(--wf-background-secondary);
}

.workflowy-demo .drag-preview {
  position: fixed;
  top: -100px;
  left: -100px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--wf-border-primary);
  pointer-events: none;
  z-index: 9999;
}

.workflowy-demo .outline-item.dragging > .item-row,
.workflowy-demo .outline-item.dragging > .children {
  background: var(--wf-background-tertiary);
}

.workflowy-demo .outline-item.drag-over-top::before,
.workflowy-demo .outline-item.drag-over-bottom > .item-row::after,
.workflowy-demo .outline-item.drag-over-child > .item-row::after {
  position: absolute;
  right: 0;
  left: 4px;
  height: 2px;
  content: "";
  border-radius: 1px;
  background: var(--wf-border-tint);
  z-index: 10;
}

.workflowy-demo .item-row.preview-drop-line::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 4px;
  height: 3px;
  content: "";
  border-radius: 2px;
  background: var(--wf-border-tint);
}

.workflowy-demo .outline-item.drag-over-top::before {
  top: 0;
}

.workflowy-demo .outline-item.drag-over-bottom > .item-row::after,
.workflowy-demo .outline-item.drag-over-child > .item-row::after {
  bottom: -1px;
}

.workflowy-demo .outline-item.drag-over-child > .item-row::after {
  left: 36px;
}

.workflowy-demo .main::-webkit-scrollbar {
  width: 7px;
}

.workflowy-demo .main::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: var(--wf-border-primary);
}

.preview-menu {
  position: absolute;
  top: 42px;
  right: 12px;
  width: 205px;
  padding: 7px;
  color: var(--wf-text-primary);
  background: var(--wf-background-primary);
  border: 1px solid var(--wf-border-primary);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(27, 38, 44, 0.22);
  z-index: 20;
}

.preview-menu button {
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 6px;
  color: var(--wf-text-primary);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 11px;
}

.preview-menu button:hover {
  background: var(--wf-background-secondary);
}

.preview-menu button.preview-menu-hover {
  background: var(--wf-background-secondary);
}

.preview-menu .danger-menu-item {
  color: var(--wf-text-danger);
}

.demo-search-field {
  height: 34px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  padding: 0 8px;
  color: var(--wf-text-secondary);
  background: var(--wf-background-secondary);
  border-radius: 7px;
}

.demo-search-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--wf-text-primary);
  background: transparent;
  font-size: 11px;
}

.dialog-scrim {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(21, 28, 31, 0.32);
  backdrop-filter: blur(2px);
  z-index: 30;
}

.preview-dialog {
  position: relative;
  width: min(430px, 90%);
  padding: 25px;
  color: var(--wf-text-primary);
  background: var(--wf-background-primary);
  border: 1px solid var(--wf-border-primary);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(20, 27, 31, 0.28);
}

.preview-dialog h2 {
  margin: 0 0 8px;
  font-size: 21px;
}

.preview-dialog p {
  margin: 0 0 18px;
  color: var(--wf-text-secondary);
  font-size: 12px;
}

.dialog-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 50%;
  color: var(--wf-text-secondary);
  background: var(--wf-background-secondary);
  cursor: pointer;
}

.dialog-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.dialog-input-row input {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--wf-border-primary);
  border-radius: 7px;
  color: var(--wf-text-primary);
  background: var(--wf-background-secondary);
  font-size: 11px;
}

.dialog-input-row button {
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  color: var(--wf-text-on-color, #fff);
  background: var(--wf-background-tint);
  font-size: 11px;
  font-weight: 700;
}

.workflowy-demo .demo-toast {
  position: absolute;
  bottom: 20px;
  left: 50%;
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--wf-text-on-color, #fff);
  background: var(--wf-background-success);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.17);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 80px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  z-index: 40;
}

.workflowy-demo .demo-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.workflowy-demo .demo-toast.preview-toast-success {
  background: var(--wf-background-success);
}

.workflowy-demo .demo-toast.preview-toast-warning {
  color: var(--wf-text-primary);
  background: var(--wf-background-warning);
}

.workflowy-demo .demo-toast.preview-toast-danger {
  background: var(--wf-background-danger);
}

.workflowy-demo .demo-toast.hide {
  opacity: 0;
  transform: translate(-50%, 80px);
}

.workflowy-demo .reset-btn {
  position: absolute;
  right: 13px;
  bottom: 13px;
  padding: 7px 10px;
  border: 1px solid var(--wf-border-primary);
  border-radius: 999px;
  color: var(--wf-text-secondary);
  background: var(--wf-background-primary);
  cursor: pointer;
  font-size: 9px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.94);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  z-index: 10;
}

.workflowy-demo .reset-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.workflowy-demo .shortcuts-panel,
.workflowy-demo .restart-btn,
.workflowy-demo .zoom-overlay {
  display: none;
}

.install-guide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: clamp(22px, 4vw, 48px);
  color: var(--builder-ink);
  background:
    radial-gradient(circle at 88% 8%, rgba(73, 186, 242, 0.18), transparent 34%),
    rgba(246, 249, 250, 0.98);
  z-index: 70;
}

.install-guide-card {
  width: min(720px, 100%);
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid #dce4e7;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 64px rgba(34, 49, 56, 0.16);
}

.install-guide-card h2 {
  margin: 5px 0 9px;
  font-size: clamp(23px, 3vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  outline: none;
}

.install-beta-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d7e8f0;
  border-radius: 9px;
  color: #52646c;
  background: #f0f8fb;
  font-size: 11px;
  line-height: 1.45;
}

.install-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.install-steps li {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.install-step-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--builder-accent);
  font-size: 11px;
  font-weight: 800;
}

.install-steps li > div > strong {
  display: block;
  margin: 1px 0 4px;
  font-size: 12px;
}

.install-steps p {
  margin: 0;
  color: #667177;
  font-size: 10px;
  line-height: 1.5;
}

.install-guide a {
  color: #2d769b;
  font-weight: 700;
  text-decoration: none;
}

.install-guide a:hover {
  text-decoration: underline;
}

.install-guide kbd,
.install-guide code {
  padding: 2px 5px;
  border: 1px solid #d6dde0;
  border-radius: 4px;
  color: #425158;
  background: #f5f7f8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.install-guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  border-top: 1px solid #e1e6e8;
}

.install-guide-links,
.install-guide-actions,
.confirm-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.install-guide-links {
  flex-wrap: wrap;
  font-size: 10px;
}

.guide-primary-button,
.guide-secondary-button,
.danger-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.guide-primary-button {
  border: 0;
  color: #fff;
  background: var(--builder-accent);
}

.guide-primary-button:hover {
  background: var(--builder-accent-hover);
}

.guide-secondary-button {
  border: 1px solid #d2dadd;
  color: #5f6a70;
  background: #fff;
}

.guide-secondary-button:hover {
  background: #f5f7f8;
}

.builder-modal-scrim {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 32, 36, 0.44);
  backdrop-filter: blur(4px);
  z-index: 120;
}

.builder-confirm-dialog {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid #e0e5e7;
  border-radius: 16px;
  color: var(--builder-ink);
  background: #fff;
  box-shadow: 0 28px 80px rgba(16, 24, 28, 0.28);
}

.confirm-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #b8404a;
  background: #fff0f1;
  font-size: 18px;
  font-weight: 800;
}

.builder-confirm-dialog h2 {
  margin: 15px 0 8px;
  font-size: 21px;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.builder-confirm-dialog p {
  margin: 0;
  color: #687278;
  font-size: 12px;
  line-height: 1.55;
}

.confirm-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

.danger-button {
  border: 0;
  color: #fff;
  background: #c9424e;
}

.danger-button:hover {
  background: #ae3440;
}

.preview-caption {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 13px 5px 0;
  color: #7b8488;
  font-size: 10px;
}

.preview-caption strong {
  color: #596267;
}

.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: #263238;
  box-shadow: 0 12px 32px rgba(20, 27, 31, 0.28);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 30px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .theme-builder-shell {
    display: block;
  }

  .builder-panel {
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--builder-line);
  }

  .control-groups {
    max-height: 46vh;
  }

  .preview-stage {
    min-height: auto;
  }
}

@media (max-width: 700px) {
  .builder-intro,
  .theme-name-field {
    padding-right: 20px;
    padding-left: 20px;
  }

  .preview-stage {
    padding: 22px 14px 28px;
  }

  .preview-stage-header {
    align-items: flex-start;
  }

  .preview-hint {
    display: none;
  }

  .workflowy-demo {
    min-height: 560px;
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .demo-brand {
    justify-content: center;
  }

  .demo-nav-item span:not(:first-child),
  .demo-nav-heading span {
    display: none;
  }

  .demo-nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
    font-size: 13px;
  }

  .demo-nav-heading {
    justify-content: center;
  }

  .demo-new-node {
    width: 34px;
    margin-right: auto;
    margin-left: auto;
    overflow: hidden;
    white-space: nowrap;
    text-indent: -999px;
  }

  .demo-new-node span {
    display: block;
    text-indent: 0;
  }

  .workflowy-demo .main {
    padding-right: 26px;
    padding-left: 36px;
  }

  .demo-outline-center {
    padding-top: 24px;
  }

  .install-guide {
    place-items: start center;
    padding: 16px;
  }

  .install-guide-card {
    padding: 22px;
  }

  .install-steps {
    grid-template-columns: 1fr;
  }

  .install-guide-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .install-guide-actions {
    justify-content: flex-end;
  }

  .preview-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
