:root {
  --ink: #1a1207;
  --paper: #fdf6ec;
  --amber: #e8820c;
  --amber-dark: #c26608;
  --forest: #2f5d50;
  --forest-soft: #e2efe9;
  --line: #e5d7c3;
  --card: #ffffff;
  --muted: #8a7a63;
  --featured: #fff3e0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

.page { position: relative; min-height: 100vh; overflow-x: hidden; }

/* ===== SIDEBAR SHELL LAYOUT ===== */
.shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: 280px;
  flex-shrink: 0;
  background: linear-gradient(165deg, #2f5d50 0%, #244a40 100%);
  color: #eadfce;
  border-left: 4px solid var(--amber);
  padding: 1.6rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 0.8rem; }
.sidebar-brand .brand-title { font-size: 1.15rem; font-weight: 900; color: #fff; }
.sidebar-brand .brand-tag { font-size: 0.78rem; font-weight: 300; color: #b9d6cb; margin-top: 0.15rem; }

.side-nav { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.4rem; }
.side-nav-btn {
  font-family: inherit;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #dcefe8;
  cursor: pointer;
  transition: background 0.25s, transform 0.15s, border-color 0.25s, box-shadow 0.25s;
}
.side-nav-btn:hover { background: rgba(255,255,255,0.12); transform: translateX(-3px); }
.side-nav-btn.active {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
  box-shadow: 0 10px 22px -10px var(--amber);
  transform: translateX(-3px);
}
.side-nav-emoji {
  font-size: 1.35rem;
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.14);
  border-radius: 12px;
}
.side-nav-text { display: flex; flex-direction: column; line-height: 1.4; }
.side-nav-panel { font-size: 0.72rem; opacity: 0.75; font-weight: 300; }
.side-nav-label { font-size: 0.95rem; font-weight: 700; }

.sidebar-stat {
  margin-top: auto;
  text-align: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  padding: 0.9rem;
}
.sidebar-foot { text-align: center; padding-top: 0.4rem; }

.content-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.panel-topbar {
  padding: 1.6rem 1.4rem 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff8ee, transparent);
}
.topbar-panel {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--amber-dark);
  background: var(--featured);
  border: 1px solid var(--line);
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}
.topbar-title { font-size: 1.5rem; font-weight: 900; color: var(--ink); }

