* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
 
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-subtle: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #cbd5e1;
  --text: #111827;
  --muted: #64748b;
  --muted-strong: #475569;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #dbeafe;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text);
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-large {
  padding: 0.85rem 1.2rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.5rem;
  background: transparent;
  border-radius: 0.5rem;
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.05);
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: #e5e7eb;
  color: #1f2937;
}

.btn-secondary:hover {
  background: #d1d5db;
}

.btn-danger {
  color: #dc2626;
}

/* Home Screen */
.home-screen {
  padding: 2rem 1rem;
  text-align: center;
}

.home-title {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--text);
}

.home-subtitle {
  font-size: 1.25rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.home-description {
  max-width: 800px;
  margin: 0 auto 3rem;
  color: #4b5563;
  line-height: 1.6;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.mode-grid.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.mode-card {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  position: relative;
}
.mode-card.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.mode-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

.mode-card.completed {
  border: 3px solid #10b981;
}

.mode-card.completed::after {
  content: "✓";
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  background: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.mode-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

.mode-card:hover .mode-icon {
  transform: scale(1.1);
}

.mode-icon.purple {
  background: var(--accent);
}
.mode-icon.blue {
  background: var(--accent);
}
.mode-icon.green {
  background: var(--accent);
}

.mode-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.mode-card p {
  color: #6b7280;
}

.method-guidance {
  margin-top: 1rem;
  text-align: left;
}

.method-guidance p {
  margin-top: 0.6rem;
  font-size: 0.86rem;
  line-height: 1.45;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  margin: 0.2rem 0.2rem 0 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.72rem;
  font-weight: 700;
}

.method-badge.recommended {
  background: #ecfdf5;
  color: #047857;
}

/* Input Screen */
.input-screen {
  padding: 3rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.card h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-hint {
  display: block;
  margin-top: 0.2rem;
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 400;
}

.item-notes-label {
  margin-top: 1rem;
}

.form-error {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 0.9rem;
}

.onboarding-hints {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
  text-align: left;
}

.onboarding-hints h2 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.onboarding-hints ul {
  list-style: disc;
  padding-left: 1.25rem;
  color: #374151;
  line-height: 1.6;
}

.onboarding-hints li {
  margin-bottom: 0.5rem;
}

.onboarding-progress {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
  text-align: left;
}

.onboarding-progress h3 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.onboarding-progress ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  padding-left: 0;
  color: #374151;
}

.onboarding-progress li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(243, 244, 246, 0.8);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}

.onboarding-progress li::before {
  content: "○";
  color: #9ca3af;
  font-size: 0.85rem;
}

.onboarding-progress li.complete {
  background: rgba(34, 197, 94, 0.15);
}

.onboarding-progress li.complete::before {
  content: "✓";
  color: #22c55e;
}

.progress-link {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}

.progress-link:hover {
  text-decoration: underline;
}

.progress-link.disabled {
  color: #9ca3af;
  pointer-events: none;
  text-decoration: none;
}

#editItemsBtn {
  border-radius: 10px;
  font-weight: 700;
  padding: .5rem;
  background: #a0a0a0;
  color: rgb(255, 255, 255);
}

#editItemsBtn:hover {
  transform: translateY(-1px);
}

/* Template System Enhancements - V3 Cards */

/* ------------------ 1. Category View (Horizontal Scroll) ------------------ */

/* Remove default styles from the container and ensure it's a block for layout */
.template-buttons {
  display: block;
}

/* Horizontal scrolling container for category cards */
.template-category-scroll {
  display: flex;
  gap: 1rem; /* Increased gap for better spacing */
  overflow-x: auto; /* Enable horizontal scrolling */
  padding: 0.25rem 0.25rem 1rem 0.25rem; /* Padding for scrollbar and shadow */
  margin-top: 0.5rem;
  /* Adds a subtle fade-out effect on the right side if content overflows */
  -webkit-mask-image: linear-gradient(to right, black 95%, transparent 100%);
  mask-image: linear-gradient(to right, black 95%, transparent 100%);
  scrollbar-width: none; /* Hide scrollbar for Firefox */
}

