@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,400;1,8..60,500&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@400;500;600&display=swap');


/* CSS Variables - Must come first */
/**
 * DataMint CSS Variables — Restyle
 *
 * New design tokens from the DataMint style system.
 * Old variables preserved as aliases for backward compatibility.
 *
 * Usage: var(--mint-700), var(--charcoal), var(--serif), etc.
 */
:root {
  /* ========================================
     Mint Scale
     ======================================== */
  --mint-900: #1E5C50;
  --mint-700: #2D7B6B;
  --mint-500: #50B9AD;
  --mint-300: #A8E1D4;
  --mint-100: #E6F5F2;
  --mint-50:  #F2FAF8;

  /* ========================================
     Warm Neutrals
     ======================================== */
  --ink:       #2C2825;
  --charcoal:  #3D3832;
  --stone-700: #5C554D;
  --stone-500: #8A8279;
  --stone-400: #A89F95;
  --stone-300: #C4BBB0;
  --sand:      #E0D8CE;
  --parchment: #F0EBE4;
  --cream:     #F6F1EB;
  --paper:     #FDFAF7;
  --white:     #FFFFFF;

  /* ========================================
     Functional Colors
     ======================================== */
  --amber:     #D4960A;
  --amber-bg:  #FDF6E7;
  --bloom:     #C48DA0;
  --bloom-bg:  #F9F0F3;
  --error:     #C44D3E;
  --error-bg:  #FDF0EE;
  --success:   var(--mint-700);
  --success-bg: var(--mint-50);

  /* Landmark documents on the Manifold constellation (ADR-002, Phase 4,
     2026-05-22). Deep burnt orange — colorblind-safe against mint and
     stone, picked by Karl. */
  --landmark:  #bf5700;

  /* ========================================
     Typography
     ======================================== */
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --mono:  'IBM Plex Mono', 'Menlo', 'Consolas', monospace;
  --sans:  'Inter', -apple-system, 'Segoe UI', sans-serif;

  /* ========================================
     UI Tokens
     ======================================== */
  --radius-card: 12px;
  --radius-button: 6px;
  --radius-input: 4px;

  --shadow-card: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-button: 0 1px 3px rgba(0,0,0,0.12);

  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* ========================================
     Legacy Aliases (Backward Compatibility)
     Remove these after all files are migrated.
     ======================================== */
  --color-mint: #2EC990;
  --color-eggplant: #5A2E4D;
  --color-orange: #FF5722;
  --color-border: #E2E8EA;
  --color-text-light: #6B7D81;
  --color-background: #f8f8f8;
  --color-light-orange: #FFE8E0;
  --color-legacy-blue: #4A90E2;
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, 'SF Mono', Monaco, Consolas, monospace;
  --font-mono-legacy: ui-monospace, 'SF Mono', Monaco, Consolas, monospace;
}
/* Template viewer styles */
/**
 * TEMPLATE-VIEWER.CSS - Template Viewer Component Styles
 *
 * Used by: Template viewer page/components
 * Status: ACTIVE
 *
 * TABLE OF CONTENTS:
 * ====================
 * 1. Container & Layout (lines ~1-10)
 * 2. V4 Header Design (lines ~10-100)
 * 3. Sharing Status Badges (lines ~58-82)
 * 4. URL Display (lines ~84-XXX)
 * [More sections - to be identified]
 *
 * NOTES:
 * - Contains "V4" designs - suggests multiple iterations
 * - Large file (1,442 lines) - could be split into sub-sections
 */
/* Template Viewer Container */
.template-viewer-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  background: var(--paper);
}
/* V4 Header Design */
.template-header-v4 {
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 24px;
}
.header-title,
.template-header-v4 h1,
.template-header-v4 .header-title {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: var(--ink) !important;
  margin-bottom: 4px !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
}
.header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--stone-500);
  margin-bottom: 20px;
}
.meta-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sharing-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.sharing-status.private {
  background: var(--cream);
  color: var(--stone-700);
}
.sharing-status.link {
  background: var(--mint-50);
  color: var(--mint-900);
}
.sharing-status.public {
  background: var(--mint-50);
  color: var(--mint-900);
}
.read-only-badge {
  background: var(--cream);
  color: var(--stone-700);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.url-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 37px;
}
/* Force all direct children to have same baseline */
.url-row > * {
  align-self: center !important;
  vertical-align: middle !important;
}
/* When no share URL, right-justify the actions */
.url-row:not(:has(.share-url-header)) {
  justify-content: flex-end;
}
/* Fallback for browsers without :has() support */
.url-row.no-share-url {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.url-row.no-share-url .back-btn {
  margin-right: auto;
}
/* Group the right-side buttons when no share URL */
.url-row.no-share-url .primary-btn {
  margin-left: auto;
  margin-right: 0;
}
.url-row.no-share-url .actions-menu {
  margin-left: 0;
}
.template-viewer-container .template-header-v4 .url-row .back-btn,
.template-viewer-container .template-header-v4 .url-row a.back-btn,
.back-btn,
.template-header-v4 .back-btn,
.template-header-v4 a.back-btn {
  background: var(--paper) !important;
  border: 1px solid var(--stone-300) !important;
  color: var(--stone-700) !important;
  padding: 0 14px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-size: 13px !important;
  flex-shrink: 0 !important;
  transition: all 0.2s !important;
  text-decoration: none !important;
  font-weight: normal !important;
  height: 37px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  line-height: 1 !important;
  margin: 0 !important;
  align-self: stretch !important;
  justify-content: center !important;
}
.back-btn:hover,
.template-header-v4 .back-btn:hover,
.template-header-v4 a.back-btn:hover {
  background: var(--cream) !important;
  color: var(--stone-700) !important;
}
.share-url-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--paper);
  border: 1px solid var(--stone-300);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--stone-700);
  flex: 1;
  min-width: 0;
  height: 37px;
  box-sizing: border-box;
}
.share-url-header input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  min-width: 0;
}
.share-url-header .copy-btn {
  background: var(--mint-700);
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: background-color 0.2s;
  flex-shrink: 0;
}
.share-url-header .copy-btn:hover {
  background: var(--mint-900);
}
.template-viewer-container .template-header-v4 .url-row .primary-btn,
.template-viewer-container .template-header-v4 .url-row button.primary-btn,
.primary-btn,
.template-header-v4 .primary-btn,
.template-header-v4 button.primary-btn {
  background: var(--mint-700) !important;
  color: white !important;
  border: none !important;
  padding: 0 18px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: background-color 0.2s !important;
  white-space: nowrap !important;
  height: 37px !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
}
.primary-btn:hover,
.template-header-v4 .primary-btn:hover,
.template-header-v4 button.primary-btn:hover {
  background: var(--mint-900) !important;
  border-color: transparent !important;
}
.secondary-btn {
  background: var(--paper) !important;
  border: 1px solid var(--stone-300) !important;
  color: var(--stone-700) !important;
  padding: 0 16px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-weight: normal !important;
  font-size: 13px !important;
  height: 37px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
.secondary-btn:hover {
  background: var(--cream) !important;
  border-color: var(--stone-400) !important;
}
.actions-menu {
  position: relative;
}
.template-viewer-container .template-header-v4 .url-row .menu-btn,
.template-viewer-container .template-header-v4 .url-row button.menu-btn,
.menu-btn,
.template-header-v4 .menu-btn,
.template-header-v4 button.menu-btn {
  background: var(--paper) !important;
  border: 1px solid var(--stone-300) !important;
  color: var(--stone-700) !important;
  padding: 0 12px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  transition: all 0.2s !important;
  font-weight: normal !important;
  height: 37px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}
.menu-btn:hover,
.template-header-v4 .menu-btn:hover,
.template-header-v4 button.menu-btn:hover {
  background: var(--cream) !important;
  border-color: var(--stone-300) !important;
}
.dropdown {
  position: absolute;
  top: calc(100% + 4px);  /* Small gap below button */
  right: 0;
  background: var(--paper);
  border: 1px solid var(--sand);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 8px 0;
  min-width: 180px;
  z-index: 1000;  /* Higher z-index to appear above popup content */
  display: none;
  max-height: 400px;  /* Prevent overflow in small popups */
  overflow-y: auto;  /* Scroll if too tall */
}
.dropdown.open {
  display: block;
}
.dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--stone-700);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.2s;
}
.dropdown-item:hover {
  background: var(--cream);
}
.dropdown-item.danger {
  color: var(--error);
}
.dropdown-item.danger:hover {
  background: var(--error-bg);
}
.dropdown-divider {
  height: 1px;
  background: var(--sand);
  margin: 8px 0;
}
/* Content Section */
.content-section,
.template-viewer-container .content-section {
  background: var(--cream) !important;
  border: 1px solid var(--sand) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}
.content-header,
.template-viewer-container .content-section .content-header {
  background: var(--paper) !important;
  padding: 18px 22px !important;
  border-bottom: 1px solid var(--sand) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  visibility: visible !important;
}
.content-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--charcoal);
}
.template-content-v4 {
  font-family: var(--mono);
  padding: 32px;
  white-space: pre-wrap;
  color: var(--stone-700);
  font-size: 13px;
  line-height: 1.7;
  background: var(--cream);
  min-height: 300px;
}
/* Legacy Template Header - REMOVED in favor of V4 */
.template-header-left {
  flex: 1;
}
.template-back-btn {
  background: var(--parchment);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--stone-500);
  cursor: pointer;
  margin-bottom: 16px;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}
.template-back-btn:hover {
  background: var(--sand);
}
.template-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.template-metadata {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.template-meta-item {
  background: var(--parchment);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--stone-500);
}
.template-meta-item.shared {
  background: var(--mint-100);
  color: var(--mint-700);
}
.template-meta-item.public {
  background: var(--mint-100);
  color: var(--mint-700);
}
.template-meta-item.link {
  background: var(--mint-100);
  color: var(--mint-700);
}
.template-meta-item.private {
  background: var(--parchment);
  color: var(--stone-700);
}
/* View Toggle */
.view-toggle,
.template-viewer-container .view-toggle,
.content-header .view-toggle {
  display: flex !important;
  background: var(--parchment) !important;
  border-radius: 8px !important;
  padding: 4px !important;
  visibility: visible !important;
}
.view-toggle-compact {
  padding: 2px !important;
  border-radius: 6px !important;
  background: var(--parchment) !important;
}
.view-toggle-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--sans);
  color: var(--stone-500);
  transition: all 0.2s;
  outline: none;
}
.view-toggle-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--mint-500);
}
.view-toggle-compact .view-toggle-btn {
  padding: 6px 12px !important;
  font-size: 13px !important;
  border-radius: 4px !important;
}
.view-toggle-btn.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.view-toggle-btn:hover:not(.active) {
  color: var(--ink);
}
/* Content Container */
.template-content-container {
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
  padding: 32px;
  min-height: 400px;
}
/* Pretty View */
.template-content-pretty {
  white-space: pre-line; /* Preserve single line breaks while allowing text wrapping */
}
.template-content-pretty h1 {
  font-size: 24px;
  color: var(--ink);
  margin-bottom: 16px;
  border-bottom: 2px solid var(--sand);
  padding-bottom: 8px;
}
.template-content-pretty h2 {
  font-size: 20px;
  color: var(--ink);
  margin: 24px 0 12px 0;
}
.template-content-pretty h3 {
  font-size: 16px;
  color: var(--charcoal);
  margin: 20px 0 8px 0;
}
.template-content-pretty p {
  margin-bottom: 12px;
  line-height: 1.7;
  color: var(--stone-700);
  white-space: pre-line; /* Also apply to paragraphs specifically */
}
.template-content-pretty ol,
.template-content-pretty ul {
  margin: 12px 0 12px 24px;
}
.template-content-pretty li {
  margin-bottom: 8px;
  line-height: 1.6;
  color: var(--stone-700);
}
.template-content-pretty strong {
  color: var(--ink);
  font-weight: 600;
}
.template-content-pretty code {
  background: var(--parchment);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 13px;
}
/* Raw View */
.template-content-raw pre {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  background: var(--cream);
  border-radius: 8px;
  padding: 20px;
  color: var(--charcoal);
  white-space: pre-wrap;
  overflow-x: auto;
  margin: 0;
}
/* Syntax View */
.template-content-syntax pre {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  background: var(--ink);
  border-radius: 8px;
  padding: 20px;
  color: var(--sand);
  white-space: pre-wrap;
  overflow-x: auto;
  margin: 0;
}
.syntax-heading {
  color: #F97316;  /* Orange for headings (# ##) */
  font-weight: bold;
}
.syntax-bold {
  color: var(--mint-500);  /* Mint green for bold (**) */
}
.syntax-list {
  color: var(--mint-500);  /* Mint green */
}
/* Show More Button */
.show-more-btn {
  background: var(--mint-700);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s;
}
.show-more-btn:hover {
  background: var(--mint-900);
}
/* Actions Panel */
.template-actions-panel {
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.template-actions-left,
.template-actions-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.template-action-btn {
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.template-action-btn.primary {
  background: var(--mint-700);
  color: white;
}
.template-action-btn.primary:hover {
  background: var(--mint-900);
}
.template-action-btn.secondary {
  background: var(--parchment);
  color: var(--stone-500);
  border: 1px solid var(--sand);
}
.template-action-btn.secondary:hover {
  background: var(--sand);
  color: var(--ink);
}
.action-icon {
  font-size: 16px;
}
/* Privacy Panel */
.template-privacy-panel {
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 24px;
  margin-top: 24px;
}
.privacy-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.privacy-label {
  font-weight: 500;
  color: var(--ink);
}
.privacy-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.privacy-btn {
  background: var(--parchment);
  border: 1px solid var(--sand);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--stone-500);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.privacy-btn:hover {
  background: var(--sand);
  color: var(--ink);
}
.privacy-btn.active {
  background: var(--mint-100);
  color: var(--mint-900);
  border-color: var(--mint-300);
}
.privacy-icon {
  font-size: 14px;
}
/* Share URL Panel */
.share-url-panel {
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
  display: none;
}
.share-url-panel.active {
  display: block;
}
.share-url-panel p {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--stone-500);
}
.share-url-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--stone-300);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--mono);
  background: var(--paper);
}
/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-container {
  background: var(--paper);
  border-radius: 12px;
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1001;
  margin: 20px;
  /* Ensure visibility */
  opacity: 1;
  visibility: visible;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--sand);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}
