/* ===== Design Tokens ===== */
:root {
  --primary: #6657E8;
  --primary-dark: #4F46E5;
  --accent: #C869E8;
  --primary-tint: #EEF0FF;
  --bg: #F7F7FB;
  --surface: #FFFFFF;
  --surface-muted: #F1F2F6;
  --border: #E2E4EA;
  --text: #171827;
  --muted: #70758A;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #EF4444;
  --danger-dark: #DC2626;
  --info: #3B82F6;
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
}

/* ===== Base Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ===== Focus Visible ===== */
*:focus-visible {
  outline: 3px solid rgba(102, 87, 232, 0.25);
  outline-offset: 2px;
}

/* ===== Admin Shell ===== */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand-text .wordmark {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.sidebar-brand-text .tagline {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  line-height: 1;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 8px 8px 3px;
  margin-top: 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.1s, color 0.1s;
}

.sidebar-nav-item:hover {
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

.sidebar-nav-item.active {
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-create-btn {
  color: var(--primary);
  font-weight: 500;
}

.sidebar-create-btn:hover {
  background: var(--primary-tint);
  color: var(--primary);
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-footer-info { flex: 1; min-width: 0; }
.sidebar-footer-info .sidebar-user-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-signout-form { margin: 0; display: flex; flex-shrink: 0; }

.sidebar-signout-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.sidebar-signout-btn:hover { color: var(--danger); border-color: var(--danger); background: #FEF2F2; }

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.sidebar-plan-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 2px;
}

/* ===== Admin Content Area ===== */
.admin-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Topbar (both variants share base) ===== */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  z-index: 50;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Editor topbar specific */
.editor-topbar-back {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.editor-topbar-back:hover { color: var(--text); }

.editor-topbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
}

.editor-topbar-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.save-state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.save-state-dot.saved { background: var(--success); }
.save-state-dot.saving { background: var(--muted); }
.save-state-dot.unsaved { background: var(--warning); }
.save-state-dot.failed { background: var(--danger); }

/* ===== Usage Pill ===== */
.usage-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.usage-pill:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.usage-pill.warning { color: #92400E; border-color: var(--warning); }
.usage-pill.danger { color: var(--danger); border-color: var(--danger); }

.usage-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.usage-dot.warning { background: var(--warning); }
.usage-dot.danger { background: var(--danger); }

/* ===== Avatar + Dropdown ===== */
.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  border: none;
  position: relative;
  flex-shrink: 0;
}

.avatar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  padding: 6px;
  z-index: 200;
}

.avatar-dropdown-item {
  display: block;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.avatar-dropdown-item:hover { background: var(--bg); text-decoration: none; }
.avatar-dropdown-item.danger { color: var(--danger); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; text-decoration: none; }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg); text-decoration: none; }

.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text); text-decoration: none; }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-dark); color: #fff; text-decoration: none; }

.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-xs { padding: 3px 10px; font-size: 12px; }

