/* Vibe Design studio: connect, dashboard, wizard, editor. Builds on base.css tokens. */

.logo svg {
  width: 26px;
  height: 26px;
  flex: none;
}
svg {
  flex: none;
}
kbd {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  white-space: nowrap;
}
.btn kbd {
  margin-left: 2px;
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.75);
}
.btn-block {
  width: 100%;
}
.btn-xs {
  width: 24px;
  height: 24px;
}
.btn-xs svg {
  width: 14px;
  height: 14px;
}
.btn.is-busy {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.is-busy > * {
  visibility: hidden;
}
.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.link {
  color: #c4a5ff;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link svg {
  width: 14px;
  height: 14px;
}
.hint {
  margin: 0;
}
p.hint:has(svg),
.hint-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
p.hint > svg {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}
.error-text {
  margin: 0;
}
p.error-text:has(svg) {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
p.error-text svg {
  width: 16px;
  height: 16px;
}
.label-strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  position: relative;
}
.input-row .input {
  flex: 1;
  min-width: 0;
}
.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  display: flex;
}
.input-icon svg {
  width: 16px;
  height: 16px;
}
.input-icon + .input {
  padding-left: 36px;
}
.input-lg {
  min-height: 46px;
  font-size: 15px;
}
.input-sm,
.select-sm {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}
.input[aria-invalid="true"] {
  border-color: rgba(239, 68, 68, 0.7);
}

/* segmented */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.seg button:hover:not(:disabled) {
  color: var(--text);
}
.seg button[aria-selected="true"],
.seg button[aria-checked="true"] {
  background: var(--panel-3);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.seg button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.seg svg {
  width: 16px;
  height: 16px;
}
.seg-sm button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 12px;
}
.seg-full {
  display: flex;
}
.seg-full button {
  flex: 1;
}
.seg-icons button {
  width: 34px;
  padding: 0;
}

/* chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 150ms var(--ease), color 150ms var(--ease);
}
.chip:hover {
  border-color: var(--brand-line);
  color: var(--text);
}

/* menus */
.menu {
  position: absolute;
  z-index: 60;
  min-width: 220px;
  padding: 6px;
  border-radius: var(--radius);
  background: #1f2532;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: pop-in 120ms var(--ease);
}
.menu[hidden] {
  display: none;
}
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.menu button span {
  flex: 1;
}
.menu button:hover,
.menu button:focus-visible {
  background: var(--panel-3);
  outline: none;
}
.menu button svg {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}
.menu button.is-danger,
.menu button.is-danger svg {
  color: #fca5a5;
}
.menu-head {
  display: flex;
  flex-direction: column;
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.menu-head span {
  color: var(--text-3);
  font-size: 12px;
}

/* boot / empty */
.boot {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-2);
}
.boot.small {
  min-height: 120px;
}
.boot-error svg {
  width: 28px;
  height: 28px;
  color: var(--danger);
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 56px 24px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
}
.empty.small {
  padding: 24px;
  border: 0;
  background: none;
  color: var(--text-3);
}
.empty h3 {
  margin: 4px 0 0;
  font-size: 18px;
}
.empty p {
  margin: 0;
  color: var(--text-2);
  max-width: 440px;
}
.empty-art {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: #c4a5ff;
}
.empty-art svg {
  width: 28px;
  height: 28px;
}
.empty .btn {
  margin-top: 8px;
}
.empty.small svg {
  width: 22px;
  height: 22px;
  color: var(--ok);
}

