@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);

  /* ========================================
     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;
}
/**
 * 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;
}
