/* =========================================================
   FreeTrafficBlogger UI (Clean)
   - Light: Sneat-style
   - Dark: Midnight with orb
   - FORMS: One global system (raw inputs) — no conflicts
   ========================================================= */

/* ---------------------------------------------------------
   1) Theme Variables
   --------------------------------------------------------- */
:root {
  --bg: #f4f5fb;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --border: rgba(15,23,42,0.04);
  --text: #0f172a;
  --muted: #6c6c6c;

  --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;
}

/* Light */
body[data-theme="light"] {
  --bg: #f4f5fb;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --border: rgba(15,23,42,0.04);
  --text: #0f172a;
  --muted: #6c6c6c;

  --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;
}

/* 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;
}

/* ---------------------------------------------------------
   2) Base / Reset
   --------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.45 "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; }

/* ---------------------------------------------------------
   3) Dark orb background (dark only)
   --------------------------------------------------------- */
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; }
}

/* ---------------------------------------------------------
   4) 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);
}

/* Make Menu button match avatar pill size */
.icon-btn.top-menu-trigger {
  height: 42px;
  padding: 0 16px;
  font-size: 0.95rem;
  font-weight: 200;
  border-radius: 999px;
}

/* 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; }

/* ---------------------------------------------------------
   5) 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;
}

/* ---------------------------------------------------------
   6) 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;
}

.page-title {
  margin-top: 4px;
  margin-bottom: 10px;
}

/* Full height helpers for pages */
.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;
  min-height: 0;

}
.page-card .label {
  font-size: 18px;
  line-height: 1.45;
  font-weight: 700;
  margin-bottom: 10px;
}
/* ---------------------------------------------------------
   Page sections (Add / Existing / etc)
   --------------------------------------------------------- */
.page-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.page-section-title {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
}

.page-section-desc {
  margin: 0;
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Optional full-screen editor pages */
.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);
}

/* ---------------------------------------------------------
   7) Cards & Panels
   --------------------------------------------------------- */
.card,
.panel {
  --pad: 36px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
  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);
}

@media (max-width: 640px){
  .card, .panel { --pad: 18px; }
}

.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)); }

/* ---------------------------------------------------------
   8) Buttons
   --------------------------------------------------------- */
@keyframes btnBreath {
  0%, 100% { opacity: .30; }
  50%      { opacity: .65; }
}

@keyframes btnShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Primary Button — Black base with subtle breathing glow */
.btn {
  position: relative;
  overflow: hidden;

  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;

  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;

  color: rgba(255,255,255,.92);
  background: #05060a;
  border: 1px solid rgba(255,255,255,.12);

  box-shadow:
    0 10px 30px rgba(0,0,0,.30),
    inset 0 1px 0 rgba(255,255,255,.06);

  transition:
    transform .15s ease,
    box-shadow .15s ease,
    filter .15s ease,
    border-color .15s ease;
}

/* breathing inner glow */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    120% 120% at 50% 0%,
    rgba(255,255,255,.12),
    rgba(255,255,255,0) 60%
  );
  opacity: .35;
  animation: btnBreath 4.5s ease-in-out infinite;
  pointer-events: none;
}

/* hover */
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  border-color: rgba(255,255,255,.18);
  box-shadow:
    0 14px 40px rgba(0,0,0,.38),
    inset 0 1px 0 rgba(255,255,255,.08);
}

/* active */
.btn:active {
  transform: translateY(0) scale(.985);
  filter: brightness(.98);
  box-shadow:
    0 8px 22px rgba(0,0,0,.32),
    inset 0 1px 0 rgba(255,255,255,.05);
}

/* keyboard focus */
.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(148,163,184,.35),
    0 10px 30px rgba(0,0,0,.35);
}

/* disabled */
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: grayscale(.2);
  animation: none;
}

/* accessibility */
@media (prefers-reduced-motion: reduce) {
  .btn::after { animation: none; opacity: .35; }
}