.modal-title-section {
  flex: 1;
}
.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.modal-metadata {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.modal-meta-item {
  font-size: 12px;
  color: var(--stone-500);
}
.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--parchment);
  color: var(--stone-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s;
}
.modal-close-btn:hover {
  background: var(--sand);
  color: var(--charcoal);
}
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
/* Ensure template content in modals uses proper dark theme colors */
.modal-body .template-content-syntax pre {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  background: var(--ink) !important;  /* Dark slate background */
  border-radius: 8px;
  padding: 20px;
  color: var(--sand) !important;  /* Light slate text */
  white-space: pre-wrap;
  overflow-x: auto;
  margin: 0;
}
.modal-body .syntax-heading {
  color: #F97316 !important;  /* Orange for headings */
  font-weight: bold;
}
.modal-body .syntax-bold {
  color: var(--mint-500) !important;  /* Mint green for bold */
}
.modal-body .syntax-list {
  color: var(--mint-500) !important;  /* Mint green for lists */
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--sand);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.modal-actions {
  display: flex;
  gap: 12px;
}
.modal-action-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.modal-action-btn.primary {
  background: var(--mint-700);
  color: white;
}
.modal-action-btn.primary:hover {
  background: var(--mint-900);
}
.modal-action-btn.secondary {
  background: var(--paper);
  color: var(--stone-500);
  border: 1px solid var(--sand);
}
.modal-action-btn.secondary:hover {
  background: var(--cream);
  color: var(--charcoal);
}
.modal-link {
  color: var(--mint-700);
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.modal-link:hover {
  text-decoration: underline;
}
.modal-loading,
.modal-error {
  padding: 40px;
  text-align: center;
  color: var(--stone-500);
}
.modal-error {
  color: var(--error);
}
/* Loading & Error States */
.template-viewer-loading,
.template-viewer-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--sand);
  border-top-color: var(--mint-700);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
/* Enhanced Template Cards */
.enhanced-card {
  border: 1px solid var(--sand);
  border-radius: 12px;
  padding: 20px;
  background: var(--paper);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  cursor: default; /* Remove cursor since we have action buttons */
}
.enhanced-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  border-color: var(--stone-300);
}
.template-title-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.template-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
  flex: 1;
  margin-right: 12px;
}
.template-card-badge.shared {
  background: var(--mint-100);
  color: var(--mint-900);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.template-card-badge.private {
  background: var(--parchment);
  color: var(--stone-700);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.template-stats-compact {
  margin-bottom: 12px;
}
.field-count {
  background: var(--parchment);
  color: var(--stone-500);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}
.template-card-desc {
  color: var(--stone-500);
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 16px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.template-fields-preview {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--cream);
  border-radius: 8px;
  border: 1px solid var(--parchment);
}
.fields-preview-header {
  font-size: 12px;
  color: var(--stone-500);
  margin-bottom: 8px;
  font-weight: 500;
}
.fields-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.field-tag {
  background: var(--sand);
  color: var(--charcoal);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.field-tag-more {
  background: var(--mint-100);
  color: var(--mint-900);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.template-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--parchment);
}
.template-date {
  font-size: 12px;
  color: var(--stone-400);
}
.template-actions {
  display: flex;
  gap: 8px;
}
.template-btn {
  padding: 4px 12px;
  border: 1px solid var(--sand);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--paper);
}
.template-btn.view-btn {
  color: var(--stone-500);
  border-color: var(--sand);
}
.template-btn.view-btn:hover {
  background: var(--parchment);
  border-color: var(--stone-300);
  color: var(--charcoal);
}
.template-btn.use-btn {
  background: var(--mint-700);
  color: white;
  border-color: var(--mint-700);
}
.template-btn.use-btn:hover {
  background: var(--mint-900);
  border-color: var(--mint-900);
}
.template-btn.delete-btn {
  color: var(--error);
  border-color: #fecaca;
  background: var(--error-bg);
}
.template-btn.delete-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}
/* Responsive Design - V4 Layout */
@media (max-width: 768px) {
  .template-viewer-container {
    padding: 16px;
  }

  .template-header-v4 {
    padding: 20px 24px;
  }

  .header-title {
    font-size: 20px;
  }

  .header-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .url-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .share-url-header {
    order: 1;
    max-width: none;
    width: 100%;
  }

  .content-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .template-content-v4 {
    padding: 20px;
    font-size: 12px;
  }

  /* Legacy styles for older layout */
  .template-header {
    flex-direction: column;
    gap: 16px;
  }

  .template-metadata {
    gap: 8px;
  }

  .template-actions-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .template-actions-left,
  .template-actions-right {
    justify-content: center;
  }

  .privacy-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .modal-footer {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .modal-actions {
    width: 100%;
  }

  .modal-action-btn {
    flex: 1;
  }
}
@media (max-width: 480px) {
  .template-viewer-container {
    padding: 10px;
  }

  .template-header-v4 {
    padding: 16px 20px;
    border-radius: 8px;
  }

  .header-title {
    font-size: 18px;
  }

  .template-content-v4 {
    padding: 16px;
  }
}
/* ========================================
   Shared Template View Styles
   ======================================== */
.shared-template-viewer {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  background: var(--paper);
  font-family: var(--sans);
}
.shared-template-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--sand);
}
.shared-template-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 20px 0;
}
.shared-template-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.shared-template-content {
  margin-bottom: 40px;
}
.shared-template-footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--sand);
  color: var(--stone-500);
  font-size: 0.9rem;
}
.shared-template-footer a {
  color: var(--mint-700);
  text-decoration: none;
  font-weight: 500;
}
.shared-template-footer a:hover {
  text-decoration: underline;
}
/* Responsive design for shared templates */
@media (max-width: 768px) {
  .shared-template-viewer {
    padding: 16px;
  }

  .shared-template-title {
    font-size: 1.5rem;
  }

  .shared-template-actions {
    flex-direction: column;
    gap: 12px;
  }
}
/* Sharing Modal */
.sharing-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.sharing-modal {
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
}
.sharing-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--sand);
}
.sharing-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--stone-400);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}
.modal-close-btn:hover {
  background: var(--parchment);
  color: var(--stone-500);
}
.sharing-modal-content {
  padding: 24px;
}
.visibility-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.visibility-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 2px solid var(--sand);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.visibility-option:hover {
  border-color: var(--stone-300);
  background: var(--cream);
}
.visibility-option.active {
  border-color: var(--mint-700);
  background: var(--mint-50);
}
.visibility-icon {
  font-size: 24px;
  width: 32px;
  text-align: center;
}
.visibility-info {
  flex: 1;
}
.visibility-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 4px;
}
.visibility-desc {
  font-size: 14px;
  color: var(--stone-500);
  line-height: 1.4;
}
.share-url-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--sand);
}
.share-url-section label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--charcoal);
  margin-bottom: 8px;
}
.share-url-container {
  display: flex;
  gap: 8px;
}
.share-url-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--stone-300);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--mono);
  background: var(--cream);
  outline: none;
}
.share-url-input:focus {
  border-color: var(--mint-700);
  background: var(--paper);
}
.copy-url-btn {
  padding: 10px 16px;
  background: var(--mint-700);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.copy-url-btn:hover {
  background: var(--mint-900);
}
/* Responsive Design for Sharing Modal */
@media (max-width: 768px) {
  .sharing-modal {
    margin: 16px;
    max-width: none;
  }

  .visibility-options {
    gap: 8px;
  }

  .visibility-option {
    padding: 12px;
  }

  .share-url-container {
    flex-direction: column;
  }
}
/**
 * PUBLIC-TEMPLATES.CSS - Public Templates Browse Page Styles
 *
 * Used by: Public templates browse/discovery page
 * Status: ACTIVE
 *
 * Contains:
 * - Page layout and container
 * - Header section
 * - Template grid display
 * - Template card variations for public view
 */
/* Public Templates Page */
.public-templates-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  background: var(--cream);
}
.public-templates-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 20px;
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.public-templates-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--serif);
  color: var(--ink);
  margin-bottom: 12px;
}
.public-templates-header p {
  font-size: 1.1rem;
  font-family: var(--sans);
  color: var(--stone-500);
  margin-bottom: 16px;
}
.templates-count {
  display: inline-block;
  background: var(--mint-100);
  color: var(--mint-700);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--mono);
}
/* Loading and Error States */
.public-templates-loading,
.public-templates-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  color: var(--stone-500);
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--sand);
  border-top-color: var(--mint-700);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
/* No Templates State */
.no-public-templates {
  text-align: center;
  padding: 80px 20px;
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.no-templates-icon {
  font-size: 4rem;
  margin-bottom: 24px;
}
.no-public-templates h3 {
  font-size: 1.5rem;
  font-weight: 600;
  font-family: var(--serif);
  color: var(--ink);
  margin-bottom: 12px;
}
.no-public-templates p {
  color: var(--stone-500);
  margin-bottom: 24px;
}
.browse-projects-btn {
  display: inline-block;
  background: var(--mint-700);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-input);
  text-decoration: none;
  font-weight: 500;
  font-family: var(--sans);
  transition: background 0.2s;
}
.browse-projects-btn:hover {
  background: var(--mint-900);
}
/* Templates Grid */
.public-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 24px;
}
.public-template-card {
  background: var(--paper);
  border-radius: var(--radius-card);
  border: 1px solid var(--sand);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.2s;
}
.public-template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--mint-700);
}
.template-card-header {
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid var(--sand);
}
.template-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--serif);
  color: var(--mint-700);
  margin-bottom: 8px;
}
.template-card-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  font-family: var(--mono);
  color: var(--stone-500);
}
.template-visibility {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  color: var(--mint-700);
}
.template-created {
  color: var(--stone-500);
}
.template-card-content {
  padding: 16px 24px 24px 24px;
}
.template-preview {
  font-size: 14px;
  color: var(--charcoal);
  line-height: 1.6;
  background: var(--cream);
  padding: 16px;
  border-radius: var(--radius-input);
  font-family: var(--mono);
  white-space: pre-line;
  max-height: 120px;
  overflow: hidden;
}
.template-card-actions {
  padding: 16px 24px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.template-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--sans);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.template-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.template-action-btn.primary {
  background: var(--mint-700);
  color: var(--white);
}
.template-action-btn.primary:hover:not(:disabled) {
  background: var(--mint-900);
}
.template-action-btn.secondary {
  background: var(--parchment);
  color: var(--charcoal);
}
.template-action-btn.secondary:hover:not(:disabled) {
  background: var(--sand);
}
.action-icon {
  font-size: 14px;
}
/* Responsive Design */
@media (max-width: 768px) {
  .public-templates-page {
    padding: 16px;
  }

  .public-templates-header {
    padding: 32px 16px;
  }

  .public-templates-header h1 {
    font-size: 2rem;
  }

  .public-templates-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .template-card-actions {
    flex-direction: column;
  }

  .template-action-btn {
    justify-content: center;
  }
}
/**
 * INDEX.CSS - Global Styles & Entry Point
 *
 * TABLE OF CONTENTS:
 * ====================
 * 1. Imports (lines 1-3)
 * 2. CSS Variables & Defaults (lines ~5-70) - Vite boilerplate
 * 3. Global Element Styles (lines ~5-70) - body, buttons, links
 * 4. Template Card Styles (lines ~72-242) - ⚠️ DUPLICATE - Also in template-cards.css
 *
 * ⚠️ CRITICAL ISSUE: Template card styles (lines ~72-242) are duplicated!
 * These styles appear in both:
 * - This file (index.css)
 * - features/templates/styles/template-cards.css
 *
 * TODO: Resolve duplication - determine canonical location
 */
/**
 * Global defaults — DataMint restyle
 * Replaces Vite boilerplate. No dark mode.
 */
:root {
  font-family: var(--serif);
  line-height: 1.6;
  font-weight: 400;
  color: var(--charcoal);
  background-color: var(--cream);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a {
  font-weight: 500;
  color: var(--mint-700);
  text-decoration: inherit;
}
a:hover {
  color: var(--mint-900);
}
body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
}
h1 {
  font-size: 3.2em;
  line-height: 1.1;
  color: var(--ink);
}
button {
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: var(--sans);
  background-color: var(--paper);
  cursor: pointer;
  transition: border-color 150ms ease;
}
button:hover {
  border-color: var(--sand);
}
button:focus {
  outline: none;
}
button:focus-visible {
  outline: 2px solid var(--mint-500);
  outline-offset: 2px;
}
/**
 * LEGACY.CSS - Old Static Site Styles
 *
 * ⚠️ WARNING: This file is 3,857 lines (52% of all CSS!)
 * Most of this is probably VESTIGIAL (from pre-React static site)
 *
 * Status: NEEDS COVERAGE ANALYSIS
 * Risk: HIGH - Don't know which parts are still used
 *
 * TABLE OF CONTENTS:
 * ====================
 * (To be filled in as sections are identified)
 *
 * KNOWN SECTIONS:
 * - Hero Section (approx lines ~10-50) - Status: VESTIGIAL?
 * - Site Header (approx lines ~56-85) - Status: UNKNOWN
 * - Navigation (approx lines ~87-XXX) - Status: UNKNOWN
 * - [More sections to be identified]
 *
 * ACTION NEEDED:
 * 1. Run CSS coverage analysis
 * 2. Extract used styles to proper component files
 * 3. DELETE unused styles
 */

/* DataMint Frontend Styles - Based on Mockup */

/* Base Styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--cream);
    color: var(--charcoal);
}

/* Auth Section */
.auth-section {
    background: var(--paper);
    padding: 16px 20px;
    border-bottom: 1px solid var(--sand);
}

.form-input {
    padding: 16px 20px;
    border: 2px solid var(--sand);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--mint-700);
}

.form-input:disabled {
    background: var(--cream);
    color: var(--stone-400);
    cursor: not-allowed;
}

.btn-large {
    padding: 16px 32px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: var(--mint-700);
    color: var(--white);
}

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

.btn-secondary {
    background: var(--cream);
    color: var(--stone-500);
    border: 2px solid var(--sand);
}

.btn-secondary:disabled {
    background: var(--cream);
    color: var(--stone-300);
    border-color: var(--parchment);
    cursor: not-allowed;
}

