/* HomeAnimate - light theme design tokens (matches the real AgentPulse app:
   white cards, light gray page background, black text, blue primary), kt-
   and cx- prefixed component system. */

:root {
  --background: #f4f5f7;
  --foreground: #16181d;
  --card: #ffffff;
  --card-foreground: #16181d;
  --primary: #4285f4;
  --primary-hover: #3367d6;
  --primary-foreground: #ffffff;
  --muted: #f0f1f4;
  --muted-foreground: #666e7d;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --success: #16a34a;
  --warning: #b45309;
  --border: #e4e6eb;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
}

a { color: inherit; text-decoration: none; }

.ha-shell {
  display: flex;
  min-height: 100vh;
}

.ha-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.ha-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 28px;
  flex: 1;
}

.ha-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 500;
}

.ha-sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.ha-sidebar-link:hover { background: var(--muted); color: var(--foreground); }

.ha-sidebar-link.is-active {
  background: rgba(66, 133, 244, 0.12);
  color: var(--primary);
}

.ha-sidebar-link.is-disabled {
  color: #52525b;
  cursor: default;
}

.ha-sidebar-link.is-disabled:hover { background: none; color: #52525b; }

.ha-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--muted);
  color: var(--muted-foreground);
  padding: 2px 6px;
  border-radius: 999px;
}

.ha-sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

.ha-credits {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 12px;
  background: var(--muted);
  border-radius: 8px;
  margin-bottom: 10px;
}

.ha-credits-count { font-size: 18px; font-weight: 700; color: var(--foreground); }
.ha-credits-label { font-size: 12px; color: var(--muted-foreground); }

.ha-help-link {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; margin-bottom: 8px;
  font-size: 13px; color: var(--muted-foreground); text-decoration: none; border-radius: 8px;
}
.ha-help-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.ha-help-link:hover { color: var(--foreground); background: var(--muted); }

.ha-user-row { padding: 0 12px; margin-bottom: 10px; }

.ha-user-email {
  font-size: 12.5px;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.ha-logout-btn { width: 100%; justify-content: center; }

.ha-main-col {
  flex: 1;
  min-width: 0;
}

.ha-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.ha-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}

/* Logo mark sized to match the marketing homepage nav exactly (.logo svg =
   34px) so it renders identically on homepage, login and sidebar. */
.ha-brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.ha-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  color: var(--muted-foreground);
}

.ha-nav a:hover { color: var(--foreground); }

.ha-container {
  max-width: 1600px;
  margin: 0;
  padding: 32px 32px 64px;
}

.cx-section {
  margin-bottom: 28px;
}

.cx-section h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.cx-section p.cx-sub {
  color: var(--muted-foreground);
  font-size: 14px;
  margin: 0;
}

.kt-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 4px rgba(16, 24, 40, .04);
}

.kt-card + .kt-card { margin-top: 16px; }

.kt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.kt-btn:hover { background: #e7e9ee; }

.kt-btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.kt-btn-primary:hover { background: var(--primary-hover); }

.kt-btn-danger {
  background: transparent;
  border-color: var(--destructive);
  color: var(--destructive);
}

.kt-btn-danger:hover { background: rgba(220, 38, 38, 0.1); }

.kt-input,
.kt-textarea,
select.kt-input {
  width: 100%;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}

.kt-input:focus, .kt-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.kt-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--foreground);
}

.kt-field { margin-bottom: 18px; }

.kt-error {
  color: var(--destructive);
  font-size: 12.5px;
  margin-top: 5px;
}

.kt-hint {
  color: var(--muted-foreground);
  font-size: 12.5px;
  margin-top: 5px;
}

.cx-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.cx-pill-draft { color: var(--muted-foreground); }
.cx-pill-queued { color: #60a5fa; border-color: rgba(96,165,250,.35); background: rgba(96,165,250,.08); }
.cx-pill-rendering { color: var(--warning); border-color: rgba(217,119,6,.35); background: rgba(217,119,6,.08); }
.cx-pill-done { color: var(--success); border-color: rgba(22,163,74,.35); background: rgba(22,163,74,.08); }
.cx-pill-failed { color: var(--destructive); border-color: rgba(220,38,38,.35); background: rgba(220,38,38,.08); }

table.kt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.kt-table th {
  text-align: left;
  color: var(--muted-foreground);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

table.kt-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

table.kt-table tr:last-child td { border-bottom: none; }

table.kt-table tr:hover td { background: rgba(16,24,40,0.025); }

.ha-empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted-foreground);
}