/* Hide scrollbar for Webkit browsers (Chrome, Safari) */
.template-category-scroll::-webkit-scrollbar {
  display: none;
}

/* Individual Category Card Styles */
.template-category-card {
  flex-shrink: 0; /* Ensures cards don't shrink when scrolling */
  width: 170px; /* Slightly wider card */
  height: 190px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between; /* Pushes content to top/bottom */
  padding: 1.25rem;
  background: white;
  border-radius: 1rem; /* More rounded corners */
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03); /* Soft initial shadow */
}

.template-category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px rgba(147, 51, 234, 0.15); /* Stronger hover shadow */
  border-color: #9333ea; /* Purple border on hover */
}

.template-category-card .icon {
  font-size: 2.5rem; /* Larger icon */
  line-height: 1;
}

.template-category-card .name {
  font-weight: 700; /* Bolder name */
  color: #1f2937;
  font-size: 1.05rem;
}

.template-category-card .description {
  font-size: 0.825rem;
  color: #6b7280;
  line-height: 1.4;
}

/* ------------------ 2. Template List View (Grid) ------------------ */

/* Header for the Template List (e.g., "Back to Categories" and Category Name) */
.template-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.template-header .form-label {
  font-size: 1.4rem; /* Larger title */
  font-weight: 700;
  margin-bottom: 0;
  color: #4c1d95; /* Accent color for the title */
}

/* Grid container for individual template cards */
.template-item-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(220px, 1fr)
  ); /* Slightly wider min size */
  gap: 1.25rem;
  max-height: 400px; /* Constrain height and allow internal scrolling */
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Individual Template Card Styles */
.template-item-card {
  position: relative;
  display: block;
  padding: 1.5rem;
  background: #fcfaff; /* Very light background for contrast */
  border-radius: 0.75rem;
  border: 1px solid #dcdcdc;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 120px;
}

.template-item-card:hover {
  background: white;
  border-color: #9333ea;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(147, 51, 234, 0.1);
}

/* The emoji in the top right corner */
.template-item-card .icon-corner {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.75rem; /* Larger emoji */
  opacity: 0.2;
  transition: opacity 0.2s;
}

.template-item-card:hover .icon-corner {
  opacity: 0.5;
}

.template-item-card .name {
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.template-item-card .description {
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.5;
}

/* Template Item Preview (The double-line item list) */
.template-item-card .preview-items {
  font-size: 0.825rem;
  color: #a1a1a1;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb; /* The separation line */

  /* Multiline text ellipsis */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  line-clamp: 2; /* Standard property */
  -webkit-box-orient: vertical;
  line-height: 1.4;
  max-height: calc(1.4em * 2); /* Fallback for non-webkit browsers */
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 1rem;
  resize: vertical;
}

textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #9333ea;
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* Pairwise Ranking */
.ranking-screen {
  padding: 2rem 1rem;
}

.progress-bar-container {
  text-align: center;
  margin-bottom: 2rem;
}

.progress-badge {
  display: inline-block;
  background: white;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
  font-weight: 600;
}

.progress-bar {
  max-width: 600px;
  margin: 0 auto;
  height: 0.5rem;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.5s;
  border-radius: 9999px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.comparison-card {
  position: relative;
  background: white;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  color: inherit;
  font: inherit;
}

.comparison-card:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

.comparison-card:focus-visible,
.mode-card:focus-visible,
.template-category-card:focus-visible,
.template-item-card:focus-visible,
.elimination-item-card:focus-visible,
.match-player:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.45);
  outline-offset: 3px;
}

.comparison-card.selected {
  transform: scale(1.05);
  box-shadow: 0 0 0 4px #10b981;
}

.comparison-arrow {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  opacity: 0.2;
  transition: opacity 0.3s;
}