/* Minimal Line Dashboard */
.minimal-dashboard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.minimal-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.minimal-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--mint-700);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.minimal-email {
    font-size: 14px;
    color: var(--charcoal);
    font-weight: 500;
    margin: 0;
}

.minimal-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--stone-500);
}

.minimal-context {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.context-line {
    display: flex;
    gap: 6px;
    font-size: 12px;
    font-family: var(--mono);
}

.context-label {
    color: var(--stone-500);
    font-weight: 400;
}

.context-project {
    color: var(--charcoal);
    font-weight: 500;
}

.context-template {
    color: var(--charcoal);
    font-weight: 500;
}

/* Balance Display */
.minimal-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--cream);
    border: 1px solid var(--sand);
    border-radius: 6px;
}

.minimal-balance.low {
    background: var(--amber-bg);
    border-color: var(--amber);
}

.balance-label {
    font-size: 12px;
    color: var(--stone-500);
    font-family: var(--mono);
}

.balance-amount {
    font-size: 15px;
    color: var(--mint-700);
    font-weight: 700;
    font-family: var(--mono);
}

.balance-amount.low {
    color: var(--amber);
}

.balance-suffix {
    font-size: 12px;
    color: var(--stone-500);
    font-family: var(--mono);
}

/* Template Selector Section */
.template-selector-section {
    background: var(--cream);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--sand);
}

.template-selector-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.template-selector-header label {
    font-weight: 600;
    color: var(--stone-700);
    font-size: 14px;
}

.template-dropdown {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--sand);
    border-radius: 4px;
    background: var(--paper);
    font-size: 14px;
    max-width: 400px;
}

.template-selector-info {
    font-size: 12px;
    color: var(--stone-500);
    font-style: italic;
}

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

.btn-small {
    padding: 8px 16px;
    border: 1px solid var(--sand);
    border-radius: 6px;
    background: var(--cream);
    color: var(--stone-500);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: var(--mono);
}

.btn-small:hover {
    border-color: var(--stone-500);
    color: var(--charcoal);
    background: var(--sand);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .minimal-dashboard {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .minimal-stats {
        justify-content: center;
    }
}

/* Page Layout */
.page {
    display: none;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    background: transparent;
    min-height: 70vh;
}

.page.active {
    display: block;
}

.page-title {
    text-align: center;
    font-size: 24px;
    font-weight: 400;
    margin: 0 0 40px 0;
    color: var(--charcoal);
}

.content {
    width: 100%;
}

/* Landing Page */
.landing-content {
    text-align: center;
    padding: 60px 20px;
}

/* Upload Section */
.upload-section {
    border: 2px dashed var(--stone-300);
    border-radius: 8px;
    padding: 40px 20px;
    margin-bottom: 40px;
    text-align: center;
    background: var(--cream);
    transition: all 0.2s ease;
}

.upload-section.dragover {
    border-color: var(--mint-700);
    background: var(--mint-50);
}

.drop-zone {
    margin-bottom: 20px;
}

.drop-zone-text {
    font-size: 18px;
    color: var(--stone-500);
    margin-bottom: 8px;
}

.drop-zone-subtext {
    font-size: 14px;
    color: var(--stone-400);
}

.upload-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.upload-btn {
    background: var(--mint-700);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.upload-btn:hover {
    background: var(--mint-900);
    transform: translateY(-1px);
}

/* Top Buttons for Step 2 */
.top-buttons {
    text-align: center;
    margin-bottom: 40px;
}

.top-button {
    display: inline-block;
    margin: 0 10px;
    background: var(--paper);
    border: 2px solid var(--sand);
    border-radius: 6px;
    padding: 18px 20px;
    text-align: center;
    cursor: pointer;
    min-width: 130px;
    vertical-align: top;
    transition: all 0.2s ease;
}

.top-button:hover {
    border-color: var(--stone-400);
    background: var(--parchment);
}

.top-button.active {
    border-color: var(--mint-700);
    background: var(--mint-50);
}

.top-button-title {
    font-size: 30px;
    font-weight: bold;
    font-family: var(--serif);
    color: var(--charcoal);
    margin: 0 0 6px 0;
    line-height: 1;
}

.top-button-desc {
    font-size: 15px;
    font-family: var(--sans);
    color: var(--stone-500);
    line-height: 1.3;
    margin: 0;
}

/* Content Section */
.content-section {
    padding: 0 20px;
}

.section-title {
    margin: 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--charcoal);
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 0;
}

.template-card {
    background: var(--paper);
    border: 1px solid var(--sand);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-card:hover {
    border-color: var(--mint-700);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.template-card.selected {
    border-color: var(--mint-700);
    background: var(--mint-50);
}

.template-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--charcoal);
}

.template-card-desc {
    font-size: 14px;
    color: var(--stone-500);
    line-height: 1.4;
    margin-bottom: 15px;
}

.template-card-meta {
    font-size: 12px;
    color: var(--stone-400);
    display: flex;
    justify-content: space-between;
}

/* Enhanced template card styling - matching inspection_standalone_v2.html aesthetic */
.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

/* New 2-line template card layout */
.card-row-1 {
    margin-bottom: 8px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--mint-700);
    margin: 0;
    line-height: 1.2;
}

.card-row-2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--stone-500);
    gap: 12px;
}

.card-left-section {
    display: flex;
    align-items: center;
    flex: 1;
}

.card-right-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-date {
    margin: 0;
}

.card-badge {
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.card-badge.private {
    background: var(--amber-bg);
    color: var(--amber);
    border: 1px solid var(--amber);
}

.card-badge.shared {
    background: var(--mint-100);
    color: var(--mint-900);
    border: 1px solid var(--mint-300);
}

.card-actions {
    display: flex;
    align-items: center;
}

.card-trash-icon {
    background: none;
    border: none;
    color: var(--stone-500);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    transition: color 0.2s ease;
    border-radius: 4px;
}

.card-trash-icon:hover {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error);
}

.template-card-visibility {
    font-size: 14px;
    opacity: 0.7;
}

.template-meta-item {
    display: inline-block;
    margin-right: 12px;
    font-size: 11px;
    color: var(--stone-500);
}

.template-meta-item:last-child {
    margin-right: 0;
}

/* Updated template cards to match inspection_standalone_v2.html */
.templates-grid .template-card,
#my-templates-grid .template-card,
.template-card {
    background: var(--paper);
    border: 1px solid var(--sand);
    border-radius: 6px;
    padding: 16px 20px 16px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 12px;
    line-height: 1.3;
}

.templates-grid .template-card:hover,
#my-templates-grid .template-card:hover,
.template-card:hover {
    border-color: var(--mint-700);
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.1);
}

.templates-grid .template-card-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--mint-700);
}

/* Empty and error states */
.templates-empty,
.templates-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--stone-500);
    background: var(--paper);
    border: 1px solid var(--sand);
    border-radius: 6px;
}

.templates-empty p {
    margin: 8px 0;
}

.templates-error {
    color: var(--error);
}

.retry-btn {
    background: var(--mint-700);
    color: var(--white);
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 12px;
}

.retry-btn:hover {
    background: var(--mint-900);
}

.gallery-actions {
    text-align: center;
    margin-top: 30px;
}

.start-assistant-btn {
    background: var(--mint-700);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.start-assistant-btn:hover {
    background: var(--mint-900);
    transform: translateY(-1px);
}

/* Template Assistant - Engineering Expert Robust Centering Solution */
.dm-grid-center {
    inline-size: 100%;
    display: grid;
    justify-items: center;      /* centers children horizontally */
    margin-bottom: 100vh;       /* Keep scroll alignment space */
}

/* Override constraining parent .content styles for Template Assistant */
.content:has(.dm-grid-center) {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.dm-fixed {
    inline-size: min(100%, 700px);
    box-sizing: border-box;
    padding-inline: 16px;       /* optional gutter */
}

.template-assistant-wrapper {
    background: transparent;
    border-radius: 12px;
    padding: 30px;
    width: 100%;
    box-sizing: border-box;
}

.start-over-container {
    text-align: right;
    margin-bottom: 20px;
}

.start-over-container-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--sand);
}

.start-over-global-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--error);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.start-over-global-btn:hover {
    background: var(--error);
}

.start-over-icon {
    font-size: 14px;
}

.assistant-progress-container {
    margin-bottom: 40px;
}

.assistant-progress-flow {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.assistant-flow-arrow {
    font-size: 16px;
    color: var(--stone-500);
    font-weight: 500;
}

.assistant-flow-step {
    background: var(--paper);
    border: 2px solid var(--sand);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    min-width: 90px;
    flex: 1;
    max-width: 110px;
    transition: all 0.2s ease;
}

.assistant-flow-step.active {
    border-color: var(--mint-700);
    background: var(--mint-50);
}

.assistant-flow-step.completed {
    border-color: var(--mint-100);
    background: var(--paper);
    border-width: 1px;
}

.assistant-flow-step.completed .assistant-flow-title {
    color: var(--stone-400);
}

.assistant-flow-title {
    font-size: 16px;
    font-weight: normal;
    color: var(--charcoal);
    line-height: 1.3;
}

.assistant-flow-subtitle {
    font-size: 13px;
    color: var(--stone-500);
    line-height: 1.3;
}

.assistant-step-content {
    display: none;
}

.assistant-step-content.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.15s ease-in-out;
}

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

.assistant-form-section {
    margin-bottom: 30px;
}

.assistant-form-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 8px;
}

.assistant-form-help {
    font-size: 14px;
    color: var(--stone-500);
    margin-bottom: 15px;
    line-height: 1.4;
}

.assistant-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 1px solid var(--sand);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.assistant-textarea:focus {
    border-color: var(--mint-700);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.assistant-ai-response {
    background: var(--cream);
    border: 1px solid var(--sand);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--stone-700);
}

.assistant-empty {
    color: var(--stone-400);
    font-style: italic;
    text-align: center;
}

.assistant-button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* When there are multiple buttons, spread them apart */
.assistant-button-group > * + * {
    margin-left: auto;
}

.back-btn, .assistant-btn-secondary {
    background: var(--stone-500);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.back-btn:hover, .assistant-btn-secondary:hover {
    background: var(--stone-700);
}

.assistant-btn-primary {
    background: var(--mint-700);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.assistant-btn-primary:hover {
    background: var(--mint-900);
}

.assistant-columns-display {
    background: var(--paper);
    border: 1px solid var(--sand);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.assistant-decision-container {
    text-align: center;
    margin-top: 30px;
}

.assistant-preview-hint {
    background: var(--mint-50);
    border: 1px solid var(--mint-300);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: left;
}

.assistant-preview-hint p {
    margin: 0;
    color: var(--mint-700);
    font-size: 14px;
    line-height: 1.4;
}

.assistant-decision-question {
    font-size: 16px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 20px;
}

.assistant-decision-buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.assistant-decision-btn {
    background: var(--paper);
    border: 2px solid var(--sand);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    max-width: 200px;
}

.assistant-decision-btn:hover {
    border-color: var(--mint-700);
    transform: translateY(-2px);
}

.assistant-decision-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.assistant-decision-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 5px;
}

.assistant-decision-desc {
    font-size: 12px;
    color: var(--stone-500);
}

.template-preview {
    background: var(--cream);
    border: 1px solid var(--sand);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.save-template-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.template-name-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--sand);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.template-name-input:focus {
    border-color: var(--mint-700);
}

.save-template-btn {
    background: var(--mint-700);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.save-template-btn:hover {
    background: var(--mint-900);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--stone-500);
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 8px;
    font-family: var(--serif);
}

.empty-state-description {
    font-size: 14px;
    color: var(--stone-500);
    line-height: 1.5;
    margin: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    background: var(--paper);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--parchment);
    border-top: 4px solid var(--mint-700);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.loading-text {
    font-size: 16px;
    color: var(--charcoal);
}

/* Utility Classes */

/* Step 4 Template Actions */
.template-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.template-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--mint-700);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

.template-action-btn:hover {
    background: var(--mint-900);
    transform: translateY(-1px);
}

.template-action-btn.start-over-btn {
    background: var(--error);
}

.template-action-btn.start-over-btn:hover {
    background: var(--error);
}

.action-icon {
    font-size: 16px;
}

/* Template Preview Section */
.template-preview-section {
    margin-bottom: 25px;
}

.template-preview-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 15px;
}

/* Template Direct Edit */
.template-edit-section {
    margin-bottom: 25px;
}

.template-edit-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 15px;
}

.template-edit-textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid var(--sand);
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 15px;
}

.template-edit-textarea:focus {
    outline: none;
    border-color: var(--mint-700);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.template-edit-actions {
    display: flex;
    gap: 10px;
}

.save-edit-btn {
    padding: 10px 20px;
    background: var(--mint-700);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.save-edit-btn:hover {
    background: var(--mint-900);
}

.cancel-edit-btn {
    padding: 10px 20px;
    background: var(--stone-500);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cancel-edit-btn:hover {
    background: var(--stone-700);
}

/* Validation Results */
.validation-results {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--sand);
}

.validation-results h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 15px;
}

.validation-content {
    font-size: 14px;
    line-height: 1.6;
}

.validation-success {
    background: var(--mint-100);
    border-color: var(--mint-300);
    color: var(--mint-900);
}

.validation-error {
    background: var(--error-bg);
    border-color: var(--error);
    color: var(--error);
}

.validation-warning {
    background: var(--amber-bg);
    border-color: var(--amber);
    color: var(--amber);
}

/* Template Assistant Edit Choice Section */
.assistant-edit-choice-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--sand);
}

.assistant-edit-choices {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.assistant-edit-choice-btn {
    flex: 1;
    background: var(--paper);
    border: 2px solid var(--sand);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.assistant-edit-choice-btn:hover {
    border-color: var(--mint-700);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.assistant-choice-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.assistant-choice-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 5px;
}

.assistant-choice-desc {
    font-size: 12px;
    color: var(--stone-500);
}

/* Direct Edit and AI Refinement Sections */
.assistant-direct-edit-section,
.assistant-ai-refinement-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--sand);
}

.assistant-direct-edit-section .assistant-form-label,
.assistant-ai-refinement-section .assistant-form-label {
    color: var(--mint-700);
    font-weight: 600;
}

