/* ============================================
   Checklist Builder Styles
   Based on checklist-builder-v1.html prototype
   ============================================ */

/* CSS Variables — Warm, Sophisticated Palette */
.checklist-builder {
  --font-display: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Clean white palette */
  --cb-color-bg: #FFFFFF;
  --cb-color-bg-elevated: #FFFFFF;
  --cb-color-bg-hover: #F5F5F3;
  --cb-color-bg-active: #EEEEE9;

  /* Text hierarchy */
  --cb-color-text-primary: #1A1A18;
  --cb-color-text-secondary: #6B6B63;
  --cb-color-text-tertiary: #9C9C91;
  --cb-color-text-placeholder: #BEBEB3;

  /* Borders */
  --cb-color-border: #E8E8E3;
  --cb-color-border-strong: #D4D4CC;

  /* Accent — Deep terracotta */
  --cb-color-accent: #C45D35;
  --cb-color-accent-soft: #FDF5F2;
  --cb-color-accent-hover: #A84D2B;

  /* Semantic */
  --cb-color-success: #2D7A4F;
  --cb-color-success-soft: #E8F5ED;

  /* Room/Amenity tints */
  --cb-color-room-bg: #F8FAFC;
  --cb-color-room-border: #E2E8F0;
  --cb-color-amenity-bg: #FFFBEB;
  --cb-color-amenity-border: #FDE68A;

  /* Shadows */
  --cb-shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --cb-shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --cb-shadow-lg: 0 12px 40px rgba(0,0,0,0.08);

  /* Spacing scale */
  --cb-space-1: 4px;
  --cb-space-2: 8px;
  --cb-space-3: 12px;
  --cb-space-4: 16px;
  --cb-space-5: 20px;
  --cb-space-6: 24px;
  --cb-space-8: 32px;
  --cb-space-10: 40px;
  --cb-space-12: 48px;
  --cb-space-16: 64px;

  /* Transitions */
  --cb-transition-fast: 120ms ease;
  --cb-transition-normal: 200ms ease;
  --cb-transition-slow: 300ms ease-out;

  font-family: var(--font-body);
  font-weight: 400;
  color: var(--cb-color-text-primary);
  background: var(--cb-color-bg);
  line-height: 1.5;
  min-height: 100vh;
}

/* Main Content */
.checklist-builder .cb-main-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: var(--cb-space-6) var(--cb-space-6) var(--cb-space-16);
}

/* ============================================
   Page Header - Breadcrumb Style
   ============================================ */
.checklist-builder .cb-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--cb-space-4);
  margin-bottom: var(--cb-space-6);
}

/* Breadcrumb Navigation */
.checklist-builder .cb-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--cb-space-2);
  font-size: 13px;
}

.checklist-builder .cb-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.checklist-builder .cb-breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cb-color-text-secondary);
  text-decoration: none;
  font-weight: 450;
  transition: all var(--cb-transition-fast);
}

.checklist-builder .cb-breadcrumb-link:hover {
  color: var(--cb-color-text-primary);
  transform: scale(1.02);
}

.checklist-builder .cb-breadcrumb-link svg {
  width: 15px;
  height: 15px;
}

.checklist-builder .cb-breadcrumb-separator {
  color: var(--cb-color-text-placeholder);
}

.checklist-builder .cb-breadcrumb-separator svg {
  width: 12px;
  height: 12px;
}

.checklist-builder .cb-breadcrumb-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cb-color-text-primary);
  font-weight: 500;
}

/* Header Actions */
.checklist-builder .cb-header-actions {
  display: flex;
  align-items: center;
  gap: var(--cb-space-2);
}

.checklist-builder .cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all var(--cb-transition-fast);
  text-decoration: none;
}

.checklist-builder .cb-btn-ghost {
  background: transparent;
  color: var(--cb-color-text-secondary);
}

.checklist-builder .cb-btn-ghost:hover {
  background: var(--cb-color-bg-hover);
  color: var(--cb-color-text-primary);
}

.checklist-builder .cb-btn-primary {
  background: var(--cb-color-text-primary);
  color: var(--cb-color-bg);
}

.checklist-builder .cb-btn-primary:hover {
  background: #333330;
}

