/* Freeform board UI theme tokens */
.freeform-library,
.freeform-save-modal,
.freeform-action-modal,
.freeform-autosave-recovery,
.freeform-status-pill,
.delete-confirmation-pill,
.new-board-modal-backdrop {
  --ff-board-surface: rgba(255, 255, 255, 0.98);
  --ff-board-surface-strong: rgba(255, 255, 255, 0.95);
  --ff-board-surface-soft: rgba(0, 0, 0, 0.03);
  --ff-board-surface-softer: rgba(0, 0, 0, 0.02);
  --ff-board-surface-subtle: rgba(0, 0, 0, 0.015);
  --ff-board-hover: rgba(0, 0, 0, 0.06);
  --ff-board-hover-strong: rgba(0, 0, 0, 0.1);
  --ff-board-border: rgba(0, 0, 0, 0.1);
  --ff-board-border-soft: rgba(0, 0, 0, 0.08);
  --ff-board-border-strong: rgba(0, 0, 0, 0.18);
  --ff-board-divider: rgba(0, 0, 0, 0.08);
  --ff-board-text: #222;
  --ff-board-text-strong: #111;
  --ff-board-text-muted: rgba(0, 0, 0, 0.6);
  --ff-board-text-soft: rgba(0, 0, 0, 0.45);
  --ff-board-text-softer: rgba(0, 0, 0, 0.4);
  --ff-board-selection: #222;
  --ff-board-selection-contrast: #fff;
  --ff-board-icon-filter: brightness(0);
  --ff-board-input-bg: rgba(255, 255, 255, 0.9);
  --ff-board-input-focus-bg: #fff;
  --ff-board-input-focus-ring: 0 0 0 3px rgba(0, 0, 0, 0.08);
  --ff-board-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
  --ff-board-shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.15);
  --ff-board-progress-track: rgba(0, 0, 0, 0.1);
  --ff-board-progress-bar: #000;
  --ff-board-spinner-track: rgba(0, 0, 0, 0.1);
  --ff-board-spinner-head: #222;
  --ff-board-success: #16a34a;
  --ff-board-success-border: rgba(22, 163, 74, 0.3);
  --ff-board-danger: #ef4444;
  --ff-board-danger-hover: #dc2626;
}

.freeform-library[data-theme="dark"],
.freeform-save-modal[data-theme="dark"],
.freeform-action-modal[data-theme="dark"],
.freeform-autosave-recovery[data-theme="dark"],
.freeform-status-pill[data-theme="dark"],
.delete-confirmation-pill[data-theme="dark"],
.new-board-modal-backdrop[data-theme="dark"] {
  --ff-board-surface: rgba(18, 20, 26, 0.96);
  --ff-board-surface-strong: rgba(24, 26, 32, 0.96);
  --ff-board-surface-soft: rgba(255, 255, 255, 0.06);
  --ff-board-surface-softer: rgba(255, 255, 255, 0.04);
  --ff-board-surface-subtle: rgba(255, 255, 255, 0.03);
  --ff-board-hover: rgba(255, 255, 255, 0.08);
  --ff-board-hover-strong: rgba(255, 255, 255, 0.14);
  --ff-board-border: rgba(255, 255, 255, 0.14);
  --ff-board-border-soft: rgba(255, 255, 255, 0.1);
  --ff-board-border-strong: rgba(255, 255, 255, 0.24);
  --ff-board-divider: rgba(255, 255, 255, 0.1);
  --ff-board-text: #eef1f7;
  --ff-board-text-strong: #f8fafc;
  --ff-board-text-muted: rgba(238, 241, 247, 0.72);
  --ff-board-text-soft: rgba(238, 241, 247, 0.56);
  --ff-board-text-softer: rgba(238, 241, 247, 0.46);
  --ff-board-selection: #eef1f7;
  --ff-board-selection-contrast: #111317;
  --ff-board-icon-filter: brightness(0) invert(1);
  --ff-board-input-bg: rgba(255, 255, 255, 0.04);
  --ff-board-input-focus-bg: rgba(255, 255, 255, 0.07);
  --ff-board-input-focus-ring: 0 0 0 3px rgba(255, 255, 255, 0.08);
  --ff-board-shadow: 0 24px 56px rgba(0, 0, 0, 0.48);
  --ff-board-shadow-soft: 0 16px 36px rgba(0, 0, 0, 0.36);
  --ff-board-progress-track: rgba(255, 255, 255, 0.14);
  --ff-board-progress-bar: #eef1f7;
  --ff-board-spinner-track: rgba(255, 255, 255, 0.18);
  --ff-board-spinner-head: #eef1f7;
  --ff-board-success: #4ade80;
  --ff-board-success-border: rgba(74, 222, 128, 0.28);
  --ff-board-danger: #f87171;
  --ff-board-danger-hover: #ef4444;
  color-scheme: dark;
}

