/* ═══════════════════════════════════════════════════════════════
   PLEEBLY ADMIN — Shadcn-style design system
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables (Shadcn tokens, violet/purple theme) ─────── */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --primary: 262.1 83.3% 57.8%;
  --primary-foreground: 210 20% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 262.1 83.3% 57.8%;
  --radius: 0.5rem;
}

/* ── Base ────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  font-family: "Inter", sans-serif;
}
a {
  color: inherit;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #71717a;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition:
    color 0.15s,
    background 0.15s;
}
.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}
.nav-item.active {
  color: #fff;
  background: rgba(139, 92, 246, 0.25);
}
.nav-item span {
  font-size: 0.875rem;
  line-height: 1;
}

/* ── Expandable nav group (e.g. Sections) ── */
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.45rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #71717a;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition:
    color 0.15s,
    background 0.15s;
}
.nav-group-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}
.nav-group-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-group-label span {
  font-size: 0.875rem;
  line-height: 1;
}
.nav-group-chevron {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  transition: transform 0.2s;
}
.nav-group-toggle.open .nav-group-chevron {
  transform: rotate(180deg);
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin-top: 0.125rem;
  overflow: hidden;
}
.nav-group.collapsed {
  display: none;
}
.nav-group .nav-item {
  padding-left: 1.625rem;
}

.sidebar-user {
  display: none;
} /* JS sets display:flex after login */

/* ── Site chips in sidebar ─────────────────────────────────── */
.site-chip {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.6875rem;
  color: #a1a1aa;
  background: transparent;
  overflow: hidden;
  transition: background 0.15s;
}
.site-chip:hover {
  background: rgba(255, 255, 255, 0.06);
}
.site-chip-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-chip-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* chip-btn: base for both chip-edit and chip-view (app.js uses class="chip-btn chip-edit") */
.chip-btn {
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 0.25rem;
  border: none;
  font-size: 0.625rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.chip-edit {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}
.chip-edit:hover {
  background: rgba(139, 92, 246, 0.35);
}
.chip-view {
  background: rgba(255, 255, 255, 0.08);
  color: #71717a;
}
.chip-view:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.chip-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.chip-delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* ══════════════════════════════════════════════════════════════
   PANELS
   ══════════════════════════════════════════════════════════════ */
.panel {
  display: none;
}
.panel.active {
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   CARD
   ══════════════════════════════════════════════════════════════ */
.sh-card {
  background: #fff;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.25rem;
}
.sh-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* ══════════════════════════════════════════════════════════════
   FORM PRIMITIVES
   ══════════════════════════════════════════════════════════════ */
.sh-field {
  margin-bottom: 0.875rem;
}
.sh-field:last-child {
  margin-bottom: 0;
}

.sh-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: 0.375rem;
}

.sh-input {
  display: block;
  width: 100%;
  height: 2.125rem;
  padding: 0 0.625rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: #fff;
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  font-family: inherit;
}
textarea.sh-input {
  height: auto;
  padding: 0.5rem 0.625rem;
  resize: vertical;
}
select.sh-input {
  cursor: pointer;
  appearance: auto;
}
.sh-input::placeholder {
  color: hsl(var(--muted-foreground));
}
.sh-input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* ── form-group / form-row used by app.js renderServices/renderTestimonials ── */
.form-group {
  margin-bottom: 0.5rem;
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-group > label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  display: block;
  width: 100%;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 4px);
  background: #fff;
  font-size: 0.75rem;
  color: hsl(var(--foreground));
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.form-group textarea {
  height: auto;
  padding: 0.375rem 0.5rem;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: hsl(var(--ring));
}
/* Checkboxes/radios must opt out of the full-width text-input styling above. */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  flex: none;
  margin: 0;
  padding: 0;
  accent-color: hsl(var(--primary));
  cursor: pointer;
}
/* A label that wraps an inline checkbox/radio + its text.
   Scoped under .form-group to outrank the `.form-group > label` block style. */
.form-group label.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  cursor: pointer;
  margin-bottom: 0;
}

/* ── Quill rich-text editor (blog + portfolio content) ── */
.ql-toolbar.ql-snow {
  border-radius: calc(var(--radius) - 4px) calc(var(--radius) - 4px) 0 0;
  border-color: hsl(var(--border));
}
.ql-container.ql-snow {
  border-radius: 0 0 calc(var(--radius) - 4px) calc(var(--radius) - 4px);
  border-color: hsl(var(--border));
  font-family: inherit;
}
.ql-editor {
  min-height: 160px;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: hsl(var(--foreground));
}
/* Placeholder — match the muted tone used by other form fields */
.ql-editor.ql-blank::before {
  color: hsl(var(--muted-foreground));
  font-style: normal;
  left: 15px;
  right: 15px;
}
/* Content elements styled to the admin theme (Quill's defaults clash) */
.ql-editor h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 1.5em 0 0.5em;
}
.ql-editor h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 1.4em 0 0.45em;
}
.ql-editor p {
  margin: 0 0 1.2em;
}
.ql-editor ul,
.ql-editor ol {
  margin: 0 0 1.2em;
  padding-left: 1.5em;
}
.ql-editor > :first-child {
  margin-top: 0;
}
.ql-editor a {
  color: hsl(var(--primary));
}
.ql-editor blockquote {
  border-left: 3px solid hsl(var(--primary));
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  padding: 0.5em 0.9em;
  margin: 1.4em 0;
  border-radius: 0 calc(var(--radius) - 4px) calc(var(--radius) - 4px) 0;
}
.ql-editor img {
  max-width: 320px;
  max-height: 240px;
  height: auto;
  width: auto;
  border-radius: calc(var(--radius) - 4px);
  margin: 1.2em 0;
}
/* Toolbar active/hover states — use the violet primary, not Quill's blue */
.ql-snow.ql-toolbar button:hover,
.ql-snow.ql-toolbar button.ql-active,
.ql-snow .ql-toolbar button:hover,
.ql-snow .ql-toolbar button.ql-active,
.ql-snow .ql-picker-label:hover,
.ql-snow .ql-picker-label.ql-active,
.ql-snow .ql-picker-item:hover,
.ql-snow .ql-picker-item.ql-selected {
  color: hsl(var(--primary));
}
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke,
.ql-snow .ql-picker-label:hover .ql-stroke,
.ql-snow .ql-picker-label.ql-active .ql-stroke {
  stroke: hsl(var(--primary));
}
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill,
.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill {
  fill: hsl(var(--primary));
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.sh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid hsl(var(--border));
  background: #fff;
  color: hsl(var(--foreground));
  transition: background 0.15s;
  height: 2rem;
  padding: 0 0.75rem;
  font-family: inherit;
}
.sh-btn:hover {
  background: hsl(var(--muted));
}

