/* =========================================================
   FreeTrafficBlogger UI
   - Light: Sneat-style
   - Dark: Midnight with orb
   ========================================================= */

/* ---------------------------------------------------------
   1) Root / fallback variables
   --------------------------------------------------------- */
:root {
  --bg: #f4f5fb;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --border: rgba(15,23,42,0.04);
  --text: #0f172a;
  --muted: #94a3b8;
  --brand: #4f46e5;
  --brand-2: #06b6d4;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15,23,42,.03);
  --shadow-hover: 0 16px 40px rgba(15,23,42,.05);
  --pad-content: 22px;
  --gap-tiles: 24px;
  --gap-section: 40px;
}

/* ---------------------------------------------------------
   2) Theme: light
   --------------------------------------------------------- */
body[data-theme="light"] {
  --bg: #f4f5fb;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --border: rgba(15,23,42,0.04);
  --text: #0f172a;
  --muted: #94a3b8;
  --brand: #4f46e5;
  --brand-2: #06b6d4;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15,23,42,.03);
  --shadow-hover: 0 16px 40px rgba(15,23,42,.05);
  --pad-content: 22px;
  --gap-tiles: 24px;
  --gap-section: 40px;
}

/* ---------------------------------------------------------
   3) Theme: dark
   --------------------------------------------------------- */
body[data-theme="dark"] {
  --bg: #0b0d10;
  --panel: rgba(11,13,16,0.82);
  --panel-2: rgba(17,20,24,0.9);
  --border: rgba(120,120,120,0.35);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --brand: #6366f1;
  --brand-2: #06b6d4;
  --radius: 16px;
  --shadow: 0 14px 40px rgba(0,0,0,.40);
  --shadow-hover: 0 18px 50px rgba(0,0,0,.48);
  --pad-content: 22px;
  --gap-tiles: 24px;
  --gap-section: 40px;
}

/* ---------------------------------------------------------
   4) Base
   --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  position: relative;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------------------------------------------------------
   5) Dark orb background (only dark)
   --------------------------------------------------------- */
body[data-theme="dark"]::before {
  content: "";
  position: fixed;
  inset: -12% -12% -12% -12%;
  background: url("background.png") center/cover no-repeat;
  opacity: 0.48;
  filter: blur(6px) saturate(140%);
  z-index: 0;
  transform: translate3d(-12%, -8%, 0) scale(1.06);
  animation: orbFloat 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes orbFloat {
  0%   { transform: translate3d(-12%, -8%, 0) scale(1.06); opacity: 0.44; }
  50%  { transform: translate3d(8%, 6%, 0) scale(1.12); opacity: 0.52; }
  100% { transform: translate3d(-4%, 10%, 0) scale(1.08); opacity: 0.46; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-theme="dark"]::before { animation: none; }
}

/* ---------------------------------------------------------
   6) Topbar
   --------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 800;
}
.crumbs {
  color: var(--muted);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Search */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(148,163,184,.12);
  border: 1px solid rgba(148,163,184,.15);
  padding: 6px 12px;
  border-radius: 999px;
}
body[data-theme="dark"] .search {
  background: rgba(11,13,16,.4);
  border: 1px solid rgba(148,163,184,.12);
}
.search input {
  all: unset;
  width: 200px;
  color: inherit;
}

/* Buttons in topbar */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
  font-weight: 500;
  font-size: 0.8rem;
}
.icon-btn:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

/* Avatar */
.avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  height: 42px;
}
.avatar > div {
  width: 34px;
  height: 34px;
}

/* Theme toggle icons */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
body[data-theme="light"] .theme-toggle .icon-sun { display: block; }
body[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ---------------------------------------------------------
   7) Top dropdown menu
   --------------------------------------------------------- */
.top-menu { position: relative; }
.top-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 10px 10px 14px;
  display: none;
  z-index: 200;
}
.top-menu-panel.open { display: block; }
.top-menu-group + .top-menu-group {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(148,163,184,.18);
}
.top-menu-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 6px;
  padding: 0 4px;
}
.top-menu-link {
  display: block;
  padding: 6px 6px 6px 4px;
  border-radius: 10px;
  font-size: 0.86rem;
  color: var(--text);
}
.top-menu-link:hover { background: rgba(99,102,241,0.08); }
.top-menu-link.active {
  background: rgba(99,102,241,0.15);
  font-weight: 600;
}