/* ===== Page Content ===== */
.page-content {
  flex: 1;
  padding: 28px;
}

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-header-text h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.page-header-text .page-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* ===== Status Badges ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-published { background: #DCFCE7; color: #15803D; }
.badge-published .status-badge-dot { background: #16A34A; }
.badge-draft { background: #F3F4F6; color: #6B7280; }
.badge-expired { background: #FEF3C7; color: #92400E; }
.badge-expired .status-badge-dot { background: var(--warning); }
.badge-archived { background: #F1F2F6; color: #9CA3AF; }

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: 13.5px;
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toast-slide-in 0.2s ease;
}

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-info    .toast-icon { color: var(--info); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-error   .toast-icon { color: var(--danger); }

.toast-message { flex: 1; color: var(--text); }

.toast-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 18px;
  line-height: 1;
  font-family: inherit;
}

.toast-dismiss:hover { color: var(--text); }

/* ===== Confirmation Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.modal-body-text {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== Blazor Infrastructure (keep from scaffold) ===== */
#blazor-error-ui {
  background: lightyellow;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem;
  position: fixed;
  width: 100%;
  z-index: 1001;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

.blazor-error-boundary {
  background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbmsiPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
  padding: 1rem 1rem 1rem 3.7rem;
  color: white;
}

.blazor-error-boundary::after { content: "An error has occurred."; }

/* ===== Form elements (shared with auth pages) ===== */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* ===== Stat Cards ===== */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: box-shadow 0.15s, transform 0.15s;
}

.stat-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}

.stat-card-icon-tile {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.stat-card-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-card-progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.stat-card-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ===== Quick-Action Banner ===== */
.quick-action-banner {
  background: linear-gradient(135deg, #6657E8, #8B5CD6);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.quick-action-banner-text h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.quick-action-banner-text p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.btn-banner {
  background: #fff;
  color: var(--primary);
  border-color: transparent;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-banner:hover:not(:disabled) {
  background: #F9F8FF;
  color: var(--primary);
  text-decoration: none;
}

/* ===== Empty State ===== */
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--primary-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.empty-state h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.empty-state p {
  font-size: 14px;
  color: var(--muted);
  max-width: 420px;
  line-height: 1.6;
}

.empty-state-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

/* ===== Campaign Table ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.campaigns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.campaigns-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.campaigns-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.campaigns-table tr:last-child td { border-bottom: none; }
.campaigns-table tr:hover td { background: var(--bg); }

.campaign-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13.5px;
  white-space: nowrap;
}

.campaign-slug {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
  font-family: 'Menlo', 'Consolas', monospace;
}

.table-muted {
  color: var(--muted);
  font-size: 13px;
}

/* ===== Row Actions ===== */
.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.more-menu-wrapper {
  position: relative;
}

.more-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
}

.more-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  padding: 6px;
  z-index: 1000;
}

.more-menu-item {
  display: block;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.more-menu-item:hover { background: var(--bg); text-decoration: none; }
.more-menu-item.danger { color: var(--danger); }

.more-menu-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

/* ===== Filter Tabs ===== */
.filter-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  width: fit-content;
}

.filter-tab {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}

.filter-tab:hover { color: var(--text); background: rgba(0,0,0,0.04); }
.filter-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ===== Search Input ===== */
.search-input-wrapper {
  position: relative;
}

.search-input {
  height: 36px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  width: 240px;
  transition: border-color 0.15s;
}

.search-input:focus { outline: none; border-color: var(--primary); }
.search-input::placeholder { color: var(--muted); }

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* ===== List Toolbar ===== */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ===== Section heading row ===== */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.section-heading-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}

.section-heading-link:hover { text-decoration: underline; }

/* ===== Form inputs (global) ===== */
input[type=text], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
}
input[type=text]:focus, input[type=date]:focus, input[type=time]:focus,
input[type=number]:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102,87,232,0.1);
}
label { font-size: 12.5px; font-weight: 500; color: var(--text); display: block; margin-bottom: 4px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.req { color: var(--danger); }

/* ===== Editor layout ===== */
.editor-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding: 24px;
  gap: 20px;
  min-height: calc(100vh - var(--topbar-h));
}
.editor-left {
  flex: 0 0 58%;
  max-width: 58%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.editor-right {
  flex: 0 0 calc(42% - 20px);
  max-width: calc(42% - 20px);
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== Accordion ===== */
.accordion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
}
.accordion-header:hover { background: #FAFAFA; }
.accordion-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.accordion-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.accordion-num.opt { background: #F3F4F6; color: var(--muted); }
.accordion-title-group { min-width: 0; flex: 1; }
.accordion-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.accordion-summary {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.accordion-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.accordion-chevron { color: var(--muted); transition: transform 0.2s; }
.accordion-open .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
}

/* Accordion locked state */
.accordion-locked .accordion-header { cursor: not-allowed; opacity: 0.5; }
.accordion-locked .accordion-header:hover { background: var(--surface); }
.status-icon-lock { color: var(--muted); flex-shrink: 0; }

/* Accordion completion indicators */
.status-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.status-icon.complete { background: #DCFCE7; }
.status-optional {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: #F3F4F6;
  padding: 2px 7px;
  border-radius: 20px;
}

/* ===== Form grid ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; }
.field.full { grid-column: 1 / -1; }

/* ===== Image upload ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  margin-top: 16px;
  transition: border-color 0.15s, background 0.15s;
}
.upload-area:hover { border-color: var(--primary); background: #F9F8FF; }
.upload-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}
.upload-area h4 { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-area p { font-size: 12px; color: var(--muted); }
.uploaded-file {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 16px;
}
.uploaded-thumb {
  width: 64px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: #1a1a2e;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.uploaded-thumb img { width: 100%; height: 100%; object-fit: cover; }
.uploaded-meta { flex: 1; min-width: 0; }
.uploaded-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uploaded-dims { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.uploaded-actions { display: flex; gap: 6px; flex-shrink: 0; }
.file-btn {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.file-btn:hover { border-color: var(--primary); color: var(--primary); }
.file-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.upload-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
}

/* ===== Format cards ===== */
.format-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.format-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.format-card:hover { border-color: #c5c8d8; }
.format-card.selected { border-color: var(--primary); background: #F9F8FF; }
.format-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}
.format-label { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.format-hint { font-size: 11.5px; color: var(--muted); }

/* ===== Mode cards (expired state) ===== */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.mode-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.mode-card:hover { border-color: #c5c8d8; }
.mode-card.selected { border-color: var(--primary); background: #F9F8FF; }
.mode-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}
.mode-card.selected .mode-card-icon { background: #DDD9FC; }
.mode-card-label { font-size: 12px; font-weight: 600; color: var(--text); }
.mode-card-hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mode-fields { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.mode-fields-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.mode-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 12.5px;
  color: #78350F;
  line-height: 1.5;
}

/* ===== Shadow chips ===== */
.shadow-presets { display: flex; gap: 8px; margin-top: 8px; }
.shadow-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  cursor: pointer;
  color: var(--muted);
  background: none;
  font-family: inherit;
}
.shadow-chip.selected {
  border-color: var(--primary);
  color: var(--primary);
  background: #F9F8FF;
  font-weight: 600;
}

/* ===== Color input ===== */
.color-input-row { display: flex; gap: 8px; align-items: center; margin-top: 5px; }
.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  background: none;
}
.color-swatch input[type=color] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.color-input-row input[type=text] { flex: 1; max-width: 140px; }

/* ===== Anchor grid ===== */
.anchor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 120px;
}
.anchor-btn {
  aspect-ratio: 1;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  font-family: inherit;
}
.anchor-btn.active { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); }

/* ===== Toggle ===== */
.toggle-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.toggle-label { font-size: 13px; font-weight: 500; color: var(--text); }

/* ===== Section separator ===== */
.section-sep { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ===== Preview panel ===== */
.preview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.preview-tabs { display: flex; border-bottom: 1px solid var(--border); }
.preview-tab {
  flex: 1;
  padding: 11px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.preview-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.preview-area {
  background: #1a1a2e;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1200 / 628;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.preview-placeholder {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 16px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  line-height: 1.6;
}
.preview-hint {
  font-size: 11px;
  color: var(--muted);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  gap: 8px;
}
.preview-actions { display: flex; gap: 6px; flex-shrink: 0; }
.preview-btn {
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.preview-btn:hover { border-color: var(--primary); color: var(--primary); }
.preview-btn:disabled { opacity: 0.4; cursor: default; }
.preview-btn--disabled { opacity: 0.4; cursor: not-allowed; }

/* Preview spinner overlay */
.preview-spinner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 50, 0.5);
  z-index: 2;
}

.preview-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: preview-spin 0.65s linear infinite;
}

@keyframes preview-spin { to { transform: rotate(360deg); } }

.preview-image { transition: opacity 0.2s ease; }
.preview-image-loading { opacity: 0.15; }

/* ===== Segment Builder (countdown format) ===== */
.segment-builder { }

.section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 8px;
}

.format-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.format-preset {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 8px 14px;
  cursor: pointer;
  text-align: center;
  min-width: 88px;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
}
.format-preset.active { border-color: var(--primary); background: #F9F8FF; }
.format-preset:hover  { border-color: #c5c8d8; }
.format-preset.active:hover { border-color: var(--primary); }
.preset-output { font-size: 13px; font-weight: 700; color: var(--text); font-family: monospace; }
.preset-name   { font-size: 10px; color: var(--muted); margin-top: 3px; }
.format-preset.active .preset-name { color: var(--primary); }

.or-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 12px 0;
}
.or-divider::before,.or-divider::after { content:''; flex:1; height:1px; background: var(--border); }

.seg-builder-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.seg-builder-header {
  display: grid;
  grid-template-columns: 22px 100px 1fr 180px;
  gap: 10px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted);
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.seg-row {
  display: grid;
  grid-template-columns: 22px 100px 1fr 180px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.seg-row:last-of-type { border-bottom: none; }
.seg-check { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.seg-unit-name { font-size: 12px; font-weight: 600; color: var(--text); }
.seg-unit-name.seg-unit-off { color: var(--muted); }
.seg-unit-hint { font-size: 10px; color: var(--muted); margin-top: 2px; }
.seg-label-input {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 5px; padding: 5px 8px;
  color: var(--text); font-size: 12px; font-family: inherit;
  width: 100%; box-sizing: border-box;
  outline: none; transition: border-color 0.15s;
}
.seg-label-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102,87,232,0.1); }
.seg-label-input.seg-input-off { opacity: 0.4; }
.sep-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.sep-chips.sep-chips-off { opacity: 0.4; pointer-events: none; }
.sep-chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 4px; padding: 4px 8px;
  font-size: 11px; color: var(--muted);
  cursor: pointer; font-family: monospace;
  transition: border-color 0.1s, color 0.1s, background 0.1s;
}
.sep-chip:hover { border-color: #c5c8d8; color: var(--text); }
.sep-chip.active { border-color: var(--primary); color: var(--primary); background: #F9F8FF; }
.sep-chip:disabled { opacity: 0.3; cursor: default; }
.sep-custom {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 4px; padding: 4px 6px;
  color: var(--text); font-size: 11px; width: 56px;
  font-family: monospace; outline: none; transition: border-color 0.15s;
}
.sep-custom:focus { border-color: var(--primary); }
.sep-last { font-size: 12px; color: var(--muted); }
.seg-preview-bar {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.seg-preview-label {
  font-size: 10px; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
}
.seg-preview-value {
  font-size: 22px; font-weight: 700;
  color: var(--text); font-family: monospace; letter-spacing: 0.04em;
}

/* ===== Side panels (publish + embed) ===== */
.side-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.panel-body { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-bottom: 14px; }
.badge-green { background: #DCFCE7; color: #15803D; }
.badge-grey  { background: #F3F4F6; color: #6B7280; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.validation-list {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #78350F;
}
.validation-list p { font-weight: 600; margin-bottom: 6px; }
.validation-list ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.validation-list li::before { content: '⚠ '; }
.btn-full { width: 100%; justify-content: center; }

/* Embed panel */
.embed-locked { text-align: center; padding: 20px; }
.embed-locked p { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.embed-block { margin-bottom: 14px; }
.embed-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.code-row { display: flex; align-items: center; gap: 7px; }
.code-box {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 11px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.copy-btn {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  flex-shrink: 0;
}
.copy-btn:hover { border-color: var(--primary); color: var(--primary); }
.copy-btn.copied { border-color: var(--success); color: var(--success); background: #F0FDF4; }
.embed-open-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 500;
  margin-top: 4px;
  text-decoration: none;
}
.embed-open-link:hover { text-decoration: underline; }

/* ===== Auth Layout ===== */

.auth-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #6675E8 0%, #8B5CD6 45%, #D873E8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.15);
}

.auth-blob-1 { width: 420px; height: 420px; top: -140px; right: -100px; }
.auth-blob-2 { width: 320px; height: 320px; bottom: -100px; left: -80px; }

.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
}

.auth-logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-logo-tile {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #6657E8, #C869E8);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.auth-wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  color: #171827;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.auth-tagline {
  font-size: 0.625rem;
  font-weight: 500;
  color: #70758A;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 3px;
}

.auth-divider-accent {
  height: 3px;
  background: linear-gradient(90deg, #6657E8, #C869E8);
  border-radius: 2px;
  margin-bottom: 1.75rem;
}

.auth-heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: #171827;
  margin-bottom: 0.25rem;
}

.auth-subheading {
  font-size: 0.8125rem;
  color: #70758A;
  margin-bottom: 1.25rem;
}

.auth-field { margin-bottom: 1rem; }

.auth-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #171827;
  margin-bottom: 0.375rem;
}

.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
}

.auth-input {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: #fff;
  border: 1.5px solid #D8DBE5;
  border-radius: 10px;
  font-size: 0.875rem;
  font-family: inherit;
  color: #171827;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.auth-input::placeholder { color: #8A8FA3; }

.auth-input:focus {
  border-color: #6657E8;
  box-shadow: 0 0 0 3px rgba(102, 87, 232, 0.12);
}

.auth-error {
  display: block;
  font-size: 0.75rem;
  color: #EF4444;
  margin-top: 0.3rem;
}

.auth-validation-summary {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: #EF4444;
  list-style: none;
}

/* StatusMessage .alert overrides inside auth card */
.auth-card .alert {
  border-radius: 8px;
  font-size: 0.8125rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-width: 1px;
  border-style: solid;
}
.auth-card .alert-danger  { background: #FEF2F2; color: #EF4444; border-color: #FECACA; }
.auth-card .alert-success { background: #F0FDF4; color: #16A34A; border-color: #BBF7D0; }
.auth-card .alert-info    { background: #EFF6FF; color: #3B82F6; border-color: #BFDBFE; }

.auth-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.auth-checkbox {
  width: 15px;
  height: 15px;
  accent-color: #6657E8;
  cursor: pointer;
  flex-shrink: 0;
}

.auth-checkbox-label { font-size: 0.8125rem; color: #70758A; cursor: pointer; }

.auth-btn-primary {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: #6657E8;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease;
  line-height: 1.4;
}

.auth-btn-primary:hover { background: #4F46E5; color: #fff; }

.auth-btn-secondary {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: #fff;
  color: #171827;
  border: 1.5px solid #E2E4EA;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s ease;
  line-height: 1.4;
}

.auth-btn-secondary:hover { border-color: #6657E8; color: #6657E8; }

.auth-btn-link {
  background: none;
  border: none;
  color: #6657E8;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}

.auth-btn-link:hover { text-decoration: underline; color: #4F46E5; }

.auth-separator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: #70758A;
  font-size: 0.8125rem;
}

.auth-separator::before,
.auth-separator::after { content: ''; flex: 1; height: 1px; background: #E2E4EA; }

.auth-link {
  color: #6657E8;
  font-size: 0.8125rem;
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover { color: #4F46E5; text-decoration: underline; }

.auth-link-small { color: #6657E8; font-size: 0.75rem; text-decoration: none; }
.auth-link-small:hover { text-decoration: underline; color: #4F46E5; }

.auth-footer {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #E2E4EA;
}

.auth-info-text {
  font-size: 0.875rem;
  color: #70758A;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.auth-icon-block {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.auth-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-icon-success { background: #F0FDF4; color: #16A34A; }
.auth-icon-error   { background: #FEF2F2; color: #EF4444; }
.auth-icon-danger  { background: #FEF2F2; color: #EF4444; }
.auth-icon-warning { background: #FFFBEB; color: #F59E0B; }

.auth-center { text-align: center; }

@media (max-width: 480px) {
  .auth-card { padding: 2rem 1.5rem; border-radius: 16px; }
}

/* ===== Homepage (hp-* prefix) ===== */
/* Reset all theme variables to light values — the home page is always light mode */
.home-page {
  --bg: #F7F7FB;
  --surface: #FFFFFF;
  --surface-muted: #F1F2F6;
  --border: #E2E4EA;
  --text: #171827;
  --muted: #70758A;
  --primary: #6657E8;
  --primary-dark: #4F46E5;
  --primary-tint: #EEF0FF;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: #fff;
  overflow-x: hidden;
}

/* NAV */
.hp-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 2.5rem;
  height: 64px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.hp-nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.hp-nav-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hp-nav-wordmark { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.hp-nav-links { display: flex; align-items: center; gap: 1.75rem; flex: 1; justify-content: center; }
.hp-nav-links a { font-size: .875rem; color: var(--muted); text-decoration: none; font-weight: 500; }
.hp-nav-links a:hover { color: var(--text); }
.hp-nav-actions { display: flex; align-items: center; gap: .75rem; }
.hp-btn-ghost { font-size: .875rem; color: var(--muted); text-decoration: none; font-weight: 500; padding: .45rem .9rem; border-radius: 8px; }
.hp-btn-ghost:hover { color: var(--text); background: var(--bg); }
.hp-btn-nav-primary {
  font-size: .875rem; font-weight: 600; text-decoration: none;
  padding: .45rem 1.1rem;
  background: var(--primary); color: #fff;
  border-radius: 8px;
}
.hp-btn-nav-primary:hover { background: var(--primary-dark); }

/* SECTIONS */
.hp-section { padding: 6rem 0; }
.hp-section-inner { max-width: 1120px; margin: 0 auto; padding: 0 2rem; }
.hp-section-label {
  display: inline-block;
  font-size: .75rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-tint);
  padding: .3rem .75rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}
.hp-section-h2 {
  font-size: 2.25rem; font-weight: 800; line-height: 1.2;
  color: var(--text);
  margin-bottom: 1rem;
}
.hp-section-sub {
  font-size: 1.05rem; color: var(--muted); line-height: 1.7;
  max-width: 640px;
  margin-bottom: 3rem;
}

/* HERO */
.hp-hero {
  background: linear-gradient(135deg, #F4F3FF 0%, #FAF5FF 50%, #F0F9FF 100%);
  padding: 5rem 0 6rem;
}
.hp-hero-inner { max-width: 1120px; margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; gap: 4rem; }
.hp-hero-content { flex: 1; max-width: 520px; }
.hp-hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .75rem; font-weight: 600;
  color: var(--primary); background: white;
  border: 1px solid var(--border);
  padding: .35rem .85rem; border-radius: 20px;
  margin-bottom: 1.5rem;
}
.hp-badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  animation: hp-pulse 2s ease-in-out infinite;
}
.hp-hero-h1 { font-size: 3rem; font-weight: 800; line-height: 1.1; color: var(--text); margin-bottom: 1.25rem; }
.hp-hero-sub { font-size: 1.1rem; color: var(--muted); line-height: 1.7; margin-bottom: .75rem; }
.hp-hero-outcome { font-size: 1rem; color: var(--text); font-weight: 500; margin-bottom: .75rem; }
.hp-hero-trust { font-size: .85rem; color: var(--muted); margin-bottom: 2rem; }
.hp-hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }
.hp-btn-hero-primary {
  font-size: 1rem; font-weight: 600; text-decoration: none;
  padding: .85rem 1.75rem;
  background: var(--primary); color: #fff;
  border-radius: 10px;
}
.hp-btn-hero-primary:hover { background: var(--primary-dark); }
.hp-btn-hero-secondary {
  font-size: 1rem; font-weight: 500; text-decoration: none;
  padding: .85rem 1.75rem;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: white;
}
.hp-btn-hero-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* HERO VISUAL */
.hp-hero-visual { flex: 1; display: flex; gap: 1.25rem; align-items: flex-start; }
.hp-mock-email {
  flex: 1;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
}
.hp-mock-email-bar { display: flex; gap: 6px; padding: .65rem 1rem; background: #f5f5f5; border-bottom: 1px solid var(--border); }
.hp-mock-dot { width: 10px; height: 10px; border-radius: 50%; }
.hp-mock-email-header { padding: 1rem 1.25rem .75rem; border-bottom: 1px solid #f0f0f0; }
.hp-mock-email-sub { font-size: .7rem; color: var(--muted); margin-bottom: .3rem; }
.hp-mock-email-title { font-size: .9rem; font-weight: 600; color: var(--text); }
.hp-mock-email-body { padding: 1rem 1.25rem 1.25rem; font-size: .8rem; color: var(--muted); }
.hp-mock-email-body p { margin-bottom: .75rem; line-height: 1.5; }
.hp-mock-countdown { background: #0f172a; border-radius: 10px; padding: .9rem 1rem; text-align: center; margin-bottom: .75rem; }
.hp-mock-cd-label { font-size: .55rem; font-weight: 700; letter-spacing: .1em; color: rgba(255,255,255,.5); margin-bottom: .5rem; }
.hp-mock-cd-digits { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.hp-mock-digit { text-align: center; }
.hp-mock-digit-num { font-size: 1.5rem; font-weight: 800; color: #fff; line-height: 1; }
.hp-mock-digit-lbl { font-size: .5rem; color: rgba(255,255,255,.45); text-transform: uppercase; margin-top: 2px; }
.hp-mock-digit-sep { font-size: 1.2rem; font-weight: 700; color: rgba(255,255,255,.4); padding-bottom: 12px; }
.hp-mock-shop-btn { background: var(--primary); color: #fff; text-align: center; padding: .5rem; border-radius: 6px; font-size: .75rem; font-weight: 600; }
.hp-mock-builder {
  width: 190px; flex-shrink: 0;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1rem 1.1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.hp-mock-builder-title { font-size: .75rem; font-weight: 700; color: var(--text); margin-bottom: .85rem; }
.hp-mock-field { margin-bottom: .6rem; }
.hp-mock-field label { display: block; font-size: .6rem; color: var(--muted); margin-bottom: 2px; }
.hp-mock-field-val { font-size: .7rem; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: .25rem .45rem; }
.hp-mock-copy-btn { margin-top: 1rem; background: var(--primary); color: #fff; text-align: center; padding: .4rem; border-radius: 6px; font-size: .65rem; font-weight: 600; cursor: pointer; }

/* PROBLEM GRID */
.hp-problem { background: var(--bg); }
.hp-problem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.hp-problem-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
}
.hp-problem-card h3 { font-size: 1rem; font-weight: 600; margin: .85rem 0 .5rem; color: var(--text); }
.hp-problem-card p { font-size: .9rem; color: var(--muted); line-height: 1.6; }
.hp-problem-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.hp-icon-red { background: #FEF2F2; color: #EF4444; }
.hp-icon-amber { background: #FFFBEB; color: #F59E0B; }
.hp-icon-blue { background: #EFF6FF; color: #3B82F6; }

/* HOW IT WORKS */
.hp-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  position: relative;
}
.hp-steps::before {
  content: '';
  position: absolute;
  top: 22px;
  left: calc(12.5% + 1rem);
  right: calc(12.5% + 1rem);
  height: 2px;
  background: linear-gradient(to right, var(--primary), var(--accent));
  z-index: 0;
}
.hp-step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  position: relative;
  z-index: 1;
}
.hp-step-num {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1rem; font-weight: 800;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.hp-step h3 { font-size: .95rem; font-weight: 600; color: var(--text); margin-bottom: .5rem; }
.hp-step p { font-size: .85rem; color: var(--muted); line-height: 1.6; }

/* DEMO */
.hp-demo { background: var(--bg); }
.hp-demo-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.hp-demo-countdown {
  background: #0f172a;
  border-radius: 18px;
  padding: 3rem 2.5rem;
  text-align: center;
}
.hp-demo-cd-label { font-size: .75rem; font-weight: 700; letter-spacing: .12em; color: rgba(255,255,255,.5); margin-bottom: 1.5rem; }
.hp-demo-cd-row { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1.5rem; }
.hp-demo-cd-unit { text-align: center; }
.hp-demo-cd-num {
  font-size: 4rem; font-weight: 800; color: #fff; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hp-demo-cd-unit-lbl { font-size: .7rem; color: rgba(255,255,255,.45); text-transform: uppercase; margin-top: .35rem; letter-spacing: .08em; }
.hp-demo-cd-sep { font-size: 3rem; font-weight: 700; color: rgba(255,255,255,.25); padding-bottom: 1.5rem; }
.hp-demo-live-badge { display: inline-flex; align-items: center; gap: .5rem; font-size: .75rem; color: rgba(255,255,255,.4); }
.hp-demo-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); animation: hp-pulse 2s ease-in-out infinite; }
.hp-demo-copy-label { font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .75rem; }
.hp-demo-code {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: .8rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  overflow-x: auto;
}
.hp-tag { color: #7dd3fc; }
.hp-attr { color: #86efac; }
.hp-val { color: #fca5a5; }
.hp-demo-caption { font-size: .9rem; color: var(--muted); line-height: 1.7; }

/* USE CASES */
.hp-usecase-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.hp-usecase-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}
.hp-usecase-icon {
  width: 38px; height: 38px;
  background: var(--primary-tint);
  color: var(--primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .85rem;
}
.hp-usecase-card h3 { font-size: .95rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.hp-usecase-card p { font-size: .85rem; color: var(--muted); line-height: 1.6; }

/* FEATURES */
.hp-features { background: var(--bg); }
.hp-features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.hp-feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.1rem;
  display: flex; align-items: center; gap: .75rem;
}
.hp-feature-check {
  width: 26px; height: 26px; flex-shrink: 0;
  background: #F0FDF4; color: var(--success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.hp-feature-card h3 { font-size: .85rem; font-weight: 500; color: var(--text); line-height: 1.35; }

/* COMPARISON */
.hp-comp-table {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 2rem;
}
.hp-comp-row { display: grid; grid-template-columns: 2fr 1.5fr 1.5fr; }
.hp-comp-row + .hp-comp-row { border-top: 1px solid var(--border); }
.hp-comp-header { background: var(--bg); }
.hp-comp-cell { padding: .9rem 1.25rem; font-size: .875rem; color: var(--text); }
.hp-comp-header .hp-comp-cell { font-weight: 600; font-size: .8rem; color: var(--muted); }
.hp-good { color: var(--success); font-weight: 500; }
.hp-bad { color: var(--danger); }

/* SEO */
.hp-seo { background: var(--bg); }
.hp-seo-copy { font-size: .9rem; color: var(--muted); line-height: 1.75; margin-bottom: 2rem; max-width: 720px; }
.hp-seo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.hp-seo-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}
.hp-seo-card h3 { font-size: .95rem; font-weight: 600; color: var(--text); margin-bottom: .5rem; }
.hp-seo-card p { font-size: .875rem; color: var(--muted); line-height: 1.65; }

/* PRICING */
.hp-pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; align-items: start; }
.hp-pricing-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  position: relative;
}
.hp-pricing-featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(102,87,232,.08);
}
.hp-pricing-pill {
  position: absolute;
  top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff;
  font-size: .7rem; font-weight: 600;
  padding: .25rem .75rem;
  border-radius: 20px;
  white-space: nowrap;
}
.hp-pricing-tier { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: .5rem; }
.hp-pricing-price { font-size: 2rem; font-weight: 800; color: var(--text); margin-bottom: .25rem; }
.hp-price-note { font-size: .75rem; color: var(--muted); margin-bottom: 1rem; }
.hp-pricing-card p { font-size: .875rem; color: var(--muted); line-height: 1.65; margin-bottom: 1.5rem; }
.hp-btn-pricing {
  display: block; text-align: center; text-decoration: none;
  font-size: .875rem; font-weight: 600;
  padding: .7rem;
  border-radius: 9px;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.hp-pricing-featured .hp-btn-pricing { background: var(--primary); color: #fff; }
.hp-btn-pricing:hover { background: var(--primary); color: #fff; }

/* FINAL CTA */
.hp-final-cta {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 6rem 2rem;
  text-align: center;
}
.hp-final-cta-inner { max-width: 640px; margin: 0 auto; }
.hp-final-cta h2 { font-size: 2.25rem; font-weight: 800; color: #fff; margin-bottom: 1rem; }
.hp-final-cta p { font-size: 1.05rem; color: rgba(255,255,255,.8); line-height: 1.7; margin-bottom: 2rem; }
.hp-final-cta-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hp-final-cta .hp-btn-hero-primary { background: #fff; color: var(--primary); }
.hp-final-cta .hp-btn-hero-primary:hover { background: rgba(255,255,255,.9); }
.hp-final-cta .hp-btn-hero-secondary { border-color: rgba(255,255,255,.4); color: #fff; background: transparent; }
.hp-final-cta .hp-btn-hero-secondary:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.7); }

/* FOOTER */
.hp-footer { background: #0f172a; padding: 4rem 0 2rem; }
.hp-footer-inner { max-width: 1120px; margin: 0 auto; padding: 0 2rem; }
.hp-footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.hp-footer-brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .75rem;
}
.hp-footer-brand-name { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: .4rem; }
.hp-footer-tagline { font-size: .8rem; color: rgba(255,255,255,.4); line-height: 1.6; max-width: 200px; }
.hp-footer-col h4 { font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 1rem; }
.hp-footer-col ul { list-style: none; padding: 0; margin: 0; }
.hp-footer-col ul li { margin-bottom: .6rem; }
.hp-footer-col ul li a { font-size: .85rem; color: rgba(255,255,255,.45); text-decoration: none; }
.hp-footer-col ul li a:hover { color: rgba(255,255,255,.8); }
.hp-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.hp-footer-copy { font-size: .8rem; color: rgba(255,255,255,.3); }
.hp-footer-legal { display: flex; gap: 1.5rem; }
.hp-footer-legal a { font-size: .8rem; color: rgba(255,255,255,.3); text-decoration: none; }
.hp-footer-legal a:hover { color: rgba(255,255,255,.6); }

/* ANIMATION */
@keyframes hp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .hp-hero-inner { flex-direction: column; gap: 2.5rem; }
  .hp-hero-content { max-width: 100%; }
  .hp-hero-h1 { font-size: 2.25rem; }
  .hp-steps { grid-template-columns: repeat(2, 1fr); }
  .hp-steps::before { display: none; }
  .hp-features-grid { grid-template-columns: repeat(2, 1fr); }
  .hp-footer-top { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}

@media (max-width: 768px) {
  .hp-nav { padding: 0 1.25rem; }
  .hp-nav-links { display: none; }
  .hp-section { padding: 4rem 0; }
  .hp-section-h2 { font-size: 1.75rem; }
  .hp-problem-grid { grid-template-columns: 1fr; }
  .hp-steps { grid-template-columns: 1fr; }
  .hp-demo-visual { grid-template-columns: 1fr; gap: 2rem; }
  .hp-usecase-grid { grid-template-columns: repeat(2, 1fr); }
  .hp-features-grid { grid-template-columns: 1fr 1fr; }
  .hp-pricing-grid { grid-template-columns: 1fr; }
  .hp-seo-grid { grid-template-columns: 1fr; }
  .hp-comp-row { grid-template-columns: 1fr 1fr 1fr; }
  .hp-footer-top { grid-template-columns: 1fr 1fr; }
  .hp-hero-visual { flex-direction: column; }
  .hp-mock-builder { width: 100%; }
}

@media (max-width: 480px) {
  .hp-hero-h1 { font-size: 1.75rem; }
  .hp-hero-btns { flex-direction: column; }
  .hp-usecase-grid { grid-template-columns: 1fr; }
  .hp-features-grid { grid-template-columns: 1fr; }
  .hp-comp-row { grid-template-columns: 1fr; }
  .hp-comp-header { display: none; }
  .hp-footer-top { grid-template-columns: 1fr; }
  .hp-final-cta h2 { font-size: 1.6rem; }
  .hp-demo-cd-num { font-size: 2.75rem; }
}

/* ===== Account & Settings Pages ===== */

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
}
.account-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.account-info-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--surface-muted);
}
.account-info-row:last-child { border-bottom: none; }
.account-info-label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
  min-width: 120px;
}
.account-info-value { font-size: .875rem; color: var(--text); }
.account-plan-badge {
  display: inline-flex;
  align-items: center;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--primary-tint);
  color: var(--primary);
  padding: .25rem .65rem;
  border-radius: 20px;
  border: 1px solid rgba(102,87,232,.2);
}
.account-usage-item { }
.account-usage-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: .45rem;
}
.account-usage-label { font-size: .875rem; color: var(--text); font-weight: 500; }
.account-usage-count { font-size: .8rem; color: var(--muted); }
.account-usage-track {
  height: 8px;
  background: var(--surface-muted);
  border-radius: 99px;
  overflow: hidden;
}
.account-usage-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width .3s ease;
}
.account-usage-fill.warning { background: var(--warning); }
.account-usage-fill.danger  { background: var(--danger); }
.account-usage-note {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .4rem;
}
.account-plan-current {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.account-plan-tagline { font-size: .85rem; color: var(--muted); line-height: 1.6; }
.account-upgrade-notice {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: var(--radius-md);
  padding: .85rem 1rem;
  font-size: .875rem;
  color: #0369A1;
  line-height: 1.6;
}
.account-upgrade-notice svg { flex-shrink: 0; margin-top: 2px; }

/* Settings card */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
}
.settings-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .4rem;
}
.settings-card-desc { font-size: .875rem; color: var(--muted); line-height: 1.6; }

/* Analytics coming-soon notice */
.analytics-coming-soon {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: .875rem;
  color: var(--muted);
  margin-top: 1.5rem;
}

/* Analytics */
.analytics-section { margin-bottom: 2rem; }
.analytics-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.analytics-table th, .analytics-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.analytics-table th { color: var(--muted); font-weight: 500; }
.analytics-note { font-size: 0.75rem; color: var(--muted); margin-top: 8px; }

/* Daily bar chart */
.daily-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 8px 0; }
.chart-bar-wrap { display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; background: var(--primary); border-radius: 2px 2px 0 0; min-height: 2px; }
.chart-label { font-size: 0.6rem; color: var(--muted); margin-top: 4px; }
.analytics-coming-soon svg { flex-shrink: 0; }

/* ===== Mobile Responsive (Admin Shell) ===== */

/* Mobile header — hidden on desktop, flex on mobile */
.mobile-header {
  display: none;
  align-items: center;
  height: var(--topbar-h);
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.hamburger-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: none;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  padding: 0;
}
.hamburger-btn:hover { background: var(--bg); }

.mobile-brand { display: flex; align-items: center; gap: 8px; }

.mobile-brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-wordmark { font-size: 15px; font-weight: 700; color: var(--text); }

/* Sidebar backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 150;
  animation: backdrop-fade-in 0.2s ease;
}
@keyframes backdrop-fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 768px) {
  /* Show mobile header */
  .mobile-header { display: flex; }

  /* Content area: full width */
  .admin-content { margin-left: 0; }

  /* Sidebar: slide-in drawer */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
  }
  .admin-shell.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.15);
  }

  /* Dashboard topbar: hidden on mobile — mobile-header handles branding/nav,
     and page-header h1 already shows the page title */
  .topbar-dashboard { display: none; }

  /* Editor topbar: stick below the mobile header (60px) instead of top:0 */
  .topbar:not(.topbar-dashboard) { top: var(--topbar-h); padding: 0 14px; }
  /* Compact editor topbar buttons so they fit on a single row above ~500px */
  .topbar:not(.topbar-dashboard) .topbar-actions .btn { padding: 4px 10px; font-size: 12px; }
  .topbar-title { font-size: 14px; }
  .usage-pill { display: none; }
  .btn-label { display: none; }

  /* Page content */
  .page-content { padding: 16px; }

  /* Page header */
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header-text h1 { font-size: 18px; }

  /* Stat cards: 2×2 */
  .stat-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
  .stat-card { padding: 14px; }
  .stat-card-value { font-size: 22px; }

  /* Quick action banner */
  .quick-action-banner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 20px; }
  .btn-banner { align-self: stretch; justify-content: center; }

  /* List toolbar */
  .list-toolbar { gap: 8px; }
  .search-input-wrapper { flex: 1 1 100%; order: -1; }
  .search-input { width: 100%; }

  /* Campaign table: too many columns for mobile — keep Campaign, Status, Actions */
  .campaigns-table th:nth-child(n+3):not(:last-child),
  .campaigns-table td:nth-child(n+3):not(:last-child) { display: none; }
  /* Reduce cell padding to give more room */
  .campaigns-table th { padding: 8px 12px; }
  .campaigns-table td { padding: 10px 12px; }

  /* Editor layout: stack vertically */
  .editor-body { flex-direction: column; padding: 16px; gap: 12px; }
  .editor-left  { flex: none; max-width: 100%; width: 100%; }
  .editor-right { flex: none; max-width: 100%; width: 100%; position: static; top: auto; }

  /* Editor topbar */
  .editor-topbar-name { max-width: 130px; }
  .editor-topbar-divider { display: none; }
  .save-state { display: none; }

  /* Form grids: single column */
  .form-grid        { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: 1fr; }

  /* Segment builder: horizontal scroll to keep full functionality */
  .seg-builder-box { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .seg-builder-header,
  .seg-row { min-width: 480px; }
  .seg-preview-bar { min-width: 0; }

  /* Shadow chips: wrap */
  .shadow-presets { flex-wrap: wrap; }

  /* Format presets: wrap */
  .format-presets { gap: 6px; }
  .format-preset { min-width: 76px; padding: 6px 10px; }

  /* Modal */
  .modal-card { width: calc(100vw - 32px); padding: 20px 18px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; justify-content: center; }

  /* Toast */
  .toast-container { right: 16px; left: 16px; bottom: 16px; }
  .toast { min-width: 0; max-width: 100%; }

  /* Account */
  .account-card { padding: 1.25rem; }
  .account-info-label { min-width: 90px; }

  /* Filter tabs: scroll without wrapping */
  .filter-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .filter-tab { flex-shrink: 0; }

  /* Section heading */
  .section-heading { flex-wrap: wrap; gap: 8px; }

  /* Row actions in table: smaller gap */
  .row-actions { gap: 4px; }
}

/* Small phones (≤500px): editor topbar wraps Save/Publish to a second row */
@media (max-width: 500px) {
  .topbar:not(.topbar-dashboard) {
    height: auto;
    min-height: var(--topbar-h);
    padding: 8px 14px 6px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .topbar:not(.topbar-dashboard) .editor-topbar-name {
    flex: 1;
    max-width: none;
  }
  .topbar:not(.topbar-dashboard) .topbar-actions {
    width: 100%;
    justify-content: flex-end;
    padding-bottom: 2px;
  }
  .editor-topbar-back { font-size: 12px; }
}

@media (max-width: 480px) {
  .stat-card-value  { font-size: 20px; }
  .page-header-text h1 { font-size: 16px; }
  .quick-action-banner { padding: 14px 16px; }
  .quick-action-banner-text h3 { font-size: 14px; }
}

/* ===== Theme Toggle Component ===== */
.theme-toggle-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  padding: 0;
  transition: color 0.15s, border-color 0.15s;
}
.theme-toggle-btn:hover { color: var(--primary); border-color: var(--primary); }

.theme-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

/* ===== Smooth theme transition ===== */
.theme-transition *, .theme-transition *::before, .theme-transition *::after {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease !important;
}

/* ===== Dark Theme ===== */
[data-theme="dark"] {
  --bg: #0E0D1A;
  --surface: #13122A;
  --surface-muted: #1A1935;
  --border: #2A2845;
  --text: #EDE9FF;
  --muted: #8B87B8;
  --primary-tint: #1E1A42;
}

/* Hover + interaction states that use hardcoded light colors */
[data-theme="dark"] .accordion-header:hover { background: var(--surface-muted); }
[data-theme="dark"] .accordion-num.opt { background: var(--surface-muted); color: var(--muted); }
[data-theme="dark"] .status-optional { background: var(--surface-muted); }
[data-theme="dark"] .status-icon.complete { background: rgba(22, 163, 74, 0.18); }
[data-theme="dark"] .filter-tab:hover { background: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .filter-tab.active { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
[data-theme="dark"] .sidebar-signout-btn:hover { background: rgba(239, 68, 68, 0.12); }

/* Status badges */
[data-theme="dark"] .badge-published { background: rgba(22, 163, 74, 0.16); color: #4ADE80; }
[data-theme="dark"] .badge-published .status-badge-dot { background: #4ADE80; }
[data-theme="dark"] .badge-draft { background: var(--surface-muted); color: var(--muted); }
[data-theme="dark"] .badge-expired { background: rgba(245, 158, 11, 0.16); color: #FCD34D; }
[data-theme="dark"] .badge-expired .status-badge-dot { background: #FCD34D; }
[data-theme="dark"] .badge-archived { background: var(--surface-muted); color: var(--muted); }
[data-theme="dark"] .badge-green { background: rgba(22, 163, 74, 0.16); color: #4ADE80; }
[data-theme="dark"] .badge-grey { background: var(--surface-muted); color: var(--muted); }

/* Selected/active states (hardcoded #F9F8FF in light → primary-tint in dark) */
[data-theme="dark"] .upload-area:hover { background: var(--primary-tint); }
[data-theme="dark"] .format-card.selected { background: var(--primary-tint); }
[data-theme="dark"] .mode-card.selected { background: var(--primary-tint); }
[data-theme="dark"] .mode-card.selected .mode-card-icon { background: rgba(102, 87, 232, 0.3); }
[data-theme="dark"] .shadow-chip.selected { background: var(--primary-tint); }
[data-theme="dark"] .sep-chip.active { background: var(--primary-tint); }
[data-theme="dark"] .format-preset.active { background: var(--primary-tint); }

/* Hover borders (hardcoded #c5c8d8 in light) */
[data-theme="dark"] .format-card:hover { border-color: var(--muted); }
[data-theme="dark"] .mode-card:hover { border-color: var(--muted); }

/* Warning / info alert boxes */
[data-theme="dark"] .mode-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #FCD34D;
}
[data-theme="dark"] .validation-list {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #FCD34D;
}
[data-theme="dark"] .account-upgrade-notice {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93C5FD;
}
[data-theme="dark"] .usage-pill.warning { color: #FCD34D; }
[data-theme="dark"] .copy-btn.copied { background: rgba(22, 163, 74, 0.12); }

/* Dropdown shadow — needs stronger contrast on dark */
[data-theme="dark"] .avatar-dropdown { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .more-menu { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); }