.sh-btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: transparent;
}
.sh-btn-primary:hover {
  background: hsl(var(--primary) / 0.9);
}

.sh-btn-destructive {
  background: hsl(var(--destructive) / 0.08);
  color: hsl(var(--destructive));
  border-color: hsl(var(--destructive) / 0.2);
}
.sh-btn-destructive:hover {
  background: hsl(var(--destructive) / 0.15);
}

.sh-btn-sm {
  height: 1.625rem;
  padding: 0 0.5rem;
  font-size: 0.6875rem;
}

/* btn-sm / btn-secondary / btn-danger — used by app.js testimonial avatar buttons */
.btn-sm {
  height: 1.625rem;
  padding: 0 0.5rem;
  font-size: 0.6875rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid hsl(var(--border));
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}
.btn-secondary {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn-secondary:hover {
  background: hsl(var(--secondary));
}
.btn-danger {
  background: hsl(var(--destructive) / 0.08);
  color: hsl(var(--destructive));
  border-color: hsl(var(--destructive) / 0.2);
}
.btn-danger:hover {
  background: hsl(var(--destructive) / 0.15);
}

/* Add buttons */
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px dashed hsl(var(--border));
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
  font-family: inherit;
}
.btn-add:hover {
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.5);
  background: hsl(var(--primary) / 0.04);
}

.btn-add-small {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px dashed hsl(var(--border));
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
  font-family: inherit;
}
.btn-add-small:hover {
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.5);
}