.checklist-builder .cb-btn svg {
  width: 15px;
  height: 15px;
}

/* ============================================
   Title Block
   ============================================ */
.checklist-builder .cb-title-block {
  margin-bottom: var(--cb-space-6);
}

.checklist-builder .cb-checklist-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--cb-color-text-primary);
  margin-bottom: var(--cb-space-4);
  border: none;
  background: none;
  width: 100%;
  outline: none;
  padding: 0;
  letter-spacing: -0.02em;
}

.checklist-builder .cb-checklist-title::placeholder {
  color: var(--cb-color-text-placeholder);
}

.checklist-builder .cb-title-meta {
  display: flex;
  align-items: center;
  gap: var(--cb-space-4);
  margin-bottom: var(--cb-space-4);
}

.checklist-builder .cb-type-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--cb-space-2);
  padding: var(--cb-space-2) var(--cb-space-3);
  background: var(--cb-color-accent-soft);
  color: var(--cb-color-accent);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--cb-transition-fast);
  border: none;
}

.checklist-builder .cb-type-badge:hover {
  background: #FAE9E3;
}

.checklist-builder .cb-type-badge svg {
  width: 14px;
  height: 14px;
}

.checklist-builder .cb-description-input {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--cb-color-text-secondary);
  background: none;
  border: none;
  padding: 0;
  outline: none;
  cursor: text;
  width: 100%;
  resize: none;
  min-height: 48px;
  overflow: hidden;
}

.checklist-builder .cb-description-input:focus {
  color: var(--cb-color-text-primary);
}

.checklist-builder .cb-description-input::placeholder {
  color: var(--cb-color-text-tertiary);
}

/* ============================================
   Sections
   ============================================ */
.checklist-builder .cb-section {
  margin-bottom: var(--cb-space-8);
  background: var(--cb-color-bg-elevated);
  border: 1px solid var(--cb-color-border);
  border-radius: 12px;
  overflow: visible;
}

/* Animation only for newly added sections */
.checklist-builder .cb-section.cb-section-new {
  animation: cb-fadeInUp 0.3s ease-out;
  animation-fill-mode: both;
}

@keyframes cb-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.checklist-builder .cb-section-header {
  display: flex;
  align-items: center;
  gap: var(--cb-space-3);
  padding: var(--cb-space-4) var(--cb-space-5);
  background: var(--cb-color-bg-hover);
  border-bottom: 1px solid var(--cb-color-border);
  border-radius: 12px 12px 0 0;
  cursor: grab;
}

.checklist-builder .cb-section-header:active {
  cursor: grabbing;
}

.checklist-builder .cb-section-drag-handle {
  color: var(--cb-color-text-tertiary);
  display: flex;
  align-items: center;
}

.checklist-builder .cb-section-drag-handle svg {
  width: 16px;
  height: 16px;
}

.checklist-builder .cb-section-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cb-color-text-primary);
  background: none;
  border: none;
  padding: 0;
  outline: none;
  flex: 1;
}

.checklist-builder .cb-section-title:focus {
  color: var(--cb-color-accent);
}

.checklist-builder .cb-section-actions {
  display: flex;
  align-items: center;
  gap: var(--cb-space-1);
}

.checklist-builder .cb-section-menu {
  padding: var(--cb-space-1);
  color: var(--cb-color-text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--cb-transition-fast);
  background: none;
  border: none;
}

.checklist-builder .cb-section-menu:hover {
  background: var(--cb-color-bg-active);
  color: var(--cb-color-text-secondary);
}

.checklist-builder .cb-section-menu svg {
  width: 16px;
  height: 16px;
}

/* Section Content */
.checklist-builder .cb-section-content {
  display: flex;
  flex-direction: column;
  padding: var(--cb-space-4) var(--cb-space-5);
  gap: var(--cb-space-1);
}

/* Section level label */
.checklist-builder .cb-content-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cb-color-text-tertiary);
  padding: var(--cb-space-3) 0 var(--cb-space-2);
  margin-top: var(--cb-space-2);
}

.checklist-builder .cb-content-group-label:first-child {
  margin-top: 0;
  padding-top: 0;
}

/* ============================================
   Tasks (Section-level)
   ============================================ */
