/* ===== THEME ===== */
:root {
  --primary: #5900ff;
  --accent:  #00ffee;
  --bg:      #0a0a12;
  --surface: #12121a;
  --border:  #1f1f2b;
  --text:    #eaeaf0;
  --muted:   #9aa0b0;
}

[data-theme="gothic"] {
  --primary: #3b0a45;
  --accent:  #9c2a5f;
}

[data-theme="steampunk"] {
  --primary: #8b5a2b;
  --accent:  #c9a46c;
}

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }

body {
  display: flex;
  height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  z-index: 1;
  position: relative;
  overflow-y: auto;
}

.sidebar.collapsed { width: 70px; }
.sidebar h2 { color: var(--accent); margin-bottom: 20px; font-size: 1.2rem; transition: opacity 0.3s; }
.sidebar.collapsed h2 { opacity: 0; }

/* ===== NAV ITEMS ===== */
.nav-item {
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  width: 100%;
}
.nav-item:hover { background: rgba(89,0,255,0.2); box-shadow: 0 0 8px var(--primary); }
.sidebar.collapsed .nav-item span { display: none; }

/* ===== NAV GROUPS ===== */
.nav-group { margin-bottom: 4px; }

.nav-group-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 8px; border: none; background: none;
  color: var(--accent); font-size: 0.75rem; font-weight: bold;
  text-transform: uppercase; letter-spacing: 1px;
  cursor: pointer; transition: 0.2s; text-align: left; width: 100%;
}
.nav-group-header:hover { background: rgba(89,0,255,0.15); }

.nav-group-arrow {
  font-size: 0.85rem; transition: transform 0.2s ease;
  display: inline-block; opacity: 0.5; flex-shrink: 0;
}

.nav-group-items {
  max-height: 0; overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 0;
}
.nav-group-items.open { max-height: 300px; opacity: 1; }

.nav-child {
  padding-left: 22px !important;
  font-size: 0.9rem !important;
  margin-bottom: 2px !important;
}

/* Collapsed sidebar hides group text */
.sidebar.collapsed .nav-group-header span:first-child,
.sidebar.collapsed .nav-group-arrow { display: none; }
.sidebar.collapsed .nav-group-items.open { max-height: 0; opacity: 0; }

.login-btn { margin-top: auto; }
.login-btn:hover { background: var(--accent); color: black; }

/* ===== TOGGLE BUTTON ===== */
.toggle-btn {
  margin-bottom: 20px;
  cursor: pointer;
  background: var(--primary);
  border: none;
  color: white;
  padding: 8px;
  border-radius: 6px;
  transition: 0.2s;
}
.toggle-btn:hover { background: var(--accent); color: black; }

/* ===== MAIN CONTENT ===== */
.main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  z-index: 1;
  position: relative;
}
.main h1 { color: var(--primary); margin-bottom: 10px; }
.main p   { color: var(--muted); }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: var(--surface);
  padding: 30px;
  border-radius: 12px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 0 20px rgba(89,0,255,0.3);
  z-index: 10000;
}

.close { align-self: flex-end; cursor: pointer; font-size: 20px; }

.modal-content input,
.modal-content textarea {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0f0f17;
  color: var(--text);
  font-size: 0.9rem;
  width: 100%;
}

.modal-content button {
  padding: 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: white;
  transition: 0.2s;
}
.modal-content button:hover { background: var(--accent); color: black; }

.divider { text-align: center; color: var(--muted); font-size: 0.9rem; }
.google-btn { background: white !important; color: black !important; }
.google-btn:hover { opacity: 0.9; }