/* btn-remove — used by app.js in repeatable-item and stat-row */
.btn-remove {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  border: none;
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
  cursor: pointer;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-remove:hover {
  background: hsl(var(--destructive) / 0.2);
}

/* ══════════════════════════════════════════════════════════════
   BADGE
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  height: 1.125rem;
  padding: 0 0.375rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  letter-spacing: 0.03em;
}

/* ══════════════════════════════════════════════════════════════
   COLOR PRESETS
   ══════════════════════════════════════════════════════════════ */
.preset {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.preset:hover {
  transform: scale(1.2);
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 3.5px rgba(0, 0, 0, 0.25);
}

/* ══════════════════════════════════════════════════════════════
   UPLOAD ZONES
   ══════════════════════════════════════════════════════════════ */
.upload-zone {
  position: relative;
  border: 2px dashed hsl(var(--border));
  border-radius: var(--radius);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  overflow: hidden;
  background: hsl(var(--muted) / 0.3);
}
.upload-zone:hover {
  border-color: hsl(var(--primary) / 0.5);
  background: hsl(var(--primary) / 0.03);
}
.upload-zone.drag-over {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.06);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 1.25rem;
  pointer-events: none;
}
.upload-zone.has-image .upload-placeholder {
  display: none;
}

.upload-preview {
  display: none;
  width: fit-content;
  height: auto;
  object-fit: contain;
  position: absolute;
  inset: 0;
  padding: 10px;
  margin: auto;
}

.upload-zone.has-image .upload-preview {
  display: block;
}

.upload-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

/* ══════════════════════════════════════════════════════════════
   REPEATABLE ITEMS (services, testimonials)
   ══════════════════════════════════════════════════════════════ */
.repeatable-item {
  background: hsl(var(--muted) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  position: relative;
}
.repeatable-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}
/* Per-row "Preview" button (blog/portfolio/property headers) */
.btn-row-preview,
.prop-row-preview {
  flex-shrink: 0;
  white-space: nowrap;
}
.repeatable-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Collapsible repeatable rows (blog posts) */
.repeatable-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.repeatable-toggle {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  transition: transform 0.2s;
}
.repeatable-item.collapsed .repeatable-toggle {
  transform: rotate(-90deg);
}
.repeatable-item.collapsed {
  margin-bottom: 0.375rem;
}
.repeatable-item.collapsed .repeatable-header {
  margin-bottom: 0;
}
.repeatable-item.collapsed .repeatable-body {
  display: none;
}

/* ── Icon picker (class="icon-select" in app.js) ──────────── */
.icon-select {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
/* icon-picker is the alias used in HTML static content */
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.icon-opt {
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 0.25rem;
  border: 1px solid hsl(var(--border));
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.icon-opt:hover {
  border-color: hsl(var(--primary) / 0.6);
  background: hsl(var(--primary) / 0.05);
}
.icon-opt.selected {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
  box-shadow: 0 0 0 1px hsl(var(--primary));
}

/* Custom service icon upload */
.svc-custom-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.svc-icon-preview {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  border-radius: 0.375rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
  padding: 3px;
}
.icon-select.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Custom font uploads */
.custom-fonts-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.custom-font-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.custom-font-badge {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
  font-weight: 700;
  font-size: 0.8rem;
}
.custom-font-name {
  flex: 1;
}

/* Custom searchable font dropdown */
.font-picker {
  position: relative;
}
.font-picker-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.08),
    0 12px 28px -8px rgba(15, 23, 42, 0.18);
  padding: 0.25rem;
  display: none;
}
.font-picker.open .font-picker-menu {
  display: block;
}
.font-picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.5rem 0.625rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 1.0625rem;
  color: hsl(var(--foreground));
  line-height: 1.2;
}
.font-picker-option:hover,
.font-picker-option.active {
  background: hsl(var(--muted));
}
.font-picker-option.selected {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}
.font-picker-option .fp-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.font-picker-option .fp-tag {
  flex-shrink: 0;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
  padding: 1px 6px;
  border-radius: 100px;
}
.font-picker-empty {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

/* Segmented radio toggle (e.g. menu mode, property input mode) */
.seg-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
}
.seg-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.seg-opt input {
  display: none;
}
.seg-opt.selected {
  background: #fff;
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* Menu builder */
.menu-cats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}
.menu-cat {
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  background: hsl(var(--card));
  overflow: hidden;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.menu-cat:focus-within {
  border-color: hsl(var(--primary) / 0.45);
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.08);
}
.menu-cat-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 0.625rem;
  background: hsl(var(--muted) / 0.45);
  border-bottom: 1px solid hsl(var(--border));
}
.menu-cat.collapsed .menu-cat-head {
  background: transparent;
  border-bottom-color: transparent;
}
.menu-cat-toggle {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  transition:
    transform 0.2s,
    background 0.15s,
    color 0.15s;
}
.menu-cat-toggle:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.menu-cat.collapsed .menu-cat-toggle {
  transform: rotate(-90deg);
}
.menu-cat-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.875rem;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.menu-cat-name:hover {
  border-color: hsl(var(--input));
  background: hsl(var(--background));
}
.menu-cat-name:focus {
  border-color: hsl(var(--primary) / 0.5);
  background: hsl(var(--background));
}
.menu-cat-count {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  padding: 0.1875rem 0.5rem;
  border-radius: 100px;
  white-space: nowrap;
}
.menu-cat-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.menu-cat.collapsed .menu-cat-body {
  display: none;
}
.menu-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.menu-item-row {
  position: relative;
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  padding: 0.625rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.625rem;
  background: hsl(var(--background));
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.menu-item-row:focus-within {
  border-color: hsl(var(--primary) / 0.45);
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.07);
}
.mi-img {
  position: relative;
  flex-shrink: 0;
}
.mi-img-btn {
  width: 3rem;
  height: 3rem;
  border: 1px dashed hsl(var(--border));
  border-radius: 0.5rem;
  background-color: hsl(var(--muted) / 0.5);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: hsl(var(--muted-foreground));
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.mi-img-btn:hover {
  border-color: hsl(var(--primary) / 0.6);
  color: hsl(var(--primary));
}
.mi-img.has-img .mi-img-btn {
  border-style: solid;
  border-color: hsl(var(--border));
}
.mi-img-clear {
  position: absolute;
  top: -0.375rem;
  right: -0.375rem;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 100px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  font-size: 0.6rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.mi-img-clear:hover {
  color: hsl(var(--destructive));
  border-color: hsl(var(--destructive) / 0.4);
}
.mi-fields {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 84px 84px 1.75rem;
  gap: 0.4rem 0.5rem;
  align-items: center;
}
.mi-fields .sh-input {
  font-size: 0.8125rem;
}
.mi-fields .mi-name {
  font-weight: 500;
}
.mi-fields .mi-price,
.mi-fields .mi-dietary {
  text-align: center;
}
.mi-fields .mi-desc {
  grid-column: 1 / -1;
  color: hsl(var(--muted-foreground));
}
.mi-remove {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: hsl(var(--muted-foreground));
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.mi-remove:hover {
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
  border-color: hsl(var(--destructive) / 0.2);
}
.menu-cat-body .add-menu-item {
  width: 100%;
  justify-content: center;
  border: 1px dashed hsl(var(--border));
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}
.menu-cat-body .add-menu-item:hover {
  border-color: hsl(var(--primary) / 0.5);
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.04);
}

/* Menu PDF upload */
.menu-pdf-preview {
  margin-bottom: 0.5rem;
}
.menu-pdf-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  background: hsl(var(--muted) / 0.4);
}
.menu-pdf-ico {
  font-size: 1.4rem;
}
.menu-pdf-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  font-size: 0.8125rem;
  gap: 2px;
}
.menu-pdf-meta a {
  font-size: 0.75rem;
  color: hsl(var(--primary));
}