.checklist-builder .cb-task-item {
  display: flex;
  align-items: flex-start;
  gap: var(--cb-space-3);
  padding: var(--cb-space-2) var(--cb-space-3);
  margin: 0 calc(var(--cb-space-3) * -1);
  border-radius: 6px;
  transition: background var(--cb-transition-fast);
  position: relative;
}

.checklist-builder .cb-task-item:hover {
  background: var(--cb-color-bg-hover);
}

.checklist-builder .cb-task-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--cb-color-border-strong);
  border-radius: 50%;
  margin-top: 2px;
  flex-shrink: 0;
  transition: all var(--cb-transition-fast);
  cursor: pointer;
}

.checklist-builder .cb-task-item:hover .cb-task-checkbox {
  border-color: var(--cb-color-text-secondary);
}

.checklist-builder .cb-task-content {
  flex: 1;
  min-width: 0;
}

.checklist-builder .cb-task-title-input {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--cb-color-text-primary);
  background: none;
  border: none;
  width: 100%;
  padding: 0;
  outline: none;
  line-height: 1.4;
}

.checklist-builder .cb-task-title-input::placeholder {
  color: var(--cb-color-text-placeholder);
}

.checklist-builder .cb-task-badges {
  display: flex;
  align-items: center;
  gap: var(--cb-space-2);
  margin-top: 2px;
}

.checklist-builder .cb-task-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--cb-transition-fast);
}

.checklist-builder .cb-task-badge-required {
  background: var(--cb-color-success-soft);
  color: var(--cb-color-success);
}

.checklist-builder .cb-task-badge-condition {
  background: var(--cb-color-accent-soft);
  color: var(--cb-color-accent);
  border: 1px solid rgba(196, 93, 53, 0.12);
}

.checklist-builder .cb-task-badge-image {
  background: #DBEAFE;
  color: #2563EB;
}

.checklist-builder .cb-task-badge svg {
  width: 12px;
  height: 12px;
}

.checklist-builder .cb-task-menu {
  opacity: 0;
  padding: var(--cb-space-1);
  color: var(--cb-color-text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--cb-transition-fast);
  background: none;
  border: none;
}

.checklist-builder .cb-task-item:hover .cb-task-menu {
  opacity: 1;
}

.checklist-builder .cb-task-menu:hover {
  background: var(--cb-color-bg-active);
  color: var(--cb-color-text-secondary);
}

.checklist-builder .cb-task-menu svg {
  width: 16px;
  height: 16px;
}

/* Photo Required Toggle */
.checklist-builder .cb-photo-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--cb-color-text-tertiary);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--cb-transition-fast);
  flex-shrink: 0;
}

.checklist-builder .cb-photo-toggle:hover {
  background: var(--cb-color-bg-hover);
  color: var(--cb-color-text-secondary);
}

.checklist-builder .cb-photo-toggle.active {
  color: #2563EB;
  background: #EFF6FF;
}

.checklist-builder .cb-photo-toggle svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   Room Block
   ============================================ */
.checklist-builder .cb-room-block {
  padding: var(--cb-space-2) 0;
  transition: all var(--cb-transition-fast);
}

.checklist-builder .cb-room-header {
  display: flex;
  align-items: center;
  gap: var(--cb-space-2);
  padding: var(--cb-space-2) var(--cb-space-3);
  margin: 0 calc(var(--cb-space-3) * -1);
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--cb-transition-fast);
}

.checklist-builder .cb-room-header:hover {
  background: var(--cb-color-bg-hover);
}

.checklist-builder .cb-room-icon {
  width: 24px;
  height: 24px;
  background: var(--cb-color-room-bg);
  border: 1px solid var(--cb-color-room-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.checklist-builder .cb-room-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #3B82F6;
  background: #EFF6FF;
  padding: 2px 6px;
  border-radius: 4px;
}

.checklist-builder .cb-room-title {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--cb-color-text-primary);
  background: none;
  border: none;
  padding: 0;
  outline: none;
}

.checklist-builder .cb-room-task-count {
  font-size: 11px;
  color: var(--cb-color-text-tertiary);
}