/* Responsive design for edit choices */
@media (max-width: 768px) {
    .assistant-edit-choices {
        flex-direction: column;
        gap: 15px;
    }
    
    .assistant-edit-choice-btn {
        margin: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-item {
        margin: 0 8px;
        padding: 12px 16px;
        min-width: 90px;
    }
    
    .step-label {
        font-size: 12px;
    }
    
    .site-title-text {
        font-size: 36px;
    }
    
    .hero-content {
        padding: 40px 15px;
    }
    
    .upload-options {
        flex-direction: column;
        align-items: center;
    }
    
    .assistant-decision-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .assistant-decision-btn {
        max-width: none;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

/* Template Detail Page */
.template-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.back-to-gallery-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.back-to-gallery-btn:hover {
    background: #5a6268;
}

.template-detail-title {
    flex: 1;
    text-align: center;
    margin: 0 20px;
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

.use-template-btn {
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.use-template-btn:hover {
    background: #357abd;
}

.template-detail-content {
    max-width: 100%;
}

.template-detail-content h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.template-content-display {
    width: 100%;
    padding: 20px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #000 !important;
    color: #fff !important;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    box-sizing: border-box;
    overflow: visible;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Disabled message styling */
.assistant-disabled-message {
    margin-top: 20px;
    border-left: 4px solid #6c757d;
}

.assistant-disabled-message .assistant-message {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.assistant-disabled-message h4 {
    color: #495057;
    margin-bottom: 10px;
}

.assistant-disabled-message p {
    color: #6c757d;
}

.assistant-disabled-message ul {
    margin: 10px 0;
    padding-left: 20px;
}

.assistant-disabled-message li {
    color: #6c757d;
    margin: 5px 0;
}

/* Error message styling */
.assistant-error-message {
    margin-top: 20px;
    border-left: 4px solid #dc3545;
}

.assistant-error-message .assistant-message {
    background: #fff5f5;
    border: 1px solid #f5c6cb;
}

.assistant-error-message h4 {
    color: #dc3545;
    margin-bottom: 10px;
}

.assistant-error-message p {
    color: #721c24;
}

.assistant-error-message ul {
    margin: 10px 0;
    padding-left: 20px;
}

.assistant-error-message li {
    color: #721c24;
    margin: 5px 0;
}

/* Step 2 Refine Template Input Styling */
#refine-template-input {
    background: #000 !important;
    color: #fff !important;
    font-family: ui-monospace, 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace !important;
    min-height: calc(100vh - 300px) !important;
    border: 1px solid #333 !important;
    /* FIX: Ensure full width regardless of CSS load order */
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

#refine-template-input:focus {
    border-color: #4a90e2 !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1) !important;
}

/* Refine help text styling */
.refine-help {
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    border-radius: 4px;
}

.refine-help p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

/* Template Deployment Styling */
.template-deployment-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.deployment-success h4 {
    color: #28a745;
    margin-bottom: 10px;
}

.deployment-options {
    margin-top: 25px;
}

.deployment-options h4 {
    color: #333;
    margin-bottom: 8px;
}

.deployment-form {
    margin-top: 15px;
}

.deployment-option {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
}

.deployment-checkbox {
    margin-top: 2px;
    transform: scale(1.1);
}

.deployment-label {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    color: #333;
}

.deployment-help {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    margin-top: 2px;
}

.deployment-description {
    margin: 15px 0;
    margin-left: 25px;
}

.deployment-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.deployment-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: flex-end;
}

.deployment-btn-secondary, .deployment-btn-primary {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.deployment-btn-secondary {
    background: #6c757d;
    color: white;
}

.deployment-btn-secondary:hover {
    background: #545b62;
}

.deployment-btn-primary {
    background: #28a745;
    color: white;
}

.deployment-btn-primary:hover {
    background: #218838;
}

.deployment-complete {
    text-align: center;
}

.deployment-success-message h4 {
    color: #28a745;
    margin-bottom: 15px;
}

.deployment-summary {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
}

.summary-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.summary-label {
    font-weight: 500;
    color: #666;
}

.summary-value {
    color: #333;
}

.deployment-next-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.action-btn-secondary, .action-btn-primary {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.action-btn-secondary {
    background: #6c757d;
    color: white;
}

.action-btn-secondary:hover {
    background: #545b62;
}

.action-btn-primary {
    background: #4a90e2;
    color: white;
}

.action-btn-primary:hover {
    background: #357abd;
}

/* Status filter pills */
.status-filter-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid #dee2e6;
    font-size: 13px;
}

.status-pill {
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid #dee2e6;
    background: transparent;
    color: #6B7D81;
    cursor: pointer;
    font-size: 13px;
    font-family: ui-monospace, "SF Mono", Monaco, Consolas, monospace;
    transition: all 0.15s;
}

.status-pill:hover {
    border-color: #2D4E52;
    color: #2D4E52;
}

.status-pill.active {
    background: #2D4E52;
    color: white;
    border-color: #2D4E52;
}

.status-pill .pill-count {
    font-weight: 600;
    margin-left: 4px;
}

/* Config tabs — manila folder style for multi-config mint tracking
   The active tab merges into the table below via a shared border line. */
.config-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    margin-top: 8px;
    margin-bottom: 0;
    overflow-x: auto;
}

/* Make documents table container scrollable when it fills the page */
#documents-table-container {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    scrollbar-gutter: stable;
}

/* When config tabs are visible, remove the table's top margin and top-left radius
   so the table flows seamlessly from the tab bar (or adopt bar). */
.config-tabs + #documents-table-container .documents-table,
.config-tabs + .config-tab-adopt-bar + #documents-table-container .documents-table {
    margin-top: 0;
    border-radius: 0 8px 8px 8px;
}

.config-tab {
    padding: 8px 20px;
    border: 1px solid var(--sand);
    border-bottom: 1px solid var(--sand);
    border-radius: 8px 8px 0 0;
    background: var(--parchment);
    color: var(--stone-500);
    cursor: pointer;
    font-size: 13px;
    font-family: var(--mono);
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.config-tab:hover {
    background: #E8E2DA;
    color: var(--stone-700);
}

.config-tab.active {
    background: var(--paper);
    border-color: var(--sand);
    border-bottom: 1px solid var(--paper);
    color: var(--charcoal);
    font-weight: 600;
}

/* Active-method indicator dot inside a tab */
.config-tab-active-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal, #2D7B6B);
    margin-right: 6px;
    flex-shrink: 0;
}

/* × remove button inside a tab */
.config-tab-remove {
    display: inline-block;
    margin-left: 7px;
    font-size: 14px;
    line-height: 1;
    color: var(--stone-400);
    opacity: 0;
    transition: opacity 0.1s;
    cursor: pointer;
}

.config-tab:hover .config-tab-remove {
    opacity: 1;
}

.config-tab-remove:hover {
    color: var(--rust, #c0392b);
}

/* "+ New method" tab */
.config-tab.config-tab-new {
    color: var(--stone-400);
    border-style: dashed;
    font-family: var(--sans);
    font-size: 12px;
    padding: 8px 14px;
}

.config-tab.config-tab-new:hover {
    color: var(--teal, #2D7B6B);
    background: var(--parchment);
}

/* "Use this method" adopt bar — shown when viewing a non-active tab */
.config-tab-adopt-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 20px;
    background: #f5f2ec;
    border-left: 3px solid var(--teal, #2D7B6B);
    font-size: 13px;
    color: var(--stone-600);
    margin-bottom: 0;
}

/* When adopt bar follows tabs, push table border to align */
.config-tab-adopt-bar + #documents-table-container .documents-table {
    margin-top: 0;
    border-radius: 0 8px 8px 8px;
}

.config-tab-adopt-btn {
    padding: 4px 12px;
    background: var(--teal, #2D7B6B);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.config-tab-adopt-btn:hover {
    background: #1A4D42;
}

/* Pulse animation for adopt bar — draws eye when user clicks a mint button on non-active tab */
.config-tab-adopt-bar.pulse {
    animation: adopt-bar-pulse 0.6s ease-out;
}
@keyframes adopt-bar-pulse {
    0%   { background: var(--mint-100, #D5EDE5); border-left-color: var(--mint-700); }
    100% { background: #f5f2ec; border-left-color: var(--teal, #2D7B6B); }
}

/* Muted mint buttons when viewing a non-active tab — still clickable, just quieter */
.action-btn.inactive-tab,
.mint-all-button.inactive-tab {
    opacity: 0.45;
    cursor: pointer;
}

/* Step 3 Document Table */
.documents-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    background: var(--paper);
    border-radius: 8px;
    overflow: visible;     /* Allow kebab menus and tooltips to overflow */
}

.documents-table th,
.documents-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--sand);
}

.documents-table th {
    background: var(--parchment);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    font-size: 14px;
    color: var(--charcoal);
    letter-spacing: 0.3px;
    padding: 14px 16px;
}

/* Allow tooltips to overflow table boundaries */
.documents-table thead {
    overflow: visible;
}

.documents-table thead tr {
    overflow: visible;
}

/* Tooltip for table headers */
.tooltip-header {
    position: relative;
    cursor: help;
    overflow: visible;
}

.tooltip-header[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;                                      /* Position below (was bottom: 100%) */
    left: 50%;
    -webkit-transform: translateX(-50%) translateY(8px);
    transform: translateX(-50%) translateY(8px);    /* Safari needs webkit prefix */
    padding: 6px 10px;
    background: rgba(45, 78, 82, 0.95);
    color: var(--white);
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    -webkit-transition: opacity 0.2s, -webkit-transform 0.2s;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
}

.tooltip-header[data-tooltip]::before {
    content: '';
    position: absolute;
    top: 100%;                                      /* Position below (was bottom: 100%) */
    left: 50%;
    -webkit-transform: translateX(-50%) translateY(2px);
    transform: translateX(-50%) translateY(2px);    /* Safari needs webkit prefix */
    border: 5px solid transparent;
    border-bottom-color: rgba(45, 78, 82, 0.95);    /* Arrow points up (was border-top) */
    opacity: 0;
    pointer-events: none;
    -webkit-transition: opacity 0.2s, -webkit-transform 0.2s;
    transition: opacity 0.2s, transform 0.2s;
}

.tooltip-header[data-tooltip]:hover::after,
.tooltip-header[data-tooltip]:hover::before {
    opacity: 1;
    -webkit-transform: translateX(-50%) translateY(0);
    transform: translateX(-50%) translateY(0);
}

.documents-table tbody tr:hover {
    filter: brightness(0.98);
}

/* Filename cell - clickable with lighter blue */
.filename-cell {
    cursor: pointer;
    color: var(--mint-500);
    transition: all 0.2s;
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filename-cell:hover {
    color: var(--mint-700);
    text-decoration: underline;
}

/* Upload Section */
.upload-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--sand);
}

.drop-zone {
    border: 2px dashed var(--mint-700);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    margin: 20px 0;
    background: var(--cream);
    transition: all 0.3s;
}

.drop-zone.drag-over {
    border-color: var(--mint-700);
    background: var(--mint-50);
}

.drop-zone-content p {
    margin: 5px 0;
    color: var(--stone-500);
}

.upload-limits {
    font-size: 14px;
    color: var(--stone-400);
}

.browse-btn {
    background: var(--mint-700);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-top: 15px;
}

.browse-btn:hover {
    background: var(--mint-900);
}

.template-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--mint-50);
    border: 1px solid var(--mint-700);
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 20px;
    color: var(--mint-700);
}

.inspect-btn {
    background: var(--mint-700);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-left: 15px;
    transition: all 0.2s ease;
}

.inspect-btn:hover {
    background: var(--mint-900);
    transform: translateY(-1px);
}

/* Upload Progress Overlay */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.progress-container {
    background: var(--paper);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    min-width: 300px;
}

.progress-bar {
    background: var(--parchment);
    border-radius: 10px;
    height: 20px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    background: var(--mint-700);
    height: 100%;
    transition: width 0.3s;
    border-radius: 10px;
}

.progress-text {
    color: var(--stone-500);
    font-size: 14px;
}

/* ===== INSPECTION PAGE STYLES (from table.html) ===== */

.inspection-header {
    padding: 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--sand);
    margin-bottom: 0;
}

.back-btn {
    background: var(--mint-50);
    border: 1px solid var(--mint-300);
    color: var(--mint-700);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
}

.back-btn:hover {
    background: var(--mint-100);
}

.template-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--stone-500);
    margin-top: 10px;
}

#inspection-template-name {
    font-weight: 600;
    color: var(--mint-700);
}

/* Main container layout */
.main-container {
    display: flex;
    height: calc(100vh - 200px);
    width: 100vw;
    gap: 0;
    overflow: hidden; /* Container should not scroll */
}

/* Left metadata panel */
.metadata-section {
    flex: 0 0 450px; /* Fixed width, no grow/shrink */
    width: 450px;
    background: var(--cream);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sand);
    overflow: hidden; /* Panel should not scroll horizontally */
}

.metadata-header {
    padding: 20px;
    border-bottom: 1px solid var(--sand);
    background: var(--cream);
}

.metadata-header h2 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--charcoal);
}

.metadata-hint {
    color: var(--stone-500);
    font-size: 14px;
}

.metadata-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.no-selection {
    text-align: center;
    color: var(--stone-500);
    padding: 40px 20px;
}

.metadata-actions {
    padding: 20px;
    border-top: 1px solid var(--sand);
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--mono);
    transition: all 0.2s;
    min-width: 90px;
    text-align: center;
}

/* Mint button states - DataMint color palette */
.action-btn.mint {
    background: var(--mint-700);
    color: var(--white);
    border: 1px solid var(--mint-700);
}

.action-btn.mint:hover {
    background: var(--mint-900);
    border-color: var(--mint-900);
}

/* Bloom & Mint button — soft bloom color for bloom-enabled configs */
.action-btn.bloom-mint {
    background: var(--bloom);
    color: var(--white);
    border: 1px solid var(--bloom);
}

.action-btn.bloom-mint:hover {
    background: #A87389;
    border-color: #A87389;
}

.action-btn.blooming {
    background: transparent;
    color: var(--bloom);
    border: 1px solid transparent;
    cursor: default;
}

.action-btn.minting {
    background: transparent;
    color: var(--amber);
    border: 1px solid transparent;
    cursor: default;
}

.action-btn.minted {
    background: transparent;
    color: var(--mint-700);
    border: 1px solid transparent;
    cursor: default;
}

.action-btn.failed {
    background: transparent;
    color: var(--error);
    border: 1px solid transparent;
    cursor: default;
}