/* Property listings (compact, collapsible — scales to long lists) */
.csv-panel {
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  background: hsl(var(--muted) / 0.4);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.csv-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  resize: vertical;
}
.properties-admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.prop-row {
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  background: #fff;
  overflow: hidden;
}
.prop-row-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  background: hsl(var(--muted) / 0.5);
}
.prop-row-toggle {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  transition: transform 0.2s;
}
.prop-row.collapsed .prop-row-toggle {
  transform: rotate(-90deg);
}
.prop-row-summary {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  cursor: pointer;
}
.prop-row-title {
  font-weight: 600;
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prop-row-price {
  font-size: 0.75rem;
  font-weight: 700;
  color: hsl(var(--primary));
  white-space: nowrap;
}
.prop-row-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  padding: 1px 7px;
  border-radius: 100px;
}
.prop-row-body {
  padding: 0.75rem;
}
.prop-row.collapsed .prop-row-body {
  display: none;
}
.prop-gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.prop-gallery-thumb {
  position: relative;
  width: 4rem;
  height: 3rem;
  border-radius: 0.375rem;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
}
.prop-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.prop-gallery-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 1.1rem;
  height: 1.1rem;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 0.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.prop-gallery-remove:hover {
  background: hsl(var(--destructive));
}
.prop-gallery-add {
  height: 3rem;
  padding: 0 0.875rem;
  border: 1px dashed hsl(var(--border));
  border-radius: 0.375rem;
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.prop-gallery-add:hover {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

/* ══════════════════════════════════════════════════════════════
   STAT ROWS
   ══════════════════════════════════════════════════════════════ */
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.625rem;
  background: hsl(var(--muted) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
}
.stat-row input {
  height: 1.875rem;
  padding: 0 0.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.75rem;
  background: #fff;
  font-family: inherit;
  outline: none;
}
.nav-link-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.btn-move {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  border: none;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-move:hover:not(:disabled) {
  background: hsl(var(--border));
}
.btn-move:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ══════════════════════════════════════════════════════════════
   GALLERY
   ══════════════════════════════════════════════════════════════ */
.gallery-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* gallery-upload-item: class used by app.js renderGallery() */
.gallery-upload-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: hsl(var(--muted));
}
.gallery-upload-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-upload-item .remove-gallery {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  cursor: pointer;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.gallery-upload-item:hover .remove-gallery {
  opacity: 1;
}

.caption-input {
  display: block;
  width: 100%;
  padding: 0.25rem 0.375rem;
  font-size: 0.6875rem;
  border: 1px solid hsl(var(--border));
  border-top: none;
  background: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  outline: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.gallery-upload-item:hover .caption-input {
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════════
   PUBLISH PANEL — sites table
   ══════════════════════════════════════════════════════════════ */
.sites-table {
  width: 100%;
}

.site-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid hsl(var(--border));
}
.site-row:first-child {
  border-top: 1px solid hsl(var(--border));
}

.site-name {
  font-size: 0.8125rem;
  font-weight: 500;
}
.site-id {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.125rem;
}

.site-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-edit-site {
  height: 1.75rem;
  padding: 0 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background: #fff;
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-edit-site:hover {
  background: hsl(var(--muted));
}
.btn-delete-site {
  height: 1.75rem;
  padding: 0 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-delete-site:hover {
  background: rgba(239, 68, 68, 0.18);
}

.site-link {
  height: 1.75rem;
  padding: 0 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--primary) / 0.3);
  background: hsl(var(--primary) / 0.08);
  color: hsl(var(--primary));
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s;
}
.site-link:hover {
  background: hsl(var(--primary) / 0.14);
}

/* ══════════════════════════════════════════════════════════════
   GENERATE RESULT
   ══════════════════════════════════════════════════════════════ */
.generate-result {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  line-height: 1.5;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
}
.generate-result.success {
  border-color: hsl(142 71% 45% / 0.35);
  background: hsl(142 71% 45% / 0.07);
}
.generate-result.error {
  border-color: hsl(var(--destructive) / 0.3);
  background: hsl(var(--destructive) / 0.05);
  color: hsl(var(--destructive));
}
.generate-result a {
  color: hsl(var(--primary));
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}
.generate-result a:hover {
  text-decoration: underline;
}

/* spinner used in generate button loading state */
.spinner {
  display: inline-block;
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ══════════════════════════════════════════════════════════════
   ADDONS — toggle, chatbot KB list, blog generator
   ══════════════════════════════════════════════════════════════ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: hsl(var(--border));
  border-radius: 100px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: hsl(var(--primary));
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* Per-section on/off banner at the top of each builder panel */
.section-toggle {
  border-left: 3px solid hsl(var(--primary));
  background: hsl(var(--primary) / 0.04);
}
.section-toggle label {
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════
   CHATBOT PANEL — settings + live glass preview
   ══════════════════════════════════════════════════════════════ */
.chatbot-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .chatbot-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
  .chatbot-preview-col {
    position: sticky;
    top: 1rem;
  }
}
.chatbot-avatar-thumb {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  font-size: 1.4rem;
  overflow: hidden;
  flex-shrink: 0;
}
.chatbot-avatar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cbprev {
  --cbp: #6d28d9;
  position: relative;
  min-height: 520px;
  border-radius: 1rem;
  border: 1px solid hsl(var(--border));
  background: linear-gradient(135deg, #eef2ff 0%, #fdf4ff 50%, #ecfeff 100%);
  overflow: hidden;
}
.cbprev-window {
  position: absolute;
  bottom: 88px;
  right: 18px;
  width: min(312px, calc(100% - 36px));
  max-height: 400px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px;
  box-shadow: 0 26px 56px -16px rgba(15, 23, 42, 0.32);
  overflow: hidden;
  animation: cbprev-in 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes cbprev-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.cbprev-left .cbprev-window {
  right: auto;
  left: 18px;
}
.cbprev-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  color: #fff;
  background: var(--cbp);
}
.cbprev-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  font-size: 1.1rem;
}
.cbprev-av img,
.cbprev-mav img,
#cbprev-toggle-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cbprev-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.cbprev-name {
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cbprev-status {
  font-size: 0.65rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.cbprev-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
}
.cbprev-x {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
  flex-shrink: 0;
}
.cbprev-body {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 130px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(241, 245, 249, 0.55));
}
.cbprev-row {
  display: flex;
  gap: 7px;
  align-items: flex-end;
  max-width: 90%;
}
.cbprev-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.cbprev-mav {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--cbp);
  color: #fff;
  font-size: 0.75rem;
}
.cbprev-mav svg {
  width: 13px;
  height: 13px;
}
.cbprev-msg {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.8rem;
  line-height: 1.45;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: #1f2937;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}
.cbprev-msg-user {
  background: var(--cbp);
  color: #fff;
  border: none;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px -3px rgba(0, 0, 0, 0.2);
}
.cbprev-input {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
  background: rgba(255, 255, 255, 0.6);
}
.cbprev-input-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 11px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: rgba(15, 23, 42, 0.45);
}
.cbprev-send {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--cbp);
  box-shadow: 0 5px 14px -4px rgba(0, 0, 0, 0.25);
}
.cbprev-send svg {
  width: 16px;
  height: 16px;
}
.cbprev-toggle {
  position: absolute;
  bottom: 18px;
  right: 18px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  overflow: hidden;
  background: var(--cbp);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.3);
}
.cbprev-left .cbprev-toggle {
  right: auto;
  left: 18px;
}
.cbprev-toggle svg {
  width: 26px;
  height: 26px;
}
#cbprev-toggle-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kb-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.kb-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--muted) / 0.4);
}
.kb-item-icon {
  font-size: 1rem;
}
.kb-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.kb-item-name {
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb-item-meta {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
}
.kb-item-remove {
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.25rem;
  border-radius: 0.25rem;
}
.kb-item-remove:hover {
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

/* ── Layout shell ── */
.bloggen-wrap {
  max-width: 62rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Hero banner ── */
.bloggen-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.375rem 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, hsl(262 83% 58%), hsl(243 75% 59%));
  color: #fff;
  box-shadow: 0 10px 30px hsl(262 83% 58% / 0.25);
}
.bloggen-hero-glow {
  position: absolute;
  top: -60%;
  right: -10%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 70%);
  pointer-events: none;
}
.bloggen-hero-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
}
.bloggen-hero-text {
  position: relative;
  z-index: 1;
}
.bloggen-hero-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.bloggen-hero-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  max-width: 46rem;
}