.checklist-builder .cb-room-menu {
  opacity: 0;
  padding: var(--cb-space-1);
  color: var(--cb-color-text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--cb-transition-fast);
  background: none;
  border: none;
}

.checklist-builder .cb-room-header:hover .cb-room-menu {
  opacity: 1;
}

.checklist-builder .cb-room-menu:hover {
  background: var(--cb-color-bg-active);
  color: var(--cb-color-text-secondary);
}

.checklist-builder .cb-room-menu svg {
  width: 16px;
  height: 16px;
}

.checklist-builder .cb-room-tasks {
  display: flex;
  flex-direction: column;
  margin-left: var(--cb-space-8);
  border-left: 2px solid var(--cb-color-room-border);
  padding-left: var(--cb-space-3);
  margin-top: var(--cb-space-1);
}

.checklist-builder .cb-room-task {
  display: flex;
  align-items: center;
  gap: var(--cb-space-3);
  padding: var(--cb-space-2) var(--cb-space-3);
  margin-left: calc(var(--cb-space-3) * -1);
  border-radius: 6px;
  transition: background var(--cb-transition-fast);
  position: relative;
}

.checklist-builder .cb-room-task:hover {
  background: var(--cb-color-bg-hover);
}

.checklist-builder .cb-room-task .cb-task-checkbox {
  width: 16px;
  height: 16px;
  margin-top: 0;
}

.checklist-builder .cb-room-task .cb-task-title-input {
  font-size: 13px;
}

.checklist-builder .cb-add-task-inline {
  display: flex;
  align-items: center;
  gap: var(--cb-space-2);
  padding: var(--cb-space-2) var(--cb-space-3);
  margin-left: calc(var(--cb-space-3) * -1);
  color: var(--cb-color-text-tertiary);
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--cb-transition-fast);
  background: none;
  border: none;
}

.checklist-builder .cb-add-task-inline:hover {
  background: var(--cb-color-bg-hover);
  color: var(--cb-color-text-secondary);
}

.checklist-builder .cb-add-task-inline svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   Amenity Block
   ============================================ */
.checklist-builder .cb-amenity-block {
  padding: var(--cb-space-2) 0;
  transition: all var(--cb-transition-fast);
}

.checklist-builder .cb-amenity-header {
  display: flex;
  align-items: center;
  gap: var(--cb-space-2);
  padding: var(--cb-space-2) var(--cb-space-3);
  margin: 0 calc(var(--cb-space-3) * -1);
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--cb-transition-fast);
}

.checklist-builder .cb-amenity-header:hover {
  background: var(--cb-color-bg-hover);
}

.checklist-builder .cb-amenity-icon {
  width: 24px;
  height: 24px;
  background: var(--cb-color-amenity-bg);
  border: 1px solid var(--cb-color-amenity-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.checklist-builder .cb-amenity-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #B45309;
  background: #FEF3C7;
  padding: 2px 6px;
  border-radius: 4px;
}

.checklist-builder .cb-amenity-title {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--cb-color-text-primary);
  background: none;
  border: none;
  padding: 0;
  outline: none;
}

.checklist-builder .cb-amenity-task-count {
  font-size: 11px;
  color: var(--cb-color-text-tertiary);
}

.checklist-builder .cb-amenity-menu {
  opacity: 0;
  padding: var(--cb-space-1);
  color: var(--cb-color-text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--cb-transition-fast);
  background: none;
  border: none;
}

.checklist-builder .cb-amenity-header:hover .cb-amenity-menu {
  opacity: 1;
}

.checklist-builder .cb-amenity-menu:hover {
  background: var(--cb-color-bg-active);
  color: var(--cb-color-text-secondary);
}

.checklist-builder .cb-amenity-menu svg {
  width: 16px;
  height: 16px;
}

.checklist-builder .cb-amenity-tasks {
  display: flex;
  flex-direction: column;
  margin-left: var(--cb-space-8);
  border-left: 2px solid var(--cb-color-amenity-border);
  padding-left: var(--cb-space-3);
  margin-top: var(--cb-space-1);
}

.checklist-builder .cb-amenity-task {
  display: flex;
  align-items: center;
  gap: var(--cb-space-3);
  padding: var(--cb-space-2) var(--cb-space-3);
  margin-left: calc(var(--cb-space-3) * -1);
  border-radius: 6px;
  transition: background var(--cb-transition-fast);
}