.action-btn.resume {
    background: #FFF8E1;
    color: #E65100;
    border: 1px solid #FFB74D;
    cursor: pointer;
    font-weight: 500;
}
.action-btn.resume:hover:not(:disabled) {
    background: #FFF3E0;
    border-color: #FF9800;
}
.action-btn.resume:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Mint All button */
.mint-all-button {
    padding: 6px 14px;
    background: var(--mint-700);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-family: var(--mono);
    cursor: pointer;
    font-weight: 600;
    margin-left: 8px;
}

.mint-all-button:hover:not(:disabled) {
    background: var(--mint-900);
}

.mint-all-button:disabled {
    background: var(--stone-300);
    cursor: not-allowed;
}

.mint-all-button.bloom-mint {
    background: var(--bloom);
}

.mint-all-button.bloom-mint:hover:not(:disabled) {
    background: #A87389;
}

/* Animated dots for minting state */
.dots-container {
    display: inline-block;
    width: 18px;
    text-align: left;
}

.dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Row background colors for document states */
.documents-table tbody tr.ready {
    background: var(--paper);
}

.documents-table tbody tr.minting {
    background: var(--amber-bg);
}

.documents-table tbody tr.minted {
    background: var(--success-bg);
}

.documents-table tbody tr.failed {
    background: var(--error-bg);
}

.flag-btn {
    background: var(--amber-bg);
    border: 1px solid var(--amber);
    color: var(--amber);
}

.flag-btn:hover {
    background: var(--parchment);
}

.note-btn {
    background: var(--mint-50);
    border: 1px solid var(--mint-300);
    color: var(--mint-900);
}

.note-btn:hover {
    background: var(--mint-100);
}

/* Right table section */
.table-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    min-width: 0;
    overflow: hidden;
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid var(--sand);
    background: var(--cream);
}

.table-header h2 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--charcoal);
}

.table-instructions {
    color: var(--stone-500);
    font-size: 14px;
    margin-bottom: 10px;
}

.table-stats {
    font-size: 14px;
    color: var(--stone-500);
    margin-top: 8px;
}

.table-container {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.inspection-table {
    width: 100%;
    min-width: 1800px;
    border-collapse: collapse;
    font-size: 12px;
    border: 1px solid var(--sand);
}

.inspection-table th,
.inspection-table td {
    border: 1px solid var(--sand);
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
}

.inspection-table th {
    background: var(--parchment);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--charcoal);
}

/* Sticky first column */
.inspection-table .doc-name,
.inspection-table .doc-column {
    position: sticky;
    left: 0;
    background: var(--paper);
    z-index: 2;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.inspection-table .doc-column {
    background: var(--parchment);
    z-index: 3;
}

/* Cell status styling */
.data-cell.processing {
    background: var(--amber-bg);
    color: var(--amber);
}

.data-cell.failed {
    background: var(--error-bg);
    color: var(--error);
}

.data-cell.completed {
    background: var(--paper);
    color: var(--charcoal);
}

.data-cell.no-data {
    background: var(--parchment);
    color: var(--stone-400);
}

.data-cell:hover {
    background: var(--mint-50) !important;
    border: 2px solid var(--mint-700) !important;
    cursor: pointer;
}

.data-cell.selected {
    background: var(--mint-50) !important;
    border: 2px solid var(--mint-700) !important;
    box-shadow: 0 0 8px rgba(25, 118, 210, 0.3);
}

/* Status indicators */
.processing-indicator {
    font-style: italic;
    color: var(--amber);
}

.error-indicator {
    font-weight: 600;
    color: var(--error);
}

.no-data {
    font-style: italic;
    color: var(--stone-400);
}

/* Document info styling */
.doc-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filename {
    font-weight: 600;
    color: var(--charcoal);
}

.status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.status-completed {
    background: var(--mint-50);
    color: var(--mint-900);
}

.status-processing {
    background: var(--amber-bg);
    color: var(--amber);
}

.status-failed {
    background: var(--error-bg);
    color: var(--error);
}

/* Notes section */
.notes-section {
    height: 80px;
    background: var(--cream);
    border-top: 1px solid var(--sand);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.notes-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.notes-left h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: var(--charcoal);
}

.no-notes {
    color: var(--stone-400);
    font-size: 14px;
}

.notes-right {
    display: flex;
    gap: 10px;
}

.export-btn, .clear-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid;
}

.export-btn {
    background: var(--mint-700);
    color: var(--white);
    border-color: var(--mint-700);
}

.export-btn:hover {
    background: var(--mint-900);
}

.clear-btn {
    background: var(--parchment);
    color: var(--stone-500);
    border-color: var(--sand);
}

.clear-btn:hover {
    background: var(--parchment);
}

/* Hide all DataMint site elements when inspection page is active */
#inspection-page.active ~ * {
    display: none !important;
}

/* Hide navigation and header on inspection page */
body:has(#inspection-page.active) .nav-container,
body:has(#inspection-page.active) .main-header,
body:has(#inspection-page.active) .landing-page,
#inspection-page.active ~ .nav-container {
    display: none !important;
}

/* Make inspection page take full viewport */
#inspection-page.active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--cream);
    z-index: 1000;
    overflow: hidden;
}

/* Prevent body scrolling when inspection page is active */
body:has(#inspection-page.active) {
    overflow: hidden;
}

/* Ensure inspection page main container fills viewport */
#inspection-page.active .main-container {
    height: calc(100vh - 80px); /* Account for notes section */
    width: 100vw;
}

/* Make only the table container scrollable */
#inspection-page .table-container {
    flex: 1;
    overflow: auto; /* ONLY the table container scrolls */
    padding: 20px;
}

/* Prevent other elements from scrolling */
#inspection-page .table-section {
    overflow: hidden; /* Section container should not scroll */
}

/* Keyboard navigation help text */
.keyboard-help {
    font-size: 12px;
    color: var(--stone-500);
    margin-top: 5px;
}

/* Inspection page header styling */
.inspection-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.inspection-title-section h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--mint-700);
}

.inspection-title-section #inspection-status {
    color: var(--stone-500);
    font-size: 14px;
    margin: 0;
}

.back-button {
    padding: 10px 16px;
    border: 1px solid var(--sand);
    background: var(--paper);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: var(--stone-500);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.back-button:hover {
    background: var(--parchment);
    border-color: var(--stone-300);
}

/* Selected cell highlighting */
.data-cell.selected {
    background: var(--mint-50) !important;
    border: 2px solid var(--mint-700) !important;
    box-shadow: 0 0 0 1px var(--mint-700);
}

/* Metadata card styling */
.metadata-card {
    background: var(--paper);
    border: 1px solid var(--sand);
    border-radius: 6px;
    margin-bottom: 16px;
    overflow: hidden;
}

.metadata-card-header {
    background: var(--cream);
    padding: 12px 16px;
    border-bottom: 1px solid var(--parchment);
    font-weight: 600;
    color: var(--charcoal);
    font-size: 14px;
}

.metadata-card-body {
    padding: 16px;
}

.final-answer {
    font-size: 16px;
    font-weight: 600;
    color: var(--mint-700);
    line-height: 1.4;
}

.evidence-summary {
    color: var(--stone-700);
    line-height: 1.6;
    margin-bottom: 12px;
}

.key-quotes {
    color: var(--stone-500);
    font-size: 14px;
}

.quote {
    margin: 8px 0;
    padding: 8px 12px;
    background: var(--cream);
    border-left: 3px solid var(--mint-700);
    font-style: italic;
}

.confidence-metrics {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.confidence-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.confidence-label {
    font-weight: 600;
    min-width: 120px;
    font-size: 13px;
    color: var(--stone-700);
}

.confidence-bar {
    flex: 1;
    height: 8px;
    background: var(--sand);
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--error) 0%, var(--amber) 30%, var(--mint-500) 70%, var(--mint-700) 100%);
    transition: width 0.3s ease;
}

.confidence-value {
    font-weight: 600;
    font-size: 13px;
    color: var(--mint-700);
    min-width: 45px;
    text-align: right;
}

/* Project Card Styles */
.project-card {
    border: 1px solid var(--sand);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: var(--paper);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-card:hover {
    border-color: var(--mint-700);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

.project-info {
    flex: 1;
}

.project-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--charcoal);
    margin-bottom: 4px;
}

.project-meta {
    font-size: 14px;
    color: var(--stone-500);
    margin-bottom: 8px;
}

.project-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--stone-500);
}

.share-status {
    font-weight: 500;
}

.project-actions {
    display: flex;
    align-items: center;
}

.share-btn {
    background: var(--mint-700);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.share-btn:hover {
    background: var(--mint-900);
}

.shared-indicator {
    color: var(--mint-700);
    font-size: 14px;
    font-weight: 500;
}

/* ==========================
   Enhanced Button Loading States
   ========================== */

/* Loading button styles */
button.btn-loading {
    background: var(--stone-500) !important;
    cursor: not-allowed !important;
    opacity: 0.8;
    transition: all 0.3s ease;
}

button.btn-loading:hover {
    background: var(--stone-500) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Button loading spinner */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: btn-spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Enhanced button hover effects (for non-loading buttons) */
button:not(.btn-loading) {
    transition: all 0.3s ease;
}

button:not(.btn-loading):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Specific Template Assistant button enhancements */
.decision-button,
.assistant-decision-btn,
button[onclick*="assistantSelectDecision"] {
    position: relative;
    overflow: hidden;
}

/* Smooth loading state transitions */
button.btn-loading {
    transform: none;
    box-shadow: none;
}

button.btn-loading .btn-spinner {
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* Loading overlay enhancements for context */
.loading-overlay .loading-text {
    font-size: 1.1em;
    color: var(--stone-700);
    font-weight: 500;
    margin-top: 15px;
    text-align: center;
}

.loading-overlay .loading-spinner {
    animation-duration: 1s;
    animation-timing-function: linear;
}

/* ==========================================
   Template Page Styles - Phase 2 Implementation
   ========================================== */

.template-page-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--cream);
    min-height: 100vh;
}

/* Template Header */
.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--mint-700);
}

.template-header-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.template-back-btn {
    background: var(--paper);
    border: 1px solid var(--sand);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--mint-700);
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-back-btn:hover {
    background: var(--cream);
    border-color: var(--mint-700);
}

.template-title-section {
    flex: 1;
}

.template-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--mint-700);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.template-metadata {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.template-metadata .template-meta-item {
    font-size: 12px;
    color: var(--stone-500);
    background: var(--paper);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--sand);
}

/* View Toggle */
.template-view-toggle {
    display: flex;
    background: var(--paper);
    border: 1px solid var(--sand);
    border-radius: 6px;
    overflow: hidden;
}

.template-view-toggle .view-toggle-btn {
    background: var(--paper);
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--stone-500);
}

.template-view-toggle .view-toggle-btn.active {
    background: var(--mint-700);
    color: var(--white);
}

.template-view-toggle .view-toggle-btn:hover:not(.active) {
    background: var(--parchment);
}

/* Template Step 2 Navigation - use standard top-button styling */
.template-step2-nav {
    padding: 20px 0;
}

/* Template Content */
.template-content-container {
    background: var(--paper);
    border: 1px solid var(--sand);
    border-radius: 6px;
    margin-bottom: 24px;
    min-height: 400px;
}

.template-content-view {
    display: none;
    padding: 24px;
}

.template-content-view.active {
    display: block;
}

.template-content-pretty {
    line-height: 1.6;
    color: var(--charcoal);
}

.template-content-pretty h1,
.template-content-pretty h2,
.template-content-pretty h3 {
    color: var(--mint-700);
    margin-top: 24px;
    margin-bottom: 12px;
}

.template-content-pretty h1 {
    font-size: 28px;
    border-bottom: 2px solid var(--sand);
    padding-bottom: 8px;
}

.template-content-pretty h2 {
    font-size: 20px;
    margin-top: 32px;
}

.template-content-pretty h3 {
    font-size: 16px;
}

.template-content-pretty p {
    margin-bottom: 16px;
}

.template-content-pretty strong {
    color: var(--mint-700);
    font-weight: 600;
}

.template-content-pretty code {
    background: var(--cream);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: ui-monospace, 'SF Mono', Monaco, Consolas, monospace;
    font-size: 13px;
}

.template-content-raw {
    background: var(--ink);
    border-radius: 6px;
    padding: 20px;
}

.template-raw-content {
    color: var(--white);
    font-family: ui-monospace, 'SF Mono', Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Template Actions Panel */
.template-actions-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--paper);
    border: 1px solid var(--sand);
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.template-actions-left,
.template-actions-right {
    display: flex;
    gap: 12px;
}

.template-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--sand);
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--paper);
    color: var(--charcoal);
}

.template-action-btn.primary {
    background: var(--mint-700);
    color: var(--white);
    border-color: var(--mint-700);
}

.template-action-btn.primary:hover {
    background: var(--mint-900);
    border-color: var(--mint-900);
}

.template-action-btn.secondary:hover {
    background: var(--cream);
    border-color: var(--mint-700);
    color: var(--mint-700);
}

.action-icon {
    font-size: 14px;
}

/* Privacy Controls */
.template-privacy-panel {
    background: var(--paper);
    border: 1px solid var(--sand);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 24px;
}

.privacy-controls {
    margin-bottom: 16px;
}

.privacy-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 8px;
}

.privacy-options {
    display: flex;
    gap: 8px;
}

.privacy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--paper);
    border: 1px solid var(--sand);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--stone-500);
}

.privacy-btn.active {
    background: var(--mint-700);
    color: var(--white);
    border-color: var(--mint-700);
}

.privacy-btn:hover:not(.active) {
    background: var(--cream);
    border-color: var(--mint-700);
}

.privacy-icon {
    font-size: 12px;
}

/* Share URL Section */
.share-url-section {
    padding-top: 16px;
    border-top: 1px solid var(--sand);
}

.share-url-label {
    display: block;
    font-size: 13px;
    color: var(--stone-500);
    margin-bottom: 6px;
}

.share-url-container {
    display: flex;
    gap: 8px;
}

.share-url-input {
    flex: 1;
    background: var(--cream);
    border: 1px solid var(--sand);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--stone-500);
    font-family: ui-monospace, 'SF Mono', Monaco, Consolas, monospace;
}

