:root {
  color-scheme: dark;
  --bg: oklch(0.145 0 0);
  --panel: oklch(0.18 0 0);
  --panel-2: oklch(0.205 0 0);
  --panel-3: oklch(0.235 0 0);
  --line: oklch(0.31 0 0);
  --line-strong: oklch(0.39 0 0);
  --text: oklch(0.88 0 0);
  --muted: oklch(0.62 0 0);
  --faint: oklch(0.48 0 0);
  --accent: oklch(0.66 0.17 250);
  --accent-soft: oklch(0.26 0.055 250);
  --success: oklch(0.71 0.14 148);
  --warning: oklch(0.77 0.13 78);
  --danger: oklch(0.66 0.17 28);
  --radius: 6px;
  --shadow: 0 12px 32px oklch(0.08 0 0 / 0.34);
}

body.theme-light {
  color-scheme: light;
  --bg: oklch(0.94 0.006 85);
  --panel: oklch(0.975 0.004 85);
  --panel-2: oklch(0.952 0.005 85);
  --panel-3: oklch(0.918 0.006 85);
  --line: oklch(0.82 0.006 85);
  --line-strong: oklch(0.7 0.008 85);
  --text: oklch(0.24 0.006 85);
  --muted: oklch(0.43 0.006 85);
  --faint: oklch(0.58 0.006 85);
  --accent-soft: oklch(0.92 0.035 250);
  --success: oklch(0.5 0.13 148);
  --danger: oklch(0.55 0.16 28);
  --shadow: 0 12px 28px oklch(0.58 0.012 85 / 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  background: oklch(0.11 0 0);
  color: var(--text);
  scrollbar-color: oklch(0.32 0 0) oklch(0.13 0 0);
  scrollbar-width: thin;
}

body.theme-light {
  background: oklch(0.9 0.006 85);
  scrollbar-color: oklch(0.68 0.006 85) oklch(0.91 0.006 85);
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: oklch(0.13 0 0);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid oklch(0.13 0 0);
  border-radius: 999px;
  background: oklch(0.32 0 0);
}

*::-webkit-scrollbar-thumb:hover {
  background: oklch(0.4 0 0);
}

body.theme-light *::-webkit-scrollbar-track {
  background: oklch(0.91 0.006 85);
}

body.theme-light *::-webkit-scrollbar-thumb {
  border-color: oklch(0.91 0.006 85);
  background: oklch(0.68 0.006 85);
}

body.theme-light *::-webkit-scrollbar-thumb:hover {
  background: oklch(0.58 0.006 85);
}

body.is-login .prototype-shell {
  display: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.prototype-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.prototype-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
  border-bottom: 0;
  background: oklch(0.17 0 0 / 0.96);
  backdrop-filter: blur(14px);
}

.toolbar-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-toolbar-btn {
  width: 34px;
  height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: oklch(0.165 0 0);
  color: var(--text);
  cursor: pointer;
}

.mobile-toolbar-btn span {
  width: 15px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 160ms ease, opacity 120ms ease;
}

.mobile-toolbar-btn:hover,
.mobile-toolbar-btn:focus-visible {
  border-color: var(--line-strong);
  background: oklch(0.22 0 0);
  outline: none;
}

.mobile-toolbar-open .mobile-toolbar-btn span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.mobile-toolbar-open .mobile-toolbar-btn span:nth-child(2) {
  opacity: 0;
}

.mobile-toolbar-open .mobile-toolbar-btn span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.toolbar-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  min-width: 180px;
  max-width: 380px;
}

.toolbar-search-input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: oklch(0.135 0 0);
  color: var(--text);
  padding: 6px 34px 6px 10px;
  outline: none;
}

.toolbar-search-input::placeholder {
  color: var(--faint);
}

.toolbar-search-input:focus {
  border-color: var(--accent);
}

.toolbar-search-input::-webkit-search-cancel-button {
  display: none;
}

.toolbar-search-clear {
  position: absolute;
  right: 74px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.toolbar-search-clear:hover,
.toolbar-search-clear:focus-visible {
  color: var(--text);
  background: oklch(0.24 0 0);
  outline: none;
}

.toolbar-search-count {
  min-width: 66px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: oklch(0.11 0 0);
}

.login-card {
  width: min(360px, 100%);
  padding: 36px 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
  box-shadow: var(--shadow);
}

.login-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 22px;
  font-weight: 750;
}

.login-subtitle {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--faint);
  pointer-events: none;
}

.login-input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: oklch(0.135 0 0);
  color: var(--text);
  padding: 8px 10px 8px 38px;
  outline: none;
}

.login-input:focus {
  border-color: var(--accent);
}

.login-input-code {
  padding-left: 18px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 6px;
}

.login-btn {
  min-height: 38px;
  border: 1px solid oklch(0.52 0.11 250);
  border-radius: 5px;
  background: var(--accent-soft);
  color: oklch(0.86 0.05 250);
  cursor: pointer;
  font-weight: 700;
}

.login-btn:hover:not(:disabled),
.login-btn:focus-visible:not(:disabled) {
  border-color: var(--accent);
  background: oklch(0.29 0.07 250);
  outline: none;
}

