:root {
  --bg-color: #0b0f19;
  --card-bg: #151e2e;
  --card-bg-hover: #1c283c;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --border: #243247;
  --font-brand: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-code: 'JetBrains Mono', monospace;
}

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

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.75rem 5rem 0.75rem;
}

.sticky-navbar-wrapper {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1100;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
}

.sticky-navbar {
  width: 100%;
  max-width: 850px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sticky-navbar h2 {
  font-family: var(--font-brand);
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
}

.navbar-actions { 
  display: flex; 
  gap: 0.35rem; 
  align-items: center; 
  flex-wrap: wrap;
}

.btn-nav {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: 0.2s;
}
.btn-nav:hover { background: var(--border); color: var(--text-main); }

.container { 
  width: 100%; 
  max-width: 850px; 
}

/* Quick Tools Links Banner */
.quick-tools-banner {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.quick-tools-title { font-size: 0.8rem; font-weight: 600; color: #93c5fd; }
.quick-tools-links { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.tool-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  transition: 0.2s;
}
.tool-chip.flow { color: #38bdf8; }
.tool-chip.eleven { color: #f59e0b; }
.tool-chip.capcut { color: #00f0ff; }
.tool-chip.chatgpt { color: #10b981; }
.tool-chip:hover { background: var(--border); }

/* Storyboard Composer */
.storyboard-composer {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 1.5rem;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  gap: 0.4rem;
}
.section-title-bar h3 { 
  font-size: 0.95rem; 
  font-family: var(--font-brand); 
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-counter { font-size: 0.74rem; font-family: var(--font-code); color: var(--text-muted); white-space: nowrap; }

.toolbar { 
  display: flex; 
  gap: 0.35rem; 
  margin-bottom: 0.65rem; 
  flex-wrap: wrap; 
}
.tool-btn {
  flex: 1 1 calc(50% - 0.35rem);
  justify-content: center;
  background: var(--bg-color);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  transition: 0.2s;
}
.tool-btn:hover { background: var(--border); }

textarea {
  width: 100%;
  min-height: 150px;
  background: var(--bg-color);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.75rem;
  border-radius: 8px;
  font-family: var(--font-code);
  font-size: 0.85rem;
  line-height: 1.45;
  resize: vertical;
  margin-bottom: 0.75rem;
}
textarea:focus { outline: none; border-color: var(--primary); }

.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.meta-label { font-size: 0.75rem; color: var(--text-muted); display: block; margin-bottom: 0.2rem; }

input[type="text"], input[type="url"], select {
  width: 100%;
  background: var(--bg-color);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.55rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.82rem;
}
input:focus, select:focus { outline: none; border-color: var(--primary); }

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 0.9rem;
  width: 100%;
  transition: 0.2s;
}
.btn-primary:hover { background: var(--primary-hover); }

/* Workspace Header & Search */
.workspace-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.workspace-header-bar h3 { margin: 0; font-size: 0.95rem; font-family: var(--font-brand); color: var(--text-muted); }

.search-box { 
  position: relative; 
  width: 100%; 
  max-width: 240px; 
}
.search-box i {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.75rem;
}
.search-box input {
  width: 100%;
  padding: 0.4rem 0.55rem 0.4rem 1.8rem;
  font-size: 0.78rem;
}

/* Storyboard Cards Grid */
.projects-grid { display: grid; gap: 0.75rem; }

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
}

.character-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font-code);
  font-weight: 600;
}

.status-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid transparent;
}
.status-Prompting { color: var(--warning); background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); }
.status-Rendering { color: #38bdf8; background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.3); }
.status-Editing { color: #00f0ff; background: rgba(0, 240, 255, 0.1); border-color: rgba(0, 240, 255, 0.3); }
.status-Ready { color: var(--success); background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); }

.project-body {
  font-family: var(--font-code);
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(11, 15, 25, 0.4);
  padding: 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 0.65rem;
}

.project-links {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}
.project-link-item {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.75rem;
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  padding-top: 0.55rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.delete-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem 0.35rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  text-align: center;
}
.modal-card i.brand-icon { font-size: 1.75rem; margin-bottom: 0.4rem; }
.modal-card h3 { font-size: 1.1rem; font-family: var(--font-brand); margin-bottom: 0.25rem; }
.modal-card p { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 0.85rem; }

.retention-guide-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
  max-height: 240px;
  overflow-y: auto;
}
.guide-item {
  background: var(--bg-color);
  border: 1px solid var(--border);
  padding: 0.65rem;
  border-radius: 6px;
  cursor: pointer;
}
.guide-item strong { display: block; font-size: 0.82rem; color: #f59e0b; margin-bottom: 0.15rem; }
.guide-item span { display: block; font-size: 0.74rem; color: var(--text-muted); line-height: 1.35; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.55rem;
  border-radius: 6px;
  width: 100%;
  cursor: pointer;
  font-size: 0.85rem;
}

@media (min-width: 600px) {
  body { padding: 0 1rem 5rem 1rem; }
  .sticky-navbar h2 { font-size: 1.25rem; }
  .btn-nav { font-size: 0.82rem; padding: 0.45rem 0.75rem; }
  .quick-tools-banner { flex-direction: row; justify-content: space-between; align-items: center; }
  .tool-btn { flex: 1; font-size: 0.8rem; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .search-box { width: 220px; }
}