.copy-url-btn {
    background: var(--mint-700);
    color: var(--white);
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-url-btn:hover {
    background: var(--mint-900);
}

/* Refinement Panel */
.template-refinement-panel {
    background: var(--paper);
    border: 1px solid var(--sand);
    border-radius: 6px;
    padding: 20px;
}

.refinement-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--mint-700);
    margin: 0 0 16px 0;
}

.refinement-tree {
    font-size: 13px;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .template-page-container {
        padding: 12px;
    }
    
    .template-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .template-header-left {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .template-actions-panel {
        flex-direction: column;
        gap: 16px;
    }
    
    .template-actions-left,
    .template-actions-right {
        width: 100%;
        justify-content: center;
    }
    
    .privacy-options {
        flex-direction: column;
    }
    
    .share-url-container {
        flex-direction: column;
    }
}

/* ===== INLINE UPLOAD INTERFACE ===== */

/* Main container */
.inline-upload-container {
    background: var(--paper);
    border: 2px solid var(--sand);
    border-radius: 12px;
    margin: 30px 0;
    overflow: hidden;
}

/* Source selection cards - 3-column grid */
.source-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid var(--sand);
    background: var(--cream);
}

.source-card {
    position: relative;
    border: 2px solid var(--sand);
    border-radius: 14px;
    padding: 28px 20px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--paper);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.source-card:hover:not(.selected) {
    border-color: var(--mint-300);
    box-shadow: 0 4px 20px rgba(45, 123, 107, 0.12);
    transform: translateY(-3px);
}

.source-card.selected {
    border-color: var(--mint-700);
    background: var(--mint-50);
    box-shadow: 0 4px 20px rgba(45, 123, 107, 0.15);
}

/* Radio indicator - top right corner */
.source-card .radio-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border: 2px solid var(--sand);
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.source-card.selected .radio-indicator {
    border-color: var(--mint-700);
    background: var(--mint-700);
}

.source-card .radio-indicator::after {
    content: '✓';
    color: var(--white);
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.source-card.selected .radio-indicator::after {
    opacity: 1;
}

/* Card icon wrap - centered SVG icon with colored background */
.source-card .card-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.source-card .card-label {
    font-size: 17px;
    font-weight: 700;
    color: var(--charcoal);
    font-family: var(--serif);
}

/* Feature bullets */
.source-card .card-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    width: 100%;
}

.source-card .card-features li {
    font-size: 13px;
    color: var(--stone-500);
    padding-left: 16px;
    position: relative;
    margin-bottom: 6px;
    line-height: 1.4;
}

.source-card .card-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--mint-700);
}

/* Fixed height content area - REMOVED: now using dialogs instead */
/* .upload-content-area {
    height: 450px;
    padding: 32px;
    overflow-y: auto;
} */

/* File drop zone (expanded to fill height) */
.inline-drop-zone {
    border: 2px dashed var(--mint-700);
    border-radius: 12px;
    padding: 80px 32px;
    text-align: center;
    background: var(--cream);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.inline-drop-zone:hover,
.inline-drop-zone.drag-active {
    background: var(--mint-50);
    border-color: var(--mint-900);
}

.drop-zone-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.drop-zone-title {
    font-family: ui-monospace, 'SF Mono', Monaco, Consolas, monospace;
    font-size: 16px;
    color: var(--charcoal);
    font-weight: 600;
    margin-bottom: 8px;
}

.drop-zone-subtitle {
    font-size: 13px;
    color: var(--stone-500);
    font-family: ui-monospace, 'SF Mono', Monaco, Consolas, monospace;
}

/* URL capture interface */
.inline-url-capture {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.inline-url-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 12px;
    font-family: ui-monospace, 'SF Mono', Monaco, Consolas, monospace;
}

.inline-url-textarea {
    flex: 1;
    min-height: 200px;
    padding: 16px;
    border: 2px solid var(--sand);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--mono);
    resize: none;
    margin-bottom: 16px;
    background: var(--white) !important;
    color: var(--charcoal) !important;
}

.inline-url-textarea:focus {
    outline: none;
    border-color: var(--mint-700);
}

/* Text paste interface */
.inline-text-paste {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.inline-text-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 12px;
    font-family: var(--mono);
}

.inline-text-textarea {
    flex: 1;
    min-height: 250px;
    padding: 16px;
    border: 2px solid var(--sand);
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    margin-bottom: 12px;
    font-family: var(--mono);
    background: var(--white) !important;
    color: var(--charcoal) !important;
}

.inline-text-textarea:focus {
    outline: none;
    border-color: var(--mint-700);
}

.inline-text-name-input {
    padding: 12px;
    border: 2px solid var(--sand);
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    font-family: var(--mono);
    background: var(--white) !important;
    color: var(--charcoal) !important;
}

.inline-text-name-input:focus {
    outline: none;
    border-color: var(--mint-700);
}

/* Action buttons */
.inline-action-button {
    padding: 12px 24px;
    background: var(--mint-700);
    color: var(--white);
    border: 2px solid var(--mint-700);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--mono);
    cursor: pointer;
    transition: all 0.15s;
}

.inline-action-button:hover:not(:disabled) {
    background: var(--mint-900);
    border-color: var(--mint-900);
    transform: translateY(-1px);
}

.inline-action-button:disabled {
    background: var(--cream);
    color: var(--stone-500);
    border-color: var(--sand);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Uploading status - gray ghost button */
.action-btn.uploading {
    background: transparent;
    color: var(--stone-500);
    border: 1px solid transparent;
    cursor: default;
}

/* Uploading row background */
.documents-table tbody tr.uploading {
    background: var(--cream);
}

/* Kebab dropdown menu */
.kebab-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #E2E8EA;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 200;
    min-width: 160px;
    padding: 4px 0;
}

.kebab-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #2D4E52;
}

.kebab-item:hover:not(:disabled) {
    background: #f5f7f8;
}

.kebab-item.disabled {
    color: #ccc;
    cursor: default;
}

.kebab-item-danger {
    color: #c0392b;
}

.kebab-item-danger:hover:not(:disabled) {
    background: #fdf2f2;
}

.kebab-divider {
    border-top: 1px solid #E2E8EA;
    margin: 4px 0;
}

/* Simple Dialog Styles */
.simple-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 78, 82, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.simple-dialog-box {
    background: var(--paper);
    border-radius: 8px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.simple-dialog-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--stone-500);
    padding: 4px 8px;
    transition: color 0.15s;
}

.simple-dialog-close:hover {
    color: var(--charcoal);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .source-cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .simple-dialog-box {
        width: 95%;
        padding: 24px;
        max-height: 90vh;
    }

    /* .upload-content-area {
        padding: 24px;
    } */
}/**
 * OVERRIDES.CSS - Corrective Overrides for Legacy/Vite Conflicts
 *
 * Purpose: Fix CSS conflicts between legacy.css and React/Vite defaults
 * Import order: Import this AFTER legacy.css to override specific styles
 * Status: ACTIVE
 *
 * Contains:
 * - Root container resets (#root, body, html)
 * - DataMint namespace (.dm-namespace) overrides
 * - Layout fixes for proper centering
 *
 * Note: Heavy use of !important flags suggests underlying architecture issues
 * TODO: Investigate if this can be reduced after legacy.css cleanup
 */

/* DataMint UI Corrective Rebuild - Minimal Overrides */
/* Import this AFTER legacy.css to override specific styles if needed */

/* CRITICAL: Reset root containers first */
#root {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  min-height: 100vh !important;
}

body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  background: var(--cream) !important;
  font-family: var(--serif) !important;
  color: var(--charcoal) !important;
}

html {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* Reset any React/Vite CSS that might interfere with DataMint layout */
.dm-namespace {
  /* Container for scoped overrides if CSS conflicts occur */
  
  /* Reset any default React styling that might interfere */
  * {
    box-sizing: border-box;
  }
  
  /* Ensure body background and layout match restyle */
  background: var(--cream);
  min-height: 100vh;
  font-family: var(--serif);
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* Force proper centering for all major sections */
.dm-namespace .hero-section {
  width: 100%;
  background: var(--paper);
  padding: 60px 20px;
  border-bottom: 1px solid var(--sand);
}

.dm-namespace .hero-content {
  max-width: 700px;
  margin: 0 auto !important;
  width: 100%;
  text-align: left;
}

/* Site header - warm palette */
.dm-namespace .site-header {
  text-align: center;
  width: 100%;
  background: var(--cream);
  padding: 40px 0;
  border-bottom: 1px solid var(--sand);
}

.dm-namespace .site-title {
  font-family: var(--mono);
  font-size: 52px;
  font-weight: bold;
  color: var(--mint-700);
  margin: 0 0 16px 0;
}

.dm-namespace .site-subtitle {
  font-size: 20px;
  color: var(--stone-500);
  font-weight: normal;
  margin: 0;
  line-height: 1.5;
}

/* Auth section styles moved to legacy.css */

/* Ensure navigation is centered */
.dm-namespace .nav-container {
  text-align: center;
  width: 100%;
  background: var(--cream);
  padding: 20px 20px 30px;
}

/* Fix any potential layout issues with the main content area */
.dm-namespace .page {
  background: var(--cream);
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.dm-namespace .content {
  /* Remove ALL constraints that could prevent centering */
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0;
  box-shadow: none !important;
  box-sizing: border-box;
  /* Let child components handle their own centering */
}

/* Form input styles */
.dm-namespace .form-input {
  color: var(--charcoal) !important;
  background: var(--white) !important;
  border: 1px solid var(--sand) !important;
  padding: 12px !important;
  border-radius: var(--radius-input) !important;
  font-size: 15px !important;
  font-family: var(--serif) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.dm-namespace .form-input::placeholder {
  color: var(--stone-400) !important;
}

.dm-namespace .form-input:focus {
  outline: none !important;
  border-color: var(--mint-500) !important;
  box-shadow: 0 0 0 2px var(--mint-100) !important;
}

/* Form labels */
.dm-namespace label {
  color: var(--charcoal) !important;
  font-family: var(--sans) !important;
  font-weight: 500 !important;
  margin-bottom: 5px !important;
  display: block !important;
}

/* CENTERING FIX: Force .top-buttons to be properly centered in viewport */
.dm-namespace .top-buttons {
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
  box-sizing: border-box !important;
  display: block !important;
}

/* CENTERING FIX: Ensure the white content container is properly centered */
.dm-namespace .dm-grid-center {
  width: 100% !important;
  display: grid !important;
  justify-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

.dm-namespace .dm-fixed {
  width: min(100%, 700px) !important;
  margin: 0 auto !important;
  padding-inline: 16px !important;
  box-sizing: border-box !important;
}

/* FIX: Browse/Create/Library/Refine buttons single line layout */
.dm-namespace .top-buttons,
.dm-namespace .centered-top-buttons,
.top-buttons,
.centered-top-buttons {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  text-align: center !important;
  margin-bottom: 40px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.dm-namespace .top-button,
.top-button {
  display: block !important;
  margin: 0 !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  background: var(--paper) !important;
  border: 2px solid var(--sand) !important;
  border-radius: 8px !important;
  padding: 18px 16px !important;
  text-align: center !important;
  cursor: pointer !important;
  vertical-align: top !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
}

.dm-namespace .top-button:hover {
  border-color: var(--stone-400) !important;
  background: var(--parchment) !important;
}

.dm-namespace .top-button.active {
  border-color: var(--mint-700) !important;
  background: var(--mint-50) !important;
}

/* Top button title */
.dm-namespace .top-button-title {
  font-size: 26px !important;
  font-weight: bold !important;
  font-family: var(--serif) !important;
  color: var(--charcoal) !important;
  margin: 0 0 6px 0 !important;
  line-height: 1.15 !important;
  overflow: visible !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 100% !important;
  text-align: center !important;
}

/* Top button description */
.dm-namespace .top-button-desc,
.top-button-desc {
  font-size: 14px !important;
  color: var(--stone-500) !important;
  font-family: var(--sans) !important;
  line-height: 1.3 !important;
  margin: 0 !important;
}

/* Active top button title gets mint color */
.dm-namespace .top-button.active .top-button-title {
  color: var(--mint-700) !important;
}

/* Responsive: Smaller buttons on mobile */
@media (max-width: 768px) {
  .dm-namespace .top-buttons {
    gap: 8px !important;
    padding: 0 10px !important;
  }
  
  .dm-namespace .top-button {
    flex: 1 1 120px !important;  /* Equal flex-grow for mobile */
    width: 120px !important;     /* Fixed width for mobile consistency */
    padding: 12px 16px !important;
  }
  
  .dm-namespace .top-button-title {
    font-size: 20px !important; /* Smaller on mobile */
  }
  
  .dm-namespace .top-button-desc {
    font-size: 12px !important;
  }
}/**
 * HEADER.CSS - Site Header and Title Styles
 *
 * Used by: DataMintLayout.tsx
 * Status: ACTIVE
 */

/* Site Header */
.site-header {
    text-align: center;
    padding: 20px 20px 10px;
    background: var(--cream);
}

.site-title {
    display: inline-block;
    cursor: pointer;
    margin: 0;
    background: transparent;
    border: none;
    padding: 0;
    transition: all 0.2s ease;
}

.site-title-text {
    font-family: var(--mono);
    color: var(--mint-700);
    font-size: 52px;
    font-weight: bold;
    margin: 0;
    text-align: center;
}

.site-title:hover .site-title-text {
    color: var(--mint-900);
}
/**
 * NAVIGATION.CSS - Navigation Item Styles
 *
 * Used by: DataMintLayout.tsx (Step 1/2/3 buttons)
 * Status: ACTIVE - CRITICAL UI ELEMENT
 *
 * Contains:
 * - Nav item base styles (.nav-item)
 * - Hover state (.nav-item:hover)
 * - Active state (.nav-item.active)
 * - Disabled state (.nav-item.disabled)
 * - Step number styling (.step-number)
 * - Step label styling (.step-label)
 */

/* Navigation Items */
.nav-item {
    display: inline-block;
    margin: 0 15px;
    background: var(--paper);
    border: 2px solid var(--sand);
    border-radius: 6px;
    padding: 18px 25px;
    text-align: center;
    cursor: pointer;
    min-width: 120px;
    vertical-align: top;
    transition: all 0.2s ease;
}

.nav-item:hover {
    border-color: var(--stone-400);
    background: var(--parchment);
}

.nav-item.active {
    border-color: var(--mint-700);
    background: var(--mint-50);
}

/* Step Number and Label */
.step-number {
    font-size: 48px;
    font-weight: bold;
    font-family: var(--mono);
    color: var(--charcoal);
    margin: 0 0 8px 0;
    line-height: 1;
}

.step-label {
    font-size: 24px;
    font-family: var(--mono);
    color: var(--stone-500);
    line-height: 1.3;
    font-weight: normal;
}

/* Active State for Step Elements */
.nav-item.active .step-number {
    color: var(--mint-700);
}

.nav-item.active .step-label {
    color: var(--charcoal);
    font-weight: 500;
}

/* Disabled State */
.nav-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
/**
 * FOOTER.CSS - App Footer Styles
 *
 * Used by: AppFooter component in DataMintLayout.tsx
 * Matches the static page footer design (datamint-base.css)
 * but lighter weight for the app context.
 */

.app-footer {
    background: var(--parchment);
    border-top: 1px solid var(--sand);
    padding: 24px 0;
    text-align: center;
    margin-top: auto;
}

.app-footer-links {
    font-family: var(--sans);
    font-size: 13px;
    color: var(--stone-500);
    margin: 0 0 6px;
}

.app-footer-links a {
    color: var(--stone-500);
    text-decoration: none;
    transition: color 0.2s;
}

.app-footer-links a:hover {
    color: var(--mint-700);
}

.app-footer-copy {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--stone-400);
    margin: 0;
}
/**
 * Manifold Landing — manifold.ing front door + demo tile detail wrapper.
 *
 * Rebuilt from first principles 2026-05-23 against
 * `company/voice/MANIFOLD_STYLE.md`. The organizing idea is physics, not
 * palette: Manifold is the field in motion (weightless, fluid, responsive),
 * DataMint is the press (solid, fixed). This surface must feel like the
 * former.
 *
 * Rules in force here:
 *   - Ground is --paper (warm, light), edge to edge. Never --cream.
 *   - Serif speaks (wordmark, prose, hooks); mono measures (counts, eras,
 *     controls, the ".ing"). The wordmark is SERIF.
 *   - Color is absent until touched: mint = the pulse of interaction;
 *     --landmark orange = "look here". No solid-fill primary buttons.
 *   - Depth from shadow + translucency, not borders/fills. Hairlines only.
 *   - Everything eases (cubic-bezier(0.4,0,0.2,1)); cards lift on hover.
 *   - Tokens only, from frontend/src/styles/global/variables.css.
 */

/* =====================================================================
   Page
   ===================================================================== */

.ml-page {
  min-height: 100vh;
  min-height: 100dvh; /* mobile: avoid iOS address-bar overflow */
  background: var(--paper);
  color: var(--charcoal);
  font-family: var(--serif);
  position: relative;
  overflow-x: hidden;
}

/* =====================================================================
   Hero — you land inside the drifting field
   ===================================================================== */

.ml-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh; /* mobile: track the visible viewport, not the address-bar-inflated one */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* The living point cloud. Fills the hero, sits behind everything, never
   intercepts pointer events (it reads the pointer off window). */
.ml-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* A soft paper veil pooled behind the hero text so the wordmark + lead
   always rest on calm ground, however dense the cloud drifts beneath. */
.ml-hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 58% 48% at 50% 44%,
    rgb(253 250 247 / 78%),
    rgb(253 250 247 / 0%) 72%
  );
}

/* The field dissolves into paper at the seam where the worlds begin. */
.ml-hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 220px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgb(253 250 247 / 0%), var(--paper));
}

/* ── Nav (frosted, floating over the field) ───────────────────────── */

.ml-nav {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgb(253 250 247 / 55%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgb(0 0 0 / 6%);
  font-family: var(--sans);
  font-size: 14px;
}

.ml-brand {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
}

.ml-brand-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.005em;
}

.ml-brand-tld {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--stone-500);
  letter-spacing: 0.01em;
}

