/* BoltOf Studio — Authentic Dark AI App Builder Design System (Desktop + Android TWA Mobile) */
:root {
  color-scheme: dark;
  --bg-root: #08090e;
  --bg-surface: #0e1018;
  --bg-elevated: #141724;
  --bg-card: #181c2c;
  --bg-hover: #1f2538;
  --border-subtle: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(56, 189, 248, 0.45);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --accent-violet: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-root);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
}

/* Custom sleek scrollbars */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.2); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.38); }

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button { cursor: pointer; }

.hidden { display: none !important; }

/* ===================== HOME / LANDING STUDIO VIEW ===================== */
#homeView {
  height: 100%;
  overflow-y: auto;
  position: relative;
  background:
    radial-gradient(ellipse 80% 46% at 50% -8%, rgba(56, 189, 248, 0.20), rgba(139, 92, 246, 0.09) 48%, transparent 80%),
    var(--bg-root);
  padding-top: var(--safe-top);
  padding-bottom: calc(36px + var(--safe-bottom));
}

.home-grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 22%, black, transparent 78%);
}

.top-nav {
  max-width: 1220px;
  margin: 0 auto;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 5;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: #fff;
}

.brand-logo img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: #7dd3fc;
  letter-spacing: 0.03em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-ghost {
  background: rgba(20, 23, 36, 0.78);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s ease;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  border: 1px solid rgba(125, 211, 252, 0.4);
  color: #fff;
  padding: 8px 15px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.28);
  transition: transform 0.14s ease, filter 0.14s ease;
}

.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.hero-container {
  max-width: 840px;
  margin: 34px auto 0;
  padding: 0 20px;
  text-align: center;
  position: relative;
  z-index: 5;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.26);
  color: #bae6fd;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.35rem);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 0;
  background: linear-gradient(180deg, #ffffff 25%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 1.02rem;
  max-width: 600px;
  margin: 14px auto 28px;
  line-height: 1.55;
}

/* Bolt Studio Prompt Box */
.prompt-studio-card {
  background: rgba(16, 19, 30, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 14px;
  text-align: left;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(56, 189, 248, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prompt-studio-card:focus-within {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow:
    0 24px 65px rgba(0, 0, 0, 0.65),
    0 0 28px rgba(56, 189, 248, 0.14);
}

.stack-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.stack-chip {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
}

.stack-chip:hover { color: #fff; background: rgba(255,255,255,0.04); }
.stack-chip.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.home-textarea {
  width: 100%;
  min-height: 92px;
  max-height: 240px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #fff;
  padding: 4px 2px;
}

.home-textarea::placeholder { color: #64748b; }

.attachment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}

.attach-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
}

.prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.prompt-tools-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tool-icon-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 0.77rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.tool-icon-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.09);
  border-color: var(--border-strong);
}

.model-select-pill {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.32);
  color: #ddd6fe;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 0.77rem;
  font-weight: 600;
  max-width: 240px;
}

.quick-ideas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.idea-pill {
  background: rgba(20, 23, 36, 0.72);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.77rem;
  transition: all 0.15s;
}

.idea-pill:hover {
  color: #fff;
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.09);
}

/* Sections below hero */
.home-section {
  max-width: 1140px;
  margin: 44px auto 0;
  padding: 0 22px;
  position: relative;
  z-index: 5;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: #e2e8f0;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.template-card {
  background: rgba(18, 22, 34, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 15px;
  padding: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  cursor: pointer;
}

.template-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(24, 29, 45, 0.95);
}

.tpl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tpl-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}

.tpl-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.11);
  color: #7dd3fc;
}

.template-card h3 { margin: 10px 0 5px; font-size: 0.96rem; color: #fff; }
.template-card p { margin: 0; font-size: 0.81rem; color: var(--text-secondary); line-height: 1.48; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.project-item-card {
  background: rgba(16, 19, 30, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.16s;
}

.project-item-card:hover { border-color: var(--border-accent); }

/* ===================== IDE WORKSPACE VIEW ===================== */
#workspaceView {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: var(--bg-root);
  padding-top: var(--safe-top);
}

.ide-header {
  height: 52px;
  min-height: 52px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ide-header-left, .ide-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-title-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  width: 190px;
}

.project-title-input:hover, .project-title-input:focus {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  outline: none;
}

.save-indicator {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Split Layout */
.ide-main {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

#chatPane {
  width: 390px;
  min-width: 300px;
  max-width: 600px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#paneResizer {
  width: 5px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
  z-index: 10;
}

#paneResizer:hover, #paneResizer.dragging {
  background: var(--accent);
}

#workbenchPane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-root);
}

/* Chat Timeline */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg-user {
  align-self: flex-end;
  max-width: 90%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(56, 189, 248, 0.16));
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 14px 14px 4px 14px;
  padding: 10px 13px;
  font-size: 0.87rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-ai {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.87rem;
  line-height: 1.58;
  color: #e2e8f0;
}

.msg-ai-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #7dd3fc;
}

.think-box {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 0.78rem;
  color: #c4b5fd;
}