.bloggen-warning {
  font-size: 0.75rem;
  color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.08);
  border: 1px solid hsl(var(--destructive) / 0.2);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.5rem 0.75rem;
  margin: 0;
}

/* ── Composer ── */
.bloggen-composer {
  background: #fff;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.25rem;
}
.bloggen-composer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.875rem;
  align-items: start;
}
.bloggen-field {
  display: flex;
  flex-direction: column;
}

/* Segmented post-count selector */
.bloggen-segment {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: hsl(var(--muted));
  border-radius: var(--radius);
}
.bloggen-seg-btn {
  flex: 1;
  height: 1.875rem;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius) - 3px);
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  font-family: inherit;
  transition:
    color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}
.bloggen-seg-btn:hover {
  color: hsl(var(--foreground));
}
.bloggen-seg-btn.active {
  background: #fff;
  color: hsl(var(--primary));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Image toggle card */
.bloggen-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.375rem;
  padding: 0.4rem 0.625rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: #fff;
}
.bloggen-toggle-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.bloggen-toggle-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.bloggen-toggle-hint {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
}

.bloggen-composer-foot {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.bloggen-status {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* Gradient primary action */
.bloggen-generate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 2.5rem;
  padding: 0 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, hsl(262 83% 58%), hsl(289 80% 60%));
  box-shadow: 0 4px 14px hsl(262 83% 58% / 0.35);
  transition:
    transform 0.12s,
    box-shadow 0.15s,
    opacity 0.15s;
}
.bloggen-generate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px hsl(262 83% 58% / 0.45);
}
.bloggen-generate-btn:active {
  transform: translateY(0);
}
.bloggen-generate-btn:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* ── Results grid ── */
.bloggen-results-head {
  display: flex;
  align-items: center;
  margin: 0.25rem 0 0;
}
.bloggen-results-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.75rem;
}
.bloggen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
  align-items: start;
}