.checklist-builder .cb-amenity-task:hover {
  background: var(--cb-color-bg-hover);
}

.checklist-builder .cb-amenity-task .cb-task-checkbox {
  width: 16px;
  height: 16px;
  margin-top: 0;
}

.checklist-builder .cb-amenity-task .cb-task-title-input {
  font-size: 13px;
}

/* ============================================
   Add Buttons Row
   ============================================ */
.checklist-builder .cb-empty-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--cb-space-6) var(--cb-space-4);
  color: var(--cb-color-text-tertiary);
  font-size: 14px;
}

.checklist-builder .cb-add-buttons-row {
  display: flex;
  align-items: center;
  gap: var(--cb-space-2);
  margin-top: var(--cb-space-2);
  padding-top: var(--cb-space-2);
}

.checklist-builder .cb-add-buttons-row.has-items {
  margin-top: var(--cb-space-4);
  padding-top: var(--cb-space-3);
  border-top: 1px solid var(--cb-color-border);
}

.checklist-builder .cb-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--cb-color-text-secondary);
  background: none;
  border: 1px solid var(--cb-color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--cb-transition-fast);
}

.checklist-builder .cb-add-btn:hover {
  border-color: var(--cb-color-border-strong);
  background: var(--cb-color-bg-hover);
  color: var(--cb-color-text-primary);
}

.checklist-builder .cb-add-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   Inline Add Form
   ============================================ */
.checklist-builder .cb-inline-add-form {
  display: none;
  margin-top: var(--cb-space-3);
}

.checklist-builder .cb-inline-add-form.show {
  display: block;
  animation: cb-fadeIn 0.12s ease-out;
}

@keyframes cb-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.checklist-builder .cb-pending-item-row {
  display: flex;
  align-items: center;
  gap: var(--cb-space-3);
  padding: var(--cb-space-2) 0;
}

.checklist-builder .cb-pending-drag-handle {
  color: var(--cb-color-text-tertiary);
  cursor: grab;
}

.checklist-builder .cb-pending-drag-handle svg {
  width: 16px;
  height: 16px;
}

.checklist-builder .cb-pending-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--cb-color-text-primary);
  background: none;
  border: none;
  outline: none;
  padding: 0;
}

.checklist-builder .cb-pending-input::placeholder {
  color: var(--cb-color-text-tertiary);
  font-style: italic;
}

/* ============================================
   Autocomplete Dropdown
   ============================================ */
.checklist-builder .cb-autocomplete-wrapper {
  position: relative;
  flex: 1;
}

.checklist-builder .cb-autocomplete-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: -12px;
  width: 300px;
  background: var(--cb-color-bg-elevated);
  border: 1px solid var(--cb-color-border);
  border-radius: 10px;
  box-shadow: var(--cb-shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
}

.checklist-builder .cb-autocomplete-dropdown.show {
  display: block;
  animation: cb-dropdownIn 0.15s ease-out;
}

@keyframes cb-dropdownIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.checklist-builder .cb-autocomplete-section {
  padding: var(--cb-space-2) 0;
}

.checklist-builder .cb-autocomplete-section:not(:last-child) {
  border-bottom: 1px solid var(--cb-color-border);
}

.checklist-builder .cb-autocomplete-section-label {
  padding: var(--cb-space-2) var(--cb-space-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cb-color-text-tertiary);
}

.checklist-builder .cb-autocomplete-item {
  display: flex;
  align-items: center;
  gap: var(--cb-space-3);
  padding: var(--cb-space-2) var(--cb-space-3);
  cursor: pointer;
  transition: background var(--cb-transition-fast);
}

.checklist-builder .cb-autocomplete-item:hover {
  background: var(--cb-color-bg-hover);
}

.checklist-builder .cb-autocomplete-item-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cb-color-text-tertiary);
}

.checklist-builder .cb-autocomplete-item-icon svg {
  width: 16px;
  height: 16px;
}

.checklist-builder .cb-autocomplete-item-name {
  flex: 1;
  font-size: 14px;
  color: var(--cb-color-text-primary);
}