.ha-empty h3 {
  color: var(--foreground);
  font-size: 17px;
  margin: 0 0 6px;
}

.ha-status-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
  background: var(--muted);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.ha-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  animation: ha-spin 0.8s linear infinite;
}

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

.ha-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 18px;
}

.ha-alert-success {
  background: rgba(22,163,74,.08);
  border: 1px solid rgba(22,163,74,.35);
  color: #15803d;
}

.ha-alert-error {
  background: rgba(220,38,38,.08);
  border: 1px solid rgba(220,38,38,.35);
  color: #dc2626;
}

.ha-photo-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.ha-photo-row img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

video.ha-video {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #000;
}

.ha-back-link {
  display: inline-block;
  color: var(--muted-foreground);
  font-size: 13px;
  margin-bottom: 14px;
}

.ha-back-link:hover { color: var(--foreground); }

.ha-row-title { font-weight: 600; }

.ha-row-sub { color: var(--muted-foreground); font-size: 12.5px; margin-top: 2px; }

ul.ha-list {
  padding-left: 48px;
  margin: 8px 0;
}

/* ==========================================================================
   Auth pages (login/register/forgot-password/etc) - sidebar-free, centered
   card. The Breeze view files still carry a handful of raw Tailwind utility
   classes for spacing/links; this app no longer loads Tailwind on this
   layout, so those classes need real definitions here or text/spacing
   silently disappears.
   ========================================================================== */

.ha-auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
}

.ha-auth-brand {
  font-size: 20px;
}

.ha-auth-card {
  width: 100%;
  max-width: 420px;
}

.ha-auth-card form > div + div,
.ha-auth-card > div + div { margin-top: 0; }