/* Freeform Library Styles */
.freeform-library {
  position: fixed;
  inset: 0;
  z-index: 2147483647; /* CRITICAL: Maximum z-index to be ABOVE iconBar in all situations */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  /* CRITICAL: Allow touch interactions to pass through to modal */
  touch-action: auto;
}

.freeform-library-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1;
  /* Allow touch events to pass to modal on top */
  touch-action: auto;
}

.freeform-library-modal {
  position: relative;
  z-index: 2;
  width: min(680px, calc(100vw - 48px));
  max-width: 680px;
  height: auto;
  max-height: min(600px, calc(100vh - 80px));
  background: var(--ff-board-surface);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--ff-board-border);
  border-radius: 24px;
  box-shadow: var(--ff-board-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
  /* CRITICAL: Allow touch interactions inside modal (scroll, tap) */
  touch-action: auto;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  background: transparent;
  border-bottom: 1px solid var(--ff-board-divider);
  flex-shrink: 0;
}

.library-title {
  color: var(--ff-board-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.library-title-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  filter: var(--ff-board-icon-filter);
  opacity: 0.7;
}

/* Board count (e.g., "39 boards, 3 shared") */
.library-count {
  margin-left: auto;
  margin-right: 48px;
  color: var(--ff-board-text-soft);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

/* View Mode Toggle */
.library-view-toggle {
  display: flex;
  gap: 2px;
  background: var(--ff-board-surface-soft);
  padding: 3px;
  border-radius: 10px;
  margin-left: 12px;
}

.library-view-btn {
  width: 32px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.4;
}

.library-view-btn:hover {
  opacity: 0.7;
  background: var(--ff-board-hover);
}

.library-view-btn.active {
  background: var(--ff-board-hover-strong);
  opacity: 1;
}

.library-view-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--ff-board-text);
}

/* Search input */
.library-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ff-board-surface-soft);
  border: 1px solid var(--ff-board-border-soft);
  border-radius: 999px;
  padding: 6px 14px;
  margin-left: 12px;
  flex: 1;
  max-width: 200px;
  transition: all 0.2s ease;
}

.library-search:focus-within {
  background: var(--ff-board-hover);
  border-color: var(--ff-board-border-strong);
}

.library-search svg {
  width: 14px;
  height: 14px;
  stroke: var(--ff-board-text-soft);
  flex-shrink: 0;
}

.library-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--ff-board-text);
  width: 100%;
  font-family: system-ui, -apple-system, sans-serif;
}

.library-search input::placeholder {
  color: var(--ff-board-text-soft);
}

.library-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: var(--ff-board-surface-soft);
  border: 1px solid var(--ff-board-border);
  color: var(--ff-board-text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  z-index: 10;
}

.library-close:hover {
  color: var(--ff-board-text);
  background: var(--ff-board-hover-strong);
  transform: rotate(90deg);
  border-color: var(--ff-board-border-strong);
}

.library-scroll-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px;
  /* CRITICAL: Enable touch scrolling on iOS/iPadOS */
  touch-action: pan-y;
  -ms-touch-action: pan-y;
  /* Ensure scroll works even when touch events are captured elsewhere */
  overscroll-behavior: contain;
}

/* Thumbnail Grid View */
.library-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.library-list.list-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.library-item {
  background: var(--ff-board-surface-soft);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid var(--ff-board-border-soft);
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  transform: translateZ(0);
}