.checklist-builder .cb-autocomplete-item-type {
  font-size: 12px;
  color: var(--cb-color-text-tertiary);
}

/* Autocomplete dropdown styles when appended to body (outside .checklist-builder) */
[data-item-autocomplete-dropdown].cb-autocomplete-dropdown {
  position: fixed;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  opacity: 1;
  transform: translateY(0);
}

[data-item-autocomplete-dropdown] .cb-autocomplete-section {
  padding: 8px 0;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-section:not(:last-child) {
  border-bottom: 1px solid #f3f4f6;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-section-label {
  padding: 4px 12px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-item:hover {
  background: #f9fafb;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-item-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  flex-shrink: 0;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-item-icon svg {
  width: 16px;
  height: 16px;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-item-name {
  flex: 1;
  font-size: 14px;
  color: #1f2937;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-item-type {
  font-size: 12px;
  color: #9ca3af;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-create-new {
  padding: 12px;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-create-name {
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 10px;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-create-buttons {
  display: flex;
  gap: 8px;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-create-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-create-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

[data-item-autocomplete-dropdown] .cb-autocomplete-create-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   Add Section Button
   ============================================ */
.checklist-builder .cb-add-section-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--cb-space-2);
  width: 100%;
  padding: var(--cb-space-4);
  margin-top: var(--cb-space-4);
  border: 2px dashed var(--cb-color-border);
  border-radius: 12px;
  background: none;
  color: var(--cb-color-text-tertiary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--cb-transition-fast);
}

.checklist-builder .cb-add-section-btn:hover {
  border-color: var(--cb-color-text-secondary);
  color: var(--cb-color-text-secondary);
  background: var(--cb-color-bg-hover);
}

.checklist-builder .cb-add-section-btn svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   Condition Button & Modal
   ============================================ */
.checklist-builder .cb-condition-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--cb-color-text-tertiary);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--cb-transition-fast);
  flex-shrink: 0;
  opacity: 0;
}

.checklist-builder .cb-task-item:hover .cb-condition-btn,
.checklist-builder .cb-room-task:hover .cb-condition-btn,
.checklist-builder .cb-amenity-task:hover .cb-condition-btn {
  opacity: 1;
}

.checklist-builder .cb-condition-btn:hover {
  background: var(--cb-color-bg-hover);
  color: var(--cb-color-text-secondary);
}

.checklist-builder .cb-condition-btn.has-conditions {
  opacity: 1;
  color: var(--cb-color-accent);
  background: var(--cb-color-accent-soft);
}

.checklist-builder .cb-condition-btn.has-conditions:hover {
  background: #FAE9E3;
}

.checklist-builder .cb-condition-btn svg {
  width: 16px;
  height: 16px;
}

/* Condition Modal Backdrop */
.cb-condition-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 24, 0.35);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cb-conditionFadeIn 0.18s ease-out;
}

@keyframes cb-conditionFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Condition Modal Container */
.cb-condition-modal {
  background: #FFFFFF;
  border: 1px solid #E8E8E3;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.03);
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: cb-conditionSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cb-conditionSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cb-condition-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f6f5f5;
}

.cb-condition-modal-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1A1A18;
  line-height: 1.4;
}

.cb-condition-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: #9C9C91;
  border-radius: 6px;
  cursor: pointer;
  transition: all 120ms ease;
  margin-right: -4px;
}

.cb-condition-modal-close:hover {
  background: #EEEEE9;
  color: #1A1A18;
}

.cb-condition-modal-close svg {
  width: 18px;
  height: 18px;
}

.cb-condition-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cb-condition-section {
  margin-bottom: 24px;
}

.cb-condition-section:last-child {
  margin-bottom: 0;
}

.cb-condition-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9C9C91;
  margin-bottom: 12px;
  padding-left: 2px;
}

.cb-condition-list {
  max-height: 172px;
  overflow-y: auto;
  border: 1px solid #E8E8E3;
  border-radius: 8px;
  background: #FFFFFF;
}

.cb-condition-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 120ms ease;
  border-bottom: 1px solid #E8E8E3;
  position: relative;
}

.cb-condition-item:last-child {
  border-bottom: none;
}

