/* ============================================================
   Motto Post — Full English Dark Theme
   ============================================================ */
:root {
  --bg: #0b0e14;
  --bg-2: #10141d;
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1f8;
  --text-dim: #9aa3b5;
  --text-faint: #6b7488;
  --blurple: #5865f2;
  --blurple-2: #7c3aed;
  --pink: #ec4899;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --cyan: #22d3ee;
  --grad: linear-gradient(135deg, #5865f2, #7c3aed 55%, #ec4899);
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

/* The `hidden` attribute must ALWAYS hide.
   Without this, hero display rules like `display:flex` override
   the browser's default `[hidden]{display:none}` and the page
   stays stuck on the login screen with the panel below it. */
[hidden] { display: none !important; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Background blobs ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35; }
.blob-1 { width: 480px; height: 480px; background: #5865f2; top: -140px; left: -120px; animation: blobMove 18s ease-in-out infinite alternate; }
.blob-2 { width: 420px; height: 420px; background: #7c3aed; bottom: -160px; right: -100px; animation: blobMove 22s ease-in-out infinite alternate-reverse; }
.blob-3 { width: 300px; height: 300px; background: #ec4899; top: 40%; left: 55%; opacity: 0.18; animation: blobMove 26s ease-in-out infinite alternate; }
@keyframes blobMove {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, -40px) scale(1.15); }
  100% { transform: translate(-40px, 50px) scale(0.95); }
}

/* ---------- Floating emojis ---------- */
.floating-emojis { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.float-emoji {
  position: absolute;
  font-size: 26px;
  opacity: 0.13;
  animation: floatUp linear infinite;
  user-select: none;
}
@keyframes floatUp {
  0%   { transform: translateY(105vh) rotate(0deg); }
  100% { transform: translateY(-10vh) rotate(360deg); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  border: none;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(124, 58, 237, 0.45); }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--card-hover); border-color: var(--border-strong); }
.btn-danger-ghost { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-danger-ghost:hover { background: rgba(239, 68, 68, 0.2); }
.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-discord { background: #5865F2; color: #fff; }
.btn-discord:hover { background: #4752c4; transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---------- Auth page ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(16, 20, 29, 0.85);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 38px 34px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  animation: authIn 0.55s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes authIn { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo-img {
  width: 76px; height: 76px;
  border-radius: 50%;
  border: 2.5px solid var(--blurple);
  box-shadow: 0 0 34px rgba(88, 101, 242, 0.55);
  animation: floaty 3.4s ease-in-out infinite;
}
.auth-logo h1 { font-size: 30px; font-weight: 800; margin-top: 12px; letter-spacing: -0.5px; }
.auth-logo h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.auth-logo p { color: var(--text-dim); font-size: 13px; margin-top: 3px; }

.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.auth-tab.active { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 16px; color: var(--text-faint); font-size: 12px; font-weight: 600; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-hint { text-align: center; font-size: 11.5px; color: var(--text-faint); margin-top: 12px; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--text-dim); }
.field label small { color: var(--text-faint); font-weight: 500; }
.field input[type="text"], .field input[type="password"], .field input[type="number"],
.field select, .field textarea {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blurple);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18);
}
.field textarea { resize: vertical; min-height: 70px; }
.field select option { background: #141926; color: var(--text); }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }
.hint { font-size: 11.5px; color: var(--text-faint); margin-top: 8px; line-height: 1.5; }

/* ---------- Searchable selects (servers / channels) ---------- */
.csb { position: relative; }
.csb-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  max-height: 250px; overflow-y: auto;
  box-shadow: var(--shadow);
  padding: 6px;
}
.csb-group {
  font-size: 10.5px; font-weight: 800; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.7px;
  padding: 9px 10px 4px;
}
.csb-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: none; background: transparent; color: var(--text);
  border-radius: 8px; font-size: 13px; font-family: var(--font); font-weight: 600;
  cursor: pointer; text-align: left;
}
.csb-item:hover { background: rgba(88, 101, 242, 0.18); }
.csb-item.active { background: rgba(88, 101, 242, 0.32); }
.csb-item .csb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csb-empty { padding: 14px; font-size: 12px; color: var(--text-faint); text-align: center; }

/* ---------- Emoji picker ---------- */
.emoji-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.emoji-hint { margin-top: 0; font-size: 12px; }
.emoji-picker {
  margin-top: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  max-width: 440px;
}
.emoji-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 12.5px; color: var(--text-dim); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; max-height: 190px; overflow-y: auto; }
.emoji-item {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  padding: 5px;
}
.emoji-item:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--border-strong); }
.emoji-item img { width: 24px; height: 24px; object-fit: contain; }
.form-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }
.field.grow { flex: 1; min-width: 180px; }
.field.grow-2 { flex: 2; min-width: 260px; }