.library-item:hover {
  background: var(--ff-board-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: var(--ff-board-border-strong);
}

.library-item.active {
  border-color: var(--ff-board-selection);
  box-shadow: 0 0 0 1px var(--ff-board-selection), 0 8px 24px rgba(0,0,0,0.12);
}

.library-item.active::after {
  content: '✓';
  position: absolute;
  top: 10px;
  left: 10px;
  width: 24px;
  height: 24px;
  background: var(--ff-board-selection);
  color: var(--ff-board-selection-contrast);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 10;
  animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* When an item is loading, dim all OTHER items */
.library-list:has(.library-item.loading) .library-item:not(.loading) {
  opacity: 0.3;
  pointer-events: none;
  filter: grayscale(0.5);
  transition: all 0.3s ease;
}

/* The loading item gets highlighted */
.library-item.loading {
  pointer-events: none;
  border-color: var(--ff-board-selection) !important;
  box-shadow: 
    0 0 0 2px var(--ff-board-border),
    0 8px 24px rgba(0, 0, 0, 0.15) !important;
  transform: scale(1.02);
  z-index: 10;
  filter: none !important;
}

/* Ensure thumbnail image stays clear */
.library-item.loading .item-preview img {
  filter: none !important;
  opacity: 1 !important;
}

@keyframes freeform-spin { 
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); } 
}

.item-preview {
  aspect-ratio: 4/3;
  min-height: 0;
  background: var(--ff-board-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Smooth Hover Gradient Overlay */
.item-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.1) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 2;
  pointer-events: none;
}

.library-item:not(.loading):hover .item-preview::before {
  opacity: 1;
}

.item-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.library-item:hover .item-preview img {
  transform: scale(1.08);
}

.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--ff-board-surface-soft) 0%, var(--ff-board-hover) 100%);
  color: var(--ff-board-text-softer);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: system-ui, -apple-system, sans-serif;
}

.item-info {
  padding: 14px 16px;
  background: transparent;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.library-item:hover .item-info {
  background: var(--ff-board-surface-softer);
}

.item-date {
  color: var(--ff-board-text-softer);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
  margin-top: 4px;
}

.library-item:hover .item-date {
  color: var(--ff-board-text-muted);
}

.item-name {
  color: var(--ff-board-text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
  position: relative;
  transition: all 0.3s ease;
  line-height: 1.3;
}

.library-item:hover .item-name {
  color: var(--ff-board-text-strong);
}

/* Shared badge - MONOCHROME */
.item-shared-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 3px 8px;
  background: var(--ff-board-surface-soft);
  border: 1px solid var(--ff-board-border);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: var(--ff-board-text-muted);
  letter-spacing: 0.3px;
  vertical-align: middle;
}

.item-shared-badge svg {
  width: 10px;
  height: 10px;
  stroke: var(--ff-board-text-soft);
}

/* Tooltip for rename */
.item-name[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--ff-board-selection);
  color: var(--ff-board-selection-contrast);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  animation: tooltipFadeIn 0.2s ease forwards;
  animation-delay: 0.5s;
  z-index: 100;
  font-weight: 500;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

@keyframes tooltipFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.item-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
  display: flex;
  gap: 6px;
}

.library-item:hover .item-actions {
  opacity: 1;
}