.comparison-card:hover .comparison-arrow {
  opacity: 0.4;
}

.comparison-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.comparison-rating {
  color: #6b7280;
  font-size: 0.875rem;
}

.comparison-hint {
  color: #9ca3af;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn-yellow {
  background: #fbbf24;
  color: white;
}

.btn-yellow:hover {
  background: #f59e0b;
}

.btn-blue {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
}

.btn-blue:hover {
  background: var(--accent-soft);
}

.btn-purple {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
}

.btn-purple:hover {
  background: var(--accent-soft);
}

/* Disabled button styling */
.btn[disabled],
.btn-disabled {
  background: #d1d5db !important;
  color: #6b7280 !important;
  cursor: not-allowed !important;
  opacity: 0.75;
  box-shadow: none !important;
  transform: none !important;
}

/* Compare results section */
.compare-results-section {
  margin-top: 2rem;
  text-align: center;
}

.compare-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.compare-counter {
  font-weight: 600;
  color: #6b7280;
  background: rgba(238, 238, 255, 0.65);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.compare-hint {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #6b7280;
}

/* Rankings Display */
.rankings-container {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-top: 2rem;
}

.rankings-container h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.ranking-list {
  list-style: none;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.ranking-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: #9ca3af;
  min-width: 2rem;
}

.ranking-name {
  flex: 1;
  font-weight: 500;
}

.ranking-rating {
  color: #6b7280;
  font-size: 0.875rem;
}

.confidence {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.confidence.low {
  color: #ef4444;
  background: #fee2e2;
}
.confidence.medium {
  color: #f59e0b;
  background: #fef3c7;
}
.confidence.high {
  color: #10b981;
  background: #d1fae5;
}

/* Tier List */
.tier-container {
  margin-bottom: 1rem;
}

.unplaced-items {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.unplaced-items h3 {
  margin-bottom: 1rem;
  font-weight: bold;
}

.items-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.items-chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.items-chip-container .chip {
  background: #f3f4f6;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #374151;
}

.decision-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.decision-chip small {
  color: #6b7280;
  font-size: 0.75rem;
}

.decision-display {
  padding: 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.decision-title-display {
  font-weight: 800;
  font-size: 1.1rem;
  color: #111827;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.items-chip-container .chip-empty {
  opacity: 0.6;
  font-style: italic;
  border: 1px dashed #d1d5db;
  background: rgba(243, 244, 246, 0.6);
}
.draggable-item {
  padding: 0.5rem 1rem;
  background: #e5e7eb;
  border-radius: 0.5rem;
  cursor: move;
  transition: all 0.2s;
  user-select: none;
}

.draggable-item:hover {
  background: #d1d5db;
  transform: scale(1.05);
}

.tier-row {
  display: flex;
  gap: 1rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1rem;
  min-height: 5rem;
}

.tier-label {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-size: 1.5rem;
  font-weight: bold;
  flex-shrink: 0;
}

.tier-label.s {
  background: #fef3c7;
  color: #92400e;
}
.tier-label.a {
  background: #dcfce7;
  color: #166534;
}
.tier-label.b {
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.tier-label.c {
  background: #f1f5f9;
  color: var(--muted-strong);
}
.tier-label.d {
  background: #e5e7eb;
  color: #374151;
}

.tier-items {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  min-height: 4rem;
  padding: 0.5rem;
  border: 2px dashed transparent;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.tier-items.drag-over {
  border-color: #9333ea;
  background: #f3e8ff;
}

.tier-items.empty {
  color: #9ca3af;
  font-style: italic;
}
.counter {
  font-weight: normal;
  font-size: 0.9em;
  color: #9333ea; /* Use an accent color */
}
/* Drag to Rank */
.drag-rank-list {
  list-style: none;
}

.drag-rank-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: move;
  transition: all 0.2s;
  user-select: none;
}

.drag-rank-item:hover {
  background: #f3f4f6;
  transform: translateX(4px);
}

.drag-rank-item.dragging {
  opacity: 0.5;
}

/* Results Comparison */
.comparison-grid-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.method-results-card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.method-results-card h3 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #9333ea;
}

.method-ranking-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  margin-bottom: 0.25rem;
  background: #f9fafb;
  border-radius: 0.375rem;
}

.method-rank-num {
  font-weight: bold;
  color: #9ca3af;
  min-width: 1.5rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.chart-container {
  margin-bottom: 2rem;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

/* Keyboard Shortcuts Info */
.shortcuts-panel {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  max-width: 250px;
  z-index: 40;
}

.shortcuts-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.shortcuts-list {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.8;
}

/* Utility */
.hidden {
  display: none !important;
}

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

.text-muted {
  color: #6b7280;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.card,
.mode-card,
.mode-icon,
.onboarding-progress,
.template-category-card,
.template-item-card,
.rankings-container,
.unplaced-items,
.tier-row,
.method-results-card,
.visual-card,
.modal-content,
.notification,
.budget-input,
.match-card,
.elimination-item-card {
  border-radius: 0.5rem;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-lg {
  width: 2rem;
  height: 2rem;
}

.icon-white {
  color: white;
}

.notification {
  position: fixed;
  top: 5rem;
  right: 1rem;
  background: #10b981;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s;
  z-index: 60;
}

/* Share / Tour Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  padding: 1.5rem;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
  color: #6b7280;
}

.modal-text {
  margin: 1rem 0;
  color: #4b5563;
}

.modal-body {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.input-text {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .home-title {
    font-size: 2rem;
  }

  .container {
    padding: 0 0.75rem;
  }

  header .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .budget-row {
    align-items: stretch;
    flex-direction: column;
  }

  .budget-label {
    white-space: normal;
  }

  .budget-input {
    width: 100%;
  }

  .results-summary-meta,
  .consistency-toggle,
  .chart-controls,
  .modal-body {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .onboarding-hints {
    padding: 1rem;
  }

  .shortcuts-panel {
    display: none;
  }
}
/* Bracket Elimination CSS */
.bracket-container {
  display: flex; /* Horizontal layout */
  overflow-x: auto;
  padding: 2rem;
  gap: 4rem; /* Space between rounds */
}

.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around; /* Distributes matches vertically */
  min-width: 200px;
}

.bracket-match {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  position: relative;
}

/* The connector lines (pseudo-elements) */
.bracket-match::after {
  content: '';
  position: absolute;
  right: -2rem; /* Stick out to the right */
  top: 50%;
  width: 2rem;
  height: 2px;
  background: #ccc;
}
/* Budget Mode Styling */
.budget-header {
  text-align: center;
  margin-bottom: 2rem;
}

.budget-header h2 {
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.budget-grid {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.budget-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.budget-label {
  flex: 1; /* Name takes remaining space */
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.budget-slider {
  flex: 2; /* Slider takes more space */
  accent-color: #9333ea;
  height: 6px;
  border-radius: 3px;
}

.budget-input {
  width: 80px;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  text-align: center;
  font-weight: bold;
}

/* Tournament Bracket Styling */
.bracket-wrapper {
  display: flex;
  gap: 3rem;
  padding: 2rem;
  overflow-x: auto;
  min-height: 400px;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-width: 220px;
  gap: 2rem;
}

.bracket-round h4 {
  text-align: center;
  color: #9ca3af;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.match-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: relative;
}

.match-card::after {
  /* Connector line */
  content: '';
  position: absolute;
  top: 50%;
  right: -3rem;
  width: 3rem;
  height: 2px;
  background: #e5e7eb;
  z-index: -1;
}
.bracket-round:last-child .match-card::after {
  display: none;
}

.match-player {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.9rem;
  border-bottom: 1px solid #f3f4f6;
  border-left: none;
  border-right: none;
  border-top: none;
  background: white;
  color: inherit;
  text-align: left;
}

.match-player:last-child {
  border-bottom: none;
}

.match-player:disabled {
  cursor: not-allowed;
}

.match-note {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.75em;
  opacity: 0.65;
}

.match-player:hover {
  background: #f9fafb;
}

.match-player.winner {
  background: #ecfdf5; /* light green */
  color: #065f46;
  font-weight: bold;
}

.match-player.loser {
  opacity: 0.5;
  text-decoration: line-through;
}

/* Smart Sort */
.smart-comparison-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
/* Keep the row height stable during input */
.budget-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  /* prevent height collapse */
  min-height: 40px; 
}

/* Tournament updates */
.match-card.placeholder {
  border-style: dashed;
  background: #f9fafb;
  color: #9ca3af;
}

.match-player.empty-slot {
  height: 40px;
  display: flex;
  align-items: center;
  padding-left: 1rem;
  color: #d1d5db;
  font-style: italic;
  pointer-events: none;
}
/* Results comparison updates */

.comparison-grid-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.method-results-card {
  padding: 1.5rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
}

.method-results-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #4f46e5;
  border-bottom: 2px solid #eef2ff;
  padding-bottom: 0.5rem;
}

.method-ranking-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px dashed #f3f4f6;
  font-weight: 500;
}

.method-ranking-item:last-child {
  border-bottom: none;
}

.rank-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4f46e5;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 0.75rem;
}

/* Specific styling for new cards */
.consensus-card {
    background: #eef2ff;
    grid-column: span 1;
}

.consensus-card h3 {
    color: #3b82f6;
}

.consistency-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  grid-column: span 1;
}

.consistency-card h3 {
  color: #2563eb;
  border-bottom-color: #bfdbfe;
}

.discrepancy-card h3 {
    color: #dc2626;
    border-bottom-color: #fecaca;
}

.discrepancy-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
    background: white;
    margin: 0.25rem 0;
    border-radius: 0.3rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.rank-value {
    font-weight: bold;
    color: #dc2626;
}

.method-name {
    font-size: 0.9em;
    color: #4b5563;
}
/* Additional results CSS for the visual cards*/

.visual-card {
    padding: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.visual-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #1f2937;
    font-size: 1.4rem;
}

.chart-caption {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 0.9em;
}

.select-input {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    background-color: white;
}

/* Update comparison-grid-results to target the new sections */
#summaryAndVolatilityArea {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.insight-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem;
}

.insight-card h3 {
  margin: 0.3rem 0 0.4rem;
  font-size: 1.1rem;
  color: #111827;
}

.insight-card p,
.insight-card li {
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.5;
}

.insight-card ul {
  padding-left: 1.2rem;
}

.insight-card-wide {
  grid-column: 1 / -1;
}

.insight-label {
  color: #4f46e5;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.reflection-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.method-note-label {
  display: block;
  margin-top: 1rem;
  color: #374151;
  font-size: 0.85rem;
  font-weight: 700;
}

.method-note-input {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  resize: vertical;
  font: inherit;
}

.import-project-label {
  position: relative;
}

section {
  padding-top: 1rem;
}

#detailedRankGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
/* Add a fixed height for the canvas wrapper */
.chart-container {
    position: relative;
    height: 400px; /* Or whatever height you prefer */
    width: 100%;
}

/* Ensure the canvas within the container takes full dimensions */
#rankFlowChart {
    height: 100%; 
    width: 100%;
}
/* --- Smart Sort Context Display --- */
.merge-lists-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.9em;
    color: #4b5563;
}

.merge-list {
    background: #f3f4f6;
    padding: 0.75rem;
    border-radius: 0.5rem;
    flex: 1;
    max-width: 45%;
    min-height: 4rem;
}

.merge-list-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #374151;
    text-align: center;
}