/* Dark mode button emphasis (submit-row) */
body[data-theme="dark"] .submit-row .btn {
  background: linear-gradient(
    110deg,
    #05060a 0%,
    #0b1020 25%,
    #111827 45%,
    #1f2937 55%,
    #070a12 75%,
    #05060a 100%
  );
  background-size: 300% 100%;
  animation: btnShift 7s ease-in-out infinite;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow:
    0 0 0 1px rgba(99,102,241,.25),
    0 14px 40px rgba(0,0,0,.55),
    inset 0 1px 0 rgba(255,255,255,.08);
}
body[data-theme="dark"] .submit-row .btn:hover {
  filter: brightness(1.12);
  box-shadow:
    0 0 0 1px rgba(99,102,241,.45),
    0 18px 55px rgba(0,0,0,.65),
    inset 0 1px 0 rgba(255,255,255,.10);
}

/* Light mode button emphasis */
body[data-theme="light"] .btn {
  background: linear-gradient(
    110deg,
    #05060a 0%,
    #0b1020 35%,
    #111827 55%,
    #070a12 75%,
    #05060a 100%
  );
  background-size: 260% 100%;
  animation: btnShift 9s ease-in-out infinite;
  border: 1px solid rgba(0,0,0,.10);
  color: rgba(255,255,255,.92);
}

/* ---------------------------------------------------------
   9) Common rows / pills / submit rows
   --------------------------------------------------------- */
.pills-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-start;
  width:100%;
  
}
/* Pull pills row closer to the page subtitle */
.page-card .pills-row {
  margin-top: -20px;  /* tweak: -6px to -14px */
}
.pill-note{
  display: inline-block;
  border-radius: 999px;
  font-size: .85rem;
  border: 1px solid rgba(148,163,184,.25);
  padding:4px 8px;
  line-height: 1;
}

.submit-row{
  display:flex;
  justify-content:center;
  width:100%;
}
.submit-row .btn{
  width:100%;
  flex: 1 1 100%;
}
/* Tighten spacing after pills row */

/* ---------------------------------------------------------
   10) Utilities
   --------------------------------------------------------- */
.muted { color: var(--muted); }

.ftb-subtle { color: var(--muted); font-size: 0.8rem; }
.ftb-brand { color: var(--brand); font-weight: 600; }

/* Tiny uppercase label (utility) */
.ftb-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.ftb-row { display: flex; align-items: center; gap: 10px; }
.ftb-divider { border-top: 1px solid rgba(15,23,42,0.05); margin: 12px 0; }

.ftb-mt-sm { margin-top: 8px; }
.ftb-mt-md { margin-top: 16px; }
.ftb-mt-lg { margin-top: 28px; }

.ftb-text-center { text-align: center; }
.ftb-text-right  { text-align: right; }

/* ---------------------------------------------------------
   11) FORMS (Single Source of Truth — GLOBAL RAW INPUTS)
   --------------------------------------------------------- */

/* Theme-friendly form tokens */
:root{
  --field-bg: rgba(148,163,184,.12);
  --field-border: rgba(148,163,184,.22);
  --field-text: var(--text);

  --field-ring: rgba(99,102,241,.18);
  --field-ring-border: rgba(99,102,241,.55);
}

body[data-theme="light"]{
  --field-bg: #f2f2f2;
  --field-border: rgba(0,0,0,.12);
  --field-text: #111827;

  --field-ring: rgba(79,70,229,.15);
  --field-ring-border: rgba(79,70,229,.55);
}

body[data-theme="dark"]{
  --field-bg: rgba(17,20,24,.72);
  --field-border: rgba(148,163,184,.18);
  --field-text: #e2e8f0;

  --field-ring: rgba(6,182,212,.18);
  --field-ring-border: rgba(6,182,212,.55);
}

/* Global default inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
textarea,
select{
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 1rem;
  box-sizing: border-box;

  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--field-text);

  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

/* textarea specifics */
textarea{
  min-height: 120px;
  resize: vertical;
  line-height: 1.45;
}

/* focus */
input:focus,
textarea:focus,
select:focus{
  outline: none;
  border-color: var(--field-ring-border);
  box-shadow: 0 0 0 3px var(--field-ring);
}

/* placeholder */
::placeholder{ color: rgba(148,163,184,.9); }
body[data-theme="light"] ::placeholder{ color: rgba(100,116,139,.9); }