.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.ms-2 { margin-left: 8px; }
.ms-3 { margin-left: 12px; }
.ms-4 { margin-left: 16px; }
.block { display: block; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.text-sm { font-size: 13px; }
.font-medium { font-weight: 600; }

/* Global text-color utility shims (Breeze views reuse these everywhere -
   profile partials, auth pages, verification banners - not just the auth
   card, so these need to be app-wide, not scoped). */
.text-gray-600,
.text-gray-800 { color: var(--muted-foreground); }

.text-gray-900 { color: var(--foreground); }

.text-green-600 { color: var(--success); }

a.underline,
button.underline {
  color: var(--muted-foreground);
  text-decoration: underline;
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
}

a.underline:hover,
button.underline:hover { color: var(--foreground); }

.text-lg { font-size: 18px; }
.space-y-6 > * + * { margin-top: 24px; }
.p-6 { padding: 24px; }
.mt-6 { margin-top: 24px; }
.gap-4 { gap: 16px; }
.w-3\/4 { width: 75%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ha-auth-card input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

/* ==========================================================================
   Breeze modal (Delete Account, etc) - Alpine-driven, Tailwind-classed.
   Tailwind isn't loaded on the app shell, so give the structural classes
   real definitions rather than let the modal render unpositioned/invisible.
   ========================================================================== */

.fixed { position: fixed; }
.absolute { position: absolute; }
.inset-0 { inset: 0; }
.overflow-y-auto { overflow-y: auto; }
.z-50 { z-index: 50; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.mb-6 { margin-bottom: 24px; }
.transform { }

[x-cloak] { display: none !important; }

.bg-gray-500 { background: #000; }
.opacity-75 { opacity: .6; }

.bg-white {
  background: var(--card);
  border: 1px solid var(--border);
}

.rounded-lg { border-radius: var(--radius); }
.shadow-xl { box-shadow: 0 24px 64px rgba(0, 0, 0, .55); }
.overflow-hidden { overflow: hidden; }

@media (min-width: 640px) {
  .sm\:w-full { width: 100%; }
  .sm\:max-w-sm { max-width: 24rem; }
  .sm\:max-w-md { max-width: 28rem; }
  .sm\:max-w-lg { max-width: 32rem; }
  .sm\:max-w-xl { max-width: 36rem; }
  .sm\:max-w-2xl { max-width: 42rem; }
  .sm\:mx-auto { margin-left: auto; margin-right: auto; }
}

/* The grey layer is fixed and would cover the panel and take every click, because .transform is empty here. */
.fixed.inset-0.overflow-y-auto > div[class*="mb-6"] {
  position: relative;
  z-index: 1;
  padding: 24px;
  color: var(--foreground);
}

.fixed.inset-0.overflow-y-auto > div[class*="mb-6"] .kt-input,
.fixed.inset-0.overflow-y-auto > div[class*="mb-6"] .kt-label { }

/* ==========================================================================
   v2 - Colour variety, editor UI, modal, table-scroll. Dark theme kept;
   brand blue #4285f4 + warm accents from the marketing homepage.
   ========================================================================== */

:root {
  --accent-blue: #4285f4;
  --accent-violet: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-teal: #14b8a6;
  --accent-rose: #f43f5e;
  --accent-warm: #ff8a4c;
  --glow-blue: rgba(66, 133, 244, 0.45);
}

/* --- Bug 1: project table never touches container edges, scrolls if narrow --- */
.kt-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.kt-table-scroll table.kt-table { min-width: 520px; }
.kt-card { overflow: hidden; }

/* --- Colourful sidebar icons (accent per destination) --- */
.ha-sidebar-nav > *:nth-child(1) svg { color: var(--accent-blue); }
.ha-sidebar-nav > *:nth-child(2) svg { color: var(--accent-violet); }
.ha-sidebar-nav > *:nth-child(3) svg { color: var(--accent-teal); }
.ha-sidebar-nav > *:nth-child(4) svg { color: var(--accent-amber); }
.ha-sidebar-link.is-active svg { color: var(--primary); }
.ha-sidebar-link.is-disabled svg { color: #52525b; }

/* Credits chip in sidebar - give it a branded gradient */
.ha-credits {
  background: linear-gradient(135deg, rgba(66,133,244,.18), rgba(139,92,246,.14));
  border: 1px solid rgba(66,133,244,.25);
}
.ha-credits-count { color: #2f6fe0; }

/* Status pills - add draft + composing */
.cx-pill-draft { color: var(--muted-foreground); border-color: var(--border); background: rgba(16,24,40,.03); }
.cx-pill-composing { color: var(--accent-violet); border-color: rgba(139,92,246,.35); background: rgba(139,92,246,.10); }

/* --- New Project modal --- */
.ha-modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.62); backdrop-filter: blur(3px); padding: 20px;
}
.ha-modal {
  width: 100%; max-width: 460px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: 0 24px 64px rgba(0,0,0,.55);
}
.ha-modal-title { margin: 0 0 16px; font-size: 18px; font-weight: 700; }
.ha-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
/* A button that cannot be pressed must look it (the price buttons of the video dialogs). */
.ha-modal .kt-btn[disabled] { opacity: .5; cursor: default; pointer-events: none; }
.ed-count { color: var(--muted-foreground); font-weight: 500; font-size: 11px; float: right; }

/* ==========================================================================
   EDITOR (/p/{id})
   ========================================================================== */
.ed { display: flex; flex-direction: column; gap: 18px; }

.ed-topbar {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; flex-wrap: wrap;
}
.ed-back {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--muted); border: 1px solid var(--border);
  font-size: 18px; color: var(--muted-foreground); flex-shrink: 0;
}
.ed-back:hover { color: var(--foreground); }
.ed-title-wrap { flex: 1; min-width: 160px; }
.ed-title-view { display: flex; align-items: center; gap: 8px; }
.ed-title-text { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.ed-pencil { background: none; border: none; color: var(--muted-foreground); cursor: pointer; padding: 4px; border-radius: 6px; }
.ed-pencil svg { width: 15px; height: 15px; }
.ed-pencil:hover { color: var(--primary); background: var(--muted); }
.ed-title-input {
  width: 100%; max-width: 420px; background: var(--muted); border: 1px solid var(--primary);
  border-radius: 8px; color: var(--foreground); font-size: 17px; font-weight: 700; padding: 6px 10px;
}
.ed-topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ed-save-flag { font-size: 12px; color: var(--muted-foreground); }

.ed-earn-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--accent-amber); border: 1px solid rgba(245,158,11,.35); background: rgba(245,158,11,.10);
}
.ed-earn-btn:hover { background: rgba(245,158,11,.18); }
.ed-earn-btn svg { width: 15px; height: 15px; }

.ed-credit-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: #2f6fe0;
  background: linear-gradient(135deg, rgba(66,133,244,.20), rgba(139,92,246,.16));
  border: 1px solid rgba(66,133,244,.35);
}
.ed-credit-pill svg { width: 15px; height: 15px; }

.ed-export-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 700; cursor: not-allowed;
  color: #52525b; background: var(--muted); border: 1px solid var(--border);
}
.ed-export-btn svg { width: 15px; height: 15px; }
.ed-export-btn.is-ready {
  cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #16a34a, #14b8a6); border-color: transparent;
  box-shadow: 0 8px 22px rgba(20,184,166,.28);
}
.ed-export-btn.is-ready:hover { filter: brightness(1.06); }