/* export loading */
.export-loading { display: inline-flex; align-items: center; gap: 0.6rem; }
.btn-big.is-loading { opacity: 0.9; cursor: progress; }
.spinner {
  width: 18px; height: 18px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* hardware-accelerated ultra-HD asset rendering */
.asset-preview img {
  transform: translateZ(0);
  will-change: transform;
  image-rendering: -webkit-optimize-contrast;
  backface-visibility: hidden;
}

/* decorative orbs */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}
.orb-1 { width: 360px; height: 360px; background: #ffcf87; top: -120px; left: -80px; }
.orb-2 { width: 320px; height: 320px; background: #b9e0d1; bottom: -100px; right: -60px; }

/* Header */
.app-header {
  position: relative;
  z-index: 1;
  background: linear-gradient(120deg, #2f5d50 0%, #3a7263 100%);
  color: #fff;
  padding: 2.4rem 1.2rem 2.8rem;
  border-bottom: 4px solid var(--amber);
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 1rem; }
.brand-mark {
  font-size: 2.6rem;
  background: rgba(255,255,255,0.14);
  width: 68px; height: 68px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px;
  flex-shrink: 0;
}
.brand-title { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.5px; }
.brand-tag { font-size: 0.95rem; font-weight: 300; color: #d6ede4; margin-top: 0.2rem; }
.header-stat {
  text-align: center;
  background: rgba(255,255,255,0.12);
  padding: 0.7rem 1.3rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.2);
}
.stat-num { display: block; font-size: 2rem; font-weight: 900; color: #ffcf87; line-height: 1; }
.stat-label { font-size: 0.8rem; font-weight: 300; }

/* container */
.container {
  position: relative;
  z-index: 1;
  max-width: 960px;
  width: 100%;
  margin: 1.2rem auto 0;
  padding: 0 1.4rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

/* cards */
.idea-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 30px -18px rgba(80,50,10,0.35);
  overflow: hidden;
  animation: rise 0.5s ease both;
}
.idea-card:nth-child(3) { animation-delay: 0.06s; }
.idea-card:nth-child(4) { animation-delay: 0.12s; }
.idea-card:nth-child(5) { animation-delay: 0.18s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.idea-card-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.1rem 1.3rem;
  background: linear-gradient(90deg, #fff8ee, #ffffff);
  border-bottom: 1px solid var(--line);
}
.step-badge {
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: var(--amber);
  color: #fff;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 1.3rem;
  box-shadow: 0 6px 14px -6px var(--amber);
}
.idea-card-title { font-size: 1.2rem; font-weight: 700; }
.idea-card-sub { font-size: 0.88rem; color: var(--muted); font-weight: 300; margin-top: 0.1rem; }
.idea-card-body { padding: 1.3rem; }

/* form fields */
.field-label { display: block; font-weight: 500; font-size: 0.95rem; margin-bottom: 0.5rem; }
.field-label.mt { margin-top: 1.1rem; }
.text-input, .text-area {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fffdf9;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.text-input:focus, .text-area:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(232,130,12,0.12);
}
.text-area { resize: vertical; line-height: 1.8; }
.hint { font-size: 0.82rem; color: var(--muted); margin-top: 0.7rem; font-weight: 300; }

/* buttons */
.btn-primary {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  color: #fff;
  background: var(--amber);
  border: none;
  padding: 0.8rem 1.4rem;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 18px -8px var(--amber);
  white-space: nowrap;
}
.btn-primary:hover { background: var(--amber-dark); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  font-family: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--forest);
  background: transparent;
  border: 1.5px solid var(--line);
  padding: 0.8rem 1.3rem;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-ghost:hover { background: var(--forest-soft); border-color: var(--forest); }

/* sections manager */
.section-add-row { display: flex; gap: 0.7rem; }
.flex-1 { flex: 1; }
.quick-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.9rem; }
.quick-label { font-size: 0.82rem; color: var(--muted); font-weight: 300; }
.quick-chip {
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  background: var(--forest-soft);
  color: var(--forest);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.quick-chip:hover { background: #cfe6dc; transform: translateY(-1px); }

.empty-state {
  margin-top: 1rem;
  text-align: center;
  color: var(--muted);
  font-weight: 300;
  padding: 1.6rem;
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  background: #fffdf9;
}

.section-list { list-style: none; margin-top: 1rem; display: flex; flex-direction: column; gap: 0.55rem; }
.section-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.9rem;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 13px;
  animation: rise 0.3s ease both;
}
.section-index {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: var(--forest-soft);
  color: var(--forest);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.section-name { flex: 1; font-weight: 500; }
.remove-btn {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border: none;
  background: #fbe4e0;
  color: #c0392b;
  font-size: 1.3rem;
  line-height: 1;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s;
}
.remove-btn:hover { background: #f5c6bf; }

/* tools grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}
.tool-card {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem;
  background: #fffdf9;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.2s;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 14px 26px -16px rgba(80,50,10,0.4); }
.tool-card.matched { border-color: var(--forest); background: var(--forest-soft); }
.tool-card.featured {
  border-color: var(--amber);
  background: var(--featured);
  box-shadow: 0 0 0 3px rgba(232,130,12,0.15);
}
.featured-badge {
  position: absolute;
  top: -11px;
  left: 12px;
  background: var(--amber);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.tool-head { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.55rem; }
.tool-emoji { font-size: 1.5rem; }
.tool-name { font-weight: 700; font-size: 1.05rem; }
.tool-desc { font-size: 0.86rem; color: #5b4e3a; font-weight: 300; margin-bottom: 0.7rem; }
.tool-fit {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--forest);
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

/* summary */
.summary-box {
  font-family: 'Vazirmatn', monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: #2f2415;
  color: #ffe7c2;
  padding: 1.2rem;
  border-radius: 14px;
  line-height: 2;
  max-height: 340px;
  overflow: auto;
  direction: rtl;
}
.summary-actions { display: flex; gap: 0.7rem; margin-top: 1rem; flex-wrap: wrap; }

/* footer */
.app-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  color: var(--muted);
  font-weight: 300;
  font-size: 0.9rem;
}
.remix-link {
  display: inline-block;
  margin-top: 0.6rem;
  color: var(--amber-dark);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--amber);
  padding-bottom: 2px;
}
.remix-link:hover { color: var(--amber); }

/* toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.92rem;
  z-index: 50;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,0.5);
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== TABS ===== */
.tab-bar {
  max-width: 960px;
  margin: 1.6rem auto -0.4rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tab-btn {
  font-family: inherit;
  font-weight: 500;
  font-size: 0.92rem;
  color: #eadfce;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 0.6rem 1rem;
  border-radius: 14px 14px 0 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}
.tab-btn:hover { background: rgba(255,255,255,0.18); }
.tab-btn.active {
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  border-color: var(--paper);
}
.tab-emoji { font-size: 1.05rem; }
.tab-panel { display: flex; flex-direction: column; gap: 1.4rem; animation: rise 0.4s ease both; }

/* ===== DROPZONE / ASSETS ===== */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 1.8rem 1rem;
  text-align: center;
  cursor: pointer;
  background: #fffdf9;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover { border-color: var(--amber); }
.dropzone.drag-over { border-color: var(--amber); background: var(--featured); }
.dz-emoji { font-size: 2.2rem; }
.dz-title { font-weight: 700; margin-top: 0.4rem; }
.dz-sub { font-size: 0.82rem; color: var(--muted); font-weight: 300; margin-top: 0.2rem; }

.assets-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.9rem;
}
.asset-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fffdf9;
  animation: rise 0.3s ease both;
}
.asset-preview {
  height: 96px;
  background: #f3e9d8;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.asset-preview img { width: 100%; height: 100%; object-fit: cover; }
.asset-preview-icon { font-size: 2.4rem; }
.asset-info { padding: 0.6rem; display: flex; flex-direction: column; gap: 0.4rem; }
.asset-name {
  font-size: 0.82rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asset-specs { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.spec-chip {
  font-size: 0.68rem; font-weight: 500;
  background: var(--forest-soft); color: var(--forest);
  padding: 0.15rem 0.45rem; border-radius: 999px;
}
.asset-select {
  font-family: inherit; font-size: 0.8rem;
  padding: 0.3rem 0.4rem; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; color: var(--ink);
}
.asset-remove { position: absolute; top: 6px; left: 6px; }

/* ===== MOCKUP BUILDER ===== */
.palette { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.2rem; }
.palette-btn {
  font-family: inherit; font-size: 0.88rem; font-weight: 500;
  color: var(--forest); background: var(--forest-soft);
  border: 1px solid transparent; border-radius: 12px;
  padding: 0.5rem 0.85rem; cursor: pointer;
  display: flex; align-items: center; gap: 0.4rem;
  transition: background 0.15s, transform 0.1s;
}
.palette-btn:hover { background: #cfe6dc; transform: translateY(-2px); }
.palette-emoji { font-size: 1.05rem; }

.mockup-stage { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.phone {
  position: relative;
  width: 260px; min-height: 520px;
  background: #241b0f;
  border-radius: 34px;
  padding: 14px 12px;
  box-shadow: 0 20px 50px -18px rgba(0,0,0,0.5);
  flex-shrink: 0;
}
.phone-notch {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 18px; background: #241b0f; border-radius: 0 0 14px 14px; z-index: 2;
}
.phone-screen {
  background: #fffdf9; border-radius: 22px;
  min-height: 492px; padding: 34px 12px 14px;
  display: flex; flex-direction: column; gap: 0.6rem;
  overflow-y: auto; max-height: 492px;
}
.phone-empty {
  margin: auto; text-align: center; color: var(--muted);
  font-weight: 300; font-size: 0.9rem; white-space: pre-line;
}
.mock-el { position: relative; }
.mock-el-tools {
  position: absolute; top: 2px; left: 2px;
  display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s;
}
.mock-el:hover .mock-el-tools { opacity: 1; }
.mini-btn {
  width: 22px; height: 22px; border: none; border-radius: 6px;
  background: var(--forest); color: #fff; font-size: 0.85rem;
  line-height: 1; cursor: pointer; padding: 0;
}
.mini-btn.danger { background: #c0392b; }
.mini-btn:disabled { opacity: 0.35; cursor: default; }

.ui-button { background: var(--amber); color: #fff; text-align: center; padding: 0.55rem; border-radius: 10px; font-weight: 700; font-size: 0.85rem; }
.ui-input { border: 1.5px solid var(--line); background: #fff; color: var(--muted); padding: 0.55rem; border-radius: 10px; font-size: 0.8rem; }
.ui-image { background: #f3e9d8; height: 90px; display: flex; align-items: center; justify-content: center; font-size: 2rem; border-radius: 10px; }
.ui-menu { background: var(--forest); color: #fff; padding: 0.5rem 0.7rem; border-radius: 10px; font-size: 0.85rem; font-weight: 500; }
.ui-text { color: var(--ink); font-size: 0.82rem; padding: 0.2rem; }
.ui-card { background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 14px -10px rgba(0,0,0,0.3); padding: 0.9rem; border-radius: 12px; font-weight: 500; font-size: 0.85rem; }
.ui-toggle { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.ui-toggle-knob { width: 34px; height: 18px; background: var(--forest-soft); border-radius: 999px; position: relative; flex-shrink: 0; }
.ui-toggle-knob::after { content: ''; position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; background: var(--forest); border-radius: 50%; }
.ui-avatar { width: 54px; height: 54px; background: var(--forest-soft); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }

.mock-list-side { flex: 1; min-width: 220px; }
.side-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.8rem; }
.mock-edit-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.55rem; }
.mock-edit-tag { font-size: 0.82rem; white-space: nowrap; color: var(--muted); }
.mock-edit-input { flex: 1; padding: 0.45rem 0.7rem; font-size: 0.85rem; }

/* ===== PAGE ARCHITECTURE ===== */
.arch-actions { display: flex; gap: 0.7rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.arch-flow { display: flex; flex-direction: column; gap: 0; }
.arch-item { display: flex; flex-direction: column; }
.arch-card {
  border: 1.5px solid var(--line); border-radius: 16px;
  padding: 0.9rem; background: #fffdf9;
  animation: rise 0.3s ease both;
}
.arch-card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.arch-order {
  flex-shrink: 0; width: 30px; height: 30px;
  background: var(--amber); color: #fff; font-weight: 900;
  border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.arch-title-input {
  flex: 1; font-family: inherit; font-weight: 700; font-size: 1rem;
  border: none; border-bottom: 1.5px solid var(--line); background: transparent;
  padding: 0.3rem 0.2rem; color: var(--ink);
}
.arch-title-input:focus { outline: none; border-bottom-color: var(--amber); }
.arch-tools { display: flex; gap: 3px; }
.arch-note {
  width: 100%; font-family: inherit; font-size: 0.88rem;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 0.5rem 0.7rem; background: #fff; resize: vertical; line-height: 1.7;
}
.arch-note:focus { outline: none; border-color: var(--amber); }
.arch-connector { text-align: center; color: var(--amber); font-size: 1.4rem; padding: 0.3rem 0; font-weight: 900; }

/* ===== EXPORT ===== */
.export-stats { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.ex-stat {
  flex: 1; min-width: 90px; text-align: center;
  background: var(--forest-soft); border-radius: 14px; padding: 0.9rem 0.6rem;
}
.ex-num { display: block; font-size: 1.8rem; font-weight: 900; color: var(--forest); line-height: 1; }
.ex-lbl { font-size: 0.8rem; color: var(--muted); }
.btn-big { font-size: 1.05rem; padding: 0.9rem 1.6rem; }

/* ===== CODE / PREVIEW PANEL ===== */
.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.code-type-badge {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--forest);
  background: var(--forest-soft);
  border: 1px solid var(--line);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}
.code-btns { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.code-btn { padding: 0.6rem 1rem; font-size: 0.92rem; }
.code-error {
  background: #fbe4e0;
  color: #a5281b;
  border: 1px solid #f1b8ae;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.9rem;
  direction: ltr;
  text-align: left;
}
.code-wrap { position: relative; }
.code-editor {
  width: 100%;
  min-height: 360px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Vazirmatn', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  padding: 1rem 1.1rem;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #1e1e1e;
  color: #d4d4d4;
  resize: vertical;
  tab-size: 2;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.code-editor::placeholder { color: #7d7d7d; }
.code-editor:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(232,130,12,0.15);
}
.preview-frame-box {
  border: 1.5px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  animation: rise 0.35s ease both;
  box-shadow: 0 14px 30px -20px rgba(80,50,10,0.4);
}
.preview-frame-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  background: #f3e9d8;
  border-bottom: 1px solid var(--line);
}
.pf-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.pf-red { background: #ff5f57; }
.pf-yellow { background: #febc2e; }
.pf-green { background: #28c840; }
.pf-title { margin-right: auto; font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.preview-iframe {
  width: 100%;
  min-height: 420px;
  border: none;
  background: #fff;
  display: block;
}

/* responsive */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-left: none;
    border-bottom: 4px solid var(--amber);
    padding: 1rem;
    gap: 0.8rem;
  }
  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.3rem;
  }
  .side-nav-btn { flex-shrink: 0; padding: 0.55rem 0.7rem; }
  .side-nav-btn:hover, .side-nav-btn.active { transform: none; }
  .side-nav-panel { display: none; }
  .side-nav-label { font-size: 0.85rem; white-space: nowrap; }
  .sidebar-stat { display: none; }
  .sidebar-foot { display: none; }
}
@media (max-width: 720px) {
  .tools-grid { grid-template-columns: 1fr; }
  .brand-title { font-size: 1.2rem; }
  .section-add-row { flex-direction: column; }
  .section-add-row .btn-primary { width: 100%; }
  .topbar-title { font-size: 1.2rem; }
  .mockup-stage { justify-content: center; }
}
@media (max-width: 480px) {
  .brand-mark { width: 54px; height: 54px; font-size: 2rem; }
  .idea-card-body { padding: 1rem; }
}
</style>