/* --- app header -------------------------------------------------------------------------------------------------- */
.app-head {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  padding: 0 24px;
  background: rgba(11, 13, 18, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-nav {
  display: flex;
  gap: 4px;
}
.app-nav a {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
}
.app-nav a:hover {
  color: var(--text);
  background: var(--panel-2);
}
.app-nav a[aria-current="page"] {
  color: var(--text);
}
.app-head-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.account {
  position: relative;
}
.account .menu {
  right: 0;
  top: calc(100% + 8px);
}
.account-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.account-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-fallback {
  font-weight: 700;
  font-size: 13px;
}

/* --- connect -------------------------------------------------------------------------------------------------------- */
.connect {
  min-height: 100vh;
  background: radial-gradient(900px 500px at 15% -10%, rgba(120, 31, 243, 0.22), transparent 60%), var(--bg);
}
.connect-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
}
.connect-main {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 380px);
  gap: 32px;
  justify-content: center;
  align-items: start;
  padding: 32px 24px 64px;
}
.connect-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.connect-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.connect-lead {
  margin: 0 0 20px;
  color: var(--text-2);
}
.connect-steps {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.connect-steps > li {
  display: flex;
  gap: 14px;
}
.connect-steps .grow {
  flex: 1;
  min-width: 0;
}
.step-n {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--brand-soft);
  color: #d7c2ff;
  border: 1px solid var(--brand-line);
}
.connect-steps strong {
  display: block;
  margin-bottom: 4px;
}
.connect-steps .hint {
  margin-bottom: 10px;
}
.connect-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trust {
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.trust h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 15px;
}
.trust h2 svg {
  width: 20px;
  height: 20px;
  color: var(--ok);
}
.trust ul {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.trust li {
  display: flex;
  gap: 12px;
}
.trust li > svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: #c4a5ff;
}
.trust li p {
  margin: 2px 0 0;
  color: var(--text-3);
  font-size: 13px;
}