.action-btn {
  background: var(--ff-board-surface-strong);
  border: 1px solid var(--ff-board-border);
  color: var(--ff-board-text-muted);
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Ensure SVG icon */
.action-btn svg {
  width: 14px !important;
  height: 14px !important;
  stroke: var(--ff-board-text) !important;
  stroke-width: 2.5px !important;
  opacity: 0.7 !important;
  display: block;
}

.action-btn:hover svg {
  opacity: 1;
}

.action-btn.delete-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.action-btn.delete-btn:hover svg {
  stroke: white !important;
}

.library-empty {
  text-align: center;
  color: var(--ff-board-text-softer);
  padding: 48px 24px;
  font-size: 13px;
  letter-spacing: 0.2px;
}

/* =====================================================
   LIST VIEW STYLES
   ===================================================== */
/* Hide autosave badge inside preview in list view */
.library-list.list-view .autosave-badge {
  display: none;
}

/* Show autosave indicator as text next to name in list view */
.library-list.list-view .item-autosave-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 6px;
  background: var(--ff-board-surface-soft);
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  color: var(--ff-board-text-soft);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* In grid view, hide the text label */
.library-list:not(.list-view) .item-autosave-label {
  display: none;
}

/* Loading overlay in list view - smaller spinner, centered, no text */
.library-list.list-view .freeform-load-overlay {
  background: var(--ff-board-surface-strong) !important;
}

.library-list.list-view .freeform-load-pill {
  flex-direction: row !important;
  gap: 0 !important;
}

.library-list.list-view .freeform-load-spinner {
  width: 20px !important;
  height: 20px !important;
  border-width: 2px !important;
}

.library-list.list-view .freeform-load-text {
  display: none !important;
}

.library-list.list-view .library-item:hover .item-actions {
  opacity: 1;
}

.library-list.list-view .library-item:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.library-list.list-view .library-item.active::after {
  top: 50%;
  transform: translateY(-50%);
  left: -6px;
  width: 3px;
  height: 20px;
  border-radius: 2px;
  font-size: 0;
}

.library-list.list-view .item-actions {
  position: static;
  opacity: 0;
  transition: opacity 0.2s;
  width: 36px;
}

/* ========================================
   LIST VIEW HEADER & COLUMN ALIGNMENT
   Using CSS Grid for perfect alignment
   ======================================== */

/* Header row - sticky with no gap */
.library-list-header {
  display: grid;
  grid-template-columns: 64px 1fr 72px 72px 45px 36px;
  align-items: center;
  padding: 6px 16px;
  gap: 16px;
  border-bottom: 1px solid var(--ff-board-divider);
  margin: -20px -24px 8px -24px;
  padding-left: 40px;
  padding-right: 40px;
  position: sticky;
  top: -20px;
  background: var(--ff-board-surface);
  z-index: 5;
}

/* Header column containers */
.header-col-preview { /* grid handles width */ }
.header-col-name { min-width: 0; }
.header-col-created { }
.header-col-modified { }
.header-col-shared { }
.header-col-actions { }

.header-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ff-board-text-softer);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: system-ui, -apple-system, sans-serif;
}

.header-cell:hover {
  background: var(--ff-board-hover);
  color: var(--ff-board-text-muted);
}

.header-cell.active {
  background: var(--ff-board-selection);
  color: var(--ff-board-selection-contrast);
}

.header-label {
  white-space: nowrap;
}

.header-arrow-icon {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  opacity: 0.9;
}

/* List items use same grid as header */
.library-list.list-view .library-item {
  display: grid;
  grid-template-columns: 64px 1fr 72px 72px 45px 36px;
  align-items: center;
  padding: 10px 16px;
  margin-left: 0;
  margin-right: 0;
  border-radius: 10px;
  gap: 16px;
}

.library-list.list-view .item-preview {
  width: 64px;
  height: 48px;
  aspect-ratio: auto;
  flex-shrink: 0;
  border-radius: 8px;
}

.library-list.list-view .item-info {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: transparent !important;
  min-width: 0;
  overflow: hidden;
}

