:root {
  color-scheme: light;
  --bg: #efedea;
  --surface: #ffffff;
  --surface-alt: #f7f5f2;
  --line: #ded8d1;
  --line-strong: #b8afa5;
  --text: #292524;
  --muted: #756c64;
  --accent: #f97316;
  --accent-strong: #c2410c;
  --accent-soft: #ffedd5;
  --danger: #b42318;
  --shadow: 0 14px 34px rgba(41, 37, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.app-shell {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo-button,
.brand-title-button {
  border: 0;
  background: transparent;
  padding: 0;
}

.brand-logo-button {
  display: flex;
  border-radius: 8px;
}

.brand-logo-button:hover .brand-mark {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.brand-title-button {
  text-align: left;
}

.brand-title-button:hover h1 {
  color: var(--accent);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(41, 37, 36, 0.16);
}

h1 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions,
.tool-actions,
.docs-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-badge {
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-wrapper {
  position: relative;
}

.user-avatar-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d8d1ca;
  border-radius: 50%;
  background: #fff;
  padding: 0;
  box-shadow: 0 2px 8px rgba(41, 37, 36, 0.16);
  overflow: hidden;
}

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

.user-avatar-button span {
  display: none;
}

.user-avatar-button:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.user-context-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}

.user-menu-summary {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-context-menu button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
}

.user-context-menu button:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.user-context-menu button:disabled {
  cursor: not-allowed;
  color: var(--line-strong);
}

.tool-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  overflow: hidden;
}

body.presentation-mode .workspace {
  grid-template-columns: minmax(0, 1fr);
}

body.prototype-mode .workspace {
  grid-template-columns: minmax(0, 1fr);
}

body.simple-page-mode .workspace {
  grid-template-columns: minmax(0, 1fr);
}

body.presentation-mode .project-panel,
body.presentation-mode .inspector-panel,
body.presentation-mode .toolbar,
body.prototype-mode .project-panel,
body.prototype-mode .inspector-panel,
body.review-mode .toolbar,
body.simple-page-mode .project-panel,
body.simple-page-mode .inspector-panel,
body.simple-page-mode .toolbar {
  display: none;
}

body.presentation-mode .canvas-column,
body.simple-page-mode .canvas-column {
  grid-template-rows: 1fr;
}

.sidebar {
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.inspector-panel {
  position: relative;
  z-index: 2;
  min-width: 0;
  overflow: auto;
  background: var(--surface);
  border-right: 0;
  border-left: 1px solid var(--line);
}

.panel-block {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.section-title {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text);
}

.section-title-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px 7px 0 0;
  background: #fff;
  overflow: hidden;
}

.panel-tabs button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 30px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 0 6px;
  white-space: nowrap;
}

.panel-tabs button:last-child {
  border-right: 0;
}

.panel-tabs button.active {
  background: var(--text);
  color: #fff;
}

.edit-project-button {
  width: 30px;
  min-height: 30px;
  color: var(--muted);
}

.edit-project-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.project-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.project-title-row input:disabled {
  color: var(--text);
  font-weight: 800;
  opacity: 1;
}

.project-documents-link {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  padding: 0 10px;
  text-align: center;
  text-transform: uppercase;
}

.project-documents-link:disabled {
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #eee9e3;
  color: #9a9087;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.screen-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.layer-list {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.layer-root {
  min-height: 28px;
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.layer-item {
  min-height: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px 24px;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  padding: 2px;
}

.layer-item.active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.layer-item.hidden-layer {
  opacity: 0.55;
}

.layer-select-button {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 4px;
  text-align: left;
}

.layer-type-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.layer-name {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-action-button {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 12px;
}

.layer-action-button:hover {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.screen-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px auto 24px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
}

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

.screen-name-input {
  min-width: 0;
  height: auto;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  resize: none;
  white-space: normal;
}

.screen-name-input:focus {
  box-shadow: none;
  background: #fff;
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.screen-item small {
  flex: 0 0 auto;
  color: var(--muted);
}

.screen-add-button,
.screen-delete-button {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--danger);
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.screen-add-button {
  color: var(--accent);
  font-size: 15px;
}

.screen-add-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.screen-delete-button:hover:not(:disabled) {
  border-color: #f2b8b5;
  background: #fff5f5;
}

.screen-delete-button:disabled {
  cursor: not-allowed;
  color: var(--line-strong);
}

.component-grid {
  display: grid;
  gap: 12px;
}

.component-library-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 7px 7px 0 0;
  background: #fff;
  padding: 0;
  overflow: hidden;
}

.component-library-tabs button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 30px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 0 6px;
  white-space: nowrap;
}

.component-library-tabs button:last-child {
  border-right: 0;
}

.component-library-tabs button.active {
  background: var(--text);
  color: #fff;
}

.component-group {
  display: grid;
  gap: 8px;
}

.component-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 0;
  text-align: left;
  text-transform: uppercase;
}

.component-group-title span {
  width: 12px;
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  font-size: 13px;
}

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

.one-c-library-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.one-c-library-item {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 2px 0;
}

.one-c-library-item:hover,
.one-c-library-item:focus-visible {
  border-color: var(--line);
  background: rgba(249, 115, 22, 0.06);
  outline: none;
}

.one-c-library-preview {
  max-width: 100%;
  display: block;
  flex: 0 1 auto;
  color: #4b5563;
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 1;
  overflow: hidden;
}

.one-c-library-preview *,
.one-c-library-preview::before,
.one-c-library-preview::after {
  box-sizing: border-box;
}

.one-c-library-preview * {
  pointer-events: none;
}

.one-c-library-button {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c7b900;
  background: #ffe500;
  color: #222;
  font-size: 12px;
  white-space: nowrap;
}

.component-button {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-rows: 28px auto;
  align-items: center;
  justify-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 6px;
}

.component-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.component-icon img {
  max-width: 24px;
  max-height: 24px;
  display: block;
  object-fit: contain;
}

.component-caption {
  max-width: 100%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.component-button:hover,
.ghost-button:hover,
.icon-button:hover,
.small-button:hover {
  border-color: var(--line-strong);
  background: #f5f7f9;
}

.component-button:hover .component-icon {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.business-component-button .component-icon {
  width: 32px;
  font-size: 11px;
  letter-spacing: 0;
}

.icon-component-button {
  min-height: 58px;
  grid-template-rows: 30px auto;
}

.icon-component-button .component-icon {
  width: 34px;
  height: 34px;
  border-color: transparent;
  background: #e9ecef;
  color: #4b5563;
  font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.icon-component-button .component-icon img {
  max-width: 28px;
  max-height: 28px;
}

.icon-component-button .component-caption {
  display: none;
}

.canvas-image-icon,
.prototype-image-icon,
.canvas-uploaded-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.canvas-image-icon,
.canvas-uploaded-image {
  pointer-events: none;
}

.image-placeholder-widget {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--muted);
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.image-placeholder-widget span {
  font-size: 24px;
  color: var(--accent);
}

.canvas-element[data-render-type^="OneC"] {
  border-color: transparent !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}

.canvas-element[data-render-type^="OneC"].selected {
  border-color: var(--accent) !important;
  box-shadow: none;
}

.canvas-element[data-render-type^="OneC"] .element-content {
  display: block;
  padding: 0;
  background: transparent !important;
  text-align: left;
}

.canvas-element[data-render-type^="OneC"] *,
.prototype-element[data-render-type^="OneC"] * {
  box-sizing: border-box;
}

.one-c-tabs-widget {
  width: 100%;
  height: 100%;
  position: relative;
  background: #fff;
  color: #4b5563;
  font-family: Arial, sans-serif;
  font-size: 12px;
  overflow: hidden;
}

.one-c-tabs-strip {
  height: 20px;
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding-left: 0;
}

.one-c-tabs-strip button {
  height: 20px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #b7b7b7;
  border-bottom: 0;
  background: #f5f5f5;
  color: #4b5563;
  font: inherit;
  line-height: 1;
  padding: 0 8px;
  white-space: nowrap;
}

.one-c-tabs-strip button.active {
  position: relative;
  z-index: 1;
  background: #fff;
}

.one-c-tabs-body {
  position: absolute;
  inset: 19px 0 0 0;
  border: 1px solid #b7b7b7;
  background: #fff;
}

.one-c-logo-widget {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 4px solid #d7c53a;
  border-radius: 999px;
  background: #fff36a;
  color: #e02222;
  font-family: Arial, sans-serif;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.one-c-round-icon {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 20px;
  font-weight: 900;
}

.one-c-plus-icon {
  background: #40b957;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
}

.one-c-save-icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.one-c-radio-group {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4b5563;
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.one-c-radio-group span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.one-c-radio-group i {
  width: 11px;
  height: 11px;
  display: inline-block;
  border: 1px solid #b7b7b7;
  border-radius: 999px;
  background: #fff;
}

.one-c-radio-group i.active::after {
  content: "";
  width: 5px;
  height: 5px;
  display: block;
  margin: 2px;
  border-radius: 999px;
  background: #55b96b;
}

.one-c-switch-widget {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4b5563;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.one-c-switch-widget span {
  width: 36px;
  height: 14px;
  position: relative;
  border-radius: 999px;
  background: #91d09b;
}

.one-c-switch-widget.inactive span {
  background: #d4d4d4;
}

.one-c-switch-widget span::after {
  content: "";
  width: 18px;
  height: 18px;
  position: absolute;
  top: -2px;
  right: 0;
  border-radius: 999px;
  background: #47b960;
}

.one-c-switch-widget.inactive span::after {
  right: auto;
  left: 0;
  background: #9ca3af;
}

.one-c-switch-widget strong {
  font: inherit;
  font-weight: 400;
}

.one-c-checkbox-widget {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #4b5563;
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.one-c-checkbox-widget i {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #7c7c7c;
  background: #fff;
}

.one-c-checkbox-widget i.active::after {
  content: "✓";
  color: #2ea043;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.one-c-checkbox-widget strong {
  font: inherit;
  font-weight: 400;
}

.one-c-segmented-widget {
  width: 100%;
  height: 100%;
  display: flex;
  border: 1px solid #c9c9c9;
  background: #f6f6f6;
  color: #4b5563;
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 1;
}

.one-c-segmented-widget span {
  flex: 1;
  display: grid;
  place-items: center start;
  border-right: 1px solid #c9c9c9;
  padding: 0 8px;
}

.one-c-segmented-widget span:last-child {
  border-right: 0;
}

.one-c-image-upload-widget {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px solid #b7b7b7;
  background: #fff;
  color: #4b5563;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.one-c-image-upload-widget span {
  font-size: 18px;
}

.one-c-image-upload-widget strong {
  font: inherit;
  font-weight: 400;
}

.one-c-input-picker-widget,
.one-c-date-field-widget {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  border: 1px solid #c9c9c9;
  background: #fff;
  color: #7a7a7a;
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 1;
}

.one-c-input-picker-widget span,
.one-c-date-field-widget span {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 8px;
}

.one-c-input-picker-widget input,
.one-c-date-field-widget input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #4b5563;
  font: inherit;
  outline: none;
  padding: 0 8px;
}

.one-c-input-picker-widget button,
.one-c-date-field-widget button {
  width: 20px;
  border: 0;
  border-left: 1px solid #c9c9c9;
  background: #f7f7f7;
  color: #4b5563;
  font: inherit;
  line-height: 1;
  padding: 0;
}

.one-c-vertical-tabs-widget {
  width: 100%;
  height: 100%;
  position: relative;
  background: #fff;
  color: #4b5563;
  font-family: Arial, sans-serif;
  font-size: 12px;
  overflow: hidden;
}

.one-c-vertical-tabs-strip {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.one-c-vertical-tabs-strip button {
  width: 24px;
  min-height: 68px;
  border: 1px solid #b7b7b7;
  border-right: 0;
  background: #f5f5f5;
  color: #4b5563;
  font: inherit;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 6px 0;
}

.one-c-vertical-tabs-strip button.active {
  position: relative;
  z-index: 1;
  background: #fff;
}

.one-c-vertical-tabs-body {
  position: absolute;
  inset: 0 0 0 23px;
  border: 1px solid #b7b7b7;
  background: #fff;
}

.canvas-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #292524;
}

.lock-toolbar-button {
  min-height: 30px;
  width: 34px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f8f5f1;
}

.lock-toolbar-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.lock-toolbar-button:disabled {
  opacity: 0.45;
}

.group-toolbar-button {
  min-height: 30px;
  width: 34px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f8f5f1;
}

.group-toolbar-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.group-toolbar-button:disabled {
  opacity: 0.45;
}

.toggle-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #d7d3cf;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.toggle-pill input {
  width: auto;
}

.icon-toggle {
  width: 34px;
  justify-content: center;
  padding: 0;
}

.icon-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.icon-toggle:has(input:checked) {
  border-color: var(--accent);
  background: rgba(249, 115, 22, 0.18);
  color: #fff7ed;
}

.segmented-control {
  display: inline-flex;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.segmented-control button {
  min-width: 34px;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #c9c4bf;
  padding: 0 8px;
  font-weight: 800;
}

.segmented-control button.active {
  background: var(--accent);
  color: #fff7ed;
}

.segmented-control button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.icon-button,
.small-button,
.ghost-button,
.primary-button {
  min-height: 36px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font-weight: 800;
}

.icon-button {
  width: 36px;
  padding: 0;
}

.wide-icon-button {
  width: 100%;
  padding: 0 10px;
}

.icon-button.success {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.auth-actions .icon-button {
  width: 34px;
  min-height: 34px;
  font-size: 16px;
  line-height: 1;
}

.small-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

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

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

.ghost-button.danger {
  color: var(--danger);
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
}

.settings-modal {
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 16px;
}

.settings-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.tab-panel {
  min-width: 0;
  min-height: 0;
  display: none;
}

.tab-panel.active {
  display: block;
}

#canvasPanel.active {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.presentation-page {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  grid-template-rows: minmax(420px, auto) auto;
  gap: 24px;
  align-items: center;
  padding: 48px;
  background:
    linear-gradient(135deg, rgba(41, 37, 36, 0.92), rgba(87, 83, 78, 0.82));
  color: #fff7ed;
}

.presentation-hero {
  max-width: 720px;
}

.presentation-hero h2 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
}

.presentation-copy {
  max-width: 620px;
  margin: 22px 0 0;
  color: #f5f2ee;
  font-size: 14px;
  line-height: 1.55;
}

.presentation-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.presentation-preview {
  min-height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.preview-toolbar {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #292524;
}

.preview-toolbar span {
  width: 28px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
}

.preview-toolbar span:first-child {
  background: var(--accent);
}

.preview-layout {
  height: 378px;
  display: grid;
  grid-template-columns: 110px 1fr 130px;
}

.preview-sidebar,
.preview-inspector {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  background: #f3f0ec;
}

.preview-sidebar span,
.preview-inspector span {
  height: 28px;
  border-radius: 6px;
  background: #ded8d1;
}

.preview-canvas {
  position: relative;
  background-image:
    linear-gradient(rgba(41, 37, 36, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 37, 36, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
}

.preview-card,
.preview-flow {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: rgba(255, 237, 213, 0.86);
}

.preview-card {
  top: 70px;
  left: 70px;
  width: 170px;
  height: 82px;
}

.preview-card.small {
  top: 205px;
  left: 260px;
  width: 130px;
  height: 64px;
}

.preview-flow {
  top: 150px;
  left: 206px;
  width: 110px;
  height: 2px;
  border-width: 0;
  background: var(--accent);
}

.presentation-features {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.presentation-features article {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 16px;
}

.presentation-features strong {
  color: #fed7aa;
}

.presentation-features span {
  color: #f5f2ee;
  line-height: 1.45;
}

.home-page {
  min-height: calc(100vh - 128px);
  overflow: auto;
  padding: 20px;
  background: #f3f0ec;
}

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

.home-header h2 {
  margin: 0;
  font-size: 16px;
}

.home-content {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(420px, 1fr);
  gap: 16px;
  align-items: start;
}

.home-project-details,
.project-list-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

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

.create-project-button {
  width: 30px;
  min-height: 30px;
  font-size: 17px;
}

.project-details-actions {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 12px;
}

.project-details-actions .icon-button {
  width: 34px;
  min-height: 34px;
}

.project-properties {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.project-properties div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
  padding: 10px;
}

.project-properties span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-properties strong {
  font-size: 14px;
}

.project-document-property {
  grid-column: 1 / -1;
}

.project-document-property button {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.project-document-property button:disabled {
  color: var(--muted);
  cursor: default;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 14px;
  text-align: left;
}

.project-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.project-select-button {
  min-width: 0;
  display: grid;
  gap: 5px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.project-menu-wrapper {
  position: relative;
}

.project-menu-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

.project-open-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

.project-menu-button:hover {
  border-color: var(--line);
  background: var(--surface-alt);
  color: var(--text);
}

.project-open-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.project-context-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}

.project-context-menu button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
}

.project-context-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.project-delete-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--danger);
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

.project-delete-button:hover {
  border-color: #f2b8b5;
  background: #fff5f5;
}

.project-empty {
  display: grid;
  gap: 5px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.sidebar-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--muted);
  padding: 12px;
  font-size: 12px;
  font-weight: 700;
}

.component-empty {
  grid-column: 1 / -1;
}

.canvas-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  padding: 24px;
}

.project-card small,
.project-empty span {
  color: var(--muted);
}

.canvas-wrap {
  width: 100%;
  min-width: 0;
  height: calc(100vh - 245px);
  overflow: auto;
  padding: 24px;
  background-color: #dfe5ea;
}

.legend-panel {
  min-width: 0;
  min-height: 117px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.legend-panel label {
  margin: 0;
}

.canvas-stage {
  position: relative;
  margin: 0 auto;
  min-width: 360px;
  min-height: 520px;
}

.screen-canvas {
  background-image: none;
}

.canvas-stage.show-grid .screen-canvas {
  background-image:
    linear-gradient(rgba(41, 37, 36, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 37, 36, 0.08) 1px, transparent 1px);
  background-size: 50px 50px;
}

.canvas-stage.show-dots .screen-canvas {
  background-image: radial-gradient(rgba(41, 37, 36, 0.28) 1px, transparent 1px);
  background-size: 50px 50px;
}

.axis {
  position: absolute;
  background: #f8f5f1;
  border: 1px solid var(--line);
  color: #7b7168;
  font-size: 10px;
  pointer-events: none;
}

.axis-x {
  top: 0;
  left: 40px;
  width: calc(100% - 40px);
  height: 32px;
  border-bottom: 0;
  background-image: repeating-linear-gradient(90deg, #b8afa5 0 1px, transparent 1px 50px);
}

.axis-y {
  top: 40px;
  left: 0;
  width: 32px;
  height: calc(100% - 40px);
  border-right: 0;
  background-image: repeating-linear-gradient(0deg, #b8afa5 0 1px, transparent 1px 50px);
}

.screen-canvas {
  position: relative;
  top: 40px;
  left: 40px;
  margin: 0;
  width: 960px;
  height: 620px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.canvas-element {
  position: absolute;
  z-index: 2;
  border: 1px solid #a79d94;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(41, 37, 36, 0.12);
  user-select: none;
}

.canvas-element.selected {
  z-index: 3;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 8px 18px rgba(41, 37, 36, 0.12);
}

.group-outline,
.selection-marquee {
  position: absolute;
  border: 1px dashed rgba(249, 115, 22, 0.9);
  border-radius: 8px;
  background: rgba(249, 115, 22, 0.06);
  cursor: move;
}

.group-outline {
  z-index: 1;
}

.selection-marquee {
  z-index: 4;
  background: rgba(249, 115, 22, 0.12);
  pointer-events: none;
}

.canvas-element.locked {
  cursor: not-allowed;
  box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.18), 0 8px 18px rgba(41, 37, 36, 0.12);
}

.element-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  color: #243040;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.element-table .element-content {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.element-table table {
  width: max-content;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}

.element-table th,
.element-table td {
  border: 0;
  padding: 0 6px;
  text-align: center;
  font-weight: 700;
}

.component-table-widget .table-column-header,
.component-table-widget .table-row-header {
  position: relative;
  user-select: none;
}

.component-table-widget .table-corner,
.component-table-widget .table-row-header {
  width: 28px;
  min-width: 28px;
  color: #6b7280;
  background: #f8fafc;
}

.table-header-label {
  display: inline-block;
  min-width: 12px;
  outline: none;
}

.table-header-label:focus {
  color: var(--accent);
  background: rgba(249, 115, 22, 0.12);
}

.table-panel-action,
.table-panel-spacer {
  width: 28px;
  min-width: 28px;
  background: transparent;
  padding: 0;
  text-align: center;
}

.table-panel-action button,
.table-delete-row,
.table-delete-column {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--accent);
  padding: 0;
  font-size: 12px;
  line-height: 1;
}

.table-delete-row,
.table-delete-column {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.table-delete-column {
  top: 2px;
  right: 4px;
}

.table-delete-row {
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
}

.table-column-header:hover .table-delete-column,
.table-row-header:hover .table-delete-row {
  opacity: 1;
  pointer-events: auto;
}

.table-column-resize,
.table-row-resize {
  position: absolute;
  z-index: 2;
  background: transparent;
}

.table-column-resize {
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
}

.table-row-resize {
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 6px;
  cursor: row-resize;
}

.table-column-resize:hover,
.table-row-resize:hover {
  background: rgba(249, 115, 22, 0.45);
}

.component-table-widget th.selected,
.component-table-widget td.selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background-color: rgba(249, 115, 22, 0.12);
}

.component-table-widget th.selected {
  color: var(--accent);
}

.component-table-widget.show-row-lines th,
.component-table-widget.show-row-lines td {
  border-bottom: 1px solid #d7dde4;
}

.component-table-widget.show-column-lines th,
.component-table-widget.show-column-lines td {
  border-right: 1px solid #d7dde4;
}

.table-cell-content {
  min-height: 100%;
  display: block;
  outline: none;
  font-weight: 600;
  white-space: pre-wrap;
}

.element-table .table-cell-content[contenteditable="true"]:focus {
  background: rgba(249, 115, 22, 0.12);
  box-shadow: none;
}

.element-button .element-content {
  background: inherit;
  border-radius: 6px;
}

.element-input .element-content,
.element-select .element-content,
.element-textarea .element-content,
.element-date-picker .element-content,
.element-file-upload .element-content {
  justify-content: flex-start;
  color: var(--muted);
  font-weight: 650;
}

.element-select {
  overflow: visible;
}

.element-select .element-content {
  overflow: visible;
  padding: 0;
}

.select-editor-widget {
  position: relative;
  width: 100%;
  height: 100%;
  font: inherit;
}

.select-editor-trigger {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0 10px;
  font: inherit;
  font-weight: 700;
}

.select-editor-trigger i {
  color: var(--muted);
  font-style: normal;
}

.select-editor-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 12px 26px rgba(41, 37, 36, 0.16);
  text-align: left;
}

.select-editor-toolbar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
  padding: 6px;
}

.select-editor-toolbar button {
  width: 28px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 3px;
  font-weight: 800;
}

.select-editor-toolbar button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.select-editor-options {
  padding: 4px 0;
}

.select-editor-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 10px;
  font-weight: 700;
}

.select-editor-option.active {
  background: rgba(249, 115, 22, 0.12);
  color: var(--text);
}

.select-editor-option input {
  width: 14px;
  height: 14px;
}

.select-editor-option span {
  min-width: 80px;
  outline: none;
}

.select-editor-option span:focus {
  background: rgba(249, 115, 22, 0.18);
}

.element-card .element-content,
.element-modal-window .element-content,
.element-sidebar .element-content,
.element-navbar .element-content {
  background: #f8fafb;
}

.element-navbar .element-content {
  justify-content: flex-start;
}

.element-sidebar .element-content {
  align-items: flex-start;
  justify-content: flex-start;
}

.resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 12px;
  height: 12px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: #fff;
  padding: 0;
}

.palette-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px 7px 0 0;
  background: #fff;
  overflow: hidden;
}

.palette-tabs button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 30px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 0 6px;
  white-space: nowrap;
}

.palette-tabs button:last-child {
  border-right: 0;
}

.palette-tabs button.active {
  background: var(--text);
  color: #fff;
}

.palette-panel {
  display: none;
}

.palette-panel.active {
  display: grid;
  gap: 8px;
}

.palette-section {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.palette-section-title {
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.system-fields {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.system-fields summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.system-fields label {
  margin-top: 8px;
}

.component-help-fields {
  margin-top: 8px;
}

.component-help-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.palette-panel label {
  gap: 4px;
  margin-bottom: 0;
  font-size: 11px;
}

.palette-panel input,
.palette-panel select,
.palette-panel textarea {
  min-height: 30px;
  padding: 5px 7px;
  font-size: 12px;
}

.palette-panel input[type="color"] {
  width: 46px;
  min-height: 30px;
  padding: 2px;
}

.compact-field {
  display: grid;
  grid-template-columns: 22px minmax(0, max-content);
  align-items: center;
  justify-content: start;
}

.compact-field > span {
  width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.compact-checkbox {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-checkbox input {
  min-height: auto;
  padding: 0;
}

.lock-button {
  width: 100%;
  margin-top: 2px;
}

.flow-builder {
  height: calc(100vh - 128px);
  overflow: auto;
  padding: 20px;
}

.prototype-wrap {
  height: calc(100vh - 128px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: #e4e9ee;
}

.prototype-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.prototype-header strong,
.prototype-header span {
  display: block;
}

.prototype-header span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.prototype-header label {
  width: min(260px, 100%);
  margin: 0;
}

.prototype-viewport {
  overflow: auto;
  padding: 28px;
}

#prototypePanel.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  height: calc(100vh - 128px);
  min-height: 0;
  overflow: hidden;
}

.prototype-comments-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 14px;
  border-left: 1px solid var(--line);
  background: #fbfcfd;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.comments-header span {
  max-width: 160px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-scope-toggle,
.comment-status-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  align-self: start;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.comment-scope-toggle button,
.comment-status-toggle button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 0 6px;
  white-space: nowrap;
}

.comment-scope-toggle button.active,
.comment-status-toggle button.active {
  background: var(--ink);
  color: #fff;
}

.comments-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
}

.comment-row,
.comment-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.comment-row {
  display: grid;
  gap: 6px;
}

.comment-row p {
  margin: 0;
}

.comment-target-path {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  padding: 0;
  text-align: left;
}

.comment-target-path:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.comment-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.comment-resolve-button,
.comment-reply-form button {
  width: 26px;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--accent);
  font-weight: 900;
  padding: 0;
}

.comment-resolve-button:disabled,
.comment-reply-form button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.5;
}

.comment-replies {
  display: grid;
  gap: 6px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

.comment-reply {
  display: grid;
  gap: 3px;
}

.comment-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
}

.comment-reply-form input {
  min-height: 28px;
  padding: 5px 8px;
}

.comment-row.resolved {
  opacity: 0.65;
}

.comment-row small,
.comment-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.comment-form {
  display: grid;
  gap: 6px;
  margin: 0;
}

.comment-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.comment-form textarea {
  min-height: 68px;
  max-height: 120px;
  resize: vertical;
}

.palette-comments-header {
  margin-bottom: 10px;
}

.palette-comments-list {
  max-height: 300px;
  margin-bottom: 10px;
}

.compact-action {
  justify-self: end;
  width: 36px;
  min-height: 34px;
  padding: 0;
  font-size: 18px;
}

.prototype-screen {
  position: relative;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.prototype-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.prototype-element {
  position: absolute;
  display: grid;
  overflow: hidden;
  border: 1px solid #a79d94;
  border-radius: 7px;
  background: #fff;
}

.prototype-element:hover,
.prototype-element.comment-target {
  overflow: visible;
}

.prototype-element .prototype-comment-marker {
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 2;
  width: 20px;
  height: 20px;
  min-height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  padding: 0;
  box-shadow: 0 2px 8px rgba(41, 37, 36, 0.16);
}

.prototype-element:hover .prototype-comment-marker,
.prototype-element.comment-target .prototype-comment-marker {
  opacity: 1;
}

.prototype-element.comment-target {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}

.prototype-element[data-render-type^="OneC"],
.prototype-element[data-render-type="Checkbox"],
.prototype-element[data-render-type="RadioButton"] {
  overflow: visible;
  border-color: transparent !important;
  border-radius: 0;
  background: transparent !important;
}

.prototype-control,
.prototype-element button,
.prototype-element input,
.prototype-element select,
.prototype-element textarea {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.prototype-control {
  display: grid;
  place-items: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.prototype-element[data-render-type^="OneC"] .prototype-control {
  display: block;
  padding: 0;
  overflow: visible;
  text-align: left;
}

.prototype-element[data-render-type^="OneC"] button,
.prototype-element[data-render-type^="OneC"] input,
.prototype-element[data-render-type^="OneC"] select,
.prototype-element[data-render-type^="OneC"] textarea {
  width: auto;
  height: auto;
  border-radius: 0;
  color: inherit;
  font: inherit;
  font-weight: inherit;
}

.prototype-element[data-render-type^="OneC"] .one-c-tabs-strip button {
  width: auto;
  height: 20px;
  border: 1px solid #b7b7b7;
  border-bottom: 0;
  background: #f5f5f5;
  padding: 0 8px;
}

.prototype-element[data-render-type^="OneC"] .one-c-input-picker-widget button,
.prototype-element[data-render-type^="OneC"] .one-c-date-field-widget button {
  width: 20px;
  height: 100%;
  border: 0;
  border-left: 1px solid #c9c9c9;
  background: #f7f7f7;
  padding: 0;
}

.prototype-element[data-render-type^="OneC"] .prototype-one-c-field input {
  width: auto;
  height: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 8px;
}

.prototype-element[data-render-type^="OneC"] .one-c-vertical-tabs-widget {
  overflow: hidden;
}

.prototype-element[data-render-type^="OneC"] .one-c-vertical-tabs-strip button {
  width: 24px;
  height: auto;
  min-height: 68px;
  border: 1px solid #b7b7b7;
  border-right: 0;
  background: #f5f5f5;
  padding: 6px 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.prototype-element button {
  border: 0;
  border-radius: 6px;
  color: inherit;
  font-weight: 800;
}

.prototype-element input,
.prototype-element select,
.prototype-element textarea {
  border: 0;
  border-radius: 6px;
}

.prototype-element textarea {
  resize: none;
}

.prototype-choice {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px;
  color: inherit;
}

.prototype-element[data-render-type="Checkbox"] .prototype-choice,
.prototype-element[data-render-type="RadioButton"] .prototype-choice {
  padding: 0;
}

.prototype-choice input {
  width: auto;
  height: auto;
}

.prototype-table .prototype-control {
  align-items: stretch;
  justify-items: stretch;
  padding: 0;
}

.prototype-table table {
  width: max-content;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}

.prototype-table th,
.prototype-table td {
  border: 0;
  padding: 0 6px;
  text-align: center;
  font-weight: 700;
}

.prototype-table .component-table-widget .table-corner,
.prototype-table .component-table-widget .table-row-header {
  width: 28px;
  min-width: 28px;
  color: #6b7280;
  background: #f8fafc;
}

.prototype-tabs {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
}

.prototype-tabs button {
  flex: 1;
  border-radius: 0;
  background: #f8fafb;
  color: #334155;
}

.prototype-tabs button.active {
  background: var(--accent);
  color: #fff;
}

.prototype-modal-button {
  background: #f8fafb;
  color: #334155;
}

.flow-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.flow-map {
  display: grid;
  gap: 12px;
}

.flow-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow-node {
  min-height: 48px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
}

.flow-arrow {
  color: var(--accent);
  font-weight: 900;
  text-align: center;
}

.docs-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.document-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  min-height: calc(100vh - 180px);
}

.document-list-panel,
.document-preview-panel {
  min-width: 0;
  padding: 16px;
}

.document-list-panel {
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.document-list {
  display: grid;
  gap: 10px;
}

.document-row {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  color: var(--text);
  text-align: left;
}

.document-select-button,
.document-project-link {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.document-project-link {
  color: var(--accent);
  font-weight: 800;
}

.document-row.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.document-row span,
.document-row small,
.document-row code {
  color: var(--muted);
  font-size: 12px;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.document-version-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.document-version-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.document-version-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.markdown-preview {
  height: calc(100vh - 285px);
  margin: 0;
  overflow: auto;
  padding: 22px;
  background: #292524;
  color: #f5f2ee;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.registration-page,
.admin-page,
.profile-page {
  min-height: calc(100vh - 128px);
  display: grid;
  grid-template-columns: minmax(280px, 420px);
  gap: 20px;
  justify-content: center;
  align-content: start;
  padding: 20px;
  overflow: auto;
  background: #f3f0ec;
}

.admin-page {
  grid-template-columns: minmax(720px, 960px);
}

.auth-card,
.admin-card,
.user-directory,
.profile-card {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.profile-card {
  max-width: 460px;
}

.profile-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-title-actions .icon-button {
  width: 26px;
  min-height: 26px;
  border-radius: 6px;
  font-size: 16px;
}

.auth-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
}

.auth-mode-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-mode-tabs button.active {
  background: #292524;
  color: #fff7ed;
}

.auth-card .auth-actions .primary-button {
  min-width: 150px;
}

.auth-choice {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-alt);
  padding: 12px;
}

.auth-choice > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
}

.admin-tabs button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-weight: 800;
}

.admin-tabs button.active {
  background: #292524;
  color: #fff7ed;
}

.admin-directory {
  display: none;
}

.admin-directory.active {
  display: block;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
}

.user-list {
  display: grid;
  gap: 10px;
}

.project-directory-list {
  display: grid;
  gap: 10px;
}

.user-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.user-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.user-row strong,
.user-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-row small {
  margin-top: 3px;
  color: var(--muted);
}

.user-row span {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.project-directory-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.2fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) minmax(140px, 0.8fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.project-directory-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.project-directory-open,
.project-owner-link {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-directory-open {
  font-weight: 800;
}

.project-owner-link {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-directory-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.checkbox-label input {
  width: auto;
}

input[type="color"] {
  min-height: 40px;
  padding: 4px;
}

.palette-panel input[type="color"] {
  width: 46px;
  min-height: 28px;
  height: 28px;
  padding: 2px;
}

@media (max-width: 1180px) {
  .presentation-page {
    grid-template-columns: 1fr;
    padding: 34px;
  }

  .presentation-preview {
    min-height: 360px;
  }

  .preview-layout {
    height: 318px;
    grid-template-columns: 90px 1fr 110px;
  }

  .workspace {
    grid-template-columns: 260px minmax(0, 1fr) 320px;
  }

  .registration-page {
    grid-template-columns: 1fr;
  }

  .home-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    border-right: 0;
  }

  .canvas-wrap,
  .flow-builder,
  .prototype-wrap,
  .presentation-page,
  .registration-page {
    min-height: 620px;
  }

  .presentation-page {
    padding: 24px;
  }

  .presentation-hero h2 {
    font-size: 40px;
  }

  .presentation-features {
    grid-template-columns: 1fr;
  }

  .presentation-preview {
    display: none;
  }

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

  .toolbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .segmented-control {
    width: 100%;
    flex-wrap: wrap;
  }

  .segmented-control button {
    flex: 1;
    min-width: 0;
  }

  .flow-form,
  .settings-toggles,
  .inspector-panel .panel-block {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }
}