/* disabled */
input:disabled,
textarea:disabled,
select:disabled{
  opacity: .65;
  cursor: not-allowed;
}

/* Optional: consistent form layout helpers (no input styling here) */
.ftb-form{
  display:flex;
  flex-direction:column;
  gap: 14px;
  width:100%;
}
.ftb-field{
  display:flex;
  flex-direction:column;
  gap: 8px;
  width:100%;
}
/* If you already used .ftb-label in forms, scope it to look like a form label */
.ftb-form .ftb-label{
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}
.ftb-help{
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

/* Checkbox inline (simple) */
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

/* Form grid 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;
}
.form-help {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 8px;
}

/* Submit row helper */
.ftb-submit-row{
  width:100%;
  padding: 0 10px;
  display:flex;
  justify-content:center;
}
.ftb-submit-row .btn{
  width:100%;
  max-width: 520px;
}

/* ---------------------------------------------------------
   12) 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;

}

.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; }

/* Wizard success */
.wizard-success {
  text-align: left;
  padding: 40px var(--pad-content);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.wizard-success ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0px;
}
.wizard-success li {
  margin: 6px 0;
  font-size: 1rem;
}
.wizard-subtitle {
  margin-top: 20px;
  color: var(--text);
  font-weight: 600;
}
.emoji-intro { font-size: 1.25rem; margin-bottom: 10px; }
.wizard-outro { margin-top: 25px; margin-bottom: 0px; font-size: 1.1rem; font-weight: 600; }
.wizard-success + .wizard-actions { margin-top: 4px; }

/* Info block / tip block (collapsible) */
.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;
}
.tip-block h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}
[data-theme="dark"] .tip-block {
  background: rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.25);
}
[data-theme="dark"] .tip-block h3 { color: #ffffff; }

.tip-block.is-collapsible {
  position: relative;
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 60px;
  transition: all 0.25s ease;
  padding-left: 20px;
}

.tip-block-toggle {
  background: transparent;
  border: none;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-size: 1.05rem;
  padding: 8px 0;
}

.tip-block-toggle::after { content: "▾"; font-size: 0.8rem; opacity: 0.75; }
.tip-block-toggle.open::after { content: "▴"; }

.tip-block-body {
  display: none;
  margin-top: 12px;
  width: 100%;
}
.tip-block-body.open { display: block; }

/* ---------------------------------------------------------
   13) Tables (basic)
   --------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148,163,184,0.2);
  text-align: left;
}

/* ---------------------------------------------------------
   14) 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;
}

/* ---------------------------------------------------------
   15) 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); } }

/* ---------------------------------------------------------
   16) 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;
}

/* ---------------------------------------------------------
   17) Reusable sections / lists
   --------------------------------------------------------- */
.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; }
}

/* Actions row (generic, not table-specific) */
.ftb-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------
   18) Modern table (reusable) — NO cards
   --------------------------------------------------------- */
.ftb-table-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148,163,184,.14);
  background: transparent;
}
.ftb-table-toolbar .left,
.ftb-table-toolbar .right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.ftb-table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ftb-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 780px;
}
.ftb-table thead th{
  text-align: left;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148,163,184,.14);
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 2;
}
.ftb-table tbody td{
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148,163,184,.10);
  vertical-align: middle;
}
.ftb-table tbody tr{ transition: background .12s ease; }
.ftb-table tbody tr:hover{ background: rgba(255,255,255,0.02); }
.ftb-table tbody tr:last-child td{ border-bottom: none; }

.ftb-cell-title{ font-weight: 800; line-height: 1.2; }
.ftb-cell-sub{
  margin-top: 4px;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.35;
}

.ftb-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .85rem;
  border: 1px solid rgba(148,163,184,.22);
  background: transparent;
  white-space: nowrap;
}
.ftb-badge.ok{ border-color: rgba(74,222,128,.35); }
.ftb-badge.warn{ border-color: rgba(251,191,36,.35); }
.ftb-badge.muted{ opacity: .75; }