.ml-nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ml-nav-link {
  color: var(--stone-700);
  text-decoration: none;
  transition: color 0.15s ease;
}

.ml-nav-link:hover {
  color: var(--mint-700);
}

.ml-nav-email {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--stone-500);
}

.ml-nav-account {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-size: 13px;
}

.ml-nav-sep {
  color: var(--stone-400);
  font-family: var(--mono);
  font-size: 13px;
}

/* ── Hero center (floats over the field) ──────────────────────────── */

.ml-hero-center {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px 96px;
  max-width: 900px;
  margin: 0 auto;
}

.ml-wordmark {
  font-family: var(--serif);
  font-size: clamp(56px, 10vw, 104px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1;
  margin: 0;
}

/* Standing tagline — the masthead line from MANIFOLD_BRAND_BOOK Ch. 10
   ("See the spread. Pulling your documents apart."). Sits BELOW the pun lead
   as the smaller dek: present, quieter, not competing with the headline.
   Catch first (Ch. 2), expansion second. */
.ml-tagline {
  font-family: var(--serif);
  font-size: clamp(15px, 1.9vw, 19px);
  font-weight: 400;
  color: var(--charcoal);
  line-height: 1.45;
  letter-spacing: 0.005em;
  margin: 14px 0 0;
}

.ml-tagline-catch {
  display: block;
}

.ml-tagline-gloss {
  display: block;
  color: var(--stone-700);
}

.ml-lead {
  font-family: var(--serif);
  font-size: clamp(20px, 3.1vw, 27px);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: -0.005em;
  margin: 18px 0 0;
  max-width: 24em;
}

/* Mono "instrument" readout — the same voice as the viz topbar. */
.ml-readout {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--stone-500);
  letter-spacing: 0.04em;
  margin: 26px 0 0;
}

/* ── CTAs — control pills, not stamps ─────────────────────────────── */

.ml-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

.ml-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  border-radius: var(--radius-button);
  padding: 11px 22px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s ease;
}

.ml-btn:focus-visible {
  outline: 2px solid var(--mint-500);
  outline-offset: 2px;
}

/* Primary borrows the viz "keep moving" voice: mint border + text + a
   faint mint tint. Mint appears because this is the live action. */
.ml-btn-primary {
  background: rgb(45 123 107 / 7%);
  border-color: var(--mint-700);
  color: var(--mint-700);
}

.ml-btn-primary:hover {
  background: rgb(45 123 107 / 13%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgb(45 123 107 / 12%);
}

/* Secondary borrows "pause": a quiet stone pill on paper. */
.ml-btn-outline {
  background: rgb(253 250 247 / 60%);
  border-color: rgb(0 0 0 / 14%);
  color: var(--stone-700);
}

.ml-btn-outline:hover {
  border-color: var(--stone-500);
  color: var(--ink);
  transform: translateY(-1px);
}

/* =====================================================================
   Scrollytelling beats — one per Constellation, registry-driven.
   Each beat is a viewport-tall section with: an eyebrow + headline
   stack above, a rotating canvas of ~1000 sampled points in the middle,
   a floating bearings panel overlaying the cloud, and a quiet "X
   documents · explore →" footer. Plan:
   thinking_and_planning/MANIFOLD_LANDING_SCROLLYTELLING_PLAN_2026-05-28.md
   ===================================================================== */

.ml-beat {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 48px 24px 56px;
  box-sizing: border-box;
}

.ml-beat-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.ml-beat-era {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone-500);
  margin-bottom: 14px;
}

/* Bumped 2026-05-28 — Karl reported "almost missed" the hook on mobile.
   The hook IS the beat's headline; size it like a headline. Italic kept
   for the brand voice but compensated for by a larger min size (italic
   reads ~10% smaller at the same px). */
.ml-beat-hook {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 400;
  color: var(--charcoal);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 16em;
  margin-left: auto;
  margin-right: auto;
}

/* The cartographer's editorial standfirst — sits under the hook (BRAND_BOOK
   Ch. 10 "the dek"). Plain serif at a quieter size: this is the explanation,
   the hook is the catch. */
.ml-beat-dek {
  font-family: var(--serif);
  font-style: normal;
  font-size: clamp(15px, 1.7vw, 18px);
  font-weight: 400;
  color: var(--stone-700);
  line-height: 1.5;
  letter-spacing: 0.005em;
  margin: 14px auto 0;
  max-width: 32em;
}

/* The stage holds the canvas + the floating bearings panel. Positions
   them: canvas fills, bearings panel floats over the cloud at lower-left
   on wider screens, stacks below on narrow. */
.ml-beat-stage {
  position: relative;
  flex: 1;
  margin: 36px auto 20px;
  width: 100%;
  max-width: 1080px;
  aspect-ratio: 16 / 11;
  display: flex;
}

/* The clickable Link wrapper sits at the same place the canvas used to
   sit — absolute, fills the stage — so a click on the cloud opens the
   demo page. Cursor: pointer comes free from the <a>. */
.ml-beat-canvas-link {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  color: inherit;
  /* Sits below the bearings panel (z:2) so bearing clicks hit their own
     links first. */
  z-index: 1;
}

.ml-beat-canvas-link:focus-visible {
  outline: 2px solid var(--mint-700);
  outline-offset: -2px;
  border-radius: 4px;
}

.ml-beat-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Bearings panel — translucent paper sheet floating over the cloud.
   MANIFOLD_STYLE rule: "Surfaces hover over the cloud as translucent
   panels you can see through." Mint underline on hover (color appears
   because the visitor touched it). */
.ml-beat-bearings {
  position: absolute;
  left: 20px;
  bottom: 20px;
  max-width: 320px;
  padding: 16px 18px;
  background: rgb(253 250 247 / 86%);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius: 4px;
  box-shadow: 0 2px 14px rgb(0 0 0 / 8%);
  z-index: 2;
}

.ml-beat-bearings-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-500);
  margin-bottom: 10px;
}

.ml-beat-bearings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Bearings rows are now BUTTONS (not links) — clicking asks the canvas
   tour to align that bearing with "up." Reset the browser button chrome
   so the row reads the same as the prior <a> version. */
.ml-beat-bearings-row {
  display: block;
  width: 100%;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--charcoal);
  background: transparent;
  text-align: left;
  text-decoration: none;
  line-height: 1.35;
  padding: 2px 0;
  border: none;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  /* Reset Safari/iOS button look */
  -webkit-appearance: none;
  appearance: none;
}

.ml-beat-bearings-row:hover,
.ml-beat-bearings-row:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--mint-700);
  outline: none;
}

/* Active state — set while the canvas is easing/holding this axis at
   "up." Mirrors the on-canvas mint label so the visitor sees the
   relationship: "the row I clicked is the axis now pointing up." */
.ml-beat-bearings-row.is-active {
  color: var(--mint-700);
  border-bottom-color: var(--mint-700);
}

.ml-beat-loading,
.ml-beat-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--stone-500);
  text-transform: lowercase;
}

.ml-beat-foot {
  text-align: center;
  margin-top: auto;
}

.ml-beat-foot-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--stone-700);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.ml-beat-foot-link:hover {
  color: var(--mint-700);
  border-bottom-color: var(--mint-700);
}

/* Mobile: bearings panel stacks BELOW the canvas instead of overlaying
   (the cloud is too small on a phone to share with a panel). */
@media (max-width: 720px) {
  .ml-beat {
    padding: 36px 18px 40px;
  }

  .ml-beat-stage {
    aspect-ratio: auto;
    flex-direction: column;
    margin: 28px auto 16px;
  }

  .ml-beat-canvas-link {
    position: relative;
    inset: auto;
    height: 56vh;
  }

  .ml-beat-canvas {
    position: relative;
    height: 100%;
  }

  .ml-beat-bearings {
    position: relative;
    left: auto;
    bottom: auto;
    max-width: 100%;
    margin-top: 16px;
    background: rgb(253 250 247 / 100%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* =====================================================================
   The worlds — paper cards that lift on touch
   ===================================================================== */

.ml-worlds {
  position: relative;
  z-index: 2;
  background: var(--paper);
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 24px 96px;
  width: 100%;
  box-sizing: border-box;
}

.ml-worlds-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}

.ml-worlds-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--charcoal);
  letter-spacing: -0.005em;
  margin: 0;
}

.ml-worlds-note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--stone-500);
  letter-spacing: 0.04em;
}

.ml-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 1023px) {
  .ml-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .ml-grid {
    grid-template-columns: 1fr;
  }
}

.ml-tile {
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 22px 22px 20px;
  background: var(--paper);
  border: 1px solid rgb(0 0 0 / 6%);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 5%);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.22s ease, box-shadow 0.22s ease;
}

.ml-tile:hover {
  transform: translateY(-3px);
  border-color: rgb(45 123 107 / 50%);
  box-shadow: 0 8px 22px rgb(45 123 107 / 10%);
}

.ml-tile:focus-visible {
  outline: 2px solid var(--mint-700);
  outline-offset: 2px;
}

.ml-tile-era {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--stone-500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ml-tile-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 0 0 8px;
}

.ml-tile-hook {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--stone-700);
  line-height: 1.45;
  margin: 0 0 14px;
  flex: 1;
}

.ml-tile-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--stone-500);
  letter-spacing: 0.02em;
}

/* Coming-soon — recedes to a dashed paper outline on the deeper warm tone. */
.ml-tile-soon {
  cursor: default;
  background: var(--cream);
  border-style: dashed;
  border-color: var(--stone-300);
  box-shadow: none;
}

.ml-tile-soon:hover {
  transform: none;
  border-color: var(--stone-300);
  box-shadow: none;
}

.ml-tile-soon .ml-tile-title,
.ml-tile-soon .ml-tile-hook {
  color: var(--stone-500);
}

.ml-tile-soon-badge {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--stone-500);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* =====================================================================
   Footer — the journey, stated quietly
   ===================================================================== */

.ml-footer {
  position: relative;
  z-index: 2;
  background: var(--paper);
  border-top: 1px solid rgb(0 0 0 / 6%);
  padding: 40px 24px;
  text-align: center;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--stone-500);
  line-height: 1.6;
}