/* ---------------------------------------------------------
   8) Layout (no sidebar)
   --------------------------------------------------------- */
.app,
.app.app-nosidebar {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
  position: relative;
  z-index: 1; /* above orb */
}

.content {
  padding: var(--pad-content);
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  flex: 1;
}
.content > * + * {
  margin-top: var(--gap-section);
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.h1 {
  font-size: 22px;
  margin: 0;
}

/* ---------------------------------------------------------
   9) Cards & Panels
   --------------------------------------------------------- */
.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 36px;
  transition: transform .12s ease, box-shadow .12s ease;
  backdrop-filter: blur(8px);
}
body[data-theme="light"] .card,
body[data-theme="light"] .panel {
  backdrop-filter: none;
}
.card:hover,
.panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.grid { display: grid; gap: var(--gap-tiles); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }

/* ---------------------------------------------------------
   10) Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  color: #fff;
  background: linear-gradient(90deg, #1e1b4b, #4c1d95, #6d28d9, #111827);
  background-size: 300% 100%;
  animation: gradientShift 8s ease infinite;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 6px 22px rgba(109, 40, 217, 0.35);
}
.btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
  box-shadow: 0 3px 10px rgba(109, 40, 217, 0.25);
}
@keyframes gradientShift {
  0% { background-position: 0 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.btn-outline {
  background: transparent;
  border: 2px solid #6d28d9;
  color: #6d28d9;
}
.btn-outline:hover {
  background: linear-gradient(90deg, #4c1d95, #6d28d9, #1e1b4b);
  color: #fff;
  border-color: transparent;
  animation: gradientShift 6s ease infinite;
}

/* ---------------------------------------------------------
   11) Tables
   --------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148,163,184,0.2);
  text-align: left;
}

/* ---------------------------------------------------------
   12) Responsive
   --------------------------------------------------------- */
@media (max-width: 1200px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .search input { width: 120px; }
  .content { padding: 16px; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .topbar-inner { padding: 0 12px; }
  .crumbs,
  .avatar,
  .search {
    display: none !important;
  }
  .top-menu-panel {
    position: fixed;
    top: 54px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  .content { padding: 14px; }
}
.icon-btn.top-menu-trigger {
  height: 42px;
  padding: 0 16px;
  font-size: 0.95rem;
  font-weight: 200;
  border-radius: 999px;
}

/* ---------------------------------------------------------
   13) Badges
   --------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.badge-red {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #ef4444;
}
.badge-yellow {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #eab308;
}
.badge-green {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #22c55e;
}
[data-theme="dark"] .badge-red {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.4);
  color: #fca5a5;
}
[data-theme="dark"] .badge-yellow {
  background: rgba(234,179,8,0.15);
  border-color: rgba(234,179,8,0.4);
  color: #fde68a;
}
[data-theme="dark"] .badge-green {
  background: rgba(34,197,94,0.15);
  border-color: rgba(34,197,94,0.4);
  color: #86efac;
}

/* ---------------------------------------------------------
   14) Global input styling
   --------------------------------------------------------- */
/* LIGHT MODE */
body[data-theme="light"] input[type="text"],
body[data-theme="light"] input[type="email"],
body[data-theme="light"] input[type="password"],
body[data-theme="light"] input[type="number"],
body[data-theme="light"] textarea,
body[data-theme="light"] select,
body[data-theme="light"] .input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #d1d5db;
  color: #111827;
  font-size: 1rem;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
}
body[data-theme="light"] input:focus,
body[data-theme="light"] textarea:focus,
body[data-theme="light"] select:focus {
  outline: none;
  border-color: var(--brand, #4f46e5);
  background: #e5e7eb;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

/* DARK MODE */
body[data-theme="dark"] input[type="text"],
body[data-theme="dark"] input[type="email"],
body[data-theme="dark"] input[type="password"],
body[data-theme="dark"] input[type="number"],
body[data-theme="dark"] textarea,
body[data-theme="dark"] select,
body[data-theme="dark"] .input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1e293b;
  color: #e2e8f0;
  font-size: 1rem;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
}
body[data-theme="dark"] input:focus,
body[data-theme="dark"] textarea:focus,
body[data-theme="dark"] select:focus {
  outline: none;
  border-color: var(--brand-2, #06b6d4);
  background: #0f172a;
  box-shadow: 0 0 0 3px rgba(6,182,212,0.25);
}

/* app-specific light inputs */
body[data-theme="light"] .app input[type="text"],
body[data-theme="light"] .app input[type="email"],
body[data-theme="light"] .app input[type="password"],
body[data-theme="light"] .app textarea,
body[data-theme="light"] .app select {
  background: #f2f2f2 !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  color: #111827 !important;
}

/* ---------------------------------------------------------
   15) Firefox fallback for dark blur
   --------------------------------------------------------- */
@supports not (backdrop-filter: blur(8px)) {
  body[data-theme="dark"] .card,
  body[data-theme="dark"] .panel,
  body[data-theme="dark"] .topbar,
  body[data-theme="dark"] .content {
    background: #0f172a !important;
    border: 1px solid rgba(148,163,184,0.12) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.35);
  }
}

/* ---------------------------------------------------------
   16) Full Height Page utilities
   --------------------------------------------------------- */
.fullscreen-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.fullscreen-page .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--pad-content);
}
.app.app-nosidebar > .content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.page-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.page-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------
   17) Form layout helpers
   --------------------------------------------------------- */