/* ── Draft card ── */
.bloggen-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    box-shadow 0.18s,
    border-color 0.18s,
    transform 0.18s;
}
.bloggen-card:hover {
  border-color: hsl(var(--primary) / 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}
.bloggen-card-media {
  position: relative;
  height: 150px;
  background: hsl(var(--muted));
}
.bloggen-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bloggen-img-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0.4;
  background: linear-gradient(135deg, hsl(var(--muted)), hsl(262 83% 58% / 0.08));
}
.bloggen-cat {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: hsl(262 83% 45% / 0.9);
  backdrop-filter: blur(4px);
  padding: 3px 10px;
  border-radius: 100px;
}
.bloggen-card-body {
  display: flex;
  flex-direction: column;
  padding: 1rem;
}
.bloggen-title {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  color: hsl(var(--foreground));
}
.bloggen-excerpt {
  margin: 0 0 0.625rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
}
.bloggen-preview {
  max-height: 130px;
  overflow: hidden;
  position: relative;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
  mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.bloggen-preview h2,
.bloggen-preview h3 {
  font-size: 0.95rem;
  color: hsl(var(--foreground));
  margin: 0.5rem 0 0.25rem;
}
.bloggen-preview ul,
.bloggen-preview ol {
  margin-left: 1.1rem;
}
/* Quill 2 emits <ol> for both list types with data-list on each <li> */
.bloggen-preview ol {
  list-style: none;
  counter-reset: ql-c;
  padding-left: 1.2rem;
}
.bloggen-preview ol li {
  position: relative;
}
.bloggen-preview ol li[data-list="ordered"] {
  counter-increment: ql-c;
}
.bloggen-preview ol li[data-list="ordered"]::before {
  content: counter(ql-c) ". ";
  position: absolute;
  left: -1.2em;
}
.bloggen-preview ol li[data-list="bullet"]::before {
  content: "\2022";
  position: absolute;
  left: -1em;
  color: hsl(var(--primary));
}

/* Inline editor for a draft (title / category / excerpt / rich content) */
.bloggen-edit {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.bloggen-edit-label {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}
.bloggen-edit-label:first-child {
  margin-top: 0;
}
.bloggen-edit .bloggen-edit-title,
.bloggen-edit .bloggen-edit-cat,
.bloggen-edit .bloggen-edit-excerpt {
  font-size: 0.8125rem;
}
.bloggen-edit-content .ql-editor {
  min-height: 140px;
  max-height: 300px;
  overflow-y: auto;
}
.bloggen-actions .bloggen-edit-toggle {
  border-color: hsl(var(--primary) / 0.3);
  background: hsl(var(--primary) / 0.08);
  color: hsl(var(--primary));
}
.bloggen-actions .bloggen-edit-toggle:hover {
  background: hsl(var(--primary) / 0.15);
}

/* SEO scorecard inside a draft */
.bloggen-seo {
  margin-top: 0.875rem;
  border-top: 1px solid hsl(var(--border));
  padding-top: 0.75rem;
}
.bloggen-seo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bloggen-seo-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}
.bloggen-card .quality-checklist {
  grid-template-columns: 1fr;
}
.bloggen-kw-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.625rem;
}
.bloggen-kw-row .bloggen-kw {
  flex: 1;
  height: 2rem;
  font-size: 0.75rem;
}
.bloggen-fix {
  flex-shrink: 0;
  height: 2rem;
  padding: 0 0.625rem;
  border: 1px solid hsl(var(--primary) / 0.3);
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary) / 0.08);
  color: hsl(var(--primary));
  font-size: 0.7rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.bloggen-fix:hover {
  background: hsl(var(--primary) / 0.15);
}
.bloggen-fix:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Card actions */
.bloggen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid hsl(var(--border));
}
.bloggen-actions button {
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid hsl(var(--border));
  background: #fff;
  color: hsl(var(--foreground));
  transition:
    background 0.15s,
    opacity 0.15s;
}
.bloggen-actions button:hover {
  background: hsl(var(--muted));
}
.bloggen-actions .bloggen-publish {
  flex: 1;
  min-width: 8rem;
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, hsl(262 83% 58%), hsl(289 80% 60%));
  box-shadow: 0 2px 8px hsl(262 83% 58% / 0.3);
}
.bloggen-actions .bloggen-publish:hover {
  opacity: 0.92;
  background: linear-gradient(135deg, hsl(262 83% 58%), hsl(289 80% 60%));
}
.bloggen-actions .bloggen-discard {
  margin-left: auto;
  border-color: hsl(var(--destructive) / 0.2);
  background: hsl(var(--destructive) / 0.06);
  color: hsl(var(--destructive));
}
.bloggen-actions .bloggen-discard:hover {
  background: hsl(var(--destructive) / 0.12);
}
.bloggen-actions button:disabled {
  opacity: 0.7;
  cursor: default;
}

/* ── Empty state ── */
.bloggen-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1.5px dashed hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.4);
}
.bloggen-empty-ico {
  font-size: 2rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: hsl(262 83% 58% / 0.1);
  margin-bottom: 0.875rem;
}
.bloggen-empty-title {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}
.bloggen-empty-sub {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
  max-width: 26rem;
}

/* ── Loading skeletons ── */
.bloggen-skel {
  pointer-events: none;
}
.skel-box,
.skel-line {
  background: linear-gradient(90deg, hsl(var(--muted)) 25%, hsl(var(--border)) 37%, hsl(var(--muted)) 63%);
  background-size: 400% 100%;
  animation: bloggen-shimmer 1.4s ease infinite;
}
.skel-box {
  height: 150px;
}
.skel-line {
  height: 0.6rem;
  border-radius: 100px;
  margin-bottom: 0.625rem;
}
.skel-line.lg {
  height: 0.9rem;
  margin-bottom: 0.875rem;
}
.skel-line.sm {
  height: 0.5rem;
}
@keyframes bloggen-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* Stack composer fields on narrow viewports */
@media (max-width: 640px) {
  .bloggen-composer-grid {
    grid-template-columns: 1fr;
  }
  .bloggen-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════
   SEO PANEL — hero score, checklist, content-quality meter
   ══════════════════════════════════════════════════════════════ */
.seo-wrap {
  max-width: 52rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Hero score banner */
.seo-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, hsl(262 83% 58%), hsl(243 75% 59%));
  color: #fff;
  box-shadow: 0 10px 30px hsl(262 83% 58% / 0.25);
}
.seo-hero-glow {
  position: absolute;
  top: -60%;
  right: -10%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 70%);
  pointer-events: none;
}
.seo-hero-score {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.seo-score-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.9);
}
.seo-hero-text {
  position: relative;
  z-index: 1;
}
.seo-hero-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.seo-hero-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  max-width: 34rem;
}