.ftb-progress{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width: 170px;
}
.ftb-progress-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size:.9rem;
}
.ftb-bar{
  height: 8px;
  border-radius: 999px;
  background: rgba(148,163,184,.16);
  overflow:hidden;
}
.ftb-bar > span{
  display:block;
  height:100%;
  width: var(--pct, 0%);
  background: rgba(74,222,128,.65);
}

/* Table-specific actions (renamed to avoid conflict with .ftb-actions) */
.ftb-table-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
.ftb-icon-btn{
  border: 1px solid rgba(148,163,184,.22);
  background: transparent;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  line-height: 1;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.ftb-icon-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(148,163,184,.35);
  background: rgba(255,255,255,0.03);
}

/* Mobile: stacked rows (not cards) */
@media (max-width: 900px){
  .ftb-table{ min-width: 0; }
  .ftb-table thead{ display:none; }
  .ftb-table-wrap{ overflow-x: visible; }

  .ftb-table tbody tr{
    display:block;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148,163,184,.12);
    background: transparent;
    margin: 0;
    border-radius: 0;
  }
  .ftb-table tbody td{
    display:block;
    padding: 10px 0;
    border-bottom: 0;
  }
  .ftb-table tbody td[data-label="Keyword"]{ padding-top: 0; }

  .ftb-table tbody td:not([data-label="Keyword"])::before{
    content: attr(data-label);
    display:block;
    font-size:.75rem;
    letter-spacing:.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
  }

  .ftb-badge{ max-width: 100%; flex-wrap: wrap; }
  .ftb-progress{ min-width: 0; width: 100%; }
  .ftb-table-actions{ justify-content:flex-start; gap: 10px; }
  .ftb-icon-btn{ padding: 10px 12px; border-radius: 14px; }
}

/* ---------------------------------------------------------
   19) Setup "Start Here" page mobile tweaks
   --------------------------------------------------------- */
.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);
}

.setup-grid,
.grid-3 { gap: var(--gap-tiles); }

@media (max-width: 768px) {
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .grid-3 { grid-template-columns: 1fr; }

  .card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
  }

  section.grid-3 > div:empty { display: none; }
}

/* ---------------------------------------------------------
   20) 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; }
}

/* ---------------------------------------------------------
   21) 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);
  }
}
.page-subtitle{ color:var(--muted); font-size:.95rem; }
/* Pull pills row closer to the page subtitle */
.page-card .page-subtitle {
  margin-top: -10px;  /* tweak: -6px to -14px */
}

.section-sub{ margin:0; }
.ftb-mb-sm{ margin-bottom:8px; }

/* Domain settings helpers */
.domain-code code{
  font-size: 1rem;
}

.domain-steps{
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.6;
  font-size: .95rem;
}

/* Optional: if you don't already have these button variants */
.btn.btn-danger{
  background: rgba(239,68,68,.14);
  border: 1px solid rgba(239,68,68,.28);
}
.btn.btn-danger:hover{
  background: rgba(239,68,68,.20);
  border-color: rgba(239,68,68,.40);
}
/* Brand settings helpers */
.ftb-checkline{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin-top: 6px;
}

.ftb-list{
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.6;
}
/* Site Appearance help box (used in sectionDescription HTML) */
.appearance-help{
  margin: 0px;
  padding: 0px 0px;
  border-radius: 10px;
  border: 1px solid rgba(96,165,250,0.35);
  background: rgba(37,99,235,0.08);
  font-size: .92rem;
  color: var(--muted);
}

.appearance-help code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  font-size: .85rem;
  padding: 1px 4px;
  border-radius: 6px;
  background: rgba(15,23,42,0.55);
}

.appearance-help strong{
  color: var(--text);
}

.appearance-help-list{
  margin: 6px 0 0 18px;
  padding: 0;
}

/* Light mode tweaks (matches your previous inline overrides) */
body[data-theme="light"] .appearance-help{
  background: #eef2ff;
  border-color: rgba(99,102,241,0.25);
  color: #374151;
}

body[data-theme="light"] .appearance-help strong{
  color: #111827;
}

body[data-theme="light"] .appearance-help code{
  background: #e5e7eb;
  color: #111827;
}