.form-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-weight: 600;
  font-size: 0.95rem;
}
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}
.form-col p.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}
.form-col .btn { align-self: flex-start; }

/* ---------------------------------------------------------
   18) Wizard / multi-step page
   --------------------------------------------------------- */
.wizard-steps {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.12);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--muted);
}
.wizard-step-number {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(79,70,229,0.12);
  color: var(--text);
  font-weight: 600;
  font-size: 0.7rem;
}
.wizard-step.active {
  background: rgba(99,102,241,0.15);
  color: var(--text);
  border-color: rgba(99,102,241,0.35);
}
.wizard-step.active .wizard-step-number {
  background: var(--brand);
  color: #fff;
}
.wizard-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.wizard-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}
.wizard-actions .btn-secondary {
  background: transparent;
  border: 1px solid rgba(148,163,184,0.4);
  color: inherit;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity .15s ease;
}
.wizard-actions .btn-secondary:hover {
  opacity: .7;
}

/* ---------------------------------------------------------
   19) Tip / helper blocks
   --------------------------------------------------------- */
.wizard-info,
.tip-block {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(79,70,229,0.06);
  border: 1px solid rgba(79,70,229,0.15);
  color: var(--text);
  line-height: 1.5;
  font-size: 0.9rem;
}
.wizard-info h3,
.tip-block h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}
[data-theme="dark"] .wizard-info,
[data-theme="dark"] .tip-block {
  background: rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.25);
}
[data-theme="dark"] .wizard-info h3,
[data-theme="dark"] .tip-block h3 {
  color: #ffffff;
}

/* collapsible variation */
.wizard-info.is-collapsible,
.tip-block.is-collapsible {
  position: relative;
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 60px;
  transition: all 0.25s ease;
  padding-left: 20px;
}
.wizard-info-toggle,
.tip-block-toggle {
  background: transparent;
  border: none;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.05rem;
  padding: 8px 0;
}
.wizard-info-toggle::after,
.tip-block-toggle::after {
  content: "▾";
  font-size: 0.8rem;
  opacity: 0.75;
}
.wizard-info-toggle.open::after,
.tip-block-toggle.open::after {
  content: "▴";
}
.wizard-info-body,
.tip-block-body {
  display: none;
  margin-top: 12px;
  width: 100%;
}
.wizard-info-body.open,
.tip-block-body.open {
  display: block;
}

/* ---------------------------------------------------------
   20) Setup / cards clickable
   --------------------------------------------------------- */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.card-link .card {
  cursor: pointer;
  transition: transform 0.05s ease-out, box-shadow 0.05s ease-out;
  height: 100%;
}
.card-link .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
@media (max-width: 768px) {
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  section.grid-3 > div:empty {
    display: none;
  }
}

/* ---------------------------------------------------------
   21) Loading overlay
   --------------------------------------------------------- */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  flex-direction: column;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
}
.loading-overlay.active {
  display: flex;
}
.loading-overlay .loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------
   22) Alerts / Messages
   --------------------------------------------------------- */