/* --- dashboard ----------------------------------------------------------------------------------------------------- */
.dash,
.wiz {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dash h1,
.wiz h1 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.usage {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
}
.usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.usage-head h2 {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
  font-weight: 600;
}
.meters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.meter-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.meter-top .mono {
  color: var(--text-3);
}
.meter-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--panel-3);
  overflow: hidden;
}
.meter-bar span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
}
.meter.is-out .meter-bar span {
  background: var(--warn);
}
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.proj-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}
.proj-card:hover {
  border-color: var(--brand-line);
}
.proj-card.skeleton {
  height: 220px;
  background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.proj-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.proj-thumb {
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(120% 120% at 0% 0%, rgba(120, 31, 243, 0.35), transparent 60%), var(--bg-2);
  border-bottom: 1px solid var(--line);
  color: #d7c2ff;
}
.proj-thumb.proj-app {
  background: radial-gradient(120% 120% at 100% 0%, rgba(13, 153, 255, 0.3), transparent 60%), var(--bg-2);
  color: #9bd4ff;
}
.proj-thumb svg {
  width: 22px;
  height: 22px;
  opacity: 0.8;
}
.proj-thumb span {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.proj-meta {
  padding: 14px 16px 16px;
}
.proj-meta h3 {
  margin: 0 0 4px;
  font-size: 15px;
}
.proj-meta p {
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proj-meta .mono {
  font-size: 12px;
  color: var(--text-2);
}
.proj-del {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(11, 13, 18, 0.6);
  opacity: 0;
  transition: opacity 150ms var(--ease);
}
.proj-card:hover .proj-del,
.proj-del:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .proj-del {
    opacity: 1;
  }
}

/* --- upgrade -------------------------------------------------------------------------------------------------------- */
.modal.upgrade {
  width: min(720px, 100%);
}
.up-reason {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--warn-soft);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
}
.up-reason svg {
  width: 18px;
  height: 18px;
}
.up-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.up-plan {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.up-plan-pro {
  border-color: var(--brand-line);
  background: linear-gradient(180deg, rgba(120, 31, 243, 0.14), transparent 70%), var(--bg-2);
}
.up-plan h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.up-price {
  margin: 8px 0 2px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.up-price small {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 500;
}
.up-plan ul {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.up-plan li {
  display: flex;
  gap: 8px;
}
.up-plan li svg {
  width: 16px;
  height: 16px;
  color: var(--ok);
  margin-top: 2px;
}
.up-action,
.up-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.up-done {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--ok-soft);
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.up-done svg {
  width: 22px;
  height: 22px;
  color: var(--ok);
}

/* --- wizard -------------------------------------------------------------------------------------------------------- */
.wiz {
  max-width: 880px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  align-self: flex-start;
}
.back-link svg {
  width: 16px;
  height: 16px;
}
.back-link:hover {
  color: var(--text);
}
.wiz-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wiz-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-3);
  font-size: 13px;
}
.wiz-steps li span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--panel-2);
}
.wiz-steps li[aria-current="step"] {
  color: var(--text);
  border-color: var(--brand-line);
  background: var(--brand-soft);
}
.wiz-steps li[aria-current="step"] span {
  background: var(--brand-strong);
  color: #fff;
}
.wiz-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.repo-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recent {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.recent[hidden] {
  display: none;
}
.pages-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.repo-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
}
.repo-title svg {
  width: 20px;
  height: 20px;
}
.pages-search {
  width: 260px;
}
.wiz-ask {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  color: #e3d4ff;
}
.wiz-ask svg {
  width: 18px;
  height: 18px;
}
.pages {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
}
.page-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.page-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
}
.page-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-2);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}
.page-opt:hover {
  border-color: var(--line-2);
  background: var(--panel-2);
}
.page-opt[aria-checked="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.page-ic {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--panel-3);
  color: var(--text-2);
}
.page-ic svg {
  width: 16px;
  height: 16px;
}
.page-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.page-txt .mono {
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  display: grid;
  place-items: center;
  color: transparent;
}
.page-check svg {
  width: 12px;
  height: 12px;
}
.page-opt[aria-checked="true"] .page-check {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}
.wiz-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.prog-title {
  margin: 0;
  font-size: 18px;
}
.prog {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.prog > li {
  display: grid;
  grid-template-columns: 18px 1fr;
  column-gap: 12px;
  row-gap: 8px;
  align-items: center;
  color: var(--text-3);
}
.prog > li > :not(.dot) {
  grid-column: 2;
}
.prog .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
}
.prog > li.is-active {
  color: var(--text);
}
.prog > li.is-active .dot {
  border-color: var(--brand);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
.prog > li.is-done {
  color: var(--text-2);
}
.prog > li.is-done .dot {
  border-color: var(--ok);
  background: var(--ok);
}
.prog-files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11px;
  color: var(--text-3);
}
.prog-files:empty {
  display: none;
}
.prog-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--panel-3);
  overflow: hidden;
}
.prog-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand-strong), #b98bff);
  border-radius: inherit;
  transition: width 400ms var(--ease);
}
.prog-error {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.prog-error[hidden] {
  display: none;
}

/* --- editor -------------------------------------------------------------------------------------------------------- */
.editor {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 288px;
  grid-template-rows: 52px minmax(0, 1fr);
  grid-template-areas: "top top top" "left canvas right";
  background: var(--bg);
}
.ed-top {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.ed-top-l,
.ed-top-c,
.ed-top-r {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ed-top-l {
  flex: 1;
}
.ed-top-c {
  flex: none;
}
.ed-top-r {
  flex: 1;
  justify-content: flex-end;
}
.ed-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.ed-title strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ed-title .mono {
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.save-state {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  margin-left: 6px;
}
.save-state[data-state="error"] {
  color: #fca5a5;
}
.save-state[data-state="saved"] {
  color: var(--text-3);
}
.vsep {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 4px;
}
.zoom {
  position: relative;
}
.zoom-menu {
  top: calc(100% + 6px);
  left: 0;
}
.zoom-menu kbd {
  margin-left: auto;
}
.ed-top [data-change-count]:not(.is-on) {
  opacity: 0.6;
}
.ed-top [data-change-count].is-on {
  background: var(--ok-soft);
  color: #86efac;
}
.ed-top .lang-switch button {
  height: 24px;
  min-width: 30px;
}

.ed-left,
.ed-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
}
.ed-left {
  grid-area: left;
  border-right: 1px solid var(--line);
}
.ed-right {
  grid-area: right;
  border-left: 1px solid var(--line);
}
.tabs {
  display: flex;
  gap: 2px;
  padding: 8px 8px 0;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.tabs [role="tab"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tabs [role="tab"] svg {
  width: 15px;
  height: 15px;
}
.tabs [role="tab"]:hover {
  color: var(--text);
}
.tabs [role="tab"][aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--brand);
}
.panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.panel[hidden] {
  display: none;
}

/* layers */
.tree {
  padding: 6px 0 24px;
  font-size: 12px;
}
.tree-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding-left: calc(6px + var(--d) * 14px);
  padding-right: 8px;
  color: var(--text-2);
  cursor: default;
  user-select: none;
}
.tree-row:hover,
.tree-row.is-hover {
  box-shadow: inset 0 0 0 1px rgba(13, 153, 255, 0.6);
}
.tree-row.is-sel {
  background: rgba(13, 153, 255, 0.18);
  color: var(--text);
}
.tree-row:focus-visible {
  outline: 2px solid var(--select);
  outline-offset: -2px;
}
.tree-row.is-hidden .tn {
  opacity: 0.5;
}
.tree-row .tw {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-3);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.tree-row .tw:disabled {
  cursor: default;
}
.tree-row .tw svg {
  width: 12px;
  height: 12px;
}
.tree-row .ti {
  display: flex;
  color: var(--text-3);
}
.tree-row .ti svg {
  width: 14px;
  height: 14px;
}
.tree-row[data-type="text"] .ti,
.tree-row[data-type="heading"] .ti {
  color: #c4a5ff;
}
.tree-row[data-type="button"] .ti,
.tree-row[data-type="link"] .ti {
  color: #86efac;
}
.tree-row[data-type="image"] .ti,
.tree-row[data-type="icon"] .ti {
  color: #fcd34d;
}
.tree-row .tn {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-row .th svg {
  width: 12px;
  height: 12px;
  color: var(--text-3);
}
.tree-rename {
  flex: 1;
  min-width: 0;
  height: 22px;
  padding: 0 4px;
  border: 1px solid var(--select);
  border-radius: 4px;
  background: var(--bg);
  font-size: 12px;
}
.tree-row[data-drop="before"]::before,
.tree-row[data-drop="after"]::after {
  content: "";
  position: absolute;
  left: calc(6px + var(--d) * 14px);
  right: 6px;
  height: 2px;
  background: var(--brand);
}
.tree-row[data-drop="before"]::before {
  top: -1px;
}
.tree-row[data-drop="after"]::after {
  bottom: -1px;
}
.tree-row[data-drop="inside"] {
  box-shadow: inset 0 0 0 2px var(--brand);
}

/* insert library */
[data-panel="insert"] {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lib {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.lib-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 72px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 12px;
  cursor: grab;
  touch-action: none;
  transition: border-color 150ms var(--ease), color 150ms var(--ease);
}
.lib-item:hover {
  border-color: var(--brand-line);
  color: var(--text);
}
.lib-item svg {
  width: 20px;
  height: 20px;
}
.lib-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 300;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--brand-strong);
  color: #fff;
  font-size: 12px;
  box-shadow: var(--shadow);
}
.lib-ghost svg {
  width: 14px;
  height: 14px;
}

/* canvas */
.ed-canvas {
  grid-area: canvas;
  position: relative;
  overflow: auto;
  background-color: #0e1117;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 20px 20px;
}
.stage {
  min-width: 100%;
  min-height: 100%;
  width: max-content;
  padding: 56px 48px 96px;
  display: flex;
  justify-content: center;
}
.frame-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.frame-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-3);
}
.frame-name {
  color: var(--text-2);
  font-weight: 500;
}
.frame-scale {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #fff;
}
.frame-scale iframe {
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  transform-origin: 0 0;
  background: #fff;
  display: block;
}
.canvas-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(14, 17, 23, 0.7);
}
.canvas-loading[hidden] {
  display: none;
}
.ed-small-note {
  display: none;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 8px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
}
.ed-small-note svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.canvas-hint {
  position: sticky;
  left: 0;
  bottom: 12px;
  margin: 0 auto;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(22, 26, 34, 0.9);
  border: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12px;
  pointer-events: none;
  transform: translateY(-12px);
}
.editor[data-mode="preview"] {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}
.editor[data-mode="preview"] .ed-left,
.editor[data-mode="preview"] .ed-right,
.editor[data-mode="preview"] .canvas-hint {
  visibility: hidden;
}
.editor[data-mode="preview"] [data-preview-btn] {
  color: var(--ok);
}
.ctx-menu {
  position: fixed;
}