.login-btn:disabled,
.login-back-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.login-back-btn {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.login-back-btn:hover:not(:disabled),
.login-back-btn:focus-visible:not(:disabled) {
  color: var(--text);
  outline: none;
}

.login-error {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
}

.user-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.user-select {
  min-width: 170px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: oklch(0.145 0 0);
  color: var(--text);
  padding: 4px 8px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.user-select:focus {
  outline: none;
  border-color: var(--accent);
}

.user-role-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: oklch(0.16 0 0);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.user-role-badge.master {
  border-color: oklch(0.52 0.11 250);
  color: oklch(0.84 0.06 250);
  background: var(--accent-soft);
}

.user-role-badge.employee {
  border-color: oklch(0.42 0 0);
  color: var(--muted);
}

.icon-text-btn,
.placeholder-action,
.component-menu button,
.tiny-btn {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 650;
}

.icon-text-btn:hover,
.component-menu button:hover,
.tiny-btn:hover {
  background: var(--panel-3);
  border-color: var(--line-strong);
}

.icon-text-btn.primary {
  border-color: oklch(0.52 0.11 250);
  background: var(--accent-soft);
  color: oklch(0.86 0.05 250);
}

.icon-text-btn.primary:hover {
  border-color: var(--accent);
}

.icon-text-btn.subtle {
  color: var(--muted);
}

.edit-mode-btn {
  color: var(--muted);
}

.edit-mode-btn.active {
  border-color: oklch(0.62 0.14 148);
  background: oklch(0.23 0.055 148);
  color: oklch(0.82 0.09 148);
}

.todo-filter-btn.active {
  border-color: var(--warning);
  background: oklch(0.24 0.055 78);
  color: oklch(0.86 0.08 78);
}

.theme-toggle-btn {
  gap: 8px;
}

.theme-toggle-track {
  width: 28px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: var(--panel-3);
  box-shadow: inset 0 0 0 1px var(--line);
}

.theme-toggle-knob {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.theme-toggle-btn[aria-pressed="true"] .theme-toggle-knob {
  transform: translateX(12px);
  background: var(--accent);
}

.tutorials-workspace {
  width: 100%;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

.sections-root {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tutorial-section {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  overflow: hidden;
  box-shadow: none;
}

.section-header,
.tutorial-header {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.section-header {
  padding: 12px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid transparent;
}

.tutorial-section.expanded .section-header {
  border-bottom-color: var(--line);
}

.section-header:hover {
  background: oklch(0.25 0 0);
}

.chevron {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  transition: transform 170ms ease;
}

.expanded > .section-header .chevron,
.tutorial-card.expanded > .tutorial-header .chevron {
  transform: rotate(90deg);
}

.section-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: oklch(0.26 0 0);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.section-icon-btn:hover,
.section-icon-btn:focus-visible {
  border-color: var(--line-strong);
  background: oklch(0.31 0 0);
  outline: none;
}

.section-icon-btn.readonly {
  cursor: default;
  pointer-events: none;
}

.ui-icon {
  display: block;
  width: 24px;
  height: 24px;
}

.section-title,
.tutorial-title {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 5px;
  margin-left: -5px;
  transition: background 140ms ease, border-color 140ms ease;
}

body.can-edit .section-title:hover,
body.can-edit .tutorial-title:hover {
  background: oklch(0.32 0 0 / 0.55);
  border-color: oklch(0.42 0 0);
}

body:not(.can-edit) .section-title,
body:not(.can-edit) .tutorial-title {
  cursor: default;
}

.section-title.renaming,
.tutorial-title.renaming {
  overflow: visible;
  padding: 0;
  border-color: transparent;
  background: transparent;
}

.inline-rename-input {
  min-width: 0;
  max-width: min(560px, calc(100vw - 220px));
  height: 28px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: oklch(0.13 0 0);
  color: var(--text);
  padding: 3px 7px;
  outline: none;
  font: inherit;
  font-weight: inherit;
}

.reorder-slot {
  display: inline-flex;
  flex-shrink: 0;
}

.reorder-controls {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
}

.reorder-arrow {
  width: 32px;
  height: 20px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.reorder-arrow:hover:not(:disabled),
.reorder-arrow:focus-visible:not(:disabled) {
  color: var(--text);
  background: oklch(0.3 0 0);
  border-color: var(--line);
  outline: none;
}

.reorder-arrow:disabled {
  color: oklch(0.33 0 0);
  cursor: default;
}

.delete-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.status-control {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: oklch(0.165 0 0);
  color: var(--faint);
  padding: 4px 10px 4px 9px;
}

.status-checkbox {
  width: 15px;
  height: 15px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 160ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.status-checkbox svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}

.status-checkbox.checked {
  color: var(--success);
}

.tutorial-status {
  pointer-events: none;
}

.tutorial-status-control,
.tutorial-todo-control {
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 180ms ease, transform 160ms ease;
}

.tutorial-status-control .status-label,
.tutorial-status-control .status-checkbox svg,
.tutorial-todo-control .status-label,
.tutorial-todo-control .status-checkbox svg {
  transition: color 160ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tutorial-status-control:hover,
.tutorial-status-control:focus-visible {
  border-color: var(--success);
  background: oklch(0.19 0.025 148);
  outline: none;
}

.tutorial-status-control:hover .tutorial-status.checked,
.tutorial-status-control:focus-visible .tutorial-status.checked {
  color: oklch(0.78 0.15 148);
}

.tutorial-todo-control:hover,
.tutorial-todo-control:focus-visible {
  border-color: var(--warning);
  background: oklch(0.2 0.035 78);
  outline: none;
}

.tutorial-todo-control.active {
  border-color: var(--warning);
  background: oklch(0.22 0.048 78);
}

.tutorial-todo-status.checked {
  color: var(--warning);
}

.tutorial-todo-control.active .status-label {
  color: var(--warning);
}

.tutorial-todo-control.readonly {
  cursor: default;
  opacity: 0.78;
}

.tutorial-todo-control.readonly:hover,
.tutorial-todo-control.readonly:focus-visible {
  border-color: var(--line-strong);
  background: oklch(0.165 0 0);
}

.tutorial-todo-control.readonly.active:hover,
.tutorial-todo-control.readonly.active:focus-visible {
  border-color: var(--warning);
  background: oklch(0.22 0.048 78);
}

.tutorial-status-control.just-checked {
  border-color: oklch(0.62 0.14 148);
  box-shadow: 0 0 0 3px oklch(0.62 0.14 148 / 0.13);
  animation: doneButtonPop 440ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tutorial-status-control.just-checked .tutorial-status {
  animation: doneCheckPop 440ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tutorial-status-control.just-checked .tutorial-status svg {
  animation: doneCheckDraw 440ms cubic-bezier(0.22, 1, 0.36, 1);
}

.section-status-control {
  opacity: 0.72;
  cursor: default;
}

.section-status-control:has(.section-status.checked) {
  border-color: oklch(0.5 0.09 148);
  background: oklch(0.18 0.024 148);
}

.status-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.status-checkbox.checked + .status-label {
  color: var(--success);
}

@keyframes doneButtonPop {
  0% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.045);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes doneCheckPop {
  0% {
    transform: scale(0.84);
  }
  48% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes doneCheckDraw {
  0% {
    transform: scale(0.4) rotate(-10deg);
    opacity: 0;
  }
  55% {
    transform: scale(1.15) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tutorial-status-control.just-checked,
  .tutorial-status-control.just-checked .tutorial-status,
  .tutorial-status-control.just-checked .tutorial-status svg {
    animation: none;
  }
}

.delete-btn:hover,
.delete-btn:focus-visible {
  color: var(--danger);
  background: oklch(0.25 0.05 28);
  border-color: oklch(0.46 0.12 28);
  outline: none;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
}

.item-count {
  flex-shrink: 0;
  color: var(--faint);
  font-size: 11px;
  font-weight: 650;
  margin-left: auto;
}

.section-body {
  display: grid;
  grid-template-rows: 0fr;
  background: oklch(0.155 0 0);
  transition: grid-template-rows 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tutorial-section.expanded .section-body {
  grid-template-rows: 1fr;
}

.section-body-inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px;
  align-items: center;
  opacity: 0;
  transition:
    opacity 160ms ease,
    padding 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tutorial-section.expanded .section-body-inner {
  padding: 10px;
  opacity: 1;
}

.tutorial-card {
  width: min(850px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  overflow: hidden;
}

.tutorial-section.is-reordering,
.tutorial-card.is-reordering,
.component-block.is-reordering {
  position: relative;
  z-index: 3;
  will-change: transform;
}

.tutorial-header {
  min-height: 42px;
  padding: 9px 12px;
}

.tutorial-header:hover,
.tutorial-header:focus-visible {
  background-color: color-mix(in oklch, currentColor 10%, oklch(0.285 0 0));
  box-shadow: inset 0 0 0 1px oklch(0.44 0 0 / 0.34);
  outline: none;
}

.tutorial-title {
  font-size: 13px;
  font-weight: 650;
  color: oklch(0.82 0 0);
}

.component-count {
  flex-shrink: 0;
  color: var(--faint);
  font-size: 11px;
  margin-left: auto;
}

.done-date {
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.08;
  white-space: nowrap;
}

.done-date span:last-child {
  color: oklch(0.58 0 0);
  font-size: 10px;
}

.tutorial-body {
  display: grid;
  grid-template-rows: 0fr;
  background: oklch(0.19 0 0);
  transition: grid-template-rows 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tutorial-card.expanded .tutorial-body {
  grid-template-rows: 1fr;
}

.tutorial-body-inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
  opacity: 0;
  transition:
    opacity 150ms ease,
    padding 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tutorial-card.expanded .tutorial-body-inner {
  padding: 10px 12px 12px;
  opacity: 1;
}

.component-block {
  position: relative;
  width: 100%;
}

body.can-edit .component-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
  align-items: stretch;
}

.component-content {
  width: 100%;
  min-width: 0;
  padding: 0;
}

.component-control-panel {
  width: 36px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 5px 3px;
  border-left: 1px solid oklch(0.245 0 0 / 0.72);
  background: oklch(0.18 0 0 / 0.42);
  opacity: 0.55;
  transition: opacity 160ms ease, background 160ms ease, border-color 160ms ease;
}

.component-block:hover .component-control-panel,
.component-control-panel:focus-within {
  opacity: 1;
  border-color: oklch(0.31 0 0);
  background: oklch(0.195 0 0 / 0.66);
}

.component-control-panel .reorder-controls {
  gap: 1px;
}

.component-control-panel .reorder-arrow {
  width: 28px;
  height: 19px;
}

.component-control-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.component-control-btn:hover,
.component-control-btn:focus-visible,
.component-edit-btn[aria-expanded="true"] {
  color: var(--text);
  background: oklch(0.28 0 0);
  border-color: var(--line);
  outline: none;
}

.component-remove:hover,
.component-remove:focus-visible {
  color: var(--danger);
  background: oklch(0.25 0.05 28);
  border-color: oklch(0.46 0.12 28);
}

.component-edit-popover {
  position: absolute;
  top: 4px;
  right: 42px;
  z-index: 8;
  width: min(330px, calc(100% - 50px));
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: oklch(0.18 0 0);
  box-shadow: var(--shadow);
}

.component-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.component-edit-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.component-edit-close {
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.component-edit-close:hover,
.component-edit-close:focus-visible {
  color: var(--text);
  background: var(--panel-3);
  border-color: var(--line);
  outline: none;
}

.component-edit-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.component-edit-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
}

.component-edit-field input,
.component-edit-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: oklch(0.135 0 0);
  color: var(--text);
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 500;
}

.component-edit-field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

.component-edit-field input:focus,
.component-edit-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.component-edit-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.component-edit-preview {
  width: 100%;
}

.component-edit-preview .youtube-frame {
  border-color: var(--line);
  background: oklch(0.145 0 0);
}

.component-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.component-edit-action {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.component-edit-action.secondary {
  background: transparent;
  color: var(--muted);
}

.component-edit-action.secondary:hover,
.component-edit-action.secondary:focus-visible {
  background: var(--panel-2);
  border-color: var(--line-strong);
  color: var(--text);
  outline: none;
}

.component-edit-action.primary {
  border-color: oklch(0.52 0.11 250);
  background: var(--accent-soft);
  color: oklch(0.86 0.05 250);
}

.component-edit-action.primary:hover,
.component-edit-action.primary:focus-visible {
  border-color: var(--accent);
  background: oklch(0.29 0.07 250);
  outline: none;
}

.text-editor {
  display: block;
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid oklch(0.285 0 0);
  border-radius: 4px;
  background: oklch(0.205 0 0);
  color: var(--text);
  padding: 9px;
  line-height: 1.5;
}

.text-editor:focus,
.url-input:focus {
  outline: none;
  border-color: var(--accent);
}

.text-display {
  width: 100%;
  min-height: 48px;
  border: 1px solid oklch(0.285 0 0);
  border-radius: 4px;
  background: oklch(0.205 0 0);
  color: oklch(0.8 0 0);
  padding: 9px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.youtube-frame,
.image-placeholder,
.upload-placeholder,
.files-placeholder {
  width: 100%;
  border: 1px solid oklch(0.285 0 0);
  border-radius: 4px;
  background: oklch(0.205 0 0);
}

.youtube-frame {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  color: var(--faint);
  overflow: hidden;
}

.youtube-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.url-input {
  width: 100%;
  margin-bottom: 8px;
  border: 1px solid oklch(0.285 0 0);
  border-radius: 4px;
  background: oklch(0.205 0 0);
  color: var(--text);
  padding: 8px 9px;
}

.image-placeholder,
.upload-placeholder {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: var(--faint);
}

.user-upload-box {
  width: 100%;
  border: 1px solid oklch(0.285 0 0);
  border-radius: 4px;
  background: oklch(0.205 0 0);
  padding: 10px;
}

.user-upload-title {
  margin: 0 0 8px;
  color: oklch(0.78 0 0);
  font-size: 12px;
  font-weight: 700;
}

.user-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.user-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 8px;
}

.image-source-tile,
.user-upload-thumb {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 6px;
}

.image-source-tile {
  overflow: hidden;
  border: 1px dashed oklch(0.34 0 0);
  background: oklch(0.22 0 0);
  color: var(--muted);
  display: grid;
  grid-template-rows: 1fr 1fr;
  text-align: center;
}

.image-source-action {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 8px;
  transition: background-color 180ms ease, color 180ms ease;
}

.image-source-action + .image-source-action {
  border-top: 1px solid oklch(0.27 0 0);
}

.image-source-tile:hover,
.image-source-tile:focus-within {
  border-color: oklch(0.5 0 0);
}

.image-source-action:hover,
.image-source-action:focus-visible {
  background: oklch(0.2 0 0);
  color: var(--text);
  outline: none;
}

.upload-tile-plus {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: oklch(0.24 0 0);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.upload-tile-label {
  color: var(--text);
  font-size: 11px;
  line-height: 1.15;
  font-weight: 700;
}

.upload-tile-hint {
  color: var(--faint);
  font-size: 10px;
}

.user-upload-thumb {
  overflow: hidden;
  border: 1px solid oklch(0.235 0 0);
  background: oklch(0.155 0 0);
}

.user-upload-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-upload-thumb.is-broken::before {
  content: "Image";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 11px;
}

.user-upload-thumb-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 24px;
  padding: 9px 6px 5px;
  background: linear-gradient(180deg, transparent, oklch(0.12 0 0 / 0.9));
  color: var(--text);
  font-size: 10px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-upload-thumb-open {
  position: absolute;
  inset: auto 50% 50% auto;
  translate: 50% 50%;
  min-width: 48px;
  height: 28px;
  border: 1px solid oklch(0.52 0 0);
  border-radius: 4px;
  background: oklch(0.13 0 0 / 0.82);
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.9;
  transition: opacity 160ms ease, background 160ms ease, border-color 160ms ease;
}

.user-upload-thumb:hover .user-upload-thumb-open,
.user-upload-thumb-open:focus-visible {
  opacity: 1;
}

.user-upload-thumb-open:hover,
.user-upload-thumb-open:focus-visible {
  background: oklch(0.2 0 0);
  border-color: oklch(0.62 0 0);
  outline: none;
}

.user-upload-thumb-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border: 1px solid oklch(0.36 0 0);
  border-radius: 50%;
  background: oklch(0.14 0 0 / 0.88);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.user-upload-thumb-delete:hover,
.user-upload-thumb-delete:focus-visible {
  background: oklch(0.2 0 0);
  border-color: oklch(0.48 0 0);
  outline: none;
}

.image-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 18px;
  background: oklch(0.06 0 0 / 0.82);
}

.image-viewer-panel {
  width: min(1120px, 100%);
  height: min(820px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: oklch(0.12 0 0);
  box-shadow: var(--shadow);
}

.image-viewer-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 12px;
  border-bottom: 1px solid var(--line);
}

.image-viewer-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.image-viewer-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.image-viewer-btn {
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.image-viewer-btn:hover,
.image-viewer-btn:focus-visible {
  border-color: var(--line-strong);
  background: var(--panel-3);
  outline: none;
}

.image-viewer-zoom {
  min-width: 44px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.image-viewer-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 18px;
}

.image-viewer-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  transform-origin: center center;
  transition: transform 160ms ease;
}

.youtube-duplicate-modal {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: grid;
  place-items: center;
  padding: 18px;
  background: oklch(0.06 0 0 / 0.74);
}

.youtube-duplicate-panel {
  width: min(420px, 100%);
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: oklch(0.19 0 0);
  box-shadow: var(--shadow);
}

.youtube-duplicate-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.youtube-duplicate-description {
  margin-top: 6px;
  color: oklch(0.78 0 0);
  line-height: 1.45;
}

.youtube-duplicate-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.youtube-duplicate-item {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid oklch(0.3 0 0);
  border-radius: 5px;
  background: oklch(0.22 0 0);
}

.youtube-duplicate-section {
  color: var(--text);
  font-weight: 750;
}

.youtube-duplicate-card {
  color: var(--muted);
  font-size: 12px;
}

.youtube-duplicate-card::before {
  content: "Tutorial card: ";
  color: var(--faint);
}

.youtube-duplicate-close {
  width: 100%;
  min-height: 34px;
  margin-top: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel-3);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.youtube-duplicate-close:hover,
.youtube-duplicate-close:focus-visible {
  border-color: oklch(0.52 0 0);
  background: oklch(0.28 0 0);
  outline: none;
}

.clipboard-paste-catcher {
  position: fixed;
  left: -1000px;
  top: -1000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.image-frame {
  position: relative;
  margin: 0;
  width: 100%;
}

.image-frame.has-image {
  overflow: hidden;
  border-radius: 4px;
  background: oklch(0.205 0 0);
  aspect-ratio: 1.5 / 1;
}

.template-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid oklch(0.285 0 0);
  background: oklch(0.205 0 0);
}

.layout-image-picker {
  width: 100%;
}

.layout-image-tile {
  width: min(156px, 100%);
}

.image-component-actions {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.image-frame:hover .image-component-actions,
.image-component-actions:focus-within {
  opacity: 1;
}

.image-component-action {
  min-height: 28px;
  border: 1px solid oklch(0.45 0 0);
  border-radius: 4px;
  background: oklch(0.13 0 0 / 0.86);
  color: var(--text);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.image-component-action:hover,
.image-component-action:focus-visible {
  border-color: oklch(0.62 0 0);
  background: oklch(0.2 0 0);
  outline: none;
}

.image-component-action.danger:hover,
.image-component-action.danger:focus-visible {
  color: var(--danger);
  border-color: oklch(0.48 0.12 28);
  background: oklch(0.22 0.04 28);
}

.image-caption {
  margin-top: 6px;
  color: var(--faint);
  font-size: 11px;
}

.files-placeholder {
  min-height: 84px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid oklch(0.3 0 0);
  border-radius: 4px;
  background: oklch(0.22 0 0);
}

.file-pill {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: oklch(0.86 0.05 250);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

.file-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: oklch(0.78 0 0);
  text-decoration: none;
}

a.file-name:hover,
a.file-name:focus-visible {
  color: var(--text);
  outline: none;
}

.file-size {
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
}

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

.file-add-btn {
  min-height: 34px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: oklch(0.205 0 0);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-weight: 650;
}

.file-add-btn:hover,
.file-add-btn:focus-visible {
  color: var(--text);
  border-color: var(--accent);
  background: oklch(0.2 0.018 250);
  outline: none;
}

.file-remove-btn {
  min-width: 54px;
}

.tiny-btn {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  color: var(--faint);
}

.placeholder-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  border-style: dashed;
  background: oklch(0.17 0 0);
  font-weight: 650;
}

.placeholder-action:hover,
.placeholder-action.active {
  color: var(--text);
  border-color: var(--accent);
  background: oklch(0.2 0.018 250);
}

.placeholder-action.full-width {
  width: 100%;
}

.tutorials-workspace > .placeholder-action.full-width {
  width: min(850px, calc(100% - 20px));
  margin: 10px;
  align-self: center;
}

body:not(.can-edit) #addSectionBtn {
  display: none !important;
}

body:not(.is-master) #editModeBtn {
  display: none !important;
}

.section-body-inner > .placeholder-action.full-width {
  width: min(850px, 100%);
}

.plus-mark {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  line-height: 1;
}

.add-component-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.component-menu {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.component-menu button {
  min-height: 34px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.empty-state {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--faint);
  background: oklch(0.205 0 0);
}

.section-body-inner > .empty-state {
  width: min(850px, 100%);
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  max-width: min(420px, calc(100vw - 28px));
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  box-shadow: var(--shadow);
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.icon-picker {
  position: fixed;
  z-index: 100;
  width: min(324px, calc(100vw - 16px));
  max-height: min(520px, calc(100vh - 16px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: oklch(0.18 0 0);
  box-shadow: var(--shadow);
}

.icon-picker-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-picker-search {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: oklch(0.135 0 0);
  color: var(--text);
  padding: 5px 8px;
}

.icon-picker-search:focus {
  outline: none;
  border-color: var(--accent);
}

.icon-picker-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
}

.icon-picker-close:hover,
.icon-picker-close:focus-visible {
  color: var(--text);
  border-color: var(--line-strong);
  outline: none;
}

.icon-picker-colors {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 2px 0 4px;
}

.icon-color-swatch {
  width: 18px;
  height: 18px;
  border: 1px solid oklch(0.48 0 0);
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
}

.icon-color-swatch.default {
  background:
    linear-gradient(135deg, transparent 44%, var(--danger) 45%, var(--danger) 55%, transparent 56%),
    oklch(0.24 0 0);
}

.icon-color-swatch.active {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.icon-custom-color {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  color: var(--faint);
  font-size: 11px;
}

.icon-custom-color input {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  overflow-y: auto;
  padding-right: 2px;
}

.icon-picker-item {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: oklch(0.145 0 0);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-picker-item:hover,
.icon-picker-item:focus-visible {
  color: var(--text);
  border-color: var(--line-strong);
  background: oklch(0.22 0 0);
  outline: none;
}

.icon-picker-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

body.theme-light .prototype-toolbar {
  background: oklch(0.975 0.004 85 / 0.96);
}

body.theme-light .login-screen {
  background: oklch(0.9 0.006 85);
}

body.theme-light .mobile-toolbar-btn,
body.theme-light .toolbar-search-input,
body.theme-light .login-input,
body.theme-light .user-select,
body.theme-light .inline-rename-input,
body.theme-light .component-edit-field input,
body.theme-light .component-edit-field textarea,
body.theme-light .url-input,
body.theme-light .icon-picker-search {
  background: oklch(0.985 0.003 85);
}

body.theme-light .mobile-toolbar-btn:hover,
body.theme-light .mobile-toolbar-btn:focus-visible,
body.theme-light .toolbar-search-clear:hover,
body.theme-light .toolbar-search-clear:focus-visible,
body.theme-light .section-header:hover,
body.theme-light .component-control-btn:hover,
body.theme-light .component-control-btn:focus-visible,
body.theme-light .component-edit-btn[aria-expanded="true"],
body.theme-light .reorder-arrow:hover:not(:disabled),
body.theme-light .reorder-arrow:focus-visible:not(:disabled),
body.theme-light .icon-picker-item:hover,
body.theme-light .icon-picker-item:focus-visible {
  background: oklch(0.89 0.007 85);
}

body.theme-light .section-icon-btn {
  background: oklch(0.88 0.006 85);
}

body.theme-light .section-icon-btn:hover,
body.theme-light .section-icon-btn:focus-visible {
  background: oklch(0.84 0.008 85);
}

body.theme-light.can-edit .section-title:hover,
body.theme-light.can-edit .tutorial-title:hover {
  background: oklch(0.87 0.007 85 / 0.8);
  border-color: var(--line-strong);
}

body.theme-light .status-control {
  background: oklch(0.96 0.004 85);
}

body.theme-light .tutorial-status-control:hover,
body.theme-light .tutorial-status-control:focus-visible,
body.theme-light .section-status-control:has(.section-status.checked) {
  background: oklch(0.92 0.035 148);
}

body.theme-light .edit-mode-btn.active {
  background: oklch(0.91 0.04 148);
  color: oklch(0.42 0.12 148);
}

body.theme-light .todo-filter-btn.active,
body.theme-light .tutorial-todo-control.active,
body.theme-light .tutorial-todo-control:hover,
body.theme-light .tutorial-todo-control:focus-visible {
  background: oklch(0.93 0.045 78);
  color: oklch(0.42 0.09 78);
}

body.theme-light .tutorial-todo-control.readonly:hover,
body.theme-light .tutorial-todo-control.readonly:focus-visible {
  background: oklch(0.96 0.004 85);
}

body.theme-light .tutorial-todo-control.readonly.active:hover,
body.theme-light .tutorial-todo-control.readonly.active:focus-visible {
  background: oklch(0.93 0.045 78);
}

body.theme-light .tutorial-title {
  color: oklch(0.27 0.006 85);
}

body.theme-light .done-date span:last-child {
  color: oklch(0.5 0.006 85);
}

body.theme-light .section-body {
  background: oklch(0.91 0.006 85);
}

body.theme-light .tutorial-body {
  background: oklch(0.94 0.006 85);
}

body.theme-light .component-control-panel {
  border-left-color: oklch(0.78 0.008 85);
  background: oklch(0.94 0.006 85 / 0.72);
}

body.theme-light .component-control-panel:hover,
body.theme-light .component-control-panel:focus-within {
  border-color: var(--line-strong);
  background: oklch(0.91 0.007 85);
}

body.theme-light .component-edit-popover,
body.theme-light .icon-picker,
body.theme-light .youtube-duplicate-panel {
  background: var(--panel);
}

body.theme-light .component-edit-preview .youtube-frame {
  background: oklch(0.94 0.006 85);
}

body.theme-light .text-editor,
body.theme-light .text-display,
body.theme-light .youtube-frame,
body.theme-light .image-placeholder,
body.theme-light .upload-placeholder,
body.theme-light .files-placeholder,
body.theme-light .user-upload-box,
body.theme-light .image-frame.has-image,
body.theme-light .template-image,
body.theme-light .empty-state,
body.theme-light .file-add-btn {
  background: oklch(0.975 0.004 85);
  border-color: var(--line);
}

body.theme-light .text-display,
body.theme-light .user-upload-title,
body.theme-light .file-name,
body.theme-light .youtube-duplicate-description {
  color: oklch(0.34 0.006 85);
}

body.theme-light .image-source-tile,
body.theme-light .file-row,
body.theme-light .youtube-duplicate-item,
body.theme-light .icon-picker-item {
  background: oklch(0.955 0.005 85);
  border-color: var(--line);
}

body.theme-light .image-source-action + .image-source-action {
  border-top-color: var(--line);
}

body.theme-light .image-source-action:hover,
body.theme-light .image-source-action:focus-visible,
body.theme-light .file-add-btn:hover,
body.theme-light .file-add-btn:focus-visible,
body.theme-light .placeholder-action:hover,
body.theme-light .placeholder-action.active {
  background: oklch(0.91 0.028 250);
}

body.theme-light .upload-tile-plus {
  background: oklch(0.9 0.007 85);
}

body.theme-light .user-upload-thumb {
  background: oklch(0.94 0.006 85);
  border-color: var(--line);
}

body.theme-light .user-upload-thumb-meta {
  background: linear-gradient(180deg, transparent, oklch(0.24 0.006 85 / 0.74));
}

body.theme-light .user-upload-thumb-open,
body.theme-light .user-upload-thumb-delete,
body.theme-light .image-component-action {
  background: oklch(0.97 0.004 85 / 0.9);
  color: var(--text);
}

body.theme-light .image-viewer-modal,
body.theme-light .youtube-duplicate-modal {
  background: oklch(0.24 0.006 85 / 0.42);
}

body.theme-light .image-viewer-panel {
  background: var(--panel);
}

body.theme-light .image-viewer-stage {
  background: oklch(0.93 0.006 85);
}

body.theme-light .icon-color-swatch.default {
  background:
    linear-gradient(135deg, transparent 44%, var(--danger) 45%, var(--danger) 55%, transparent 56%),
    oklch(0.92 0.006 85);
}

@media (max-width: 720px) {
  .prototype-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  .toolbar-title {
    align-items: center;
    justify-content: space-between;
  }

  .mobile-toolbar-btn {
    display: inline-flex;
    justify-self: end;
  }

  .toolbar-search {
    display: none;
    flex: 1 1 auto;
    grid-column: 1 / -1;
    max-width: none;
    width: 100%;
  }

  .toolbar-actions {
    display: none;
    grid-column: 1 / -1;
    align-items: stretch;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    padding-top: 2px;
  }

  .mobile-toolbar-open .toolbar-search,
  .mobile-toolbar-open .toolbar-actions {
    display: flex;
  }

  .toolbar-actions > button,
  .toolbar-actions .user-switcher,
  .toolbar-actions .user-select,
  .toolbar-actions .user-role-badge {
    width: 100%;
  }

  .toolbar-actions > button {
    justify-content: center;
  }

  #editModeBtn {
    display: none !important;
  }

  .tutorials-workspace {
    width: 100%;
    margin-top: 0;
  }

  .component-menu {
    grid-template-columns: 1fr;
  }

  body.can-edit .component-block {
    grid-template-columns: minmax(0, 1fr) 32px;
    gap: 6px;
  }

  .component-control-panel {
    width: 32px;
  }

  .component-edit-popover {
    right: 38px;
    width: min(300px, calc(100% - 44px));
  }
}

/* Mintlify-inspired documentation shell */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f7f9f8;
  --panel-3: #eef3f1;
  --line: #e5e9e7;
  --line-strong: #cdd6d2;
  --text: #111827;
  --muted: #65716c;
  --faint: #8b9691;
  --accent: #f97316;
  --accent-hover: #df5d0b;
  --accent-soft: #fff1e8;
  --success: #16a37a;
  --warning: #b7791f;
  --danger: #dc4c4c;
  --sidebar-done: #9aa3a0;
  --radius: 10px;
  --shadow: 0 18px 55px rgb(15 23 42 / 0.12);
  --topbar-height: 65px;
  --sidebar-width: 272px;
  --toc-width: 220px;
}

body.theme-dark {
  color-scheme: dark;
  --bg: #0e1011;
  --panel: #141618;
  --panel-2: #191b1e;
  --panel-3: #222529;
  --line: #2b2f33;
  --line-strong: #444a50;
  --text: #f3f5f4;
  --muted: #a3a8ae;
  --faint: #767d85;
  --accent: #fb923c;
  --accent-hover: #fdac6b;
  --accent-soft: #3a2415;
  --success: #fb923c;
  --warning: #e6ad51;
  --danger: #ff7272;
  --sidebar-done: #737980;
  --shadow: 0 18px 60px rgb(0 0 0 / 0.42);
}

body.theme-light {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f7f9f8;
  --panel-3: #eef3f1;
  --line: #e5e9e7;
  --line-strong: #cdd6d2;
  --text: #111827;
  --muted: #65716c;
  --faint: #8b9691;
  --accent: #f97316;
  --accent-hover: #df5d0b;
  --accent-soft: #fff1e8;
  --success: #16a37a;
  --warning: #b7791f;
  --danger: #dc4c4c;
  --sidebar-done: #9aa3a0;
  --shadow: 0 18px 55px rgb(15 23 42 / 0.12);
}

body,
body.theme-light,
body.theme-dark {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.5;
  scrollbar-color: var(--line-strong) var(--panel-2);
}

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

.prototype-shell {
  min-height: 100vh;
  background: var(--bg);
}

.prototype-toolbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: minmax(190px, var(--sidebar-width)) minmax(180px, 1fr) max-content;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
}

.toolbar-brand,
.brand-lockup,
.brand-copy,
.toolbar-actions,
.account-controls {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #fb923c, #ea580c);
  color: #fff;
  box-shadow: 0 7px 16px rgb(249 115 22 / 0.22);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-copy {
  gap: 7px;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-copy strong { font-weight: 750; }
.brand-copy span { color: var(--muted); font-weight: 500; }

.toolbar-search {
  position: relative;
  min-width: 0;
  max-width: none;
  width: 100%;
  max-width: 520px;
  justify-self: center;
  display: flex;
  align-items: center;
}

.toolbar-search-icon {
  position: absolute;
  z-index: 1;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--faint);
  pointer-events: none;
}

.toolbar-search-icon svg,
.sidebar-filter-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toolbar-search-input {
  width: 100%;
  height: 39px;
  padding: 8px 68px 8px 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35);
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.toolbar-search-input:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background: var(--panel);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}

.toolbar-search-clear {
  right: 39px;
  color: var(--faint);
}

.search-shortcut {
  position: absolute;
  right: 11px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--faint);
  font-size: 12px;
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 70;
  max-height: min(520px, calc(100vh - 100px));
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-result {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 10px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.search-result-path {
  grid-column: 1;
  color: var(--faint);
  font-size: 12px;
}

.search-result-title {
  grid-column: 1;
  font-size: 14px;
  font-weight: 650;
}

.search-result-title mark {
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: inherit;
}

.search-result-arrow {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--faint);
}

.search-empty {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.toolbar-actions {
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.account-controls { min-width: 0; gap: 8px; }

.user-switcher { position: relative; }
.user-switcher::after {
  content: '';
  position: absolute;
  right: 11px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.user-select,
.user-role-badge,
.icon-text-btn,
.mobile-toolbar-btn {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}

.user-select {
  min-width: 140px;
  max-width: 190px;
  padding: 5px 28px 5px 9px;
  appearance: none;
  cursor: pointer;
  text-overflow: ellipsis;
}

.user-select option {
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
}

.user-role-badge {
  max-width: 180px;
  overflow: hidden;
  padding: 5px 9px;
  text-overflow: ellipsis;
}

.user-role-badge.master,
.edit-mode-btn.active {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-hover);
}

body.theme-dark .user-role-badge.master,
body.theme-dark .edit-mode-btn.active { color: var(--accent); }

.icon-text-btn {
  padding: 6px 10px;
  font-weight: 600;
}

.icon-text-btn:hover,
.icon-text-btn:focus-visible,
.user-select:hover,
.user-select:focus,
.user-switcher:focus-within .user-select {
  border-color: var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
}

.theme-toggle-btn { width: 40px; padding: 6px; }
.theme-toggle-track { width: 27px; height: 16px; background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--line); }
.theme-toggle-knob { width: 12px; height: 12px; background: var(--faint); }
.theme-toggle-btn[aria-pressed="true"] .theme-toggle-knob { transform: translateX(11px); background: var(--accent); }

.docs-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
  padding-top: var(--topbar-height);
}

.docs-sidebar {
  position: fixed;
  z-index: 25;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 25px 18px 18px 22px;
  border-right: 0;
  background: var(--bg);
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 7px 13px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sidebar-close { display: none; }

.sidebar-filter {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 23px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  text-align: left;
}

.sidebar-filter-icon { width: 17px; height: 17px; }
.sidebar-filter:hover, .sidebar-filter:focus-visible { border-color: var(--line-strong); color: var(--text); outline: none; }
.sidebar-filter.active { border-color: color-mix(in srgb, var(--accent) 36%, var(--line)); background: var(--accent-soft); color: var(--accent-hover); }
body.theme-dark .sidebar-filter.active { color: var(--accent); }

.sections-root {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 25px;
}

.sidebar-group { min-width: 0; }

.sidebar-group-heading {
  position: relative;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  padding: 2px 3px 2px 10px;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.sidebar-group-heading:hover { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.sidebar-group-heading:focus-within { box-shadow: inset 0 0 0 1px var(--accent); }

.sidebar-group-toggle {
  width: 19px;
  height: 24px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.sidebar-group-toggle:hover,
.sidebar-group-toggle:focus-visible {
  background: var(--panel-2);
  color: var(--text);
  outline: none;
}

.sidebar-group-toggle svg { width: 14px; height: 14px; transition: transform 160ms ease; }
.sidebar-group.expanded .sidebar-group-toggle svg { transform: rotate(90deg); }

.sidebar-group-title { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
body.can-edit .sidebar-group-title { cursor: text; }
.sidebar-group-progress { flex: 0 0 auto; margin-left: auto; color: var(--faint); font-size: 11px; }

.sidebar-tutorial-list { display: flex; flex-direction: column; gap: 2px; padding-left: 22px; }
.sidebar-tutorial-row { position: relative; display: flex; align-items: center; min-width: 0; border-radius: 8px; }
.sidebar-tutorial-row.active { background: var(--accent-soft); }

.sidebar-tutorial-link {
  width: 100%;
  min-width: 0;
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.sidebar-tutorial-link:hover,
.sidebar-tutorial-link:focus-visible { background: var(--panel-2); color: var(--text); outline: none; }
.sidebar-tutorial-row.active .sidebar-tutorial-link { color: var(--accent-hover); font-weight: 650; }
body.theme-dark .sidebar-tutorial-row.active .sidebar-tutorial-link { color: var(--accent); }
.sidebar-tutorial-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-state-dot {
  width: 15px;
  height: 15px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
}

.sidebar-state-dot.done { border-color: var(--sidebar-done); background: var(--sidebar-done); }
.sidebar-state-dot svg { width: 11px; height: 11px; }
.sidebar-state-dot:hover,
.sidebar-state-dot:focus-visible { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 28%, transparent); outline-offset: 1px; }
.sidebar-todo-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--warning); }

.sidebar-admin-actions {
  display: none;
  align-items: center;
  gap: 1px;
  margin-left: auto;
}

.sidebar-group-heading:hover .sidebar-admin-actions,
.sidebar-group-heading:focus-within .sidebar-admin-actions,
.sidebar-tutorial-row:hover .sidebar-admin-actions,
.sidebar-tutorial-row:focus-within .sidebar-admin-actions { display: inline-flex; }
.sidebar-group-heading > .sidebar-admin-actions { margin-left: 8px; }
.sidebar-tutorial-row .tutorial-actions { position: absolute; right: 4px; padding-left: 6px; background: linear-gradient(90deg, transparent, var(--panel-2) 18%); }
.sidebar-tutorial-row.active .tutorial-actions { background: linear-gradient(90deg, transparent, var(--accent-soft) 18%); }

.sidebar-admin-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font-size: 12px;
}

.sidebar-admin-btn:hover:not(:disabled), .sidebar-admin-btn:focus-visible:not(:disabled) { background: var(--panel-3); color: var(--text); outline: none; }
.sidebar-admin-btn:disabled { opacity: 0.3; cursor: default; }

.sidebar-add-tutorial,
.sidebar-add {
  min-height: 32px;
  margin-top: 4px;
  padding: 6px 9px;
  border: 1px dashed transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  text-align: left;
}

.sidebar-add-tutorial:hover,
.sidebar-add-tutorial:focus-visible,
.sidebar-add:hover,
.sidebar-add:focus-visible { border-color: var(--line); background: var(--panel-2); color: var(--text); outline: none; }
.sidebar-add { width: 100%; margin-top: 20px; }
.sidebar-footer { margin-top: 18px; padding: 15px 7px 0; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }

.tutorials-workspace {
  grid-column: 2;
  width: 100%;
  min-width: 0;
  padding: 62px clamp(28px, 5vw, 82px) 80px;
}

.article-root { width: min(760px, 100%); margin: 0 auto; }
.docs-article { width: 100%; }

.article-header { position: relative; padding-bottom: 34px; border-bottom: 0; }
.article-eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 15px; color: var(--accent); font-size: 13px; font-weight: 650; }

.article-title {
  max-width: 690px;
  margin: 0;
  color: var(--text);
  font-size: clamp(30px, 3.6vw, 40px);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

body.can-edit .article-title { cursor: text; }
body.can-edit .article-title:hover { color: var(--accent-hover); }
.article-title .inline-rename-input { height: 52px; max-width: 100%; font-size: inherit; font-weight: inherit; }

.article-meta { display: flex; align-items: center; gap: 10px; margin-top: 13px; color: var(--faint); font-size: 13px; }
.meta-divider { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.article-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

.article-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
}

.article-action svg { width: 15px; height: 15px; }
.article-action:hover:not(:disabled), .article-action:focus-visible:not(:disabled) { border-color: var(--line-strong); background: var(--panel-2); color: var(--text); outline: none; }
.article-action.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.article-action.primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: #fff; }
.article-action.active:not(.primary) { border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); background: var(--accent-soft); color: var(--accent-hover); }
.article-action:disabled { opacity: 0.75; cursor: default; }

.article-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 38px 0 52px;
}

.docs-component { scroll-margin-top: calc(var(--topbar-height) + 28px); }
body.can-edit .docs-component { grid-template-columns: minmax(0, 1fr) 38px; gap: 10px; }

.text-display,
.text-editor {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
  white-space: pre-wrap;
}

body:not(.can-edit) .text-display {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.rich-text-editor {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.rich-text-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.rich-text-tool {
  min-width: 30px;
  height: 29px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.rich-text-tool.strong { font-weight: 800; }
.rich-text-tool.history { font-size: 18px; line-height: 1; }
.rich-text-tool:hover:not(:disabled), .rich-text-tool:focus-visible:not(:disabled) { border-color: var(--line-strong); background: var(--panel-3); color: var(--text); outline: none; }
.rich-text-tool:disabled { opacity: 0.35; cursor: default; }
.rich-text-toolbar-divider { width: 1px; height: 20px; margin: 0 4px; background: var(--line); }

.rich-text-panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 230px;
}

.rich-text-pane { min-width: 0; display: flex; flex-direction: column; }
.rich-text-pane + .rich-text-pane { border-left: 1px solid var(--line); }
.rich-text-pane-label { padding: 10px 14px 0; color: var(--faint); font-size: 11px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.rich-text-editor .rich-text-source { flex: 1; min-height: 200px; resize: vertical; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; line-height: 1.65; }
.rich-text-editor .rich-text-source:focus { border: 0; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 32%, transparent); outline: none; }
.rich-text-preview { flex: 1; min-height: 200px; padding: 10px 16px 18px; }

.markdown-preview { color: var(--text); font-size: 16px; line-height: 1.75; }
.text-display.markdown-preview { font-size: 16px; line-height: 1.75; }
body.theme-dark .text-display.markdown-preview,
body.theme-dark .markdown-preview { color: #c8cdd2; }
.markdown-preview p { margin: 0 0 1em; }
.markdown-preview p:last-child { margin-bottom: 0; }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { margin: 1.15em 0 0.45em; color: var(--text); line-height: 1.25; letter-spacing: -0.02em; }
.markdown-preview h1 { font-size: 32px; }
.markdown-preview h2 { font-size: 24px; }
.markdown-preview h3 { font-size: 20px; }
.markdown-preview ul, .markdown-preview ol { margin: 0 0 1em; padding-left: 1.4em; }
.markdown-preview li { padding-left: 0.2em; }
.markdown-preview blockquote { margin: 1em 0; padding: 0.2em 1em; border-left: 3px solid var(--accent); color: var(--muted); }
.markdown-preview code { padding: 0.15em 0.35em; border-radius: 5px; background: var(--panel-3); color: var(--accent-hover); font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.9em; }
.markdown-preview a { color: var(--accent-hover); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 42%, transparent); text-underline-offset: 2px; }
.markdown-preview a:hover { color: var(--accent); }
.markdown-empty { color: var(--faint); font-style: italic; }

body.theme-dark .rich-text-editor { box-shadow: 0 1px 2px rgb(0 0 0 / 0.24); }

@media (max-width: 700px) {
  .rich-text-panes { grid-template-columns: 1fr; }
  .rich-text-pane + .rich-text-pane { border-top: 1px solid var(--line); border-left: 0; }
  .rich-text-source, .rich-text-preview { min-height: 170px; }
}

.text-editor {
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.text-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); outline: none; }

.youtube-frame,
.image-frame.has-image,
.template-image,
.files-placeholder,
.user-upload-box,
.image-placeholder,
.upload-placeholder,
body.theme-light .youtube-frame,
body.theme-light .image-frame.has-image,
body.theme-light .template-image,
body.theme-light .files-placeholder,
body.theme-light .user-upload-box,
body.theme-light .image-placeholder,
body.theme-light .upload-placeholder {
  overflow: hidden;
  border-color: var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.youtube-frame { aspect-ratio: 16 / 9; }
.image-frame.has-image { padding: 8px; }
.template-image { border: 0; border-radius: 8px; }
.image-caption { padding-top: 9px; color: var(--faint); font-size: 13px; text-align: center; }

.files-placeholder,
.user-upload-box { padding: 14px; }
.file-row,
body.theme-light .file-row { min-height: 48px; border-color: var(--line); border-radius: 8px; background: var(--panel); }
.file-pill { border-radius: 6px; background: var(--accent-soft); color: var(--accent-hover); }
.file-name { color: var(--text); font-size: 14px; }

.component-control-panel,
body.theme-light .component-control-panel {
  width: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  opacity: 0.55;
}

.component-block:hover .component-control-panel,
.component-control-panel:focus-within,
body.theme-light .component-control-panel:hover,
body.theme-light .component-control-panel:focus-within { border-color: var(--line-strong); background: var(--panel-2); opacity: 1; }
.component-control-btn:hover, .component-control-btn:focus-visible, .component-edit-btn[aria-expanded="true"] { border-color: var(--line); background: var(--panel-3); color: var(--text); }

.add-component-wrap { margin-top: 4px; }
.placeholder-action,
body.theme-light .placeholder-action {
  min-height: 43px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--faint);
}

.placeholder-action:hover,
.placeholder-action:focus-visible,
.placeholder-action.active,
body.theme-light .placeholder-action:hover,
body.theme-light .placeholder-action.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); outline: none; }

.component-menu { top: calc(100% + 8px); border-color: var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.component-menu button { min-height: 37px; border-color: var(--line); border-radius: 8px; background: var(--panel-2); }
.component-menu button:hover, .component-menu button:focus-visible { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); outline: none; }

.component-edit-popover,
.icon-picker,
.youtube-duplicate-panel,
body.theme-light .component-edit-popover,
body.theme-light .icon-picker,
body.theme-light .youtube-duplicate-panel { border-color: var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }

.article-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-top: 28px;
  border-top: 0;
}

.pager-button {
  min-height: 86px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.pager-button.next { grid-column: 2; align-items: flex-end; text-align: right; }
.pager-button span { color: var(--faint); font-size: 12px; }
.pager-button strong { font-size: 14px; font-weight: 650; }
.pager-button:hover, .pager-button:focus-visible { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); outline: none; }

.docs-toc {
  position: fixed;
  z-index: 10;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  width: var(--toc-width);
  overflow-y: auto;
  padding: 62px 24px 40px 18px;
  border-left: 0;
  background: var(--bg);
}

.toc-heading { margin-bottom: 11px; color: var(--text); font-size: 12px; font-weight: 700; }
.toc-link { display: block; padding: 5px 0 5px 12px; border-left: 1px solid var(--line); color: var(--faint); font-size: 12px; line-height: 1.4; text-decoration: none; }
.toc-link:hover, .toc-link:focus-visible { border-left-color: var(--accent); color: var(--accent-hover); outline: none; }

.article-empty { min-height: 55vh; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.article-empty-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 17px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.article-empty-icon .ui-icon { width: 25px; height: 25px; }
.article-empty h1 { margin: 0 0 7px; color: var(--text); font-size: 25px; }
.article-empty p { max-width: 420px; margin: 0; font-size: 15px; }

.empty-state,
body.theme-light .empty-state { padding: 22px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel-2); color: var(--muted); font-size: 14px; }

.login-screen,
body.theme-light .login-screen {
  background:
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34%),
    var(--bg);
}

.login-card {
  width: min(390px, 100%);
  padding: 39px 34px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card::before { content: "D"; width: 45px; height: 45px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 12px; background: linear-gradient(145deg, #fb923c, #ea580c); color: #fff; font-weight: 800; }
.login-title { color: var(--text); font-size: 25px; letter-spacing: -0.025em; }
.login-subtitle { margin-bottom: 28px; color: var(--muted); font-size: 14px; }
.login-input { height: 43px; border-color: var(--line); border-radius: 9px; background: var(--panel-2); color: var(--text); font-size: 14px; }
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.login-btn { min-height: 43px; border-color: var(--accent); border-radius: 9px; background: var(--accent); color: #fff; font-size: 14px; }
.login-btn:hover:not(:disabled), .login-btn:focus-visible:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); }

.toast { bottom: 24px; border-color: var(--line); border-radius: 10px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); }
.mobile-nav-btn { display: none; }
.sidebar-backdrop { display: none; }

/* Mintlify-style navigation scrollbar: reveal it only while the panel is hovered. */
.docs-sidebar {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.docs-sidebar::-webkit-scrollbar-thumb { background: transparent; }
.docs-sidebar:hover { scrollbar-color: #b9c0c5 transparent; }
.docs-sidebar:hover::-webkit-scrollbar-thumb { background: #b9c0c5; background-clip: padding-box; }
body.theme-dark .docs-sidebar:hover { scrollbar-color: #4a5056 transparent; }
body.theme-dark .docs-sidebar:hover::-webkit-scrollbar-thumb { background: #4a5056; background-clip: padding-box; }
.docs-sidebar:hover::-webkit-scrollbar-thumb:hover { background: #8f979e; background-clip: padding-box; }
body.theme-dark .docs-sidebar:hover::-webkit-scrollbar-thumb:hover { background: #687078; background-clip: padding-box; }

/* Minimal, neutral scrollbars */
html { scrollbar-width: thin; scrollbar-color: #b9c0c5 transparent; }
html.theme-dark { scrollbar-color: #4a5056 transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  border: 1px solid transparent;
  border-radius: 999px;
  background: #b9c0c5;
  background-clip: padding-box;
}
body.theme-dark *::-webkit-scrollbar-thumb { background: #4a5056; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #8f979e; background-clip: padding-box; }
body.theme-dark *::-webkit-scrollbar-thumb:hover { background: #687078; background-clip: padding-box; }
html.theme-dark::-webkit-scrollbar-thumb { background: #4a5056; background-clip: padding-box; }
html.theme-dark::-webkit-scrollbar-thumb:hover { background: #687078; background-clip: padding-box; }

@media (max-width: 1100px) {
  :root { --toc-width: 0px; }
  .prototype-toolbar { grid-template-columns: minmax(190px, 230px) minmax(170px, 1fr) max-content; gap: 14px; padding-inline: 16px; }
  .docs-layout { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .docs-toc { display: none; }
  .tutorials-workspace { padding-inline: clamp(28px, 6vw, 70px); }
  .user-role-badge { display: none; }
}

@media (max-width: 940px) and (min-width: 821px) {
  .prototype-toolbar { grid-template-columns: 190px minmax(150px, 1fr) max-content; gap: 10px; padding-inline: 12px; }
  .account-controls { gap: 5px; }
  .user-select { min-width: 112px; max-width: 132px; }
  .icon-text-btn { padding-inline: 9px; }
}

@media (max-width: 820px) {
  :root { --sidebar-width: 284px; }
  .prototype-toolbar {
    height: var(--topbar-height);
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    gap: 12px;
    padding: 0 16px;
  }
  .toolbar-brand { min-width: 0; gap: 9px; }
  .mobile-nav-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
  }
  .mobile-nav-btn span { width: 15px; height: 1.5px; border-radius: 999px; background: currentColor; }
  .toolbar-search { grid-column: 2; display: flex; }
  .toolbar-actions { grid-column: 3; display: flex; width: auto; flex-direction: row; align-items: center; padding-top: 0; }
  .toolbar-actions .account-controls { display: none; }
  .toolbar-actions > .mobile-toolbar-btn { display: inline-flex; width: 34px; min-width: 34px; height: 34px; border-radius: 999px; }
  .mobile-toolbar-open .toolbar-actions .account-controls { position: absolute; top: calc(100% + 8px); right: 14px; width: 220px; display: flex; flex-direction: column; align-items: stretch; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
  .mobile-toolbar-open .toolbar-actions .user-switcher, .mobile-toolbar-open .toolbar-actions #logoutBtn, .mobile-toolbar-open .toolbar-actions .theme-toggle-btn { display: flex; width: 100%; }
  .mobile-toolbar-open .toolbar-actions .user-select { width: 100%; max-width: none; }
  .docs-layout { display: block; }
  .docs-sidebar { top: 0; z-index: 80; width: min(var(--sidebar-width), calc(100vw - 42px)); padding-top: 22px; transform: translateX(-104%); box-shadow: var(--shadow); transition: transform 190ms ease; }
  .mobile-nav-open .docs-sidebar { transform: translateX(0); }
  .sidebar-close { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 22px; }
  .sidebar-close:hover, .sidebar-close:focus-visible { background: var(--panel-2); color: var(--text); outline: none; }
  .sidebar-backdrop:not([hidden]) { position: fixed; inset: 0; z-index: 75; display: block; background: rgb(3 10 7 / 0.44); backdrop-filter: blur(2px); }
  .tutorials-workspace { width: 100%; padding: 46px clamp(22px, 7vw, 54px) 70px; }
}

@media (max-width: 560px) {
  :root { --topbar-height: 59px; }
  .prototype-toolbar { grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 10px; }
  .toolbar-search-input { height: 36px; padding-left: 34px; padding-right: 35px; }
  .toolbar-search-icon { left: 11px; }
  .search-shortcut { display: none; }
  .toolbar-search-clear { right: 6px; }
  .search-results { position: fixed; top: calc(var(--topbar-height) + 7px); right: 8px; left: 8px; max-height: calc(100vh - var(--topbar-height) - 20px); }
  .tutorials-workspace { padding: 36px 19px 60px; }
  .article-title { font-size: 30px; }
  .article-header { padding-bottom: 29px; }
  .article-content { gap: 23px; padding-top: 31px; }
  .article-pager { grid-template-columns: 1fr; }
  .pager-button.next { grid-column: 1; }
  .article-actions { align-items: stretch; }
  .article-action { flex: 1; justify-content: center; }
  body.can-edit .docs-component { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .docs-sidebar { transition: none; }
  .toc-link, .pager-button, .sidebar-tutorial-link { scroll-behavior: auto; }
}
