:root {
  --app-ink: #1f2937;
  --app-muted: #6b7280;
  --app-border: #e5e7eb;
  --app-surface: #ffffff;
  --app-surface-soft: #f7f8fb;
  --app-brand: #3857f0;
  --app-brand-dark: #2740c5;
  --app-success: #2f9e74;
}

body {
  --builder-header-top-height: 58px;
  --builder-bottom-panel-height: 0px;
  background: var(--app-surface-soft);
  color: var(--app-ink);
}

#vvveb-builder #top-panel {
  height: var(--builder-header-top-height);
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: var(--app-border);
  box-shadow: 0 1px 10px rgba(27, 39, 71, 0.06);
  position: relative;
  z-index: 30;
}

#vvveb-builder #top-panel > div:not(#app-toolbar) {
  display: none !important;
}

#app-toolbar {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 16px;
}

.app-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.app-brand-group {
  margin-right: 4px;
  gap: 9px;
  white-space: nowrap;
}

.app-brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #4c67ff 0%, #2945d2 100%);
  box-shadow: 0 5px 12px rgba(56, 87, 240, 0.22);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.app-brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.app-brand-copy strong {
  font-size: 13px;
  font-weight: 760;
  color: #111827;
}

.app-brand-copy span {
  color: var(--app-muted);
  font-size: 10px;
}

.app-file-actions {
  padding-left: 10px;
  border-left: 1px solid var(--app-border);
}

.app-edit-actions {
  padding: 0 10px;
  margin-left: auto;
  border-left: 1px solid var(--app-border);
  border-right: 1px solid var(--app-border);
}

.app-save-actions {
  margin-left: auto;
  flex-shrink: 0;
}

.app-button,
.app-icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  min-height: 32px;
  padding: 0 10px;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.app-button i,
.app-icon-button i {
  margin-right: 5px;
  vertical-align: -1px;
}

.app-icon-button {
  width: 32px;
  padding: 0;
  font-size: 15px;
}

.app-icon-button i {
  margin: 0;
}

.app-button:hover,
.app-icon-button:hover {
  background: #f0f3ff;
  border-color: #d8defc;
  color: var(--app-brand-dark);
}

.app-button:active,
.app-icon-button:active {
  transform: translateY(1px);
}

.app-button-primary {
  background: var(--app-brand);
  border-color: var(--app-brand);
  color: #fff;
  box-shadow: 0 4px 10px rgba(56, 87, 240, 0.17);
}

.app-button-primary:hover {
  background: var(--app-brand-dark);
  border-color: var(--app-brand-dark);
  color: #fff;
}

.app-toggle-button[aria-pressed="true"] {
  background: #edf0ff;
  border-color: #cbd3ff;
  color: var(--app-brand-dark);
}

.app-filename {
  max-width: 150px;
  overflow: hidden;
  color: #374151;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--app-muted);
  font-size: 11px;
  white-space: nowrap;
}

.app-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--app-success);
}

.app-status.is-dirty {
  color: #b7791f;
}

.app-status.is-dirty .app-status-dot {
  background: #e2a33a;
}

#vvveb-builder #left-panel,
#vvveb-builder #right-panel {
  top: var(--builder-header-top-height);
  background: #fff;
}

#vvveb-builder #canvas {
  top: var(--builder-header-top-height);
  height: calc(100vh - var(--builder-header-top-height));
  background: #eef1f6;
}

#elements-tabs > .pages-tab,
#elements-tabs > .sections-tab,
#elements-tabs > .heading,
#elements-tabs > .nav-item:not(.components-tab):not(.component-configuration-tab):not(.component-properties-tab) {
  display: none !important;
}

#elements-tabs > .components-tab > .nav-link {
  background: rgba(56, 87, 240, 0.08);
  border-color: rgba(56, 87, 240, 0.2);
  color: var(--app-brand-dark);
}

#filemanager {
  display: none !important;
}

#pages-tabs {
  display: none !important;
}

#components-tabs {
  display: block !important;
}

#right-panel {
  box-shadow: -1px 0 8px rgba(27, 39, 71, 0.04) !important;
}

#app-source-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  padding: 6vh 7vw;
  background: rgba(20, 28, 48, 0.5);
  backdrop-filter: blur(4px);
}

#app-source-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-source-dialog {
  width: min(1050px, 100%);
  height: min(760px, 88vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.app-source-header,
.app-source-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--app-border);
}

.app-source-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--app-border);
  border-bottom: 0;
}

.app-source-header strong {
  color: #111827;
  font-size: 15px;
}

.app-source-header span {
  display: block;
  margin-top: 3px;
  color: var(--app-muted);
  font-size: 11px;
}

.app-source-close {
  border: 0;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

#app-source-textarea {
  width: 100%;
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  padding: 18px;
  background: #111827;
  color: #dbeafe;
  font: 12px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  tab-size: 2;
}

.app-source-hint {
  margin-right: auto;
  color: var(--app-muted);
  font-size: 11px;
}

@media (max-width: 1180px) {
  .app-brand-copy span,
  .app-designer span {
    display: none;
  }

  .app-brand-copy strong {
    font-size: 12px;
  }

  .app-filename {
    max-width: 95px;
  }
}

@media (max-width: 900px) {
  #app-toolbar {
    gap: 4px;
    padding: 0 8px;
  }

  .app-brand-group {
    margin-right: 0;
  }

  .app-brand-copy {
    display: none;
  }

  .app-file-actions,
  .app-edit-actions {
    padding-left: 4px;
    padding-right: 4px;
  }

  .app-button {
    padding: 0 7px;
  }

  .app-button span,
  .app-status {
    display: none;
  }

  .app-button i {
    margin: 0;
  }

  .app-save-actions {
    gap: 3px;
  }
}

@media (max-width: 680px) {
  #vvveb-builder #left-panel,
  #vvveb-builder #right-panel {
    width: 220px;
  }

  #vvveb-builder #canvas {
    margin-left: 220px;
    margin-right: 220px;
  }

  .app-filename {
    display: none;
  }
}