/* ---------- Switch ---------- */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.12); border-radius: 26px; cursor: pointer; transition: 0.25s; }
.slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.25s; }
.switch input:checked + .slider { background: var(--grad); }
.switch input:checked + .slider::before { transform: translateX(22px); }

/* ---------- Segmented ---------- */
.segmented { display: flex; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); border-radius: 11px; padding: 4px; gap: 4px; }
.segmented .seg {
  flex: 1; padding: 9px 10px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-dim);
  font-family: var(--font); font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: all 0.2s ease;
}
.segmented .seg.active { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35); }

/* ---------- App layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; flex-shrink: 0;
  background: rgba(13, 17, 26, 0.85);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 50;
}
.logo { display: flex; align-items: center; gap: 12px; padding: 26px 22px 20px; }
.logo-img {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid var(--blurple);
  box-shadow: 0 0 18px rgba(88, 101, 242, 0.5);
  animation: bounce 2.4s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-7px) rotate(4deg); }
}
.logo-text h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
.logo-text h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.logo-text p { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.nav { flex: 1; padding: 8px 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  color: var(--text-dim); cursor: pointer;
  font-weight: 600; font-size: 14px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  user-select: none;
}
.nav-item:hover { background: var(--card); color: var(--text); transform: translateX(3px); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.22), rgba(124, 58, 237, 0.18));
  border-color: rgba(88, 101, 242, 0.35);
  color: #fff;
  box-shadow: 0 4px 18px rgba(88, 101, 242, 0.18);
}
.nav-emoji { font-size: 18px; width: 24px; text-align: center; }
.nav-item.active .nav-emoji { animation: wiggle 1.6s ease-in-out infinite; }
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-12deg); }
  75%      { transform: rotate(12deg); }
}

.sidebar-footer { padding: 16px 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.user-mini { display: flex; align-items: center; gap: 10px; }
.mini-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--blurple);
  object-fit: cover;
}
.mini-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.mini-role { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.version { font-size: 10px; color: var(--text-faint); text-align: center; }

/* ---------- Main ---------- */
.main { flex: 1; padding: 34px 40px 60px; min-width: 0; }
.menu-btn { display: none; }
.view { display: none; animation: fadeIn 0.35s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.view-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.view-header h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.view-header p { color: var(--text-dim); font-size: 13.5px; margin-top: 5px; }
.wave { display: inline-block; animation: wave 2.4s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  20%      { transform: rotate(16deg); }
  40%      { transform: rotate(-8deg); }
  60%      { transform: rotate(12deg); }
  80%      { transform: rotate(-4deg); }
}
.header-actions { display: flex; gap: 10px; }

/* ---------- License banner + hero ---------- */
.license-banner {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.14), rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(88, 101, 242, 0.3);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  backdrop-filter: blur(14px);
}
.license-banner.active { border-color: rgba(34, 197, 94, 0.35); background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(88, 101, 242, 0.1)); }
.icon-mini { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--blurple); }
.lb-text { flex: 1; display: flex; flex-direction: column; }
.lb-text b { font-size: 14.5px; }
.lb-text span { font-size: 12px; color: var(--text-dim); }