/* Body layout: subnav | panel | preview */
.ed-body { display: grid; grid-template-columns: 190px 1fr 380px; gap: 16px; align-items: start; }

.ed-subnav {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
  position: sticky; top: 18px;
}
.ed-tab {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  background: none; border: none; cursor: pointer; text-align: left;
  color: var(--muted-foreground); font-size: 14px; font-weight: 500; width: 100%;
}
.ed-tab svg { width: 18px; height: 18px; flex-shrink: 0; }
.ed-tab:nth-child(1) svg { color: var(--accent-blue); }
.ed-tab:nth-child(2) svg { color: var(--accent-violet); }
.ed-tab:nth-child(3) svg { color: var(--accent-teal); }
.ed-tab:nth-child(4) svg { color: var(--accent-amber); }
.ed-tab:nth-child(5) svg { color: var(--accent-rose); }
.ed-tab:hover { background: var(--muted); color: var(--foreground); }
.ed-tab.is-active { background: rgba(66,133,244,.12); color: var(--foreground); box-shadow: inset 3px 0 0 var(--primary); }

.ed-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; min-height: 420px; }
.ed-panel-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.ed-panel-sub { color: var(--muted-foreground); font-size: 13px; margin: 0 0 18px; }

/* Dropzone */
.ed-dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border: 1.5px dashed var(--border); border-radius: 12px; padding: 30px 20px; cursor: pointer;
  background: rgba(66,133,244,.03); transition: border-color .15s, background .15s;
}
.ed-dropzone:hover, .ed-dropzone.is-drag { border-color: var(--primary); background: rgba(66,133,244,.08); }
.ed-dropzone svg { width: 30px; height: 30px; color: var(--accent-blue); }
.ed-dropzone strong { font-size: 15px; }
.ed-dropzone span { font-size: 12.5px; color: var(--muted-foreground); }