.alert {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.4;
  border: 1px solid transparent;
}
.alert-title {
  font-weight: 600;
  margin-bottom: 2px;
}
.alert-icon {
  font-size: 1.2rem;
  line-height: 1;
  margin-top: 1px;
}
.alert-error {
  background: rgba(254, 226, 226, 0.85);
  border-color: rgba(248, 113, 113, 0.6);
  color: #7f1d1d;
}
[data-theme="dark"] .alert-error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}
.alert-success {
  background: rgba(220, 252, 231, 0.85);
  border-color: rgba(34, 197, 94, 0.5);
  color: #14532d;
}
[data-theme="dark"] .alert-success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}
.alert-info {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.25);
  color: inherit;
}

/* ---------------------------------------------------------
   23) Reusable page sections (edit-* pages)
   --------------------------------------------------------- */
.ftb-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 22px;
}
.ftb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.ftb-section-header span,
.ftb-section-header h2,
.ftb-section-header h3 {
  font-weight: 600;
  font-size: 1rem;
}
.ftb-section-header small {
  color: var(--muted);
  font-size: .75rem;
}
.ftb-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
@media (max-width: 800px) {
  .ftb-form-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------
   24) Community page
   --------------------------------------------------------- */
.community-page-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.comm-breadcrumb {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.dash-section {
  background: var(--panel);
  border: 1px solid rgba(148,163,184,0.12);
  border-radius: 14px;
  overflow: hidden;
}
.dash-section-header {
  background: radial-gradient(circle at top, rgba(79,70,229,0.03), rgba(15,23,42,0));
  padding: 12px 16px 10px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.dash-section-header small {
  font-weight: 400;
  color: var(--muted);
  font-size: .7rem;
}
.dash-section-body {
  padding: 4px 16px 12px;
}
.dash-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148,163,184,0.08);
}
.dash-row:last-child { border-bottom: none; }
.icon-link { text-decoration: none; font-size: 1.05rem; }

.community-tip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 14px;
  padding: 14px 16px;
}

/* modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal {
  background: var(--panel);
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 16px;
  width: min(520px, 94%);
  padding: 18px 18px 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.modal-title {
  font-weight: 600;
  font-size: 1rem;
}
.modal-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.modal .form-group {
  margin-bottom: 10px;
}
.modal .form-group label {
  display: block;
  font-size: .75rem;
  margin-bottom: 4px;
  color: var(--muted);
}
.modal .form-control,
.modal textarea,
.modal select {
  width: 100%;
  background: rgba(15,23,42,0.035);
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 10px;
  padding: 8px 10px;
  color: inherit;
  font-size: .8rem;
}
.modal textarea {
  min-height: 120px;
  resize: vertical;
}

/* ---------------------------------------------------------
   25) Crumb Pills (final unified version)
   --------------------------------------------------------- */
.crumb-pill {
  background: #f8fafc;
  border: 1px solid rgba(148,163,184,0.35);
  border-radius: 9999px;
  padding: 6px 14px 7px;
  font-size: .8rem;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #1e293b;
  transition: all 0.15s ease;
}
.crumb-pill:hover {
  background: #eef2ff;
  border-color: rgba(99,102,241,0.4);
  color: #111827;
}
.crumb-pill a {
  color: inherit !important;
  text-decoration: none !important;
}
body[data-theme="dark"] .crumb-pill {
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(99,102,241,0.35);
  color: #e2e8f0;
}
body[data-theme="dark"] .crumb-pill:hover {
  background: rgba(99,102,241,0.28);
  border-color: rgba(99,102,241,0.55);
  color: #ffffff;
}
/* ---------------------------------------------------------
   Thread view (community thread.php)
   --------------------------------------------------------- */
.thread-page-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.thread-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.thread-header {
  padding: 16px 22px 12px;
  border-bottom: 1px solid rgba(148,163,184,0.08);
  background: radial-gradient(circle at top, rgba(99,102,241,0.04), rgba(15,23,42,0));
}
.thread-back {
  margin: 0 0 6px;
  font-size: .75rem;
  color: var(--muted);
  display: inline-block;
}
.thread-title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
}
@media (max-width: 640px) {
  .thread-title { font-size: 1.35rem; }
}
.thread-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  font-size: .75rem;
  color: var(--muted);
}
.thread-meta strong {
  color: var(--text);
}

/* posts container */
.thread-posts-wrap {
  padding: 10px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 6px; /* ultra tight between posts */
}