/* Auth tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.2s;
}
.auth-tab.active  { color: var(--accent); border-bottom-color: var(--accent); }
.auth-tab:hover   { color: var(--text); }

/* ===== TOOL PAGE ===== */
.tool-page {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.tool-page h1 { text-align: center; font-size: 2rem; color: var(--primary); margin-bottom: 10px; }

.tool-section {
  background: linear-gradient(145deg, #12121a, #0c0c14);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: 0.2s;
}
.tool-section::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  border: 1px solid transparent;
  background: linear-gradient(120deg, transparent, var(--primary), var(--accent), transparent);
  opacity: 0.15;
}
.tool-section:hover { transform: translateY(-2px); box-shadow: 0 0 15px rgba(0,255,238,0.15); }
.tool-section label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); opacity: 0.8; margin-bottom: 5px; }
.tool-section input,
.tool-section textarea,
.tool-section select {
  background: #0a0a12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  font-size: 0.9rem;
  width: 100%;
}
.tool-section textarea { resize: vertical; overflow-y: auto; min-height: 60px; scrollbar-width: thin; scrollbar-color: var(--accent) #12121a; }
.tool-page button {
  align-self: flex-end;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: bold;
  transition: 0.2s;
}
.tool-page button:hover { transform: translateY(-2px); box-shadow: 0 0 20px var(--accent); }

/* ===== LORE MANAGER ===== */
.lore-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  overflow-y: auto;
  height: calc(100vh - 40px);
  box-sizing: border-box;
}
.lore-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 900px) { .lore-grid { grid-template-columns: repeat(2, 1fr); } }

.lore-section {
  background: linear-gradient(145deg, #12121a, #0c0c14);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: auto;
  transition: 0.2s;
  min-height: 150px;
}
.lore-section::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  border: 1px solid transparent;
  background: linear-gradient(120deg, transparent, var(--primary), var(--accent), transparent);
  opacity: 0.15;
}
.lore-section:hover { transform: translateY(-3px); box-shadow: 0 0 15px rgba(0,255,238,0.15); }
.lore-section label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); opacity: 0.8; }
.lore-section input,
.lore-section textarea,
.lore-section select {
  background: #0a0a12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  font-size: 0.9rem;
  width: 100%;
  overflow-y: auto;
}
.lore-section textarea { resize: vertical; min-height: 80px; }
.lore-full { grid-column: span 1; }
@media (min-width: 900px) { .lore-full { grid-column: span 2; } }

.save-btn {
  align-self: flex-end;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: bold;
  transition: 0.2s;
}
.save-btn:hover { transform: translateY(-2px); box-shadow: 0 0 20px var(--accent); }

/* ===== BOT CARD (organizer) ===== */
.bot-card {
  background: linear-gradient(145deg, #12121a, #0c0c14);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.bot-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.bot-name   { color: var(--accent); font-size: 1.1rem; }
.bot-card button {
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: bold;
  transition: 0.2s;
}
.bot-card button:hover { transform: translateY(-1px); box-shadow: 0 0 10px var(--accent); }

/* ===== CHARACTER LIST ===== */
.character-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 5px;
}
.character-item {
  background: linear-gradient(145deg, #12121a, #0c0c14);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: 0.2s;
}
.character-item:hover { transform: translateY(-2px); box-shadow: 0 0 15px rgba(0,255,238,0.15); }
.character-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* ===== CHARACTER GRID ===== */
.character-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.character-card {
  background: linear-gradient(145deg, #12121a, #0c0c14);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  color: var(--text);
}
.character-card:hover { transform: translateY(-2px); box-shadow: 0 0 12px var(--accent); }
.character-card.selected { border: 2px solid var(--primary); box-shadow: 0 0 15px var(--primary); }

/* ===== BOT DIRECTORY ===== */
.bot-directory { max-width: 1100px; }

.dir-form-wrap > summary {
  list-style: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.5px;
  user-select: none;
  padding: 2px 0 8px;
}
.dir-form-wrap > summary:hover { color: var(--text); }
.dir-form-wrap[open] > summary { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 16px; }

.dir-form { display: flex; gap: 20px; flex-wrap: wrap; }

.dir-img-upload {
  width: 180px; min-width: 180px; height: 180px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); font-size: 0.85rem;
  text-align: center; position: relative; overflow: hidden;
  transition: 0.2s; flex-shrink: 0; background: #0a0a12;
}
.dir-img-upload:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px rgba(0,255,238,0.15); }

.dir-fields { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 260px; }
.dir-tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }

.dir-link-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.dir-link-row  { display: flex; gap: 8px; align-items: center; }
.dir-link-row select,
.dir-link-row input {
  background: #0a0a12; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; color: var(--text); font-size: 0.85rem;
}
.dir-link-row select { width: 150px; min-width: 150px; flex-shrink: 0; }
.dir-link-row input  { flex: 1; }
.dir-link-remove {
  background: none; border: 1px solid #ff000044; color: #f87171;
  border-radius: 6px; width: 28px; height: 28px; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: 0.2s; padding: 0; line-height: 1;
}
.dir-link-remove:hover { background: #ff000022; }
.dir-add-link-btn {
  align-self: flex-start !important; padding: 6px 14px !important; font-size: 0.82rem !important;
  background: none !important; border: 1px solid var(--border) !important;
  color: var(--accent) !important; border-radius: 8px !important; cursor: pointer; transition: 0.2s;
  box-shadow: none !important;
}
.dir-add-link-btn:hover { border-color: var(--accent) !important; }

.dir-filter-bar { gap: 12px; }
.dir-filter-inputs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dir-filter-inputs input,
.dir-filter-inputs select {
  background: #0a0a12; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; color: var(--text); font-size: 0.85rem; flex: 1; min-width: 130px;
}
.dir-filter-inputs input { min-width: 200px; }

.dir-count { font-size: 0.8rem; color: var(--muted); text-align: right; margin: -10px 0 0; }

.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

.dir-card {
  background: linear-gradient(145deg, #12121a, #0c0c14);
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column; transition: 0.2s; position: relative;
}
.dir-card::before {
  content: ""; position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  border: 1px solid transparent;
  background: linear-gradient(120deg, transparent, var(--primary), var(--accent), transparent);
  opacity: 0.1;
}
.dir-card:hover { transform: translateY(-3px); box-shadow: 0 0 15px rgba(0,255,238,0.15); }
.dir-card-img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: var(--bg);
}.dir-card-img-placeholder { width: 100%; height: 160px; background: #0f0f1a; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--border); }
.dir-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.dir-card-name { font-size: 1.05rem; font-weight: bold; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-card-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dir-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.dir-tag { font-size: 0.7rem; padding: 3px 8px; border-radius: 20px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.dir-tag.gender      { border-color: #5900ff55; color: #a78bfa; }
.dir-tag.host        { border-color: #00ffee44; color: #67e8f9; }
.dir-tag.role        { border-color: #ff006644; color: #f9a8d4; }
.dir-tag.content     { border-color: #ff990044; color: #fcd34d; }
.dir-tag.personality { border-color: #44ff8844; color: #86efac; }
.dir-tag.type        { border-color: #a78bfa44; color: #a78bfa; }
.dir-tag.custom      { border-color: #ffffff22; color: #cbd5e1; }
.dir-card-footer { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 12px; border-top: 1px solid var(--border); margin-top: auto; }
.dir-card-links { display: flex; flex-wrap: wrap; gap: 6px; }
.dir-card-link-btn {
  flex: 1; min-width: 80px; text-align: center; padding: 6px 10px; border-radius: 8px;
  font-size: 0.78rem; background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white; text-decoration: none; font-weight: bold; transition: 0.2s; white-space: nowrap;
}
.dir-card-link-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.dir-remove-btn {
  flex: 1; padding: 6px 12px; border-radius: 8px; font-size: 0.78rem;
  border: 1px solid #ff000044; background: transparent; color: #f87171; cursor: pointer; transition: 0.2s; font-weight: bold;
}
.dir-remove-btn:hover { background: #ff000022; transform: translateY(-1px); }

.dir-edit-card-btn {
  flex: 1; padding: 6px 12px; border-radius: 8px; font-size: 0.78rem;
  border: none; background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white; cursor: pointer; transition: 0.2s; font-weight: bold;
}
.dir-edit-card-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.dir-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px; font-size: 0.95rem; }

/* Chip group */
.dir-chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.dir-chip {
  font-size: 0.78rem; padding: 4px 12px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--muted); cursor: pointer; transition: 0.2s; user-select: none;
}
.dir-chip:hover { border-color: var(--accent); color: var(--accent); }
.dir-chip.selected { border-color: var(--accent); background: rgba(0,255,238,0.1); color: var(--accent); }

/* ===== LORE CARDS ===== */
.lore-entries-list { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.lore-search-bar input {
  background: #0a0a12; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px; color: var(--text); font-size: 0.9rem; width: 100%;
}
.lore-card {
  background: linear-gradient(145deg, #12121a, #0c0c14);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; position: relative; transition: 0.2s;
}
.lore-card::before {
  content: ""; position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  border: 1px solid transparent;
  background: linear-gradient(120deg, transparent, var(--primary), var(--accent), transparent);
  opacity: 0.1;
}
.lore-card:hover { transform: translateY(-2px); box-shadow: 0 0 15px rgba(0,255,238,0.12); }
.lore-card-title { font-size: 1.15rem; font-weight: bold; color: var(--accent); }
.lore-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 4px; }
.lore-card-field { display: flex; flex-direction: column; gap: 3px; }
.lore-card-field-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); opacity: 0.7; }
.lore-card-field-value { font-size: 0.88rem; color: var(--muted); line-height: 1.6; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.lore-card-field-value.expanded { -webkit-line-clamp: unset; }
.lore-card-expand { font-size: 0.75rem; color: var(--accent); cursor: pointer; background: none; border: none; padding: 0; opacity: 0.7; transition: 0.2s; text-align: left; }
.lore-card-expand:hover { opacity: 1; }
.lore-char-toggle {
  font-size: 0.78rem; color: var(--accent); cursor: pointer; background: none;
  border: 1px solid rgba(0,255,238,0.25); border-radius: 20px; padding: 3px 12px; transition: 0.2s; align-self: flex-start;
}
.lore-char-toggle:hover { background: rgba(0,255,238,0.08); }
.lore-char-panel { display: none; flex-direction: column; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.lore-char-panel.open { display: flex; }
.lore-char-search { background: #0a0a12; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text); font-size: 0.82rem; width: 100%; }
.lore-char-picker { display: flex; flex-wrap: wrap; gap: 6px; max-height: 140px; overflow-y: auto; }
.lore-char-chip { font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border); color: var(--muted); cursor: pointer; transition: 0.2s; user-select: none; }
.lore-char-chip:hover { border-color: var(--accent); color: var(--accent); }
.lore-char-chip.linked { border-color: var(--accent); background: rgba(0,255,238,0.08); color: var(--accent); }
.lore-linked-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.lore-linked-pill { font-size: 0.75rem; padding: 3px 10px; border-radius: 20px; border: 1px solid rgba(0,255,238,0.3); color: var(--accent); background: rgba(0,255,238,0.06); }
.lore-card-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.lore-card-actions button { padding: 7px 16px; border-radius: 8px; font-size: 0.82rem; font-weight: bold; cursor: pointer; transition: 0.2s; border: none; }
.lore-edit-btn   { background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; }
.lore-edit-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.lore-delete-btn { background: transparent; border: 1px solid #ff000044 !important; color: #f87171; }
.lore-delete-btn:hover { background: #ff000022; transform: translateY(-1px); }
.lore-highlight { background: rgba(0,255,238,0.18); border-radius: 3px; color: var(--text); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0d0805; }
::-webkit-scrollbar-thumb { background: var(--parchment-dark, #555); }

@media (max-width: 600px) {
  .dir-form { flex-direction: column; }
  .dir-img-upload { width: 100%; height: 140px; min-width: unset; }
}







/* Footer */
.botforge-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 0.75rem;
  color: var(--muted);
  z-index: 50;
}
 
.footer-disc-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-disc-btn:hover { opacity: 0.7; }
 
/* Adjust main content so footer doesn't overlap */
.main { padding-bottom: 52px; }
 
/* Disclaimer modal sizing */
.disclaimer-modal-content {
  width: min(680px, 95vw) !important;
  max-height: 85vh;
  overflow-y: auto;
  gap: 0 !important;
  padding: 0 !important;
}
 
.disc-panel {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
 
/* Disclaimer sections */
.disc-section {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: linear-gradient(145deg, #12121a, #0c0c14);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
 
.disc-section::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  background: linear-gradient(120deg, transparent, var(--primary), var(--accent), transparent);
  opacity: 0.07;
}
 
.disc-warning { border-color: rgba(248,113,113,0.3) !important; }
.disc-warning::before { background: linear-gradient(120deg, transparent, #f87171, #ff9900, transparent) !important; }
 
.disc-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 1px;
}
 
.disc-section > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
 
.disc-heading {
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--accent);
  margin: 0;
}
 
.disc-section p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}
 
.disc-section strong { color: var(--text); }
 
.disc-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
 
.disc-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
}
 
/* Contact links */
.disc-contact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
 
.disc-contact-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(145deg, #12121a, #0c0c14);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: 0.2s;
  color: var(--text);
}
 
.disc-contact-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(0,255,238,0.1);
}
 
.disc-contact-icon { font-size: 1.3rem; flex-shrink: 0; }
.disc-contact-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.disc-contact-value { font-size: 0.88rem; color: var(--accent); }
 
.disc-divider {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  position: relative;
}
 
/* Contact type buttons */
.contact-type-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
 
.contact-type-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  transition: 0.2s;
}
 
.contact-type-btn:hover { border-color: var(--accent); color: var(--accent); }
.contact-type-btn.active { border-color: var(--accent); background: rgba(0,255,238,0.08); color: var(--accent); }












.profile-badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.profile-badge-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--surface), var(--bg));
  transition: 0.2s;
  min-width: 160px;
}
.profile-badge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(0,255,238,0.1);
}
.profile-badge-card.locked {
  opacity: 0.35;
  filter: grayscale(1);
}
.profile-badge-emoji { font-size: 1.6rem; flex-shrink: 0; }
.profile-badge-info  { display: flex; flex-direction: column; gap: 1px; }
.profile-badge-label { font-size: 0.85rem; font-weight: bold; color: var(--text); }
.profile-badge-desc  { font-size: 0.7rem; color: var(--muted); }

.profile-badge-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 0.72rem; font-weight: bold;
  border: 1px solid var(--border);
  background: rgba(0,255,238,0.06);
  color: var(--accent);
  cursor: default;
  transition: 0.2s;
}
.profile-badge-chip:hover { box-shadow: 0 0 8px rgba(0,255,238,0.15); }







.roadmap-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  width: min(640px, 95vw);
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 0 30px rgba(0,255,238,0.12);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--surface);
}
.roadmap-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.roadmap-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  opacity: 0.8;
  margin-bottom: 6px;
}
.roadmap-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.roadmap-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(145deg, #0f0f17, #0a0a12);
  border: 1px solid var(--border);
  transition: 0.2s;
  position: relative;
  overflow: hidden;
}
.roadmap-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  pointer-events: none;
  background: linear-gradient(120deg, transparent, var(--primary), var(--accent), transparent);
  opacity: 0.06;
}
.roadmap-item:hover { transform: translateX(3px); border-color: rgba(0,255,238,0.2); }
 
.roadmap-item-icon  { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
.roadmap-item-body  { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.roadmap-item-title { font-size: 0.9rem; font-weight: bold; color: var(--text); }
.roadmap-item-desc  { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }
 
.roadmap-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: bold;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  white-space: nowrap;
}
.badge-shipped    { background: rgba(134,239,172,0.1); border: 1px solid rgba(134,239,172,0.3); color: #86efac; }
.badge-inprogress { background: rgba(0,255,238,0.08); border: 1px solid rgba(0,255,238,0.3);    color: var(--accent); }
.badge-planned    { background: rgba(167,139,250,0.08); border: 1px solid rgba(167,139,250,0.3); color: #a78bfa; }
.badge-soon       { background: rgba(253,186,116,0.08); border: 1px solid rgba(253,186,116,0.3); color: #fbbf24; }
/* Ensure selects/inputs are above decorative ::before overlays */
.tool-section select,
.tool-section input,
.tool-section textarea,
.lore-section select,
.lore-section input,
.lore-section textarea,
.dir-filter-inputs select,
.dir-filter-inputs input,
.dir-link-row select,
.dir-link-row input {
  position: relative;
  z-index: 1;
}

/* =====================================================
   MOBILE VIEW  (max-width: 768px)
   Additive only - no desktop rules overridden
   ===================================================== */

/* Hide topbar on desktop */
.mobile-topbar { display: none; }

@media (max-width: 768px) {

  body {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  /* Top bar */
  .mobile-topbar {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 52px;
    min-height: 52px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 200;
    flex-shrink: 0;
  }
  .mobile-topbar h2 {
    font-size: 1.1rem;
    color: var(--accent);
    flex: 1;
    margin: 0;
  }
  .mobile-menu-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 6px 8px;
    line-height: 1;
    border-radius: 6px;
    transition: background 0.2s;
  }
  .mobile-menu-btn:hover { background: rgba(89,0,255,0.2); }

  /* Sidebar slides in from left as overlay */
  .sidebar {
    position: fixed !important;
    top: 52px;
    left: 0;
    bottom: 36px;
    width: 260px !important;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 150;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Backdrop when sidebar is open */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 140;
  }
  .sidebar-backdrop.active { display: block; }

  /* Hide desktop collapse button and sidebar title on mobile */
  .sidebar .toggle-btn { display: none; }
  .sidebar h2 { display: none; }

  /* Main content area */
  .main {
    flex: 1;
    overflow-y: visible;
    padding: 16px;
    padding-bottom: 16px;
  }

  /* Bot directory */
  .dir-grid { grid-template-columns: 1fr !important; }
  .dir-form { flex-direction: column; }
  .dir-img-upload { width: 100% !important; height: 160px; min-width: unset; }
  .dir-tag-grid { grid-template-columns: 1fr !important; }
  .dir-filter-inputs { flex-direction: column; }
  .dir-filter-inputs select,
  .dir-filter-inputs input { width: 100%; }

  /* Lore manager */
  .lore-grid { grid-template-columns: 1fr !important; }

  /* Collections */
  .collections-grid { grid-template-columns: 1fr !important; }

  /* Upgrade plans */
  .upgrade-plans { grid-template-columns: 1fr !important; }

  /* Modals */
  .modal-content { width: 95vw !important; padding: 20px !important; }
  .disclaimer-modal-content { width: 98vw !important; }

  /* Link rows */
  .dir-link-row { flex-wrap: wrap; }
  .dir-link-row select { width: 100% !important; }
  .dir-link-row .dir-link-custom,
  .dir-link-row .dir-link-url { width: 100% !important; }

  /* Feed */
  .post-card { padding: 14px; }

  /* Footer: static in flow so user scrolls to it */
  .botforge-footer {
    position: static;
    margin-top: auto;
  }
  /* Remove the padding-bottom that compensated for fixed footer */
  .main { padding-bottom: 16px; }
}

/* ===== NAV ICONS ===== */
.nav-item span, .nav-group-header span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.nav-icon {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s, filter 0.2s;
}
.nav-item:hover .nav-icon,
.nav-group-header:hover .nav-icon {
  opacity: 1;
  filter: drop-shadow(0 0 4px var(--accent));
}
/* Collapsed sidebar: hide text but keep icon visible */
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-group-header span:first-child {
  display: inline-flex;
}
.sidebar.collapsed .nav-item span .nav-icon,
.sidebar.collapsed .nav-group-header span:first-child .nav-icon {
  display: inline-block;
}