.merge-list-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
}

.merge-list-item {
    padding: 0.2rem 0.4rem;
    background: #d1d5db;
    border-radius: 4px;
    white-space: nowrap;
}

.highlight-item {
    /* Highlight the item being compared */
    background: #4f46e5;
    color: white;
    font-weight: bold;
}

/* --- Elimination Method Styles --- */
.elimination-item-card {
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.elimination-item-card:hover {
    border-color: #ef4444; /* Highlight red on hover for active items */
    background-color: #fee2e2;
    /* ... (rest of hover styles) ... */
}

.eliminated-card {
    background-color: #f3f4f6;
    color: #9ca3af;
    border: 2px solid #d1d5db; /* Changed from 1px to 2px for consistency */
    text-decoration: line-through;
    cursor: default; /* Crucial: changes cursor to indicate no action */
    opacity: 0.7;
}

.eliminated-card:hover {
    /* Crucial: prevents hover effects on eliminated cards */
    border-color: #d1d5db;
    background-color: #f3f4f6;
    transform: none;
    box-shadow: none;
}

/* Footer */
.site-footer {
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.site-footer .elegant-font {
  font-size: 1rem;
}

.site-footer a.footer-link {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 600;
}

.site-footer a.footer-link:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Heatmap for comparison results */
.heatmap-container {
  overflow-x: auto;
  padding: 0.5rem 0;
}

.heatmap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.heatmap-table th,
.heatmap-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
  text-align: center;
  min-width: 90px;
}

.heatmap-table th {
  background: rgba(243, 244, 246, 0.8);
  color: #374151;
  font-weight: 700;
}

.heatmap-item {
  text-align: left;
  color: #1f2937;
  font-weight: 600;
}

.heatmap-cell {
  border-radius: 0.5rem;
}

@media (max-width: 768px) {
  .heatmap-table th,
  .heatmap-table td {
    padding: 0.4rem 0.5rem;
    min-width: 70px;
  }
}

/* Aggregated Results Table */
.smart-table-container {
  overflow-x: auto;
  padding: 0.75rem 0;
}

.smart-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.smart-results-table th,
.smart-results-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
  text-align: left;
  min-width: 110px;
}