.seo-score-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: conic-gradient(hsl(var(--border)) 0deg, hsl(var(--border)) 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.seo-score-ring span {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: hsl(var(--foreground));
}
.seo-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.5rem;
}
.seo-check {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.5rem 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background: #fff;
  transition:
    box-shadow 0.15s,
    transform 0.15s;
}
.seo-check:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}
.seo-check-ico {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
}
.seo-check.ok {
  border-color: rgba(22, 163, 74, 0.25);
  background: rgba(22, 163, 74, 0.05);
}
.seo-check.ok .seo-check-ico {
  background: #16a34a;
}
.seo-check.bad {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.04);
}
.seo-check.bad .seo-check-ico {
  background: #dc2626;
}
.seo-check-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.seo-check-text strong {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.seo-check-text em {
  font-style: normal;
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}
.seo-og-preview {
  width: 96px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid hsl(var(--border));
}
.seo-files-grid {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.seo-files-grid code {
  font-size: 0.75rem;
  background: hsl(var(--muted));
  padding: 1px 5px;
  border-radius: 4px;
}
.seo-sitemap-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.seo-sitemap-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.4rem 0.625rem;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  background: hsl(var(--muted) / 0.4);
}
.seo-sitemap-path {
  font-size: 0.75rem;
  background: hsl(var(--muted));
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}
.seo-sitemap-label {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stack the SEO hero on narrow viewports */
@media (max-width: 640px) {
  .seo-hero {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  .seo-hero-sub {
    max-width: none;
  }
}

/* Per-post SEO + content quality (inside blog editor) */
.blog-seo {
  margin-top: 0.75rem;
  border-top: 1px solid hsl(var(--border));
  padding-top: 0.75rem;
}
.blog-seo-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  font-family: inherit;
}
.quality-badge {
  font-size: 0.7rem;
  font-weight: 800;
}
.quality-meter {
  height: 8px;
  border-radius: 100px;
  background: hsl(var(--border));
  overflow: hidden;
  margin: 0.75rem 0 0.5rem;
}
.quality-meter-fill {
  height: 100%;
  width: 0;
  border-radius: 100px;
  transition:
    width 0.3s,
    background 0.3s;
}
.quality-checklist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1rem;
}
.quality-checklist li {
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  display: flex;
  gap: 0.375rem;
  align-items: baseline;
}
.quality-checklist li > span {
  font-weight: 700;
}
.quality-checklist li.ok > span {
  color: #16a34a;
}
.quality-checklist li.bad > span {
  color: #dc2626;
}
.quality-checklist li em {
  font-style: normal;
  opacity: 0.7;
}

/* ══════════════════════════════════════════════════════════════
   DOMAIN RESULT — rendered by app.js
   ══════════════════════════════════════════════════════════════ */
.domain-result {
  margin-top: 1rem;
  font-size: 0.75rem;
}

.domain-section-title {
  font-weight: 600;
  font-size: 0.75rem;
  margin: 0.75rem 0 0.375rem;
  color: hsl(var(--foreground));
}

.dns-table {
  width: 100%;
  border-collapse: collapse;
}
.dns-table th,
.dns-table td {
  padding: 0.375rem 0.5rem;
  border: 1px solid hsl(var(--border));
  text-align: left;
  font-size: 0.6875rem;
}
.dns-table th {
  background: hsl(var(--muted));
  font-weight: 600;
}

/* code-block: used by app.js for nginx config and SSL instructions */
.code-block {
  padding: 0.625rem;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  font-family: "Cascadia Code", "Fira Mono", monospace;
  font-size: 0.6875rem;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════
   AUTH OVERLAY
   ══════════════════════════════════════════════════════════════ */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.auth-overlay.hidden {
  display: none;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 1.25rem;
}
.auth-tab {
  flex: 1;
  padding: 0.5rem 0;
  border: none;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition:
    color 0.15s,
    border-color 0.15s;
  font-family: inherit;
}
.auth-tab.active {
  color: hsl(var(--foreground));
  border-bottom-color: hsl(var(--primary));
}
.auth-tab:hover:not(.active) {
  color: hsl(var(--foreground));
}

.auth-form {
  display: none;
}
.auth-form.active {
  display: block;
}

.auth-error {
  display: none;
  padding: 0.5rem 0.625rem;
  margin-bottom: 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--destructive) / 0.08);
  border: 1px solid hsl(var(--destructive) / 0.2);
  color: hsl(var(--destructive));
  font-size: 0.75rem;
  line-height: 1.4;
}
.auth-error.show {
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════════ */
.toast {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  max-width: 320px;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 500;
  opacity: 0;
  transform: translateY(0.5rem);
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.success {
  background: hsl(142 71% 45%);
  color: #fff;
}
.toast.error {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}
.toast.info {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground));
}