.think-box summary {
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.think-box pre {
  white-space: pre-wrap;
  font-family: var(--font-sans);
  margin: 8px 0 0;
  color: #a78bfa;
  max-height: 180px;
  overflow-y: auto;
}

/* Bolt Artifact Action Card */
.bolt-artifact-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.artifact-header {
  padding: 10px 13px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.artifact-title {
  font-weight: 700;
  font-size: 0.83rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 7px;
}

.artifact-steps {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.artifact-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.79rem;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: background 0.14s;
}

.artifact-step:hover { background: rgba(56, 189, 248, 0.10); }

.step-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.step-path {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #bae6fd;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-done { color: var(--success); font-weight: 800; }
.step-spin {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(56, 189, 248, 0.25);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.artifact-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(0,0,0,0.18);
}

/* Error Auto-Fix Banner */
.error-fix-banner {
  margin: 0 12px 8px;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
}

.error-fix-text {
  color: #fca5a5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* Chat Composer */
.chat-composer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.chat-input-box {
  background: var(--bg-root);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 8px 10px;
  transition: border-color 0.15s;
}

.chat-input-box:focus-within { border-color: var(--accent); }

.chat-textarea {
  width: 100%;
  min-height: 52px;
  max-height: 150px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #fff;
}

.chat-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  gap: 6px;
}

/* Workbench Header & Mode Switcher */
.workbench-toolbar {
  height: 44px;
  min-height: 44px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.segmented-tabs {
  display: inline-flex;
  background: var(--bg-root);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.14s;
}

.seg-btn.active {
  background: var(--bg-card);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.workbench-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Code Explorer + Editor */
#codeSection {
  flex: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border-subtle);
}

.file-explorer {
  width: 205px;
  min-width: 165px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.explorer-head {
  padding: 9px 11px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-tree {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-mono);
}

.file-row:hover { background: rgba(255,255,255,0.04); color: #fff; }
.file-row.active {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  font-weight: 600;
}

.file-row-del {
  opacity: 0;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 0 3px;
}

.file-row:hover .file-row-del { opacity: 1; }
.file-row-del:hover { color: var(--danger); }

.editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #0a0c14;
}

.editor-tabs {
  height: 36px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 0 6px;
  gap: 4px;
}

.editor-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px 6px 0 0;
  font-size: 0.76rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.editor-tab.active {
  color: #fff;
  background: #0a0c14;
  border-bottom-color: var(--accent);
}

.code-editor-wrap {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.line-numbers {
  width: 46px;
  padding: 14px 8px 14px 4px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: #475569;
  background: #080a11;
  border-right: 1px solid rgba(255,255,255,0.05);
  user-select: none;
  overflow: hidden;
}

#codeTextarea {
  flex: 1;
  background: #0a0c14;
  color: #e2e8f0;
  border: none;
  outline: none;
  resize: none;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}

.editor-statusbar {
  height: 28px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Live Preview Section */
#previewSection {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #0c0e16;
}

.preview-bar {
  height: 40px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-url-box {
  flex: 1;
  background: var(--bg-root);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 80px;
}

.preview-stage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: auto;
  background: #07080d;
  padding: 0;
}

.preview-stage.device-framed {
  padding: 16px;
}

#previewIframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
  transition: width 0.22s ease;
}

.preview-stage.viewport-tablet #previewIframe {
  width: 768px;
  max-width: 100%;
  border-radius: 14px;
  border: 2px solid #334155;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.preview-stage.viewport-mobile #previewIframe {
  width: 390px;
  max-width: 100%;
  border-radius: 24px;
  border: 3px solid #334155;
  box-shadow: 0 20px 50px rgba(0,0,0,0.65);
}

/* Bottom Console & Terminal Dock */
#bottomDock {
  height: 185px;
  min-height: 140px;
  background: #090b12;
  border-top: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
}

.dock-header {
  height: 34px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dock-tabs {
  display: flex;
  gap: 6px;
}

.dock-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
}

.dock-tab.active {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
}

.console-list, .terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

.log-row { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.03); white-space: pre-wrap; }
.log-warn { color: #fbbf24; }
.log-error { color: #f87171; }
.log-info { color: #93c5fd; }

.terminal-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
}

.terminal-prompt { color: #10b981; font-weight: 700; }
#terminalInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #fff;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 5, 10, 0.76);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 28px 70px rgba(0,0,0,0.7);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-head h3 { margin: 0; font-size: 1.12rem; }

.field-group { margin-bottom: 14px; }
.field-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  background: var(--bg-root);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.86rem;
  color: #fff;
}

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

/* Toast notification */
#toastContainer {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-msg {
  background: #182032;
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #f8fafc;
  padding: 10px 15px;
  border-radius: 11px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* ===================== ANDROID / PLAY STORE MOBILE LAYOUT ===================== */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 920px) {
  .top-nav { padding: 12px 14px; }
  .brand-badge, .hide-mobile { display: none !important; }
  .hero-container { margin-top: 18px; padding: 0 14px; }
  .templates-grid { grid-template-columns: 1fr; }

  #paneResizer { display: none; }
  #chatPane {
    width: 100% !important;
    max-width: none;
    border-right: none;
  }

  .file-explorer {
    width: 140px;
    min-width: 120px;
  }

  .project-title-input { width: 120px; }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-strong);
    padding-bottom: var(--safe-bottom);
    min-height: calc(54px + var(--safe-bottom));
  }

  .mob-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
  }

  .mob-tab.active {
    color: var(--accent);
    background: rgba(56, 189, 248, 0.07);
  }
}