/* design props */
.props-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-2);
}
.props-empty svg {
  width: 26px;
  height: 26px;
  color: var(--text-3);
}
.props-empty p {
  margin: 8px 0 0;
}
.ps-head {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ps-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ps-type {
  display: flex;
  color: var(--select);
}
.ps-type svg {
  width: 16px;
  height: 16px;
}
.ps-name {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-weight: 600;
  font-size: 13px;
}
.ps-name:hover:not(:disabled) {
  border-color: var(--line-2);
}
.ps-name:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--bg-2);
}
.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 11px;
}
.crumbs button {
  max-width: 120px;
  padding: 2px 4px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumbs button:hover {
  color: var(--text);
  background: var(--panel-2);
}
.crumbs button[aria-current="true"] {
  color: var(--select);
}
.crumbs span svg {
  width: 10px;
  height: 10px;
  color: var(--text-3);
  display: block;
}
.ps-src {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  min-width: 0;
}
.ps-src svg {
  width: 12px;
  height: 12px;
}
.ps-src span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.ps-h {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.ps-b {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ps-sub {
  margin: 4px 0 -2px;
  font-size: 11px;
  color: var(--text-3);
}
.ps .textarea {
  min-height: 56px;
  font-size: 12px;
}
.row-field {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: center;
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.num {
  display: flex;
  align-items: center;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
  transition: border-color 150ms var(--ease);
}
.num:hover {
  border-color: var(--line-2);
}
.num:focus-within {
  border-color: var(--brand);
}
.num-l {
  flex: none;
  min-width: 22px;
  padding: 0 4px 0 6px;
  font-size: 11px;
  color: var(--text-3);
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
}
.num-l:empty {
  display: none;
}
.num input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 6px;
  border: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
}
.num input:focus {
  outline: none;
}
.size-row {
  display: grid;
  grid-template-columns: 14px auto 1fr;
  align-items: center;
  gap: 6px;
}
.size-l {
  font-size: 11px;
  color: var(--text-3);
}
.chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.chk input {
  accent-color: var(--brand);
}
.clr {
  display: flex;
  align-items: center;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
}
.clr:focus-within {
  border-color: var(--brand);
}
.clr-sw {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0 6px 0 4px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: repeating-conic-gradient(#444 0% 25%, #222 0% 50%) 50% / 8px 8px;
}
.clr-sw input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.clr-sw span {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  pointer-events: none;
}
.clr-sw span.is-none {
  background: linear-gradient(135deg, transparent 45%, #ef4444 45% 55%, transparent 55%) !important;
}
.clr-hex {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 11px;
  padding: 0 6px 0 0;
}
.clr-hex:focus {
  outline: none;
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sw {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  padding: 0;
}
.sw:hover {
  transform: scale(1.1);
}
.range {
  display: grid;
  grid-template-columns: auto 1fr 40px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.range input {
  accent-color: var(--brand);
}
.range output {
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
}

/* AI panel */
[data-panel="ai"] {
  display: flex;
  flex-direction: column;
}
[data-panel="ai"][hidden] {
  display: none;
}
.ai-block {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-head h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.ai-head h3 svg {
  width: 16px;
  height: 16px;
  color: #c4a5ff;
}
.ai-head .count.is-out {
  background: var(--warn-soft);
  color: #fcd34d;
}
.ai-target {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-target svg {
  width: 13px;
  height: 13px;
}
.ai-block .textarea {
  min-height: 72px;
}
.ai-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-progress[hidden] {
  display: none;
}
.score {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.score p {
  margin: 0;
  font-size: 12px;
  color: var(--text-2);
}
.score-ring {
  --c: var(--ok);
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--panel-3) 0);
}
.score-ring span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  font-weight: 700;
  font-size: 15px;
}
.score-warn .score-ring {
  --c: var(--warn);
}
.score-bad .score-ring {
  --c: var(--danger);
}
.issues {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.issue {
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.issue p {
  margin: 0;
  color: var(--text-2);
}
.issue-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.issue-cat {
  color: var(--text-3);
  font-size: 11px;
  text-transform: capitalize;
}
.issue-act {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.pill-high {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
  background: var(--danger-soft);
}
.pill-medium {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--warn-soft);
}
.pill-low {
  color: #9bd4ff;
  border-color: rgba(13, 153, 255, 0.4);
  background: rgba(13, 153, 255, 0.12);
}
.review > .hint {
  margin-top: 8px;
}

/* changes */
.modal.changes .modal-body {
  padding: 0;
  flex: 1;
  min-height: 0;
}
.chg {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100%;
  min-height: 0;
}
.chg-list {
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 12px;
  font-size: 12px;
}
.chg-list-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.chg-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.chg-g {
  margin-bottom: 10px;
}
.chg-name {
  border: 0;
  background: none;
  padding: 4px 0;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.chg-name:hover {
  color: #c4a5ff;
}
.chg-item {
  display: grid;
  grid-template-columns: 18px 1fr 24px;
  gap: 6px;
  align-items: start;
  padding: 4px 0 4px 2px;
  color: var(--text-2);
}
.chg-ic svg {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--text-3);
}
.chg-added .chg-ic svg {
  color: var(--ok);
}
.chg-removed .chg-ic svg {
  color: var(--danger);
}
.chg-txt {
  word-break: break-word;
}
.chg-txt code {
  font-family: var(--mono);
  font-size: 11px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--panel-3);
}
.chg-txt svg {
  width: 11px;
  height: 11px;
  vertical-align: -1px;
  color: var(--text-3);
}
.chg-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
}
.chg-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
}
.chg-col:last-child {
  border-right: 0;
}
.chg-col-h {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.chg-frame {
  flex: 1;
  overflow: auto;
  background: #0e1117;
  padding: 0;
}
.chg-sizer {
  position: relative;
  overflow: hidden;
  background: #fff;
}
.chg-sizer iframe {
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  transform-origin: 0 0;
  background: #fff;
}
.modal.changes .modal-foot {
  justify-content: space-between;
  align-items: center;
}

/* submit */
.modal.submit {
  width: min(560px, 100%);
}
.mr-target {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.mr-target > svg {
  width: 22px;
  height: 22px;
}
.mr-target div {
  display: flex;
  flex-direction: column;
}
.mr-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mr-form[hidden],
.mr-run[hidden],
.mr-result[hidden] {
  display: none;
}
.mr-changes summary {
  cursor: pointer;
  color: var(--text-2);
}
.mr-changes ul {
  margin: 8px 0 0;
  padding-left: 18px;
  max-height: 160px;
  overflow: auto;
  font-size: 12px;
  color: var(--text-2);
}
.mr-changes code {
  font-family: var(--mono);
  font-size: 11px;
}
.mr-changes svg {
  width: 11px;
  height: 11px;
}
.mr-run,
.mr-result {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mr-ok {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.mr-ok svg {
  width: 26px;
  height: 26px;
  color: var(--ok);
}
.mr-ok p {
  margin: 2px 0 0;
}
.mr-skipped {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--warn-soft);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 12px;
}
.mr-skipped ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* shortcuts */
.shortcuts {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shortcuts div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  align-items: center;
}
.shortcuts dd {
  margin: 0;
  color: var(--text-2);
}

/* responsive */
@media (max-width: 1100px) {
  .editor {
    grid-template-columns: 210px minmax(0, 1fr) 264px;
  }
  .ed-top [data-changes] > span:not(.count) {
    display: none;
  }
  .ed-title .mono {
    display: none;
  }
}
@media (max-width: 900px) {
  .connect-main {
    grid-template-columns: 1fr;
  }
  .meters {
    grid-template-columns: 1fr 1fr;
  }
  .app-nav {
    display: none;
  }
  .up-plans {
    grid-template-columns: 1fr;
  }
  .chg {
    grid-template-columns: 1fr;
    grid-template-rows: 200px 1fr;
  }
  .chg-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
@media (max-width: 820px) {
  .editor {
    grid-template-columns: 0 minmax(0, 1fr) 0;
  }
  .ed-left,
  .ed-right {
    display: none;
  }
  .ed-top .lang-switch,
  .ed-top .vsep {
    display: none;
  }
  .ed-top-c,
  .ed-top [data-undo],
  .ed-top [data-redo],
  .ed-top [data-preview-btn],
  .ed-top .save-state,
  .ed-top .ed-title .mono,
  .canvas-hint {
    display: none;
  }
  .ed-top {
    gap: 6px;
  }
  .ed-title {
    min-width: 0;
  }
  .ed-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ed-small-note {
    display: flex;
  }
}
@media (max-width: 480px) {
  .ed-top [data-changes] > span:not(.count),
  .ed-top [data-submit] > span:not(.count) {
    display: none;
  }
}
@media (max-width: 560px) {
  .app-head {
    padding: 0 14px;
    gap: 12px;
  }
  .connect-card {
    padding: 22px;
  }
  .wiz-card {
    padding: 16px;
  }
  .pages-search {
    width: 100%;
  }
  .wiz-foot .btn {
    width: 100%;
  }
  .input-row:has(.input-lg) {
    flex-direction: column;
  }
  .input-row:has(.input-lg) .input-icon {
    top: 23px;
  }
  .chg-compare {
    grid-template-columns: 1fr;
  }
}