.cb-condition-item:hover {
  background: #F5F5F3;
}

.cb-condition-item.selected {
  background: #FDF5F2;
}

.cb-condition-item.selected:hover {
  background: #FAE9E3;
}

.cb-condition-item.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: #C45D35;
  border-radius: 0 2px 2px 0;
}

.cb-condition-checkbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid #D4D4CC;
  border-radius: 4px;
  background: #FFFFFF;
  cursor: pointer;
  transition: all 120ms ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cb-condition-item.selected .cb-condition-checkbox {
  background: #C45D35;
  border-color: #C45D35;
}

.cb-condition-checkbox svg {
  width: 11px;
  height: 11px;
  color: white;
  opacity: 0;
  transition: opacity 120ms ease;
}

.cb-condition-item.selected .cb-condition-checkbox svg {
  opacity: 1;
}

.cb-condition-item-name {
  flex: 1;
  font-size: 13px;
  font-weight: 450;
  color: #1A1A18;
}

.cb-condition-item.selected .cb-condition-item-name {
  color: #A84D2B;
  font-weight: 500;
}

.cb-condition-item-tag {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  flex-shrink: 0;
}

.cb-condition-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid #E8E8E3;
}

.cb-condition-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 120ms ease;
}

.cb-condition-modal-btn-cancel {
  background: transparent;
  color: #6B6B63;
  padding: 8px 12px;
}

.cb-condition-modal-btn-cancel:hover {
  background: #EEEEE9;
  color: #1A1A18;
}

.cb-condition-modal-btn-save {
  background: #1A1A18;
  color: #FFFFFF;
}

.cb-condition-modal-btn-save:hover {
  background: #333330;
}

/* ============================================
   Condition Wizard Modal - Dynamic State Styles
   (These handle JavaScript class toggles that can't be done with static Tailwind)
   ============================================ */

/* Feature item selected state - for amenities and tags */
button.feature-item.selected,
.feature-item.selected {
  border-color: #fbbf24 !important; /* amber-400 */
  background-color: #fef3c7 !important; /* amber-100 for better visibility */
}

/* Show the checkmark icon when selected */
button.feature-item.selected .check-icon,
.feature-item.selected .check-icon {
  display: block !important;
}

/* Amenity icon container - when selected */
button.feature-item.selected > div:first-of-type,
.feature-item.selected > div:first-of-type {
  background-color: #fde68a !important; /* amber-200 */
}

button.feature-item.selected > div:first-of-type svg,
.feature-item.selected > div:first-of-type svg {
  color: #b45309 !important; /* amber-700 */
}

/* Tag text styling when selected */
button.feature-item.selected span,
.feature-item.selected span {
  color: #92400e !important; /* amber-800 */
}

/* Step transition animation */
[data-condition-wizard-target="step"] {
  animation: wizardStepIn 0.2s ease-out;
}

@keyframes wizardStepIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
  .checklist-builder .cb-main-content {
    padding: var(--cb-space-4) var(--cb-space-3) var(--cb-space-12);
  }

  .checklist-builder .cb-checklist-title {
    font-size: 28px;
  }

  .checklist-builder .cb-title-meta {
    margin-bottom: var(--cb-space-3);
  }

  .checklist-builder .cb-description-input {
    font-size: 15px;
  }

  .checklist-builder .cb-section {
    border-radius: 8px;
  }

  .checklist-builder .cb-section-header {
    padding: var(--cb-space-3) var(--cb-space-4);
  }

  .checklist-builder .cb-section-content {
    padding: var(--cb-space-3) var(--cb-space-4);
  }

  .checklist-builder .cb-task-item {
    margin-left: calc(var(--cb-space-2) * -1);
    margin-right: calc(var(--cb-space-2) * -1);
    padding: var(--cb-space-2);
  }

  .checklist-builder .cb-task-menu,
  .checklist-builder .cb-section-menu,
  .checklist-builder .cb-room-menu,
  .checklist-builder .cb-amenity-menu,
  .checklist-builder .cb-condition-btn {
    opacity: 1;
  }

  .checklist-builder .cb-room-tasks,
  .checklist-builder .cb-amenity-tasks {
    margin-left: var(--cb-space-6);
  }
}