.ml-footer a {
  color: var(--stone-700);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.ml-footer a:hover {
  color: var(--mint-700);
}

/* Quieter than the "wander / land" line — the one demoted way back to
   DataMint for signed-in owners (kept few and hidden, per IA intent). */
.ml-footer-secondary {
  margin-top: 12px;
  font-size: 13px;
  opacity: 0.7;
}

/* =====================================================================
   Demo tile detail wrapper (Surface 3) — same gestalt, no live field
   ===================================================================== */

.ml-demo-page {
  min-height: 100vh;
  background: var(--paper);
  color: var(--charcoal);
  font-family: var(--serif);
  display: flex;
  flex-direction: column;
}

.ml-demo-breadcrumb {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--stone-500);
  letter-spacing: 0.02em;
  padding: 14px 32px;
  background: rgb(253 250 247 / 70%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgb(0 0 0 / 6%);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ml-demo-breadcrumb a {
  color: var(--stone-500);
  text-decoration: none;
  transition: color 0.15s ease;
}

.ml-demo-breadcrumb a:hover {
  color: var(--mint-700);
}

.ml-demo-breadcrumb-sep {
  color: var(--stone-400);
}

.ml-demo-header {
  padding: 36px 32px 28px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.ml-demo-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.ml-demo-provenance {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--stone-500);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.ml-demo-disclosure {
  margin: 0;
}

.ml-demo-disclosure summary {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--mint-700);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}

.ml-demo-disclosure summary::-webkit-details-marker {
  display: none;
}

.ml-demo-disclosure summary:hover {
  color: var(--mint-900);
}

.ml-demo-disclosure-body {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--charcoal);
  line-height: 1.55;
  max-width: 720px;
  margin: 14px 0 4px;
}

.ml-demo-disclosure-body p {
  margin: 0 0 10px;
}

.ml-demo-stage-wrap {
  flex: 1;
  position: relative;
  min-height: 70vh;
  display: flex;
}

.ml-demo-stage-wrap > * {
  flex: 1;
  width: 100%;
}

/* =====================================================================
   Bearings panel — HTML index of the constellation's axes.
   The landing's scroll-beats link here with `#bearing-N` (1-indexed
   axis_index). Each row is a magazine-caption-style entry: serif axis
   name above mono-uppercase poles. Hover shows a mint underline (the
   "color appears because the visitor touched it" rule, MANIFOLD_STYLE).
   ===================================================================== */

.ml-demo-bearings {
  max-width: 760px;
  margin: 56px auto 0;
  padding: 0 24px 16px;
  box-sizing: border-box;
  width: 100%;
}

.ml-demo-bearings-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone-500);
  margin: 0 0 18px;
}

.ml-demo-bearings-row {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid rgb(0 0 0 / 6%);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease;
  /* `scroll-margin-top` keeps the row's contents visible when the URL hash
     scrolls it into view (browsers land the row at viewport top by default,
     which can clip the multi-line entry under any sticky chrome). */
  scroll-margin-top: 24px;
}

.ml-demo-bearings-row:last-child {
  border-bottom: none;
}

.ml-demo-bearings-row:focus-visible {
  outline: 2px solid var(--mint-700);
  outline-offset: 2px;
  border-radius: 2px;
}

.ml-demo-bearings-name {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--charcoal);
  line-height: 1.3;
  letter-spacing: -0.005em;
  transition: color 0.18s ease;
}

.ml-demo-bearings-row:hover .ml-demo-bearings-name,
.ml-demo-bearings-row:focus-visible .ml-demo-bearings-name {
  text-decoration: underline;
  text-decoration-color: var(--mint-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  color: var(--ink);
}

.ml-demo-bearings-poles {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--stone-500);
  margin-top: 6px;
  line-height: 1.5;
}

.ml-demo-bearings-sep {
  color: var(--stone-400);
  margin: 0 4px;
}

@media (max-width: 480px) {
  .ml-demo-bearings {
    padding: 0 20px 12px;
    margin-top: 40px;
  }

  .ml-demo-bearings-name {
    font-size: 16px;
  }
}

.ml-demo-loading,
.ml-demo-error {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--stone-500);
  padding: 96px 32px;
  text-align: center;
}

.ml-demo-error-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--charcoal);
  margin: 0 0 12px;
}

/* Quiet "bring your own" footer line — replaces the larger conversion
   block in Phase 5 of the scrollytelling redesign. Visitors deep in a
   demo arrived from the landing carousel and don't need a second pitch;
   one mono link is enough. Mint underline on hover, per the
   color-only-on-touch rule. */
.ml-demo-footer {
  background: var(--paper);
  border-top: 1px solid rgb(0 0 0 / 6%);
  padding: 28px 24px;
  text-align: center;
}

/* Two-CTA variant — sign-up funnel at the bottom of a demo. Flex so the
   two links sit side-by-side on wide, stack on narrow. */
.ml-demo-footer-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 16px 36px;
}

.ml-demo-footer-link {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--stone-700);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.ml-demo-footer-link:hover,
.ml-demo-footer-link:focus-visible {
  color: var(--mint-700);
  border-bottom-color: var(--mint-700);
  outline: none;
}

.ml-demo-attribution {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--stone-500);
  line-height: 1.6;
  text-align: center;
  padding: 20px 32px 36px;
}

/* =====================================================================
   Mobile
   ===================================================================== */

@media (max-width: 640px) {
  .ml-hero-center {
    padding: 28px 20px 64px;
  }

  .ml-wordmark {
    font-size: clamp(44px, 16vw, 72px);
  }

  .ml-lead {
    font-size: 19px;
  }

  .ml-readout {
    /* let the instrument line wrap rather than overflow on a narrow screen */
    max-width: 18em;
    margin-left: auto;
    margin-right: auto;
  }

  .ml-ctas {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
  }

  .ml-btn {
    justify-content: center;
    /* ≥44px touch target */
    padding: 14px 22px;
  }

  /* Comfortable single-column tiles with a real tap target */
  .ml-tile {
    min-height: 132px;
  }

  .ml-nav {
    padding: 14px 20px;
  }

  .ml-demo-title {
    font-size: 24px;
  }

  .ml-demo-header {
    padding: 24px 20px 20px;
  }
}

/* =====================================================================
   ManifoldStory — mobile scrollytelling narrative (feel prototype)
   ===================================================================== */

.mstory {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
}

/* Fixed cloud behind the scrolling beats. */
.mstory-field {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* Paper veil pooled center so text stays legible over the cloud. */
.mstory-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 70% 46% at 50% 48%,
    rgb(253 250 247 / 80%),
    rgb(253 250 247 / 0%) 74%
  );
}

.mstory-beat {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12vh 24px;
  box-sizing: border-box;
  opacity: 0.16;
  transition: opacity 0.6s ease;
}

.mstory-beat.is-on {
  opacity: 1;
}

.mstory-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone-500);
  margin: 0 0 18px;
}

.mstory-wordmark {
  font-family: var(--serif);
  font-size: clamp(52px, 16vw, 92px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1;
  margin: 0;
}

.mstory-hook {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 5vw, 24px);
  color: var(--stone-700);
  margin: 18px 0 0;
  max-width: 16em;
  line-height: 1.4;
}

.mstory-cue {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--stone-400);
  margin: 40px 0 0;
}

.mstory-line {
  font-family: var(--serif);
  font-size: clamp(26px, 7vw, 40px);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 14em;
}

.mstory-pun em {
  font-style: italic;
}

/* The lens, shown as a frosted card of paper floating over the cloud. */
.mstory-lens {
  font-family: var(--serif);
  font-size: clamp(15px, 4vw, 18px);
  line-height: 1.55;
  color: var(--stone-700);
  max-width: 22em;
  margin: 28px 0 0;
  padding: 18px 20px;
  background: rgb(253 250 247 / 86%);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-left: 2px solid var(--mint-700);
  border-radius: 4px;
  box-shadow: 0 2px 12px rgb(0 0 0 / 6%);
  text-align: left;
}

.mstory-ctas {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 320px;
  margin: 32px 0 0;
}

.mstory-ctas .ml-btn {
  justify-content: center;
  padding: 14px 22px;
}

/* Quiet mono note under the mobile CTAs — mobile upload is deferred, so
   "bring your own" links to the desktop /new screen. Mirrors .mstory-cue. */
.mstory-cta-note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--stone-400);
  margin: 16px 0 0;
}

/* =====================================================================
   Login modal — a sheet of paper floats in over the drifting cloud.

   Physics translation of DataMint's #loginModal (backend/static/landing.html
   lines 1488-1521). DataMint's version is correct for DataMint's press
   metaphor: 12px stamped corners, 2px sand borders, solid mint button,
   opaque overlay. Manifold lightens every one of those — hairlines and
   shadow do the work that borders and fills did. The overlay is a paper
   veil + backdrop blur (you can still feel the cloud drifting underneath),
   the sheet is 6px-radius paper with a soft shadow, and the submit is the
   `keep moving` mint pill — a control, not a commitment.
   ===================================================================== */

.ml-loginmodal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(253 250 247 / 70%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: ml-loginmodal-veil-in 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ml-loginmodal-veil-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ml-loginmodal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--paper);
  border: 1px solid rgb(0 0 0 / 6%);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgb(0 0 0 / 10%), 0 1px 4px rgb(0 0 0 / 5%);
  padding: 36px 36px 28px;
  font-family: var(--serif);
  color: var(--charcoal);
  animation: ml-loginmodal-sheet-in 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ml-loginmodal-sheet-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ml-loginmodal-overlay,
  .ml-loginmodal {
    animation: none;
  }
}

.ml-loginmodal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--stone-400);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.ml-loginmodal-close:hover {
  color: var(--ink);
  background: rgb(0 0 0 / 4%);
}

.ml-loginmodal-close:focus-visible {
  outline: 2px solid var(--mint-700);
  outline-offset: 2px;
}

.ml-loginmodal-mark {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 0;
}

.ml-loginmodal-rule {
  height: 1px;
  background: rgb(0 0 0 / 8%);
  margin: 18px 0 22px;
}

.ml-loginmodal-h {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--charcoal);
  letter-spacing: -0.005em;
  margin: 0 0 22px;
}

.ml-loginmodal-field {
  margin-bottom: 18px;
}

.ml-loginmodal-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--stone-500);
  margin-bottom: 8px;
}

.ml-loginmodal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  background: var(--paper);
  border: 1px solid rgb(0 0 0 / 12%);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ml-loginmodal-input::placeholder {
  color: var(--stone-400);
}

.ml-loginmodal-input:focus {
  outline: none;
  border-color: var(--mint-700);
  box-shadow: 0 0 0 3px rgb(45 123 107 / 12%);
}

.ml-loginmodal-helper {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--stone-500);
  margin: 0 0 18px;
  line-height: 1.5;
}

.ml-loginmodal-error {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--error);
  margin: 0 0 14px;
  letter-spacing: 0.01em;
}

.ml-loginmodal-submit {
  width: 100%;
  justify-content: center;
}

.ml-loginmodal-body {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--charcoal);
  line-height: 1.55;
  margin: 0 0 12px;
}

.ml-loginmodal-body strong {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.005em;
}

.ml-loginmodal-fine {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--stone-400);
  margin: 18px 0 0;
}

@media (max-width: 480px) {
  .ml-loginmodal {
    padding: 28px 22px 22px;
  }

  .ml-loginmodal-mark {
    font-size: 22px;
  }

  .ml-loginmodal-h {
    font-size: 20px;
  }
}
/**
 * CREATE-PROJECT.CSS - Create Project Form Styles
 *
 * Used by: CreateProject component (project creation modal/form)
 * Status: ACTIVE — Restyled Phase 1
 */

/* Create Project Form */

#create-project-section {
    max-width: 600px;
    margin: 0 auto;
}

#create-project-section .section-title {
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 32px;
    text-align: center;
}

#create-project-section .project-form {
    /* Clean container */
}

#create-project-section .form-group {
    margin-bottom: 24px;
}

#create-project-section .form-group label {
    display: block;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--charcoal) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#create-project-section .form-input {
    width: 100%;
    padding: 12px !important;
    border: 1px solid var(--sand) !important;
    border-radius: var(--radius-button) !important;
    font-size: 15px !important;
    font-family: var(--serif) !important;
    transition: border-color 150ms ease, box-shadow 150ms ease !important;
    background: var(--white) !important;
    color: var(--charcoal) !important;
    box-sizing: border-box !important;
}

#create-project-section .form-input::placeholder {
    color: var(--stone-400) !important;
}

#create-project-section .form-input:focus {
    outline: none !important;
    border-color: var(--mint-500) !important;
    box-shadow: 0 0 0 2px var(--mint-100) !important;
}

#create-project-section .form-actions {
    margin-top: 0;
}

#create-project-section .btn-primary {
    width: 100% !important;
    padding: 14px !important;
    background: var(--mint-700) !important;
    color: var(--white) !important;
    border: none !important;
    border-radius: var(--radius-button) !important;
    font-family: var(--sans) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background 150ms ease !important;
    display: block !important;
    text-align: center !important;
}

#create-project-section .btn-primary:hover:not(:disabled) {
    background: var(--mint-900) !important;
}

#create-project-section .btn-primary:disabled {
    background: var(--stone-300) !important;
    cursor: not-allowed !important;
}
/**
 * PROJECT-CARDS.CSS - Project Card Component Styles
 *
 * Used by: Projects list/grid on projects page
 * Status: ACTIVE — Restyled Phase 1
 */

/* Project Cards */

.project-cards {
    display: grid !important;
    gap: 16px !important;
    grid-template-columns: 1fr !important;
}

.project-card {
    display: block !important;
    background: var(--paper) !important;
    border: 1px solid var(--sand) !important;
    border-radius: var(--radius-card) !important;
    padding: 20px !important;
    cursor: pointer !important;
    transition: border-color 150ms ease !important;
}

.project-card:hover {
    border-color: var(--mint-700) !important;
}

.project-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 12px !important;
}

.project-card-title {
    font-family: var(--serif) !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--mint-700) !important;
    margin: 0 !important;
}

.project-card-badge {
    background: var(--mint-100) !important;
    color: var(--mint-700) !important;
    font-family: var(--mono) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.project-card-desc {
    font-family: var(--serif) !important;
    font-size: 14px !important;
    color: var(--stone-700) !important;
    line-height: 1.6 !important;
    margin-bottom: 12px !important;
}

.project-card-stats {
    display: flex !important;
    gap: 16px !important;
    font-family: var(--mono) !important;
    font-size: 12px !important;
    color: var(--stone-500) !important;
    margin-bottom: 8px !important;
}

.project-card-stats span {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.project-card-footer {
    font-family: var(--mono) !important;
    font-size: 11px !important;
    color: var(--stone-400) !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--sand) !important;
}

.project-card-date {
    color: inherit !important;
}