.smart-results-table th {
  background: rgba(243, 244, 246, 0.85);
  color: #374151;
  font-weight: 700;
}

.smart-results-table tr:nth-child(even) td {
  background: rgba(243, 244, 246, 0.5);
}

@media (max-width: 768px) {
  .smart-results-table th,
  .smart-results-table td {
    padding: 0.4rem 0.5rem;
    min-width: 90px;
  }
}

/* Results comparison layout helpers */
.results-summary {
  margin-top: 2rem;
}

.results-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.results-summary-meta {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.summary-meta-item {
  background: rgba(243, 244, 246, 0.7);
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  text-align: center;
}

.summary-meta-label {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
}

.summary-meta-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

/* Consistency toggle */
.consistency-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-btn {
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: rgba(255, 255, 255, 0.8);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #374151;
  transition: background 0.2s, border 0.2s;
}

.toggle-btn:hover {
  background: rgba(243, 244, 246, 1);
}

.toggle-btn.active {
  background: #6366f1;
  border-color: #6366f1;
  color: white;
}

.results-visuals {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.results-details {
  margin-top: 2.5rem;
}

.results-details h3 {
  margin-bottom: 0.25rem;
}

.results-details p {
  margin-bottom: 1.5rem;
}

/* Polished V2 decision desk */
header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

.logo,
.home-title {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--text);
}

.logo {
  letter-spacing: 0;
}

.home-screen {
  padding: 2rem 0 3rem;
  text-align: left;
}

.workspace-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem 0 1.25rem;
}