/* single post card */
.thread-post-card {
  display: flex;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid rgba(148,163,184,0.03);
  transition: box-shadow .2s ease;
}
body[data-theme="dark"] .thread-post-card {
  border: 1px solid rgba(15,23,42,0.35);
}
.thread-post-card:hover {
  box-shadow: 0 10px 25px rgba(0,0,0,0.22);
}

/* left column */
.thread-post-left {
  flex: 0 0 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(15,23,42,0.05);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  gap: 4px;
  transition: background .3s ease, box-shadow .3s ease;
  padding: 12px 0; /* ← add this */
}
body[data-theme="dark"] .thread-post-left {
  background: linear-gradient(180deg, rgba(99,102,241,0.25), rgba(6,182,212,0.2));
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.05);
}
body[data-theme="dark"] .thread-post-card:hover .thread-post-left {
  background: linear-gradient(180deg, rgba(99,102,241,0.35), rgba(6,182,212,0.3));
  box-shadow:
    0 0 10px rgba(99,102,241,0.4),
    inset 0 0 6px rgba(6,182,212,0.25);
}

/* light mode version of the cool effect */
body[data-theme="light"] .thread-post-left {
  background: linear-gradient(
    180deg,
    rgba(99,102,241,0.08),
    rgba(6,182,212,0.05)
  );
  border-right: 1px solid rgba(148,163,184,0.12);
}

body[data-theme="light"] .thread-post-card:hover .thread-post-left {
  background: linear-gradient(
    180deg,
    rgba(99,102,241,0.14),
    rgba(6,182,212,0.10)
  );
  box-shadow:
    0 0 10px rgba(99,102,241,0.18);
}




.thread-post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 4px;
  transition: transform .2s ease;
}
body[data-theme="dark"] .thread-post-card:hover .thread-post-avatar {
  transform: scale(1.05);
}
.thread-post-author {
  font-weight: 600;
  font-size: .72rem;
}
.thread-post-subtitle {
  font-size: .6rem;
  color: var(--muted);
}

/* right side */
.thread-post-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
}
.thread-post-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.thread-post-date {
  font-size: .68rem;
  color: var(--muted);
}
.thread-post-divider {
  border: none;
  border-top: 1px solid rgba(148,163,184,0.12);
  margin: -4px 0 0;
}
.thread-post-content {
  white-space: normal;      /* let the HTML <br> from nl2br() handle line breaks */
  font-size: 1.0rem;
  line-height: 1.55;
  margin-top: 0;            /* no extra gap under the hr */
  padding-top: 0;
}

.thread-post-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  font-size: .68rem;
}
.thread-post-action-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* reply box */
.thread-reply {
  padding: 10px 22px 14px;
  border-top: 1px solid rgba(148,163,184,0.08);
  margin-top: 4px;
}
.thread-reply-title {
  margin: 0 0 6px;
  font-size: .9rem;
  font-weight: 600;
}
.thread-reply-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.thread-reply-textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
}
.thread-reply-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.thread-reply-actions .toggle-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}


/* responsive tweak */
@media (max-width: 680px) {
  .thread-post-card {
    flex-direction: row;
  }
  .thread-post-left {
    flex: 0 0 78px;
  }
  .thread-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
body[data-theme="light"] .thread-post-card {
  box-shadow: none !important;
  border: 1px solid rgba(15,23,42,0.06);
}
body[data-theme="light"] .thread-post-card:hover {
  box-shadow: 0 2px 6px rgba(15,23,42,0.05);
}
/* thread posts shouldn't inherit big margins from ftb-section */
.thread-post-card.ftb-section {
  margin-bottom: 0;
  padding: 0; /* we already handle padding inside columns */
}
.thread-card {
  padding: 14px 16px; /* tighter than global 36px */
}
/* HARD RESET for thread post inner spacing */
.thread-post-body {
  gap: 0;                  /* kill flex gap */
}
.thread-post-body > * {
  margin: 0;               /* kill default div/hr margins */
}

/* make the line just a hairline */
.thread-post-divider {
  border: none;
  border-top: 1px solid rgba(148,163,184,0.12);
  margin: 6px 0 4px;   /* ← top gap 6px, bottom gap 4px */
}
.thread-post-topline {
  margin-bottom: 2px;   /* tiny breathing room under the date */
}
.thread-post-body {
  gap: 0;
}

/* now add back the TINIEST space under the line */
.thread-post-content {
  margin-top: 2px;         /* this is the only spacing now */
}
.thread-page-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.thread-page-shell .thread-card {
  flex: 1 1 auto;               /* make the card stretch */
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 120px); /* tweak this number if your topbar is taller */
}
/* new-thread.php alignment */
.community-new-thread-form .form-group {
  margin-bottom: 16px;
}