.license-hero {
  display: flex; align-items: center; gap: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
}
.lh-icon {
  font-size: 40px;
  width: 76px; height: 76px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.25), rgba(236, 72, 153, 0.2));
  border-radius: 18px;
  animation: floaty 3.2s ease-in-out infinite;
}
.lh-title { font-size: 19px; font-weight: 800; }
.lh-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.lh-meta { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: var(--border-strong); }
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 15px; font-weight: 700; }
.card-body { padding: 22px; }
.card-body.no-pad { padding: 0; }
.link { color: var(--blurple); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(14px);
  transition: all 0.25s ease;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.stat-icon {
  font-size: 28px;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.25), rgba(236, 72, 153, 0.2));
  border-radius: 14px;
  animation: floaty 3.4s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.stat-label { font-size: 12px; color: var(--text-dim); font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---------- Accounts ---------- */
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.account-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(14px);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.account-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad); opacity: 0; transition: opacity 0.25s;
}
.account-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.account-card:hover::before { opacity: 1; }
.account-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.account-avatar {
  width: 50px; height: 50px; border-radius: 50%;
  border: 2px solid var(--blurple);
  object-fit: cover;
  animation: floaty 3.8s ease-in-out infinite;
}
.account-name { font-weight: 800; font-size: 15px; }
.account-user { font-size: 12px; color: var(--text-dim); }
.chip {
  font-size: 11.5px; font-weight: 700;
  padding: 5px 11px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.chip.shared { background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.3); color: #67e8f9; }
.chip.green { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.3); color: #86efac; }

/* ---------- Tasks ---------- */
.tasks-list { display: flex; flex-direction: column; gap: 16px; }
.task-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  backdrop-filter: blur(14px);
  transition: all 0.25s ease;
}
.task-card:hover { border-color: var(--border-strong); }
.task-card.running { border-color: rgba(34, 197, 94, 0.4); box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15), var(--shadow); }
.task-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.task-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-title h4 { font-size: 15px; font-weight: 800; }
.badge {
  font-size: 10.5px; font-weight: 800;
  padding: 4px 10px; border-radius: 20px;
  letter-spacing: 0.4px; text-transform: uppercase;
}
.badge.autopost { background: rgba(88, 101, 242, 0.18); color: #a5b4fc; border: 1px solid rgba(88, 101, 242, 0.35); }
.badge.autoforward { background: rgba(34, 211, 238, 0.14); color: #67e8f9; border: 1px solid rgba(34, 211, 238, 0.3); }
.badge.status { background: rgba(239, 68, 68, 0.14); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge.status.on { background: rgba(34, 197, 94, 0.14); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }
.task-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.task-msg {
  font-size: 13px; color: var(--text-dim);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  word-break: break-word;
}
.task-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.task-stat { display: flex; flex-direction: column; }
.task-stat b { font-size: 15px; font-weight: 800; }
.task-stat b.cd { font-family: Consolas, monospace; font-variant-numeric: tabular-nums; }
.task-stat b.cd.cd-live { color: #67e8f9; }
.task-stat span { font-size: 10.5px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------- Tables ---------- */
.logs-table-wrap { overflow-x: auto; }
.logs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.logs-table th {
  text-align: left; padding: 13px 20px;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}
.logs-table td { padding: 12px 20px; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.logs-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.log-level { font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.4px; }
.log-level.success { background: rgba(34, 197, 94, 0.14); color: #86efac; }
.log-level.error { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }
.log-level.info { background: rgba(88, 101, 242, 0.16); color: #a5b4fc; }
.log-level.warn { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }

/* ---------- Empty ---------- */
.empty {
  text-align: center; color: var(--text-faint);
  padding: 40px 20px; font-size: 13.5px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.15);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 7, 12, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.25s ease; }
.modal {
  background: #12161f;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  width: 100%; max-width: 720px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(30px) scale(0.96); } to { opacity: 1; transform: none; } }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #12161f; z-index: 2;
}
.modal-header h3 { font-size: 17px; font-weight: 800; }
.modal-close {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-dim); width: 34px; height: 34px;
  border-radius: 10px; cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.modal-close:hover { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 24px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: #12161f;
}

/* ---------- Image / source preview ---------- */
.image-preview { position: relative; margin-top: 10px; display: inline-block; }
.image-preview img { max-height: 130px; border-radius: 12px; border: 1px solid var(--border-strong); }
.chip-remove {
  position: absolute; top: -8px; right: -8px;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: var(--red); color: #fff;
  cursor: pointer; font-size: 12px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}
.file-btn { cursor: pointer; }
.source-preview {
  margin-top: 10px; background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-size: 12.5px; color: var(--text-dim);
  white-space: pre-wrap; word-break: break-word;
}
.src-preview-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 6px; }
.src-preview-body { font-family: Consolas, monospace; font-size: 12px; line-height: 1.4; }
.gen-result {
  margin-top: 16px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  padding: 16px;
}
.gen-result label { font-size: 12px; font-weight: 700; color: var(--text-dim); display: block; margin-bottom: 7px; }

/* ---------- Toast ---------- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: #141926;
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--blurple);
  border-radius: 12px;
  padding: 13px 18px;
  min-width: 280px; max-width: 380px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(60px); } }
.toast-emoji { font-size: 20px; animation: bounce 1.6s ease-in-out infinite; }

.loading { display: inline-block; width: 16px; height: 16px; border: 2.5px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 30px 0 60px rgba(0, 0, 0, 0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 24px 20px 50px; }
  .menu-btn {
    display: inline-flex;
    position: fixed; top: 16px; left: 16px; z-index: 60;
    width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(13, 17, 26, 0.9); color: var(--text);
    font-size: 18px; cursor: pointer;
    align-items: center; justify-content: center;
    backdrop-filter: blur(10px);
  }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .view-header { align-items: flex-start; }
}
