/* --- II. SHARED COMPONENT STYLES --- */
/* Styles for reusable UI components that can appear in various parts of the application. */

/* --- Card Component --- */
/* Card styles have been moved to ../shared-code/components/cards.css */
/* Use .os-card or .tea-card classes from the shared component library */

/* Market Size Explorer specific card customizations */
/* Animated top border for MSE cards */
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #6B8E23; /* Mindstate: Data green solid */
    z-index: 1;
    border-top-left-radius: 0; /* Mindstate: Sharp corners */
    border-top-right-radius: 0; /* Mindstate: Sharp corners */
  }
  
  /* Styling for primary headings (H2) within cards */
  .card h2 {
    font-size: 1.7rem;
    color: #000000; /* Mindstate: Pure black */
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    position: relative;
  }
  
  .card h2::after {
    content: "";
    position: absolute;
    width: 60px;
    height: 3px;
    background: #6B8E23; /* Mindstate: Data green */
    bottom: -2px; /* To sit on top of the border-bottom */
    left: 0;
    border-radius: 0; /* Mindstate: Sharp corners */
  }
  
  /* Styling for secondary headings (H3) within cards */
  .card h3 {
    font-size: 1.4rem;
    color: #000000; /* Mindstate: Pure black */
    margin: 5px 0 15px 0;
    font-weight: 600;
    letter-spacing: 0.3px;
    position: relative;
    padding-left: 15px; /* Space for the ::before pseudo-element */
  }
  
  .card h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 22px;
    background: #6B8E23; /* Mindstate: Data green */
    border-radius: 0; /* Mindstate: Sharp corners */
    box-shadow: none; /* Mindstate: No shadow on decorative elements */
  }
  
  /* Styling for tertiary headings (H4) within cards */
  .card h4 {
    font-size: 1.15rem;
    color: var(--text-dark);
    font-weight: 600;
    margin: 15px 0 10px 0;
    opacity: 0.95;
  }
  
  /* Styling for paragraphs within cards */
  .card p {
    color: var(--text-light); /* Lighter text for paragraphs */
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5; /* Slightly tighter line-height for card content */
  }
  
  /* --- Disorder Selector Component --- */
  .disorder-selector-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
  }
  
  .disorder-select {
    background: #FAFAFA; /* Mindstate: Light gray */
    color: var(--text-dark);
    border: 1px solid transparent;
    border-radius: 0; /* Mindstate: Sharp corners */
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    flex-grow: 1;
    transition: all var(--transition-fast) ease;
    box-shadow: none; /* Mindstate: No inset shadows */
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2361677C' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-sm) center;
    background-size: 12px;
    padding-right: calc(var(--spacing-md) + 16px);
  }
  
  .disorder-select:hover {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231ca095' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  }
  
  .disorder-select:focus {
    border-color: var(--primary-light);
    background: var(--color-bg);
    box-shadow: 0 0 0 2px #6B8E23; /* Mindstate: Simple focus ring */
    outline: none;
  }
  
  .disorder-select option {
    background-color: var(--card-bg);
    color: var(--text-medium);
    padding: 10px;
  }
  
  /* --- Button Components Migration Summary --- */
  /* All button styles have been migrated to ../shared-code/components/buttons.css
     Migration mapping:
     .refresh-btn → .os-btn.os-btn--primary.os-btn--refresh
     .unified-calculate-button → .os-btn.os-btn--primary
     .copy-md-btn → .os-btn.os-btn--copy.os-btn--secondary
     .download-btn → .os-btn.os-btn--download.os-btn--primary
  */
  
  /* --- Refresh Button Component --- */
  /* REMOVED - Use .os-btn--primary from ../shared-code/components/buttons.css
  .refresh-btn {
    background: #6B8E23; /* Mindstate: Data green */
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 0; /* Mindstate: Sharp corners */
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-medium) ease;
    font-family: var(--font-body);
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
  .refresh-btn:hover {
    background: #8FB339; /* Mindstate: Light data green */
    transform: translateY(-3px);
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.08); /* Mindstate: Subtle shadow */
  }
  
  .refresh-btn:active {
    transform: translateY(1px);
    background: #4A6319; /* Mindstate: Dark data green */
    box-shadow: none; /* Mindstate: No shadow when selected */
  }
  
  /* Radial gradient effect on hover */
  .refresh-btn::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255,255,255,0.1); /* Mindstate: Simple overlay */
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.5s ease, opacity 0.5s ease;
  }
  
  .refresh-btn:hover::after {
    opacity: 1;
    transform: scale(1);
  }
  
  /* Spinning refresh icon */
  .refresh-btn::before {
    content: "↻";
    font-weight: bold;
    font-size: 18px;
    /* margin-right: 5px; */ /* Removed as gap is used on parent */
    animation: spin 8s linear infinite paused; /* Animation defined in Global */
  }
  
  .refresh-btn:hover::before {
    animation-play-state: running;
  }
  */
  
  /* Custom refresh icon animation for os-btn--refresh */
  .os-btn--refresh::before {
    content: "↻";
    font-weight: bold;
    font-size: 18px;
    animation: spin 8s linear infinite paused;
  }
  
  .os-btn--refresh:hover::before {
    animation-play-state: running;
  }
  
  /* --- Unified Calculate Button Component (e.g., for JSON input) --- */
  /* REMOVED - Use .os-btn--primary from ../shared-code/components/buttons.css
  .unified-calculate-button {
    background: #6B8E23; /* Mindstate: Data green */
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 0; /* Mindstate: Sharp corners */
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-medium) ease;
    font-family: 'Open Sans', sans-serif; /* Open Sans for all text */
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
  }
  
  .unified-calculate-button:hover {
    background: #8FB339; /* Mindstate: Light data green */
    transform: translateY(-3px);
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.08); /* Mindstate: Subtle shadow */
  }
  
  .unified-calculate-button:active {
    transform: translateY(1px);
    background: #4A6319; /* Mindstate: Dark data green */
    box-shadow: none; /* Mindstate: No shadow when selected */
  }
  
  /* Radial gradient effect on hover */
  .unified-calculate-button::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255,255,255,0.1); /* Mindstate: Simple overlay */
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.5s ease, opacity 0.5s ease;
  }
  
  .unified-calculate-button:hover::after {
    opacity: 1;
    transform: scale(1);
  }
  */
  
  /* --- Error Message Component (Static version) --- */
  /* This is for the #errorMessage element. A dynamic popup error is styled in Block 2. */
  .error-message {
    color: white;
    background: #DC2626; /* Mindstate: Red */
    padding: 18px;
    border-radius: 0; /* Mindstate: Sharp corners */
    margin-bottom: 15px;
    display: none; /* Shown by JS */
    font-weight: 500;
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */
      -2px -2px 6px var(--color-shadow-light),
      inset 1px 1px 1px rgba(255, 255, 255, 0.1);
    border: 1px solid var(--error);
    position: relative;
    padding-left: 45px; /* Space for icon */
    animation: fadeInDown 0.5s ease; /* Animation defined in Global */
  }
  
  .error-message::before {
    content: "!";
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
  }
  
  /* --- Tab Navigation System --- */
  /* REMOVED - Now using unified tab components from shared-code/components/tabs.css
  .tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--color-shadow-dark);
  }
  
  .tabs::-webkit-scrollbar {
    height: 4px;
  }
  
  .tabs::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 0; /* Mindstate: Sharp corners */
  }
  
  .tabs::-webkit-scrollbar-track {
    background-color: var(--color-shadow-dark);
  }
  
  .tab {
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    transition: all var(--transition-medium) ease;
    white-space: nowrap;
    position: relative;
    border-radius: 0; /* Mindstate: Sharp corners */
  }
  
  .tab::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary-light), var(--primary-dark));
    transition: all var(--transition-medium) ease;
    border-radius: 0; /* Mindstate: Sharp corners */
  }
  
  .tab:hover {
    color: var(--primary);
    background-color: rgba(28, 160, 149, 0.05);
  }
  
  .tab:hover::after {
    width: 100%;
    background: linear-gradient(to right, var(--secondary-light), var(--secondary));
  }
  
  .tab.active {
    color: var(--primary);
    font-weight: 600;
    background-color: rgba(28, 160, 149, 0.07);
  }
  
  .tab.active::after {
    width: 100%;
    background: linear-gradient(to right, var(--primary-light), var(--primary-dark));
    height: 3px;
  }
  */
  
  /* Tab content visibility */
  .tab-content {
    display: none; /* Hidden by default */
    animation: fadeIn 0.5s ease; /* Animation defined in Global */
  }
  
  .tab-content.active {
    display: block;
  }
  
  /* --- Available Disorders List Component --- */
  /* (Displayed below the disorder selector) */
  #availableDisorders {
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-light);
    background: #F0F8F0; /* Mindstate: Very light green tint */
    padding: 15px;
    border-radius: 0; /* Mindstate: Sharp corners */
    border: 1px solid rgba(28, 160, 149, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */
    line-height: 1.8;
  }
  
  /* --- Dashboard Grid Layout (for metric cards) --- */
  .dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 25px;
  }
  
  /* --- Metric Card Component --- */
  .metric-card {
    background: #FFFFFF; /* Mindstate: White background */
    border-radius: 0; /* Mindstate: Sharp corners */
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */
      -4px -4px 8px var(--color-shadow-light),
      inset 1px 1px 1px rgba(255, 255, 255, 0.5);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    transition: all var(--transition-medium) ease;
    border: 1px solid rgba(255, 255, 255, 0.18);
    position: relative;
    overflow: hidden; /* For ::before pseudo-element */
  }
  
  .metric-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.08); /* Mindstate: Subtle shadow */
      -6px -6px 12px var(--color-shadow-light),
      inset 1px 1px 1px rgba(255, 255, 255, 0.5);
  }
  
  /* Animated top border for metric cards */
  .metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #6B8E23; /* Mindstate: Data green solid */
    z-index: 1;
    border-top-left-radius: 0; /* Mindstate: Sharp corners */
    border-top-right-radius: 0; /* Mindstate: Sharp corners */
  }
  
  .metric-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
  }
  
  /* Base style for metric values (can be in metric cards or tables) */
  .metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #000000; /* Mindstate: Pure black */
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1; /* Above ::before element */
  }
  
  .metric-details {
    font-size: 14px;
    color: var(--text-light);
    margin-top: auto; /* Pushes details to the bottom if card is flex column */
    line-height: 1.4;
    position: relative;
    z-index: 1; /* Above ::before element */
  }
  
  /* --- Confidence Label Component --- */
  .confidence {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 0; /* Mindstate: Sharp corners */
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); /* Mindstate: Minimal shadow */
    transition: all var(--transition-fast) ease;
  }
  
  .confidence-high {
    background: #e6fffa; /* Mindstate: Light green tint */
    color: var(--color-green-dark);
    border: 1px solid rgba(16, 185, 129, 0.2);
  }
  
  .confidence-medium {
    background: #fffbeb; /* Mindstate: Light yellow tint */
    color: var(--color-yellow-dark);
    border: 1px solid rgba(245, 158, 11, 0.2);
  }
  
  .confidence-low {
    background: #fef2f2; /* Mindstate: Light red tint */
    color: var(--color-red-dark);
    border: 1px solid rgba(239, 68, 68, 0.2);
  }
  
  .confidence-veryLow { /* Note: Corrected CSS var name in HTML might be needed if 'veryLow' isn't a direct class */
    background: #fee2e2; /* Mindstate: Lighter red tint */
    color: var(--color-red-dark);
    border: 1px solid rgba(244, 63, 94, 0.2);
  }
  
  .confidence-insufficient {
    background: #f9fafb; /* Mindstate: Very light gray */
    color: #6b7280; /* Using a specific gray */
    border: 1px solid rgba(107, 114, 128, 0.2);
  }
  
  .confidence:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06); /* Mindstate: Subtle shadow */
  }
  
  /* --- Generic Table Styling (within a .card) --- */
  /* This is a base style; specific tables might extend or override parts of it. */
  .card table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin-top: 15px;
    font-size: 14px;
  }
  
  .card table th,
  .card table td {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    border-bottom: 1px solid var(--color-bg);
  }
  
  .card table tr:last-child td {
    border-bottom: none; /* Remove border from last row's cells */
  }
  
  .card table th {
    background: #FAFAFA; /* Mindstate: Light gray */
    color: var(--color-text-dark);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--primary-lighter);
    position: relative;
    vertical-align: middle;
  }
  
  /* Specific styling for certain columns in generic card tables (e.g., for numeric data) */
  .card table td:nth-child(2), /* Example: Second column */
  .card table td:nth-child(3), /* Example: Third column */
  .card table td:nth-child(5) { /* Example: Fifth column */
    font-family: var(--font-heading); /* Open Sans for numeric/code-like data */
    font-size: 0.9rem;
  }
  
  /* Example of highlighting a specific column's text */
  .card table td:nth-child(4) { /* Example: Fourth column */
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: #6B8E23; /* Mindstate: Data green */
    font-weight: 600;
  }
  
  /* --- Date Info Component (within a .card) --- */
  .card .date-info {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: -5px; /* Adjust spacing */
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    font-style: italic;
  }
  
  .card .date-info::before { /* Decorative dot */
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    background: #8FB339; /* Mindstate: Light data green */
    border-radius: 50%;
    box-shadow: none; /* Mindstate: No shadow on small elements */
  }
  
  /* --- Section Divider Component (within a .card) --- */
  .card .section-divider {
    height: 1px;
    background: #EBEBEB; /* Mindstate: Light border */
    margin: 30px 0;
    border: none;
    position: relative;
  }
  
  .card .section-divider::before { /* Decorative element in the middle of the divider */
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background: #8FB339; /* Mindstate: Light data green */
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: none; /* Mindstate: No shadow on decorative elements */
  }
  
  /* --- Calculation Details Section Component --- */
  /* Primarily used in "Detailed Calculations" tab but designed as reusable. */
  .calculation-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #FFFFFF; /* Mindstate: White background */
    border-radius: 0; /* Mindstate: Sharp corners */
    border: 1px solid #F4F4F4; /* Mindstate: Light border */
    box-shadow:
      3px 3px 6px var(--color-shadow-dark),
      -3px -3px 6px var(--color-shadow-light),
      inset 1px 1px 1px rgba(255, 255, 255, 0.5);
    transition: all var(--transition-medium) ease;
  }
  
  .calculation-section:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); /* Mindstate: Subtle shadow */
    transform: translateY(-1px); /* Mindstate: Reduced movement */
    background: #FAFAFA; /* Mindstate: Light gray on hover */
  }
  
  .calculation-section h4 { /* Main heading for a calculation block */
    margin-top: 0;
    margin-bottom: 1.2rem;
    color: #000000; /* Mindstate: Pure black */
    /* Removed gradient text effect */
    background-clip: text;
    color: transparent; /* Fallback */
    font-family: var(--font-heading); /* Open Sans */
    font-size: 1.15rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.8rem;
    position: relative;
  }
  
  .calculation-section h4::after { /* Underline effect */
    content: "";
    position: absolute;
    width: 50px;
    height: 3px;
    background: #6B8E23; /* Mindstate: Data green */
    bottom: -2px; /* Sits on border */
    left: 0;
    border-radius: 0; /* Mindstate: Sharp corners */
  }
  
  .calculation-section h5 { /* Sub-heading for a specific formula/result */
    color: var(--text-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    position: relative;
    padding-left: 15px; /* Space for ::before element */
  }
  
  .calculation-section h5::before { /* Decorative bar for H5 */
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background: #6B8E23; /* Mindstate: Data green */
    border-radius: 0; /* Mindstate: Sharp corners */
  }
  
  .calculation-formula {
    font-family: var(--font-heading); /* Open Sans */
    padding: 14px 18px;
    background: #F0F8F0; /* Mindstate: Very light green tint */
    border-radius: 0; /* Mindstate: Sharp corners */
    margin: 12px 0;
    display: block;
    white-space: nowrap; /* Allows horizontal scrolling */
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */
    border: 1px solid rgba(28, 160, 149, 0.1);
    position: relative;
  }
  
  .calculation-formula::-webkit-scrollbar {
    height: 6px;
  }
  
  .calculation-formula::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 0; /* Mindstate: Sharp corners */
  }
  
  .calculation-formula::-webkit-scrollbar-track {
    background-color: rgba(28, 160, 149, 0.05);
    border-radius: 0; /* Mindstate: Sharp corners */
  }
  
  /* Styling for named variables in formulas */
  .calc-var-named {
    font-weight: 500;
    color: #2563eb; /* Mindstate: Blue */
  }
  
  /* Styling for numerical variables in formulas */
  .calc-var-numerical {
    font-weight: 500;
    color: #dc2626; /* Mindstate: Red */
  }
  
  /* Styling for the result of a calculation */
  .calculation-result {
    font-weight: 600;
    color: #6B8E23; /* Mindstate: Data green */
    position: relative;
  }
  
  .calculation-result::after { /* Underline for results */
    content: "";
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: #6B8E23; /* Mindstate: Data green */
    border-radius: 0; /* Mindstate: Sharp corners */
  }
  
  /* --- Assumptions Editor Component --- */
  /* Primarily used in "Modify Assumptions" tab but designed as reusable. */
  .assumptions-editor {
    margin-top: 20px;
  }
  
  .assumptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
  }
  
  .assumption-item {
    display: flex;
    flex-direction: column;
    background: #F0F8F0; /* Mindstate: Very light green tint */
    padding: 18px;
    border-radius: 0; /* Mindstate: Sharp corners */
    border: 1px solid rgba(28, 160, 149, 0.1);
    transition: all var(--transition-medium) ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */
  }
  
  .assumption-item:hover {
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */
      -4px -4px 8px var(--color-shadow-light),
      inset 1px 1px 1px rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
  }
  
  .assumption-item label {
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-dark);
  }
  
  .assumption-item input {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid transparent;
    border-radius: 0; /* Mindstate: Sharp corners */
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast) ease;
    background: #FAFAFA; /* Mindstate: Light gray */
    color: var(--color-text);
    box-shadow: none; /* Mindstate: No inset shadows */
    }
  
  .assumption-item input:focus {
    border-color: var(--primary-light);
    background: var(--color-bg);
    box-shadow: 0 0 0 2px #6B8E23; /* Mindstate: Simple focus ring */
    outline: none;
  }
  
  /* Button associated with the assumptions editor */
  #recalculateBtn {
    background: #6B8E23; /* Mindstate: Data green */
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 0; /* Mindstate: Sharp corners */
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-medium) ease;
    font-family: var(--font-body);
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    margin-top: 20px; /* Spacing from the grid */
  }
  
  #recalculateBtn:hover {
    background: #8FB339; /* Mindstate: Light data green */
    transform: translateY(-3px);
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.08); /* Mindstate: Subtle shadow */
  }
  
  #recalculateBtn:active {
    transform: translateY(1px);
    background: #4A6319; /* Mindstate: Dark data green */
    box-shadow: none; /* Mindstate: No shadow when selected */
  }
  
  #recalculateBtn::after { /* Radial hover effect */
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255,255,255,0.1); /* Mindstate: Simple overlay */
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.5s ease, opacity 0.5s ease;
  }
  
  #recalculateBtn:hover::after {
    opacity: 1;
    transform: scale(1);
  }
  
  /* --- Preview Actions Container & Buttons (e.g., for CSV export) --- */
  .preview-actions-container {
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    animation: fadeIn 1s ease; /* Animation defined in Global */
  }
  
  /* Copy Markdown Button */
  /* REMOVED - Use .os-btn--copy.os-btn--secondary from ../shared-code/components/buttons.css
  .copy-md-btn {
    background: linear-gradient(145deg, var(--secondary-dark), var(--secondary)); /* Uses secondary color */
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 0; /* Mindstate: Sharp corners */
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-medium) ease;
    font-family: var(--font-body);
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
  }
  
  .copy-md-btn:hover {
    background: linear-gradient(145deg, var(--secondary), var(--secondary-light));
    transform: translateY(-3px);
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.08); /* Mindstate: Subtle shadow */
  }
  
  .copy-md-btn:active {
    transform: translateY(1px);
    background: linear-gradient(145deg, var(--secondary-dark), var(--secondary));
    box-shadow: none; /* Mindstate: No shadow when selected */
  }
  
  .copy-md-btn::after { /* Radial hover effect */
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255,255,255,0.1); /* Mindstate: Simple overlay */
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.5s ease, opacity 0.5s ease;
  }
  
  .copy-md-btn:hover::after {
    opacity: 1;
    transform: scale(1);
  }
  */
  
  /* Download Button (e.g., Download CSV) */
  /* REMOVED - Use .os-btn--download.os-btn--primary from ../shared-code/components/buttons.css
  .download-btn {
    background: #6B8E23; /* Mindstate: Data green */ /* Uses primary color */
    color: white;
    border: none;
    padding: 16px 30px; /* Slightly larger padding */
    border-radius: 0; /* Mindstate: Sharp corners */
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-medium) ease;
    font-family: var(--font-body);
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.05); /* Mindstate: Minimal shadow */
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    overflow: hidden;
    letter-spacing: 0.5px;
  }
  
  .download-btn:hover {
    background: #8FB339; /* Mindstate: Light data green */
    transform: translateY(-3px);
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.08); /* Mindstate: Subtle shadow */
  }
  
  .download-btn:active {
    transform: translateY(1px);
    background: #4A6319; /* Mindstate: Dark data green */
    box-shadow: none; /* Mindstate: No shadow when selected */
  }
  
  .download-btn::after { /* Radial hover effect */
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255,255,255,0.1); /* Mindstate: Simple overlay */
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.5s ease, opacity 0.5s ease;
  }
  
  .download-btn:hover::after {
    opacity: 1;
    transform: scale(1);
  }
  
  .download-icon { /* Animated download arrow */
    font-weight: bold;
    font-size: 22px;
    /* margin-right: 2px; */ /* Removed as parent uses gap */
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
    display: inline-block;
    animation: bounce 2s infinite; /* Animation defined in Global */
  }
  */
  
  /* Download icon animation for use with os-btn--download */
  .os-btn--download .download-icon {
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
    display: inline-block;
    animation: bounce 2s infinite;
  }
  
  /* --- File Stats Info Component --- */
  /* (Potentially used with file selection or upload features) */
  .file-stats {
    font-size: 14px;
    color: var(--text-light);
    text-align: right;
    margin-top: 8px;
    font-style: italic;
    margin-bottom: 10px;
  }
  
  /* --- Hint Text Component (e.g., for assumption items) --- */
  .hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
    font-style: italic;
  }
  
  /* --- Citation Styling Components --- */
  /* Unified citation badge for inline citations (e.g., [1] with icon) */
  a.citation-badge {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    background: #FFFFFF; /* Mindstate: White background */
    padding: 2px 6px;
    border-radius: 0; /* Mindstate: Sharp corners */
    font-size: 0.8em;
    margin-left: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); /* Mindstate: Minimal shadow */
    border: 1px solid #F4F4F4; /* Mindstate: Light border */
    transition: all var(--transition-fast) ease;
    position: relative;
  }
  
  a.citation-badge:hover {
    background: #FAFAFA; /* Mindstate: Light gray on hover */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06); /* Mindstate: Subtle shadow */
    transform: translateY(-1px);
  }
  
  /* Number part within the inline citation badge */
  a.citation-badge .citation-number {
    font-weight: 600;
    margin-right: 4px;
    color: #6B8E23; /* Mindstate: Data green */
    transition: color var(--transition-fast) ease;
  }
  
  a.citation-badge:hover .citation-number {
    color: #AA374C; /* Mindstate: Secondary red */
  }
  
  /* External link icon for the inline citation badge */
  a.citation-badge::after {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    background-image: url("data:image/svg+xml;%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231ca095' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'%3E%3C/path%3E%3Cpolyline points='15 3 21 3 21 9'%3E%3C/polyline%3E%3Cline x1='10' y1='14' x2='21' y2='3'%3E%3C/line%3E%3C/svg%3E"); /* MODIFIED - Encoded # */
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    vertical-align: middle;
    opacity: 0.7;
    transition: opacity 0.2s ease, background-image 0.2s ease;
  }
  
  a.citation-badge:hover::after {
    opacity: 1;
    background-image: url("data:image/svg+xml;%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aa374c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'%3E%3C/path%3E%3Cpolyline points='15 3 21 3 21 9'%3E%3C/polyline%3E%3Cline x1='10' y1='14' x2='21' y2='3'%3E%3C/line%3E%3C/svg%3E"); /* MODIFIED - Encoded # */
  }
  
  /* External link icon for .citation-link (used in "All Sources" lists) */
  a.citation-link::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 5px;
    background-image: url("data:image/svg+xml;%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231ca095' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'%3E%3C/path%3E%3Cpolyline points='15 3 21 3 21 9'%3E%3C/polyline%3E%3Cline x1='10' y1='14' x2='21' y2='3'%3E%3C/line%3E%3C/svg%3E"); /* MODIFIED - Encoded # */
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    vertical-align: middle;
    opacity: 0.7;
    transition: opacity 0.2s ease, background-image 0.2s ease;
  }
  
  a.citation-link:hover::before {
    opacity: 1;
    background-image: url("data:image/svg+xml;%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aa374c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'%3E%3C/path%3E%3Cpolyline points='15 3 21 3 21 9'%3E%3C/polyline%3E%3Cline x1='10' y1='14' x2='21' y2='3'%3E%3C/line%3E%3C/svg%3E"); /* MODIFIED - Encoded # */
  }
  
  /* Citation list container (for summaries and per-metric boxes) */
  .citation-list {
    margin-top: 20px;
    padding: 15px;
    background: #F0F8F0; /* Mindstate: Very light green tint */
    border-radius: 0; /* Mindstate: Sharp corners */
    font-size: 13px;
    box-shadow: none; /* Mindstate: No inset shadows */
    border: 1px solid rgba(28, 160, 149, 0.1);
  }
  
  .citation-list h4 { /* Optional title for a citation list */
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-dark);
    border-bottom: none; /* No double borders */
    padding-bottom: 0;
  }
  
  .citation-list h4::after { /* No underline for this h4 */
    display: none;
  }
  
  /* Container for multiple citation links/badges within a .citation-list */
  .citations { /* Used by renderCitationList 'domain' mode */
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  /* Individual citation link badges within a .citation-list (domain mode) */
  .citation-link {
    padding: 4px 10px;
    border-radius: 0; /* Mindstate: Sharp corners */
    font-size: 12px;
    background: #FFFFFF; /* Mindstate: White background */
    color: var(--primary-dark);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); /* Mindstate: Minimal shadow */
    border: 1px solid #F4F4F4; /* Mindstate: Light border */
    transition: all var(--transition-fast) ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
  }
  
  .citation-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06); /* Mindstate: Subtle shadow */
    /* background-color: var(--primary-lighter); */ /* Hover state handled by gradient shift and shadow */
    color: var(--primary-dark);
  }
  
  /* Ensure no other ::after icon for .citation-link if it's used for number badges */
  .citation-link::after {
    display: none;
  }
  
  /* Citation counter for grouped citations (e.g., "domain.com +3") */
  .citation-count {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-dark);
    vertical-align: super;
    margin-left: 2px;
  }
  
  /* Styling for per-metric source boxes (nested citation lists) */
  .metric-row-sources-container {
    grid-column: 1 / -1; /* Span all columns of parent .metric-row grid */
    padding-left: 20px;
    margin-top: 8px;
    margin-bottom: 12px;
    animation: fadeIn 0.5s ease;
  }
  
  .metric-row-sources-container .citation-list { /* More compact styling for nested list */
    margin-top: 0;
    padding: 10px 12px;
    font-size: 12px;
    background: #F0F8F0; /* Mindstate: Very light green tint */
    box-shadow: none; /* Mindstate: No inset shadows */
    border: 1px solid rgba(28, 160, 149, 0.1);
    border-radius: 0; /* Mindstate: Sharp corners */
  }
  
  .metric-row-sources-container .citation-list h4 { /* Hide h4 in compact metric source boxes */
    display: none;
  }
  
  .metric-row-sources-container .citation-link { /* Smaller links in compact boxes */
    padding: 3px 8px;
    font-size: 11px;
  }
  
  /* Container for numbered badges within a metric row's source box */
  .metric-row-sources-container .compact-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0px 0px 0px; /* Minimal top padding for separation */
    justify-content: flex-start;
  }
  
  .metric-row-sources-container .compact-badge-list a.citation-badge {
    font-size: 0.75em; /* Slightly smaller if needed for ultra-compact display */
  }
  
  /* Styling for citation groups within Key Insights */
  .insight-citations {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  /* --- Responsive Adjustments for Shared Components --- */
  @media (max-width: 768px) {
    .disorder-selector-container {
      flex-direction: column;
      align-items: stretch;
    }
  
    .refresh-btn { /* Stack below select on mobile */
      margin-top: 10px;
    }
  
    /* Responsive adjustments for citations within this media query */
    .citation-list {
      padding: 10px;
    }
  
    .citation-link {
      padding: 3px 8px;
      font-size: 11px;
    }
  
    .metric-row-sources-container {
      padding-left: 10px; /* Less indent on mobile */
    }
    .metric-row-sources-container .citation-list {
      padding: 8px 10px;
    }
    .metric-row-sources-container .citation-link {
      font-size: 10px; /* Even smaller for compact lists on mobile */
      padding: 2px 6px;
    }
  }
  
  @media (max-width: 480px) {
    .card { /* Smaller padding for cards on very small screens */
      padding: 20px;
    }
  
    .metric-value { /* Smaller font for metric values on very small screens */
      font-size: 24px;
    }
  }
  
  /* --- JSON Input Section Specific Shared Styles (from Block 2) --- */
  /* These are "shared" in the sense they style generic input components,
     but are defined within a specific <style> block. */
  
  /* Container for the JSON input section, styled like a card */
  #json-input-section {
    margin-top: 20px;
    margin-bottom: 25px;
    animation: fadeInUp 0.6s ease forwards; /* Animation defined in Global */
    /* Inherits .card styles if class="card" is on the element */
  }
  
  .neumorph-input-container { /* Wrapper for the textarea */
    margin-bottom: 20px;
  }
  
  .neumorph-textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 0; /* Mindstate: Sharp corners */
    font-family: var(--font-heading); /* Open Sans for code-like input */
    font-size: 0.95rem;
    transition: all var(--transition-medium) ease;
    background-color: var(--card-bg);
    color: var(--text-medium);
    box-shadow: none; /* Mindstate: No inset shadows */
    resize: vertical; /* Allow vertical resizing */
  }
  
  .neumorph-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px #6B8E23; /* Mindstate: Simple focus ring */
    outline: none;
  }
  
  .button-container { /* For buttons related to the JSON input */
    display: flex;
    justify-content: flex-end; /* Aligns button(s) to the right */
  }
  
  /* --- Dynamic Error Message Popup (from Block 2) --- */
  /* This is a more interactive error display than the static #errorMessage.
     It's a shared pattern for dynamic feedback. */
  .error-message.dynamic-error-popup { /* Added .dynamic-error-popup for specificity */
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #DC2626; /* Mindstate: Red */
    color: white;
    padding: 16px 20px;
    border-radius: 0; /* Mindstate: Sharp corners */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); /* Mindstate: Subtle shadow */
    display: flex; /* Will be set by JS */
    align-items: center;
    justify-content: space-between;
    max-width: 400px;
    z-index: 1001; /* Higher than loading overlay */
    border: 1px solid rgba(170, 55, 76, 0.3); /* --color-red with opacity */
    animation: fadeInUp 0.3s ease forwards; /* Animation defined in Global */
  }
  
  .error-message.dynamic-error-popup .error-content { /* Wrapper for icon and text */
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .error-message.dynamic-error-popup svg {
    color: var(--color-red); /* Ensure icon color matches */
    flex-shrink: 0;
  }
  
  .error-message.dynamic-error-popup .dismiss-error {
    background: none;
    border: none;
    color: var(--color-red);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-left: 15px;
    box-shadow: none; /* No neumorphic shadow for dismiss button */
  }
  
  .error-message.dynamic-error-popup .dismiss-error:hover {
    color: var(--color-red-dark);
  }
  
  /* Fade out animation for the dynamic error message */
  .error-message.dynamic-error-popup.fade-out {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