/* topbar-sub: queried by app.js to update subtitle text */
.topbar-sub {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* ══════════════════════════════════════════════════════════════
   SITE TYPE PICKER
   ══════════════════════════════════════════════════════════════ */
.site-type-option {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1.5px solid hsl(var(--border));
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
  color: hsl(var(--muted-foreground));
  user-select: none;
}
.site-type-option:hover {
  border-color: hsl(var(--primary) / 0.5);
  color: hsl(var(--foreground));
}
.site-type-option.selected {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.07);
  color: hsl(var(--primary));
  font-weight: 600;
}
.site-type-option .icon {
  font-size: 1rem;
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════════
   MEDIA LIBRARY
   ══════════════════════════════════════════════════════════════ */
.media-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}
.media-item {
  position: relative;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  aspect-ratio: 1;
  group: true;
}
.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  opacity: 0;
  transition: opacity 0.15s;
}
.media-item:hover .media-item-overlay {
  opacity: 1;
}
.media-item-overlay button {
  height: 1.625rem;
  padding: 0 0.625rem;
  border-radius: 0.25rem;
  border: none;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.media-btn-copy {
  background: #fff;
  color: #1f2937;
}
.media-btn-delete {
  background: hsl(var(--destructive));
  color: #fff;
}
.media-item-type {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.media-item-type-image {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}
.media-item-type-video {
  background: var(--primary);
  color: #fff;
}
.media-item-type-file {
  background: hsl(var(--foreground) / 0.78);
  color: #fff;
}
/* Placeholder shown for non-image / non-video files (PDF, DOCX, …) */
.media-item-file {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
.media-item-file svg {
  width: 38px;
  height: 38px;
}
.media-item-ext {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: hsl(var(--foreground));
}
.media-item-size {
  position: absolute;
  bottom: 0.25rem;
  right: 0.25rem;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ══════════════════════════════════════════════════════════════
   MEDIA PICKER MODAL
   ══════════════════════════════════════════════════════════════ */
.media-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.media-picker-overlay.hidden {
  display: none;
}

/* Reusable confirmation dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.confirm-overlay.hidden {
  display: none;
}
.confirm-modal {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: confirm-pop 0.15s ease-out;
}
@keyframes confirm-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.confirm-title {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0 0 0.5rem;
}
.confirm-message {
  font-size: 0.85rem;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
  margin: 0 0 1.25rem;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.media-picker-modal {
  background: hsl(var(--background));
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.media-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
  flex-shrink: 0;
}
.media-picker-close {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition:
    background 0.15s,
    color 0.15s;
}
.media-picker-close:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.media-picker-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}
.media-picker-upload-btn {
  margin-bottom: 1rem;
}
.media-picker-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid hsl(var(--border));
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}
.media-picker-item {
  position: relative;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: hsl(var(--muted));
  border: 2px solid hsl(var(--border));
  aspect-ratio: 1;
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.1s;
}
.media-picker-item:hover {
  border-color: hsl(var(--primary) / 0.5);
}
.media-picker-item img,
.media-picker-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-picker-item.selected {
  border-color: hsl(var(--primary));
}
.media-picker-item.selected::after {
  content: "✓";
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   BLOG / PROPERTY / MENU ITEMS
   ══════════════════════════════════════════════════════════════ */
.go-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
}
.go-live-badge-pending {
  background: hsl(45 96% 94%);
  color: hsl(40 96% 40%);
}
.go-live-badge-approved {
  background: hsl(142 71% 93%);
  color: hsl(142 71% 35%);
}
.go-live-badge-live {
  background: hsl(142 71% 93%);
  color: hsl(142 71% 35%);
}
.go-live-badge-rejected {
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}

/* ══════════════════════════════════════════════════════════════
   DISABLED STATES
   ══════════════════════════════════════════════════════════════ */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════════════
   ANALYTICS
   ══════════════════════════════════════════════════════════════ */
.nav-divider {
  height: 1px;
  margin: 0.625rem 0.625rem;
  background: rgba(255, 255, 255, 0.08);
}

.analytics-select {
  width: auto;
  min-width: 9rem;
}

.analytics-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}
@media (max-width: 900px) {
  .analytics-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.analytics-stat-card {
  background: #fff;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem;
}
.analytics-stat-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.375rem;
}
.analytics-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.analytics-chart-svg {
  width: 100%;
  height: 220px;
  color: hsl(var(--muted-foreground));
}

.analytics-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.analytics-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.375rem 0;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.8125rem;
}
.analytics-list-row:last-child {
  border-bottom: none;
}
.analytics-list-label {
  color: hsl(var(--foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.analytics-list-value {
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}

.heatmap-frame-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
}
.heatmap-scale-wrap {
  position: relative;
  transform-origin: top left;
}
.heatmap-iframe {
  display: block;
  border: none;
  pointer-events: none;
}
.heatmap-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* ── Billing / feature locks ── */
.nav-item .lock-badge { margin-left: auto; font-size: 11px; line-height: 1; opacity: .85; }
.bloggen-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1.5px dashed hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.4);
}
.bloggen-locked .bloggen-empty-sub {
  max-width: 26rem;
}
.bloggen-unlock {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  padding: 0.6rem 1.15rem;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary));
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 16px -6px hsl(var(--primary) / 0.6);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.bloggen-unlock:hover {
  background: hsl(var(--primary) / 0.92);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -8px hsl(var(--primary) / 0.6);
}