.home-title {
  max-width: 760px;
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 0;
  line-height: 0.98;
}

.home-subtitle,
.home-description {
  color: var(--muted);
}

.home-description {
  max-width: 680px;
  margin: 0;
  font-size: 1.05rem;
}

.eyebrow {
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-promise {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  max-width: 320px;
}

.workspace-promise span,
.method-badge,
.compare-counter {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted-strong);
}

.workspace-promise span {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.decision-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 1.25rem;
  align-items: start;
}

.workspace-main,
.workspace-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card,
.mode-card,
.method-results-card,
.visual-card,
.insight-card,
.reflection-panel,
.onboarding-progress,
.recommended-methods-panel,
.latest-reflection-panel {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card {
  padding: 1.35rem;
}

.card h2,
.section-heading h2,
.section-heading h3 {
  letter-spacing: 0;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.section-note {
  max-width: 420px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
}

textarea,
input[type="text"],
.input-text,
.select-input {
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

textarea:focus,
input[type="text"]:focus,
.input-text:focus,
.select-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.onboarding-progress,
.recommended-methods-panel,
.latest-reflection-panel {
  padding: 1rem;
  border-radius: var(--radius);
}

.onboarding-progress ul {
  flex-direction: column;
  gap: 0.5rem;
}

.onboarding-progress li {
  justify-content: flex-start;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.onboarding-progress li.complete {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.recommended-methods-list {
  display: grid;
  gap: 0.7rem;
}

.recommended-method-card {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.recommended-method-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.recommended-method-card:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.recommended-method-card.completed {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.recommended-method-card strong {
  font-size: 1rem;
}

.recommended-method-card span,
.recommended-method-card small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.recommended-method-kicker {
  color: var(--accent) !important;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ranking-methods-section {
  margin-top: 1.5rem;
}

.mode-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}

.mode-card {
  padding: 1rem;
  text-align: left;
  box-shadow: none;
}

.mode-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mode-card.completed {
  border: 1px solid #a7f3d0;
  background: #f0fdf4;
}

.mode-icon {
  width: 2.7rem;
  height: 2.7rem;
  margin: 0 0 0.75rem;
  border-radius: var(--radius);
}

.mode-card:hover .mode-icon {
  transform: none;
}

.mode-icon,
.mode-icon.purple,
.mode-icon.blue,
.mode-icon.green,
.btn-purple,
.progress-fill {
  background: var(--accent);
}

.method-guidance {
  margin-top: 0.8rem;
}

.method-guidance p {
  color: var(--muted);
}

.method-badge.recommended {
  border-color: #bfdbfe;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.compare-results-section {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.method-screen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.method-screen-header h2 {
  margin-bottom: 0.35rem;
  font-size: 1.5rem;
  letter-spacing: 0;
}

.method-screen-header p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.5;
}

.method-header-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 220px;
}

.method-header-meta span {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 700;
}

.comparison-card,
.unplaced-items,
.tier-row,
.rankings-container,
.budget-grid,
.match-card,
.elimination-item-card {
  box-shadow: var(--shadow-sm);
}

.comparison-card:hover,
.elimination-item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.method-reflection {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.latest-reflection-panel textarea,
.method-reflection textarea,
#decisionNoteInput {
  width: 100%;
  margin-top: 0.5rem;
}

.answer-first {
  padding-top: 0;
}

.insight-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.insight-card {
  background: var(--surface-subtle);
}

.insight-card h3 {
  font-size: 1.15rem;
}

.insight-card-wide {
  grid-column: 1 / -1;
  background: #f8fafc;
}

.supporting-summary {
  margin-top: 1rem;
}

.evidence-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.results-details {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.visual-card,
.method-results-card {
  box-shadow: var(--shadow-sm);
}

.consensus-card,
.consistency-card {
  border: 1px solid var(--border);
  background: var(--surface);
}

.rank-badge,
.toggle-btn.active {
  background: var(--accent);
}

.site-footer {
  background: var(--surface);
}

@media (max-width: 900px) {
  .workspace-intro,
  .section-heading-row,
  .method-screen-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .decision-workspace,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .workspace-promise,
  .method-header-meta {
    justify-content: flex-start;
  }
}