.library-list.list-view .item-name {
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Column layout for meta info in list view */
.library-list.list-view .item-meta {
  display: none; /* Hide old meta, using columns instead */
}

/* Item columns - grid handles widths */
.library-list.list-view .item-col-created {
  color: var(--ff-board-text-muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.library-list.list-view .item-col-modified {
  color: var(--ff-board-text-muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.library-list.list-view .item-col-shared {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Shared info column in list view - MONOCHROME */
.library-list.list-view .item-shared-info {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--ff-board-surface-soft);
  border-radius: 999px;
  color: var(--ff-board-text-muted);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.library-list.list-view .item-shared-info svg {
  width: 12px;
  height: 12px;
  stroke: var(--ff-board-text-soft);
}

/* Empty shared column just takes up space */
.library-list.list-view .item-col-shared:empty {
  min-width: 90px;
}

/* Backups section (separate from primary boards list) */
.library-backups-section {
  grid-column: 1 / -1;
  border: 1px dashed var(--ff-board-border-strong);
  border-radius: 12px;
  background: var(--ff-board-surface-subtle);
  overflow: hidden;
  margin-top: 2px;
}

.library-backups-toggle {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
}

.library-backups-toggle:hover {
  background: var(--ff-board-surface-soft);
}

.library-backups-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.library-backups-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: var(--ff-board-text-muted);
}

.library-backups-subtitle {
  font-size: 10px;
  color: var(--ff-board-text-soft);
  letter-spacing: 0.2px;
}

.library-backups-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.library-backups-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  border-radius: 999px;
  background: var(--ff-board-surface-soft);
  color: var(--ff-board-text-muted);
  font-size: 10px;
  font-weight: 700;
}

.library-backups-chevron {
  color: var(--ff-board-text-softer);
  font-size: 12px;
  transition: transform 0.18s ease;
}

.library-backups-section.expanded .library-backups-chevron {
  transform: rotate(180deg);
}

.library-backups-content {
  display: none;
  gap: 12px;
  padding: 10px;
}

.library-backups-section.expanded .library-backups-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.library-backups-section.list-view .library-backups-content {
  padding: 8px 10px 10px;
}

.library-backups-section.list-view.expanded .library-backups-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.library-backups-content .library-item {
  margin: 0;
}

/* Tablet / portrait friendly spacing */
@media (max-width: 700px) {
  .freeform-library {
    padding: 12px;
  }

  .freeform-library-modal {
    width: calc(100vw - 24px);
    max-width: none;
    max-height: calc(100vh - 80px);
  }

  .library-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .library-backups-section.expanded .library-backups-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =====================================================
   TOUCH DEVICE SCROLLING FIX (iPad, tablets, mobile)
   ===================================================== */
@media (hover: none) and (pointer: coarse) {
  /* Ensure scroll container works with touch */
  .library-scroll-container {
    /* Allow vertical scrolling with finger/pen */
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
    /* Prevent overscroll bounce affecting parent */
    overscroll-behavior-y: contain;
  }
  
  /* Ensure modal itself allows touch interactions */
  .freeform-library-modal {
    touch-action: auto !important;
  }
  
  /* Ensure items don't block scroll */
  .library-item {
    touch-action: auto;
  }
  
  /* Header should allow horizontal touch but not block vertical scroll */
  .library-header {
    touch-action: pan-x pan-y;
  }
}

/* Skeleton Loading */
.library-item-skeleton {
  background: var(--ff-board-surface-soft);
  border-radius: 16px;
  overflow: hidden;
  height: 160px;
  border: 1px solid var(--ff-board-border-soft);
  width: 100%;
}

.skeleton-preview {
  height: 110px;
  background: var(--ff-board-hover);
  animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 10px;
  background: var(--ff-board-hover);
  border-radius: 4px;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 0.8; }
  100% { opacity: 0.5; }
}

/* Save panel (explicit Save / Save as copy / Overwrite) */
.freeform-save-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.freeform-save-modal.visible {
  opacity: 1;
}

.freeform-save-panel {
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--ff-board-surface);
  border: 1px solid var(--ff-board-border);
  border-radius: 18px;
  box-shadow: var(--ff-board-shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateY(6px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.freeform-save-modal.visible .freeform-save-panel {
  transform: translateY(0) scale(1);
}

.freeform-save-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.freeform-save-title {
  margin: 0;
  font-size: 19px;
  color: var(--ff-board-text-strong);
  letter-spacing: 0.1px;
}

.freeform-save-subtitle {
  margin: 0;
  color: var(--ff-board-text-muted);
  font-size: 13px;
}

.freeform-save-context-card {
  border: 1px solid var(--ff-board-border-soft);
  border-radius: 12px;
  background: var(--ff-board-surface-softer);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.freeform-save-context-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.freeform-save-context-label {
  color: var(--ff-board-text-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  font-weight: 700;
}

.freeform-save-context-value {
  color: var(--ff-board-text-strong);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.freeform-save-context-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ff-board-surface-soft);
  color: var(--ff-board-text-muted);
  font-size: 10px;
  letter-spacing: 0.45px;
  font-weight: 700;
}

.freeform-save-field-label {
  color: var(--ff-board-text-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  font-weight: 700;
}

.freeform-save-input,
.freeform-save-select {
  width: 100%;
  border: 1px solid var(--ff-board-border-strong);
  border-radius: 11px;
  background: var(--ff-board-input-bg);
  color: var(--ff-board-text-strong);
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.freeform-save-input:focus,
.freeform-save-select:focus {
  border-color: var(--ff-board-selection);
  box-shadow: var(--ff-board-input-focus-ring);
  background: var(--ff-board-input-focus-bg);
}

.freeform-save-input::placeholder {
  color: var(--ff-board-text-soft);
}

.freeform-save-input.error {
  border-color: #dc2626;
}

.freeform-save-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.freeform-save-mode-btn {
  border: 1px solid var(--ff-board-border);
  border-radius: 11px;
  background: var(--ff-board-surface-softer);
  padding: 10px 10px 11px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.freeform-save-mode-btn:hover {
  background: var(--ff-board-surface-soft);
}

.freeform-save-mode-btn.active {
  border-color: var(--ff-board-selection);
  background: var(--ff-board-hover);
}

.freeform-save-mode-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.freeform-save-mode-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ff-board-text-strong);
}

.freeform-save-mode-desc {
  font-size: 10px;
  color: var(--ff-board-text-soft);
}

.freeform-save-overwrite-target {
  display: none;
}

.freeform-save-overwrite-target.visible {
  display: block;
}

.freeform-save-preview {
  border: 1px dashed var(--ff-board-border-strong);
  border-radius: 11px;
  background: var(--ff-board-surface-softer);
  color: var(--ff-board-text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px;
}

.freeform-save-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.freeform-save-action {
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.freeform-save-action.cancel {
  background: var(--ff-board-surface-soft);
  color: var(--ff-board-text-muted);
}

.freeform-save-action.cancel:hover {
  background: var(--ff-board-hover-strong);
  color: var(--ff-board-text-strong);
}

.freeform-save-action.confirm {
  background: var(--ff-board-selection);
  color: var(--ff-board-selection-contrast);
}

.freeform-save-action.confirm:hover {
  background: var(--ff-board-text);
  transform: translateY(-1px);
}

/* Non-blocking recovery prompt for newer autosave backup */
.freeform-autosave-recovery {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(14px);
  opacity: 0;
  z-index: 2147483647;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.freeform-autosave-recovery.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.freeform-autosave-recovery-inner {
  min-width: 300px;
  max-width: min(640px, calc(100vw - 30px));
  background: var(--ff-board-surface);
  border: 1px solid var(--ff-board-border);
  border-radius: 13px;
  box-shadow: var(--ff-board-shadow-soft);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.freeform-autosave-recovery-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.freeform-autosave-recovery-text strong {
  color: var(--ff-board-text-strong);
  font-size: 12px;
}

.freeform-autosave-recovery-text span {
  color: var(--ff-board-text-muted);
  font-size: 11px;
}

.freeform-autosave-recovery-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.freeform-autosave-btn {
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.freeform-autosave-btn.keep {
  background: var(--ff-board-surface-soft);
  color: var(--ff-board-text-muted);
}

.freeform-autosave-btn.recover {
  background: var(--ff-board-selection);
  color: var(--ff-board-selection-contrast);
}

@media (max-width: 700px) {
  .freeform-save-panel {
    width: calc(100vw - 20px);
    padding: 16px;
    border-radius: 14px;
  }

  .freeform-save-modes {
    grid-template-columns: 1fr;
  }

  .freeform-save-actions {
    flex-direction: column-reverse;
  }

  .freeform-save-action {
    width: 100%;
  }

  .freeform-autosave-recovery {
    bottom: 12px;
  }

  .freeform-autosave-recovery-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .freeform-autosave-recovery-actions {
    width: 100%;
  }

  .freeform-autosave-btn {
    flex: 1;
  }
}

/* Generic Action Modal (Confirm / Prompt) - LIGHT THEME */
.freeform-action-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2147483647; /* CRITICAL: Maximum z-index to be above iconBar */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.freeform-action-modal.visible {
  opacity: 1;
}

.freeform-action-content {
  background: var(--ff-board-surface);
  border: 1px solid var(--ff-board-border);
  border-radius: 20px;
  padding: 28px;
  width: 90%;
  max-width: 420px;
  box-shadow: var(--ff-board-shadow);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.freeform-action-modal.visible .freeform-action-content {
  transform: scale(1);
}

.freeform-action-title {
  color: var(--ff-board-text);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.freeform-action-title-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.freeform-action-title-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  filter: var(--ff-board-icon-filter);
  opacity: 0.7;
}

.freeform-action-message {
  color: var(--ff-board-text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.freeform-action-input {
  background: var(--ff-board-input-bg);
  border: 1px solid var(--ff-board-border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--ff-board-text);
  font-size: 15px;
  width: 100%;
  outline: none;
  transition: all 0.2s;
}

.freeform-action-input:focus {
  border-color: var(--ff-board-selection);
  background: var(--ff-board-input-focus-bg);
  box-shadow: var(--ff-board-input-focus-ring);
}

.freeform-action-input::placeholder {
  color: var(--ff-board-text-soft);
}

/* Discrete overwrite hint pill */
.freeform-overwrite-hint {
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ff-board-surface-soft);
  border: 1px solid var(--ff-board-border-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--ff-board-text-muted);
}

.freeform-overwrite-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ff-board-selection);
}

.freeform-overwrite-text {
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}

.freeform-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.freeform-action-btn {
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.freeform-action-btn.cancel {
  background: var(--ff-board-surface-soft);
  color: var(--ff-board-text-muted);
}

.freeform-action-btn.cancel:hover {
  background: var(--ff-board-hover-strong);
  color: var(--ff-board-text);
}

.freeform-action-btn.confirm {
  background: var(--ff-board-selection);
  color: var(--ff-board-selection-contrast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.freeform-action-btn.confirm:hover {
  background: var(--ff-board-text);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.freeform-action-btn.danger {
  background: var(--ff-board-danger);
  color: #fff;
}

.freeform-action-btn.danger:hover {
  background: var(--ff-board-danger-hover);
}

/* ============================================================
   FREEFORM LIBRARY LOADING OVERLAY - LIGHT THEME
   ============================================================ */
.freeform-load-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: var(--ff-board-surface-strong) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 100 !important;
  border-radius: 0 !important;
}

.freeform-load-pill {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
}

/* Dark spinning circle */
.freeform-load-spinner {
  width: 40px !important;
  height: 40px !important;
  border: 3px solid var(--ff-board-spinner-track) !important;
  border-top-color: var(--ff-board-spinner-head) !important;
  border-radius: 50% !important;
  animation: freeform-spin 0.8s linear infinite !important;
  box-sizing: border-box !important;
}

/* LOADING text */
.freeform-load-text {
  color: var(--ff-board-text) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
}

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

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

/* Hide hover gradient when loading */
.library-item.loading .item-preview::before {
  opacity: 0 !important; 
}

/* Success state for loaded board */
.freeform-load-overlay.success .freeform-load-spinner {
  border-color: transparent !important;
  border-top-color: transparent !important;
  animation: none !important;
  background: var(--ff-board-success) !important;
  width: 32px !important;
  height: 32px !important;
}

.freeform-load-overlay.success .freeform-load-spinner::after {
  content: '✓' !important;
  color: white !important;
  font-size: 16px !important;
  font-weight: bold !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

.freeform-load-overlay.success .freeform-load-text {
  color: var(--ff-board-success) !important;
}

/* Thin black progress line on board card thumbnail */
.freeform-card-progress-wrap {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 3px !important;
  background: var(--ff-board-progress-track) !important;
  z-index: 200 !important;
  border-radius: 0 !important;
}

.freeform-card-progress-bar {
  height: 100% !important;
  width: 0%;
  background: var(--ff-board-progress-bar) !important;
  border-radius: 0 !important;
  transition: width 0.3s linear !important;
}

.freeform-card-progress-pct {
  position: absolute !important;
  bottom: 8px !important;
  right: 8px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  color: var(--ff-board-text-strong) !important;
  letter-spacing: 0.5px !important;
  z-index: 200 !important;
}

/* --------------------------------------------------------------------------
   Global Freeform Status Pill (Saving) - LIGHT THEME
   -------------------------------------------------------------------------- */
.freeform-status-pill {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2147483647; /* CRITICAL: Maximum z-index to be above iconBar */
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.freeform-status-pill--closing {
  opacity: 0;
  transform: translate(-50%, calc(-50% + 8px));
}

.freeform-status-pill-inner {
  background: var(--ff-board-surface-strong);
  border-radius: 999px;
  border: 1px solid var(--ff-board-border);
  padding: 12px 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--ff-board-shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.freeform-status-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--ff-board-spinner-track);
  border-top-color: var(--ff-board-spinner-head);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.freeform-status-text {
  color: var(--ff-board-text);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 700;
}

.freeform-status-pill--success .freeform-status-pill-inner {
  border-color: var(--ff-board-success-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.freeform-status-pill--success .freeform-status-text {
  color: var(--ff-board-success);
}

.freeform-status-pill--error .freeform-status-pill-inner {
  border-color: rgba(220, 38, 38, 0.3);
}

.freeform-status-pill--error .freeform-status-text {
  color: #dc2626;
}

/* Autosave Styles - LIGHT THEME */
.autosave-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--ff-board-surface-soft);
  color: var(--ff-board-text-muted);
  font-size: 9px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  z-index: 10;
  pointer-events: none;
  border: 1px solid var(--ff-board-border);
}

.library-item.autosave-item {
  border-color: var(--ff-board-border);
}

.library-item.autosave-item:hover {
  border-color: var(--ff-board-border-strong);
}

/* Delete Confirmation Pill - LIGHT THEME */
.delete-confirmation-pill {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 20px;
  z-index: 2147483647; /* CRITICAL: Maximum z-index to be above iconBar */
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.delete-confirmation-pill.active {
  opacity: 1;
  transform: translateY(0);
}

.confirm-pill-container {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--ff-board-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--ff-board-border);
  border-radius: 999px;
  padding: 14px 20px;
  box-shadow: var(--ff-board-shadow-soft);
}

.confirm-pill-icon {
  font-size: 20px;
}

.confirm-pill-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.confirm-pill-title {
  color: var(--ff-board-text);
  font-size: 13px;
  font-weight: 700;
}

.confirm-pill-subtitle {
  color: var(--ff-board-text-muted);
  font-size: 11px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confirm-pill-actions {
  display: flex;
  gap: 8px;
}

.confirm-pill-btn {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.confirm-pill-btn.confirm-no {
  background: var(--ff-board-surface-soft);
  color: var(--ff-board-text-muted);
}

.confirm-pill-btn.confirm-no:hover {
  background: var(--ff-board-hover-strong);
  color: var(--ff-board-text);
}

.confirm-pill-btn.confirm-yes {
  background: var(--ff-board-danger);
  color: white;
}

.confirm-pill-btn.confirm-yes:hover {
  background: var(--ff-board-danger-hover);
  transform: translateY(-1px);
}

/* New Board modal */
.new-board-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100002;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.new-board-modal {
  background: var(--ff-board-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  border: 1px solid var(--ff-board-border);
  box-shadow: var(--ff-board-shadow);
  text-align: center;
  transform: scale(0.9) translateY(10px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.new-board-modal-icon {
  width: 48px;
  height: 48px;
  background: var(--ff-board-surface-soft);
  border: 1px solid var(--ff-board-border-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--ff-board-text);
}

.new-board-modal-title {
  color: var(--ff-board-text);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  font-family: system-ui;
}

.new-board-modal-message {
  color: var(--ff-board-text-muted);
  font-size: 13px;
  margin: 0 0 24px;
  line-height: 1.5;
  font-family: system-ui;
}

.new-board-modal-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 22px;
  text-align: left;
}

.new-board-modal-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--ff-board-text);
  font-family: system-ui;
}

.new-board-modal-input {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--ff-board-border-strong);
  background: var(--ff-board-input-bg);
  color: var(--ff-board-text);
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
  outline: none;
  font-family: system-ui;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.new-board-modal-input:focus {
  border-color: var(--ff-board-selection);
  box-shadow: var(--ff-board-input-focus-ring);
  background: var(--ff-board-input-focus-bg);
}

.new-board-modal-input::placeholder {
  color: var(--ff-board-text-soft);
}

.new-board-modal-hint {
  font-size: 11px;
  color: var(--ff-board-text-soft);
  font-family: system-ui;
}

.new-board-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.new-board-modal-btn {
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: system-ui;
  transition: all 0.2s ease;
}

.new-board-modal-btn.secondary {
  background: var(--ff-board-surface-soft);
  border: 1px solid var(--ff-board-border);
  color: var(--ff-board-text-muted);
}

.new-board-modal-btn.secondary:hover {
  background: var(--ff-board-hover-strong);
  border-color: var(--ff-board-border-strong);
  color: var(--ff-board-text);
}

.new-board-modal-btn.primary {
  background: var(--ff-board-selection);
  border: none;
  color: var(--ff-board-selection-contrast);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.new-board-modal-btn.primary:hover {
  background: var(--ff-board-text);
  transform: translateY(-1px);
}

/* Beta label - for use in freeform context */
.freeform-beta-label {
  font-size: 9px;
  color: var(--ff-board-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--ff-board-surface-soft);
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 8px;
  border: 1px solid var(--ff-board-border-soft);
}