.community-new-thread-form label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}

.community-new-thread-form input[type="text"],
.community-new-thread-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.9rem;
}

.community-new-thread-form textarea {
  resize: vertical;
  min-height: 120px;
}

.new-thread-options {
  margin: 18px 0 20px;
  padding: 12px 14px;
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.new-thread-options .toggle-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.new-thread-options input[type="checkbox"] {
  width: auto;
}

.community-new-thread-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.community-new-thread-form .form-group {
  margin-bottom: 16px;
}

.community-new-thread-form label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}

.community-new-thread-form input[type="text"],
.community-new-thread-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.9rem;
}

.community-new-thread-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* New inline action bar */
.new-thread-actionbar {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.new-thread-actionbar .toggle-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.new-thread-actionbar input[type="checkbox"] {
  width: auto;
}
/* Avatar preview (settings.php) */
.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 8px;
}
/* hard clamp avatar in settings card */
.card .form-group .avatar-preview {
  width: 64px !important;
  height: 64px !important;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}
/* community list avatars like forum
   (thread list rows that match thread.php look) */
.comm-thread-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Each community row = card */
.comm-thread-row {
  display: flex;
  align-items: stretch;          /* children full height */
  gap: 0;
  margin: 6px 0;
  padding: 0;                    /* padding handled inside columns */
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,0.16);
  background: var(--panel);
  box-shadow: 0 2px 6px rgba(15,23,42,0.06);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* kill dash-row bottom border for these */
.dash-section-body .comm-thread-row {
  border-bottom: none;
}

/* hover like a subtle card lift */
.dash-section-body .comm-thread-link:hover .comm-thread-row {
  box-shadow: 0 6px 18px rgba(15,23,42,0.16);
  transform: translateY(-1px);
}

/* DARK MODE card tweak */
body[data-theme="dark"] .comm-thread-row {
  border-color: rgba(15,23,42,0.75);
  background: rgba(15,23,42,0.96);
  box-shadow: 0 10px 25px rgba(0,0,0,0.7);
}

/* LEFT column – clone of .thread-post-left */
.comm-thread-avatar-wrap {
  flex: 0 0 95px;                /* same width as thread-post-left */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 12px 0;
  background: rgba(15,23,42,0.05);
  transition: background .3s ease, box-shadow .3s ease;
}

/* light mode gradient clone */
body[data-theme="light"] .comm-thread-avatar-wrap {
  background: linear-gradient(
    180deg,
    rgba(99,102,241,0.08),
    rgba(6,182,212,0.05)
  );
  border-right: 1px solid rgba(148,163,184,0.12);
}
body[data-theme="light"] .dash-section-body .comm-thread-link:hover .comm-thread-avatar-wrap {
  background: linear-gradient(
    180deg,
    rgba(99,102,241,0.14),
    rgba(6,182,212,0.10)
  );
  box-shadow: 0 0 10px rgba(99,102,241,0.18);
}

/* dark mode gradient + glow (same feel as thread-post-left) */
body[data-theme="dark"] .comm-thread-avatar-wrap {
  background: linear-gradient(180deg,
    rgba(99,102,241,0.25),
    rgba(6,182,212,0.2)
  );
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.05);
}
body[data-theme="dark"] .dash-section-body .comm-thread-link:hover .comm-thread-avatar-wrap {
  background: linear-gradient(180deg,
    rgba(99,102,241,0.35),
    rgba(6,182,212,0.3)
  );
  box-shadow:
    0 0 10px rgba(99,102,241,0.4),
    inset 0 0 6px rgba(6,182,212,0.25);
}

/* avatar circle – clone of .thread-post-avatar */
.comm-thread-avatar,
.comm-thread-avatar--fallback {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  object-fit: cover;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

/* TEXT COLUMN (right side) */
.comm-thread-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 14px;
  margin: 0;
}

.comm-thread-title {
  font-weight: 500;
  line-height: 1.3;
  font-size: 1.25rem;
}
@media (max-width: 640px) {
  .comm-thread-title { font-size: 1.15rem; }
}