.ed-zillow { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ed-zillow .kt-input { flex: 1; min-width: 180px; }
.ed-zillow .kt-btn { white-space: nowrap; }

.ed-note { font-size: 12.5px; margin-top: 8px; padding: 8px 11px; border-radius: 7px; }
.ed-note-error { color: #dc2626; background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.3); }
.ed-note-ok { color: #15803d; background: rgba(22,163,74,.08); border: 1px solid rgba(22,163,74,.3); }

.ed-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 16px; }
.ed-thumb { position: relative; aspect-ratio: 1; }
.ed-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.ed-thumb-x {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff; border: none; cursor: pointer; font-size: 15px; line-height: 1;
}
.ed-thumb-x:hover { background: var(--destructive); }
.ed-thumb { cursor: default; }
.ed-thumb.is-skipped { cursor: pointer; }
.ed-thumb.is-skipped img { filter: grayscale(1) brightness(.6); opacity: .65; }
.ed-thumb-tag {
  position: absolute; left: 4px; bottom: 4px; right: 26px; padding: 2px 6px; border-radius: 5px;
  background: rgba(0,0,0,.72); color: #fff; font-size: 10.5px; line-height: 1.3; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; text-transform: capitalize;
}
.ed-thumb-skip {
  position: absolute; left: 4px; bottom: 4px; padding: 2px 6px; border-radius: 5px;
  background: rgba(0,0,0,.72); color: var(--muted-foreground); font-size: 10.5px; line-height: 1.3;
  cursor: pointer;
}

.ed-animate-row { display: flex; align-items: center; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.ed-animate-btn { padding: 11px 20px; font-size: 14px; }
.ed-animate-btn svg { width: 15px; height: 15px; }
.ed-animate-btn:disabled { opacity: .45; cursor: not-allowed; }
.ed-animate-hint { font-size: 12.5px; color: var(--muted-foreground); }

/* Music */
.ed-tracklist { display: flex; flex-direction: column; gap: 8px; }
.ed-track {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--muted); cursor: pointer;
}
.ed-track:hover { border-color: rgba(139,92,246,.4); }
.ed-track.is-selected { border-color: var(--accent-violet); background: rgba(139,92,246,.10); }
.ed-track-play {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  border: none; color: #fff; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-blue));
}
.ed-track-play svg { width: 14px; height: 14px; }
.ed-track-meta { display: flex; flex-direction: column; flex: 1; }
.ed-track-name { font-size: 14px; font-weight: 600; }
.ed-track-mood { font-size: 12px; color: var(--muted-foreground); }
.ed-track-check { color: var(--accent-violet); font-weight: 700; }
.ed-or { text-align: center; color: var(--muted-foreground); font-size: 12px; margin: 16px 0; position: relative; }
.ed-music-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-upload-name { font-size: 13px; color: var(--foreground); display: inline-flex; gap: 8px; align-items: center; }
.ed-mini-x { background: none; border: none; color: var(--destructive); cursor: pointer; font-size: 12px; text-decoration: underline; }
.ed-volume { margin-top: 20px; }
.ed-range { width: 100%; accent-color: var(--accent-violet); }

/* Intro / End controls */
.ed-cycle {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 8px;
  background: var(--muted); border: 1px solid var(--border); color: var(--foreground);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.ed-cycle svg { width: 15px; height: 15px; color: var(--accent-teal); }
.ed-cycle:hover { border-color: var(--accent-teal); }
.ed-inline { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.ed-sf { display: flex; align-items: center; gap: 8px; }
.ed-sf-label { font-size: 12px; color: var(--muted-foreground); }
.ed-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ed-seg-btn { width: 34px; padding: 7px 0; background: var(--muted); border: none; color: var(--muted-foreground); cursor: pointer; font-size: 13px; font-weight: 600; border-right: 1px solid var(--border); }
.ed-seg-btn:last-child { border-right: none; }
.ed-seg-btn.is-on { background: var(--primary); color: #fff; }
.ed-font-select { width: auto; min-width: 150px; padding: 7px 10px; }
.ed-font-select option { background: var(--background); color: var(--foreground); }

.ed-check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; }
.ed-check input { width: 17px; height: 17px; accent-color: var(--accent-rose); }
.ed-room-details { margin: 4px 0 4px; }
.ed-hint { color: var(--muted-foreground); font-size: 13px; line-height: 1.5; margin: 0 0 16px; }
.ed-end-fields { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 18px; }
.ed-icon-row { display: flex; align-items: center; gap: 14px; }
.ed-icon-preview { width: 46px; height: 46px; object-fit: contain; border-radius: 8px; border: 1px solid var(--border); background: var(--muted); padding: 4px; }

.ed-support p { color: var(--muted-foreground); font-size: 14px; line-height: 1.6; margin-bottom: 16px; }

/* Preview panel */
.ed-preview {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  position: sticky; top: 18px;
}
.ed-aspect-btns { display: flex; gap: 8px; margin-bottom: 16px; }
.ed-shape-note { margin: -6px 0 14px; font-size: 13px; line-height: 1.45; color: var(--muted-foreground); }
.ha-shape-links { display: flex; flex-wrap: wrap; gap: 10px; }
.ed-aspect {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px;
  border-radius: 9px; background: var(--muted); border: 1px solid var(--border); color: var(--muted-foreground);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.ed-aspect:hover { border-color: var(--primary); color: var(--foreground); }
.ed-aspect.is-active { background: rgba(66,133,244,.12); border-color: var(--primary); color: var(--foreground); }
.ed-aspect-ic { border: 2px solid currentColor; border-radius: 3px; display: block; }
.ar-vert { width: 13px; height: 22px; }
.ar-horz { width: 24px; height: 14px; }
.ar-sq { width: 18px; height: 18px; }

.ed-stage {
  position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: #000;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
.ed-stage.ar-16-9 { aspect-ratio: 16 / 9; }
.ed-stage.ar-9-16 { aspect-ratio: 9 / 16; max-width: 260px; }
.ed-stage.ar-1-1  { aspect-ratio: 1 / 1; }
.ed-glow {
  position: absolute; inset: -30%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, var(--glow-blue), rgba(139,92,246,.18) 40%, transparent 70%);
  filter: blur(26px); opacity: .9;
}
.ed-video { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: #000; }
.ed-placeholder { position: relative; z-index: 1; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ed-ph-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; color: rgba(255,255,255,.75); text-align: center; padding: 20px; }
.ed-ph-inner svg { width: 40px; height: 40px; }
.ed-ph-inner span { font-size: 12.5px; }
.ed-busy { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #fff; font-size: 13px; }
.ed-err { color: var(--destructive); font-size: 13px; line-height: 1.45; margin-top: 12px; text-align: center; }

@media (max-width: 1080px) {
  .ed-body { grid-template-columns: 1fr; }
  .ed-subnav { flex-direction: row; overflow-x: auto; position: static; }
  .ed-tab { white-space: nowrap; }
  .ed-preview { position: static; }
  /* A Top film (being made, finished or failed) comes right under the steps: the open step can be 68 photos long. */
  .ed-body.ed-film-first .ed-subnav { order: 1; }
  .ed-body.ed-film-first .ed-preview { order: 2; }
  .ed-body.ed-film-first > section { order: 3; }
}
/* A finger needs 44 px: the three create buttons and every dialog button on a phone. */
@media (max-width: 640px) {
  .ed-animate-btn, .ha-modal .kt-btn { min-height: 44px; }
}

/* --- Responsive shell: collapse the fixed sidebar on narrow viewports so
   content (and the projects table) gets full width instead of being crushed
   into a ~135px column behind a 240px sidebar. --- */
@media (max-width: 820px) {
  .ha-shell { flex-direction: column; }
  .ha-sidebar {
    width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap;
    align-items: center; gap: 8px 14px; padding: 12px 16px;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .ha-sidebar .ha-brand { margin-right: auto; }
  .ha-sidebar-nav { flex-direction: row; flex-wrap: wrap; margin-top: 0; gap: 4px; flex: 0 0 100%; order: 3; }
  .ha-sidebar-link { padding: 8px 10px; font-size: 13px; }
  .ha-sidebar-footer {
    border-top: none; padding-top: 0; margin-top: 0; order: 2;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  }
  .ha-credits { margin-bottom: 0; }
  .ha-user-row { display: none; }
  .ha-help-link { margin-bottom: 0; padding: 6px 8px; }
  .ha-logout-btn { width: auto; }
  .ha-container { padding: 20px 16px 48px; }
}

.ha-profile-page { max-width: 640px; }

/* Walkthrough tour: room picker under each photo (2026-11-18) */
.ed-thumbs .ed-thumb { aspect-ratio: auto; display: flex; flex-direction: column; gap: 6px; }
.ed-thumb img { aspect-ratio: 1; height: auto; cursor: pointer; }
.ed-thumb-room { width: 100%; min-height: 36px; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; background: #fff; color: inherit; }
.ed-thumb-skip { pointer-events: none; }
.ed-animate-row { flex-wrap: wrap; }
.ed-thumbs { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.ed-thumbs .ed-thumb-skip { bottom: auto; top: 4px; }
.ed-thumbs .ed-thumb-x { width: 28px; height: 28px; font-size: 17px; }

.ha-auth-title { font-size: 20px; font-weight: 700; margin: 0 0 16px; }
.ha-auth-alt { margin: 18px 0 0; font-size: 14px; text-align: center; }
.ha-auth-alt a { font-weight: 600; text-decoration: underline; padding: 10px 2px; display: inline-block; }
/* Auth forms: Tailwind spacing utilities are not compiled here, so space the fields explicitly */
.ha-auth-card form > div + div { margin-top: 16px; }
.ha-auth-card form .mt-2 { margin-top: 6px; }
.ha-auth-card form > div:last-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.ha-auth-card a.underline { padding: 10px 0; display: inline-block; }
html { background: #f3f4f6; }

/* Google sign-in button: the standard Google look (white, grey outline, their G). Kept as Google specifies it. */
.ha-google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 48px; padding: 0 16px; box-sizing: border-box;
  background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 8px;
  font: 500 15px/20px Roboto, "Helvetica Neue", Arial, sans-serif; letter-spacing: .25px;
  text-decoration: none; cursor: pointer; transition: background-color .15s, box-shadow .15s;
}
.ha-google-btn:hover { background: #f8fafd; box-shadow: 0 1px 3px rgba(60, 64, 67, .3); }
.ha-google-btn:focus-visible { outline: 3px solid #a8c7fa; outline-offset: 2px; }
.ha-google-g { flex: none; }
.ha-auth-hint { margin: 14px 0 0; font-size: 14px; color: #5f6368; text-align: center; }
.ha-auth-error { margin: 0 0 14px; padding: 10px 12px; font-size: 14px; color: #8c1d18; background: #fce8e6; border-radius: 8px; }

/* Dashboard on phones: drop the date column so Open stays on screen */
@media (max-width: 640px) { .ha-col-date { display: none; } }

/* Editor: the tool list holds only tools; help sits below it as a quiet link (2026-11-19) */
.ed-subnav-help {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted-foreground); text-decoration: none;
}
.ed-subnav-help svg { width: 15px; height: 15px; flex-shrink: 0; }
.ed-subnav-help:hover { color: var(--foreground); }
@media (max-width: 1080px) {
  .ed-subnav-help { border-top: none; margin-top: 0; padding: 8px 10px; white-space: nowrap; }
}

/* --- Billing: editor error action and credit pill link --- */
.ed-err-action { display: inline-flex; margin-left: 8px; padding: 5px 12px; font-size: 12.5px; }
a.ed-credit-pill { text-decoration: none; }

/* --- Billing --- */
.ha-alert-warn { background: rgba(245,158,11,.10); border: 1px solid rgba(245,158,11,.40); color: #92400e; }
.ha-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ha-banner .kt-btn { white-space: nowrap; }
a.ha-credits { text-decoration: none; transition: border-color .15s ease; }
a.ha-credits:hover { border-color: rgba(66,133,244,.6); }
.ha-credits-label { line-height: 1.25; }

.bl-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.bl-grid > .kt-card, .bl-section { margin-top: 0 !important; }
.bl-section { margin-bottom: 16px; }
@media (max-width: 860px) { .bl-grid { grid-template-columns: 1fr; } }
.bl-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); }
.bl-plan-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.bl-plan-name { margin: 6px 0 4px; font-size: 28px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bl-sub { margin: 4px 0 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.5; }
.bl-hint { margin: 6px 0 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }
.bl-h { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.bl-perks { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.bl-perks li { background: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--foreground); }
.bl-total { font-size: 14px; color: var(--muted-foreground); margin: 6px 0 14px; }
.bl-total span { font-size: 44px; font-weight: 800; color: #2f6fe0; letter-spacing: -.02em; margin-right: 6px; }
.bl-meter + .bl-meter { margin-top: 14px; }
.bl-hint + .bl-meter { margin-top: 12px; }
.bl-meter-row { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.bl-bar { height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.bl-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4285f4, #8b5cf6); }
.bl-bar-alt i { background: linear-gradient(90deg, #14b8a6, #4285f4); }

.bl-packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
@media (max-width: 760px) { .bl-packs { grid-template-columns: 1fr; } }
.bl-pack { position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; background: var(--card); }
.bl-pack.is-popular { border: 2px solid var(--primary); box-shadow: 0 10px 28px rgba(66,133,244,.14); }
.bl-tag { position: absolute; top: -11px; right: 14px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.bl-pack-credits { font-size: 26px; font-weight: 800; }
.bl-pack-credits small { font-size: 14px; font-weight: 600; color: var(--muted-foreground); }
.bl-pack-price { font-size: 20px; font-weight: 700; }
.bl-pack-price s { font-size: 14px; color: var(--muted-foreground); margin-left: 6px; font-weight: 500; }
.bl-pack .kt-btn { margin-top: 12px; width: 100%; justify-content: center; }
.bl-singles { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.bl-singles .bl-pack-credits { font-size: 19px; font-weight: 700; }
.bl-singles .bl-pack .kt-btn { margin-top: auto; }
.bl-singles .bl-hint { margin-bottom: 12px; }
@media (max-width: 760px) { .bl-singles { grid-template-columns: 1fr; } }

.bl-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.bl-toggle { display: inline-flex; background: var(--muted); border-radius: 999px; padding: 3px; }
.bl-toggle button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted-foreground); cursor: pointer; }
.bl-toggle button.is-on { background: #fff; color: var(--foreground); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.bl-toggle em { font-style: normal; font-size: 11px; color: var(--success); margin-left: 4px; }
.bl-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
@media (max-width: 760px) { .bl-plans { grid-template-columns: 1fr; } }
.bl-planbox { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.bl-planbox.is-current { border-color: var(--primary); background: rgba(66,133,244,.04); }
.bl-planbox h4 { margin: 0; font-size: 16px; }
.bl-planprice { font-size: 24px; font-weight: 800; }
.bl-planprice small { font-size: 13px; font-weight: 500; color: var(--muted-foreground); margin-left: 3px; }
.bl-planbox .kt-btn { margin-top: 10px; }
.bl-planbox .kt-btn[disabled] { opacity: .55; cursor: default; }

.bl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bl-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); padding: 10px 8px; border-bottom: 1px solid var(--border); }
.bl-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); }
.bl-table a { color: var(--primary); font-weight: 600; }
.bl-plus { color: var(--success); font-weight: 700; }
.bl-minus { color: var(--foreground); font-weight: 700; }
.bl-ref .kt-input { width: 100%; max-width: 520px; margin-top: 10px; }

.bl-result { max-width: 560px; text-align: center; margin: 24px auto; padding: 36px 28px; }
.bl-result .kt-btn { margin: 14px 4px 0; }
.bl-result-mark { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px; background: rgba(22,163,74,.12); color: var(--success); display: flex; align-items: center; justify-content: center; }
.bl-result-mark svg { width: 28px; height: 28px; }
[x-cloak] { display: none !important; }
.ha-auth-note { margin: -8px 0 16px; font-size: 13.5px; color: var(--muted-foreground); line-height: 1.5; }
.ha-auth-note-plan { background: rgba(66,133,244,.08); border: 1px solid rgba(66,133,244,.3); color: var(--foreground); border-radius: 8px; padding: 10px 12px; margin-top: 0; }
.ha-auth-note { text-wrap: pretty; }

/* Billing tables fit a phone without sideways scrolling. */
@media (max-width: 560px) {
  .kt-table-scroll table.kt-table.bl-table { min-width: 0; }
  .bl-table th, .bl-table td { padding: 9px 5px; font-size: 13px; }
  .bl-table th { font-size: 11px; letter-spacing: .03em; }
}

/* ---- Editor step flow: numbered steps, a final "Create video" step with a checklist ---- */
.ed-step-n {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border);
}
.ed-tab.is-done .ed-step-n { background: rgba(34,197,94,.14); color: #15803d; border-color: rgba(34,197,94,.35); }
.ed-tab.is-active .ed-step-n { background: var(--primary); color: #fff; border-color: var(--primary); }
.ed-tab-create { white-space: nowrap; margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; padding-top: 14px; font-weight: 600; color: var(--foreground); }
.ed-tab-create svg { color: var(--primary) !important; }
.ed-next-row { display: flex; justify-content: flex-end; margin-top: 22px; }
.ed-btn-sm { padding: 6px 12px; font-size: 13px; min-height: 0; }
.ed-checklist { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 10px; }
.ed-checklist li {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
}
.ed-checklist li.warn { border-color: rgba(245,158,11,.55); background: rgba(245,158,11,.07); }
.ed-check-i {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.ed-checklist li.ok .ed-check-i { background: rgba(34,197,94,.15); color: #15803d; }
.ed-checklist li.warn .ed-check-i { background: rgba(245,158,11,.2); color: #b45309; }
.ed-check-t { flex: 1; min-width: 0; font-size: 14px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.ed-check-t strong { color: var(--foreground); margin-right: 6px; }
.ed-missing-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; font-size: 14px; }
.ed-missing-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 900px) {
  .ed-tab-create { margin-top: 0; border-top: none; padding-top: 10px; border-radius: 8px; }
}

/* ---- Editor: one-time message after creating from a listing ---- */
.ed-flash { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 16px 0; }
.ed-flash-x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .7; }
.ed-flash-x:hover { opacity: 1; }

/* Audit 2026-11-22: brand-blue checkboxes; the five editor steps fit a phone without sideways scrolling */
.ed-check input { accent-color: var(--primary); }
@media (max-width: 560px) {
  .ed-subnav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 6px; overflow: visible; }
  .ed-tab { flex-direction: column; gap: 4px; padding: 8px 2px; font-size: 11px; line-height: 1.2; white-space: normal; text-align: center; }
  .ed-tab svg { display: none; }
  .ed-tab.is-active { box-shadow: inset 0 -3px 0 var(--primary); }
}

/* Login / sign-up: Google button, then an "or" rule, then the email form */
.ha-auth-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 18px; font-size: 13px; color: #5f6368; text-align: center; }
.ha-auth-or::before, .ha-auth-or::after { content: ""; flex: 1; height: 1px; background: #dadce0; }
.ha-auth-or span { flex: none; }
