.lovable-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: white;
  color: #1a1a1a;
  font-size: 14px;
}

/* ---------- Top bar ---------- */
.top-bar {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 12px;
  border-bottom: 1px solid #e7e5e4;
  gap: 8px;
  flex-shrink: 0;
}
.top-bar .brand { display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.top-bar .brand .logo {
  width: 28px; height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
.top-bar .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.top-bar .brand-text .name { font-weight: 600; font-size: 13px; }
.top-bar .brand-text .sub { font-size: 11px; color: #78716c; }
.top-bar .icon-btn {
  width: 32px; height: 32px; border-radius: 6px;
  display: grid; place-items: center; border: none; background: transparent; color: #57534e;
}
.top-bar .icon-btn:hover { background: #f5f5f4; }
.top-bar .preview-pill {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: #eff6ff; color: #1d4ed8; border-radius: 999px; font-weight: 500; font-size: 13px;
}
.top-bar .url-pill {
  flex: 1; max-width: 480px; height: 32px; padding: 0 12px;
  border: 1px solid #e7e5e4; border-radius: 8px;
  display: flex; align-items: center; color: #78716c; font-size: 13px; margin: 0 8px;
}
.top-bar .spacer { flex: 1; }
.top-bar .share-btn {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: white; border: 1px solid #e7e5e4; border-radius: 8px; font-size: 13px; font-weight: 500;
}
.top-bar .share-btn .avatar {
  width: 20px; height: 20px; border-radius: 999px; background: linear-gradient(135deg, #f59e0b, #ef4444);
}
.top-bar .upgrade-btn {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: linear-gradient(135deg, #7c3aed, #a855f7); color: white;
  border-radius: 8px; font-size: 13px; font-weight: 600; border: none;
}
.top-bar .publish-btn {
  padding: 6px 14px; background: #2563eb; color: white;
  border-radius: 8px; font-size: 13px; font-weight: 600; border: none;
}

/* ---------- Body split ---------- */
.body-split { display: flex; flex: 1; min-height: 0; }
.chat-panel {
  width: 32%; min-width: 360px; max-width: 520px;
  border-right: 1px solid #e7e5e4;
  display: flex; flex-direction: column; background: white;
}
.chat-scroll { flex: 1; overflow-y: auto; padding: 16px 20px; }

/* ---------- Chat messages ---------- */
.msg-ai { font-size: 14px; color: #292524; line-height: 1.55; margin: 12px 0 16px; }
.msg-ai p { margin: 0 0 8px; }
.msg-ai ul { padding-left: 18px; margin: 8px 0; }
.msg-ai li { margin: 6px 0; }
.msg-actions { display: flex; gap: 4px; margin-top: 8px; color: #78716c; }
.msg-actions .icon-btn { width: 24px; height: 24px; }

.msg-user {
  align-self: flex-end;
  background: #f5f5f4;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin: 12px 0;
  max-width: 80%;
  margin-left: auto;
}
.msg-timestamp { color: #a8a29e; font-size: 12px; text-align: center; margin: 16px 0 8px; }

/* Setup-specific cards inside chat */
.setup-card {
  border: 1px solid #e7e5e4;
  border-radius: 10px;
  padding: 14px;
  margin: 10px 0;
  background: #fafaf9;
}
.setup-card .title { font-weight: 600; font-size: 13px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.setup-card .title .dot { width: 6px; height: 6px; border-radius: 999px; background: #f59e0b; }
.setup-card .title .dot.done { background: #16a34a; }
.setup-card .body { font-size: 13px; color: #57534e; line-height: 1.5; }
.setup-card .open-link {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px; padding: 10px 14px;
  background: #1a1a1a; border: 1px solid #1a1a1a; border-radius: 8px;
  text-decoration: none; color: white; font-weight: 500; font-size: 14px;
  transition: background 120ms;
}
.setup-card .open-link:hover { background: #292524; }
.setup-card .open-link i { transition: transform 120ms; }
.setup-card .open-link:hover i { transform: translateX(2px); }
.setup-card code {
  font-family: var(--font-mono); font-size: 12px;
  background: white; border: 1px solid #e7e5e4; border-radius: 4px; padding: 1px 5px;
}

/* ---------- Composer ---------- */
.composer {
  border-top: 1px solid #e7e5e4;
  padding: 12px 16px;
  background: white;
}
.composer-box {
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.composer-input { font-size: 14px; color: #a8a29e; min-height: 24px; }
.composer-row { display: flex; align-items: center; gap: 4px; }
.composer-row .pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border: 1px solid #e7e5e4; border-radius: 999px;
  font-size: 12px; color: #57534e;
}
.composer-row .spacer { flex: 1; }
.composer-row .send {
  width: 28px; height: 28px; border-radius: 999px;
  background: #d6d3d1; display: grid; place-items: center; border: none; color: #57534e;
}

/* ---------- Preview pane (right) ----------
   Deliberately subtle wireframe so the eye stays on the chat at left.
   No brand, no copy — just gray skeleton blocks suggesting "an app is being built". */
.preview-pane {
  flex: 1;
  background: #f7f5f0;
  padding: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.preview-pane .preview-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a8a29e;
  font-weight: 600;
}
.preview-pane .preview-skeleton {
  background: white;
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  padding: 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.preview-pane .skel-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.preview-pane .skel-block {
  background: #ece9e4;
  border-radius: 6px;
}
.preview-pane .skel-logo    { width: 32%; height: 18px; }
.preview-pane .skel-pill    { width: 64px; height: 18px; border-radius: 999px; }
.preview-pane .skel-headline { width: 65%; height: 28px; }
.preview-pane .skel-headline.short { width: 45%; }
.preview-pane .skel-line    { width: 82%; height: 10px; }
.preview-pane .skel-line.short { width: 58%; }
.preview-pane .skel-button  { width: 170px; height: 36px; margin-top: 14px; border-radius: 8px; }

/* ---------- Cloud pane (screen 5) ---------- */
.cloud-pane {
  flex: 1;
  background: white;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.cloud-topline {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid #e7e5e4;
  font-size: 16px; font-weight: 500; color: #1a1a1a;
}
.cloud-topline .cloud-close {
  text-decoration: none; color: #57534e; font-size: 14px;
}
.cloud-topline .cloud-close:hover { color: #1a1a1a; }

.cloud-body { display: flex; flex: 1; min-height: 0; }

.cloud-sidebar {
  width: 200px; flex-shrink: 0;
  border-right: 1px solid #f0eeec;
  padding: 16px 8px;
  display: flex; flex-direction: column; gap: 2px;
  background: white;
}
.cs-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  font-size: 13px; color: #57534e;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}
.cs-item:hover { background: #fafaf9; }
.cs-item.active { background: #f0eeec; color: #1a1a1a; font-weight: 500; }
.cs-badge {
  margin-left: auto;
  font-size: 10px; padding: 1px 6px;
  background: #ede9fe; color: #6d28d9;
  border-radius: 4px; font-weight: 500;
}

.cloud-main {
  flex: 1; overflow-y: auto;
  padding: 24px 32px;
}
.breadcrumb {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; color: #57534e;
  margin-bottom: 8px;
}
.cloud-h1 {
  font-size: 26px; font-weight: 600; margin: 0 0 6px; color: #1a1a1a;
}
.cloud-sub {
  font-size: 14px; color: #78716c; margin: 0 0 20px;
}

.banner-info {
  display: flex; gap: 10px; align-items: flex-start;
  background: #ecfdf5; border: 1px solid #a7f3d0;
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; color: #065f46; line-height: 1.55;
  margin-bottom: 20px;
}

.secret-form {
  margin-bottom: 32px;
}
.form-row {
  display: flex; gap: 12px; align-items: flex-end;
  margin-bottom: 12px;
}
.form-field {
  flex: 1;
  display: flex; flex-direction: column; gap: 6px;
}
.form-field label {
  font-size: 13px; font-weight: 500; color: #1a1a1a;
}
.form-field input {
  padding: 8px 12px; font-size: 13px;
  border: 1px solid #d6d3d1; border-radius: 6px;
  font-family: var(--font-mono);
  color: #1a1a1a; background: white;
}
.form-field input.prefilled {
  background: #ecfdf5; border-color: #a7f3d0;
}
.form-field input:focus { outline: 2px solid #1a1a1a; outline-offset: -1px; border-color: #1a1a1a; }
.trash-btn {
  background: white; border: 1px solid #d6d3d1; border-radius: 6px;
  width: 36px; height: 36px;
  display: grid; place-items: center; color: #78716c;
  flex-shrink: 0;
}
.trash-btn[disabled] { opacity: 0.4; cursor: default; }

.form-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px;
}
.actions-left { display: flex; gap: 8px; align-items: center; }
.add-another {
  background: white; border: 1px solid #d6d3d1; border-radius: 6px;
  padding: 7px 12px; font-size: 13px; color: #57534e;
}
.paste-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: white; border: 1px solid #d6d3d1; border-radius: 6px;
  padding: 7px 12px; font-size: 13px; color: #1a1a1a; font-weight: 500;
}
.paste-btn:hover { background: #fafaf9; border-color: #1a1a1a; }
.save-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: #1a1a1a; color: white; text-decoration: none;
  padding: 8px 20px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
}
.save-btn:hover { background: #292524; }
.save-btn.is-disabled {
  background: #d6d3d1; color: white; pointer-events: none; cursor: not-allowed;
}

.cloud-h2 {
  font-size: 18px; font-weight: 600; margin: 0 0 12px; color: #1a1a1a;
}
.secrets-table {
  border: 1px solid #f0eeec; border-radius: 8px;
  overflow: hidden;
}
.st-header, .st-row {
  display: grid; grid-template-columns: 2fr 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 16px;
}
.st-header {
  background: #fafaf9;
  font-size: 12px; color: #78716c; text-transform: none; font-weight: 500;
  border-bottom: 1px solid #f0eeec;
}
.st-row { font-size: 13px; color: #1a1a1a; }
.st-name { font-family: var(--font-mono); display: flex; align-items: center; gap: 8px; }
.st-badge {
  font-family: var(--font-sans); font-size: 11px;
  padding: 1px 6px; border: 1px solid #d6d3d1; border-radius: 4px;
  color: #57534e;
}
.st-created { color: #57534e; }
.st-actions { display: flex; gap: 6px; justify-self: end; }
.st-action {
  background: white; border: 1px solid #d6d3d1; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; color: #57534e;
  display: inline-flex; align-items: center; gap: 4px;
}