/* snippet under title */
.comm-thread-snippet {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 4px;
  max-height: 3.6em; /* ≈ 2 lines */
  overflow: hidden;
}
body[data-theme="dark"] .comm-thread-snippet {
  color: #cdd4e0;
}

/* scheduled pill */
.comm-scheduled-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.35);
  color: var(--text);
}
body[data-theme="dark"] .comm-scheduled-pill {
  background: rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.55);
  color: #ffffff;
}

/* right-most icon column (pin, admin icons) */
.comm-thread-row > div:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
}

/* DASHBOARD: Coming Soon cards */
.content-grid .card.coming-soon {
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

/* readable but disabled */
.content-grid .card.coming-soon .card-content {
  filter: blur(1.5px) grayscale(15%) !important;
  opacity: 0.9;
  transition: filter 0.25s ease, opacity 0.25s ease;
}

/* keep hover subtle (no 6px blur) */
.content-grid .card.coming-soon:hover .card-content {
  filter: blur(2px) grayscale(25%) !important;
  opacity: 0.85;
}

/* centered pill */
.content-grid .card.coming-soon .coming-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(144, 19, 254, 0.9);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 25px rgba(144, 19, 254, 0.5);
  z-index: 10;
  white-space: nowrap;
}
/* force coming soon overlay to win */
body[data-theme="dark"] .content-grid .card.coming-soon,
body[data-theme="light"] .content-grid .card.coming-soon {
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

body[data-theme="dark"] .content-grid .card.coming-soon .card-content,
body[data-theme="light"] .content-grid .card.coming-soon .card-content {
  filter: blur(1.5px) grayscale(15%) !important;
  opacity: 0.9;
  transition: filter 0.25s ease, opacity 0.25s ease;
}

body[data-theme="dark"] .content-grid .card.coming-soon:hover .card-content,
body[data-theme="light"] .content-grid .card.coming-soon:hover .card-content {
  filter: blur(2px) grayscale(25%) !important;
  opacity: 0.85;
}

body[data-theme="dark"] .content-grid .card.coming-soon .coming-overlay,
body[data-theme="light"] .content-grid .card.coming-soon .coming-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(144, 19, 254, 0.9);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 25px rgba(144, 19, 254, 0.5);
  z-index: 10;
  white-space: nowrap;
}
.tool-video {
  margin-bottom: 24px;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.1);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}
/* Replay nav (light + dark) */
body[data-theme="light"] .replay-nav,
body[data-theme="dark"] .replay-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 24px;
}

body[data-theme="light"] .replay-nav-left,
body[data-theme="dark"] .replay-nav-left,
body[data-theme="light"] .replay-nav-right,
body[data-theme="dark"] .replay-nav-right {
  display: flex;
  align-items: center;
}

/* mobile */
@media (max-width: 640px) {
  body[data-theme="light"] .replay-nav,
  body[data-theme="dark"] .replay-nav {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-theme="light"] .replay-nav a,
  body[data-theme="dark"] .replay-nav a {
    width: 100%;
    text-align: center;
  }

  body[data-theme="light"] .replay-nav-left,
  body[data-theme="dark"] .replay-nav-left,
  body[data-theme="light"] .replay-nav-right,
  body[data-theme="dark"] .replay-nav-right {
    justify-content: center;
  }
}
/* Mobile tweaks for community thread list */
@media (max-width: 640px) {
  /* let each row behave like a simple card */
  .dash-section-body .comm-thread-row {
    margin: 8px 0;
    border-radius: 10px;
    padding: 0;
    align-items: center;
  }

  /* hide the left avatar/gradient column on small screens */
  .dash-section-body .comm-thread-row .comm-thread-avatar-wrap {
    display: none;
  }

  /* give the text full width & comfy padding */
  .dash-section-body .comm-thread-row .comm-thread-body {
    padding: 10px 12px;
    margin: 0;
  }

  /* right-side icon column tighter */
  .dash-section-body .comm-thread-row > div:last-child {
    padding-right: 8px;
  }

  /* slightly smaller title on phones */
  .comm-thread-title {
    font-size: 1.05rem;
  }

  /* optional: tighten snippet a bit for mobile */
  .comm-thread-snippet {
    font-size: 0.9rem;
  }
}
