/* ===== Calculator (index.html) ===== */
/* paste the WHOLE <style> from index.html here, unchanged */
    :root {
      /* Primary Colors */
      --primary-blue: #001639;
      --primary-light: #0050b3;
      
      /* Risk Indicator Colors */
      --risk-low: #2e7d32;
      --risk-moderate: #f57c00;
      --risk-high: #d32f2f;
      
      /* Status Colors */
      --success-bg: #e8f5e9;
      --success-border: #4caf50;
      --warning-bg: #fff3e0;
      --warning-border: #ff9800;
      --danger-bg: #ffebee;
      --danger-border: #f44336;
      
      /* Neutral Colors */
      --gray-100: #f5f5f5;
      --gray-200: #eeeeee;
      --gray-300: #e0e0e0;
      --gray-600: #757575;
      --gray-900: #212121;
      
      /* Spacing */
      --spacing-xs: 4px;
      --spacing-sm: 8px;
      --spacing-md: 16px;
      --spacing-lg: 24px;
      --spacing-xl: 32px;
    }

    * {
      box-sizing: border-box;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
      background: #f8f9fa;
      margin: 0;
      color: var(--gray-900);
      line-height: 1.6;
    }

    .container {
      max-width: 900px;
      margin: 0 auto;
      background: white;
      min-height: 100vh;
    }

    /* Header */
    .header {
      background: var(--primary-blue);
      color: white;
      padding: var(--spacing-lg) var(--spacing-md);
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .header h1 {
      font-size: 1.5rem;
      margin: 0;
      font-weight: 600;
    }

    .header p {
      font-size: 0.875rem;
      opacity: 0.9;
      margin: var(--spacing-xs) 0 0 0;
    }

    /* Progress Indicator */
    .progress-bar {
      display: flex;
      justify-content: space-between;
      padding: var(--spacing-lg) var(--spacing-md);
      background: white;
      border-bottom: 1px solid var(--gray-200);
    }

    .progress-step {
      flex: 1;
      text-align: center;
      position: relative;
      cursor: pointer;
      transition: opacity 0.3s ease;
    }

    .progress-step:hover {
      opacity: 0.8;
    }

    .progress-step.disabled {
      cursor: not-allowed;
      opacity: 0.5;
    }

    .progress-step::after {
      content: '';
      position: absolute;
      top: 15px;
      right: -50%;
      width: 100%;
      height: 2px;
      background: var(--gray-300);
      z-index: 0;
    }

    .progress-step:last-child::after {
      display: none;
    }

    .progress-circle {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: white;
      border: 2px solid var(--gray-300);
      margin: 0 auto var(--spacing-sm);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 600;
      font-size: 0.875rem;
      position: relative;
      z-index: 1;
    }

    .progress-step.active .progress-circle {
      background: var(--primary-blue);
      border-color: var(--primary-blue);
      color: white;
    }

    .progress-step.completed .progress-circle {
      background: var(--risk-low);
      border-color: var(--risk-low);
      color: white;
    }

    .progress-label {
      font-size: 0.75rem;
      color: var(--gray-600);
    }

    /* Form Sections */
    .form-section {
      padding: var(--spacing-lg) var(--spacing-md);
      display: none;
    }
    
    .form-hint { 
      font-size: 0.875rem; 
      line-height: 1.25rem; 
      margin-top: 0.25rem; 
    }

    .form-hint.muted { 
      color: #6b7280; 
    } /* neutral gray */

    .form-section.active {
      display: block;
    }

    .section-title {
      font-size: 1.25rem;
      font-weight: 600;
      margin-bottom: var(--spacing-lg);
      color: var(--primary-blue);
    }

    /* Form Groups */
    .form-group {
      margin-bottom: var(--spacing-lg);
    }

    .form-label {
      display: flex;
      align-items: center;
      font-weight: 500;
      margin-bottom: var(--spacing-sm);
      color: var(--gray-900);
    }

    .required {
      color: var(--risk-high);
      margin-left: var(--spacing-xs);
    }

    .help-icon {
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: var(--gray-300);
      color: var(--gray-600);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.75rem;
      margin-left: var(--spacing-sm);
      cursor: help;
    }

    .form-input {
      width: 100%;
      padding: var(--spacing-sm) var(--spacing-md);
      border: 2px solid var(--gray-300);
      border-radius: 8px;
      font-size: 1rem;
      transition: all 0.3s ease;
    }

    .form-input:focus {
      outline: none;
      border-color: var(--primary-light);
      box-shadow: 0 0 0 3px rgba(0, 80, 179, 0.1);
    }

    .form-input.error {
      border-color: var(--risk-high);
    }

    .error-message {
      color: var(--risk-high);
      font-size: 0.875rem;
      margin-top: var(--spacing-xs);
    }

    /* Risk Cards */
    .risk-card {
      border: 2px solid var(--gray-200);
      border-radius: 12px;
      padding: var(--spacing-md);
      margin-bottom: var(--spacing-md);
      transition: all 0.3s ease;
      cursor: pointer;
    }

    .risk-card:hover {
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .risk-card.selected {
      border-color: var(--primary-blue);
      background: rgba(0, 22, 57, 0.05);
    }

    .risk-card.low-risk {
      border-left: 4px solid var(--risk-low);
    }

    .risk-card.moderate-risk {
      border-left: 4px solid var(--risk-moderate);
    }

    .risk-card.high-risk {
      border-left: 4px solid var(--risk-high);
    }

    .risk-title {
      font-weight: 600;
      margin-bottom: var(--spacing-xs);
    }

    .risk-description {
      font-size: 0.875rem;
      color: var(--gray-600);
    }

    /* Navigation Buttons */
    .nav-buttons {
      display: flex;
      justify-content: space-between;
      padding: var(--spacing-lg) var(--spacing-md);
      background: var(--gray-100);
      border-top: 1px solid var(--gray-200);
      position: sticky;
      bottom: 0;
    }

    .btn {
      padding: var(--spacing-sm) var(--spacing-lg);
      border: none;
      border-radius: 8px;
      font-size: 1rem;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s ease;
      min-width: 120px;
    }

    .btn-secondary {
      background: white;
      color: var(--gray-600);
      border: 1px solid var(--gray-300);
    }

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

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

    .btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }

    /* Results Section */
    .results-container {
      padding: var(--spacing-lg) var(--spacing-md);
    }

    .result-card {
      border-radius: 12px;
      padding: var(--spacing-lg);
      margin-bottom: var(--spacing-lg);
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .result-card.success {
      background: var(--success-bg);
      border: 1px solid var(--success-border);
    }

    .result-card.warning {
      background: var(--warning-bg);
      border: 1px solid var(--warning-border);
    }

    .result-card.danger {
      background: var(--danger-bg);
      border: 1px solid var(--danger-border);
    }

    .result-icon {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      margin-bottom: var(--spacing-md);
    }

    .result-icon.success {
      background: var(--risk-low);
      color: white;
    }

    .result-icon.warning {
      background: var(--risk-moderate);
      color: white;
    }

    .result-icon.danger {
      background: var(--risk-high);
      color: white;
    }

    .result-title {
      font-size: 1.25rem;
      font-weight: 600;
      margin-bottom: var(--spacing-sm);
    }

    .result-description {
      margin-bottom: var(--spacing-md);
    }

    .timeline {
      background: white;
      border-radius: 8px;
      padding: var(--spacing-md);
      margin-top: var(--spacing-md);
    }

    .timeline-item {
      display: flex;
      align-items: flex-start;
      margin-bottom: var(--spacing-md);
    }

    .timeline-marker {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--primary-light);
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.875rem;
      flex-shrink: 0;
      margin-right: var(--spacing-md);
    }

    .timeline-marker.stop {
      background: var(--risk-high);
    }

    .timeline-marker.procedure {
      background: var(--primary-blue);
    }

    .timeline-marker.restart {
      background: var(--risk-low);
    }

    .timeline-marker.bridge {
      background: var(--risk-moderate);
    }

    .timeline-marker.catheter {
      background: var(--gray-600);
    }

    .timeline-content {
      flex: 1;
    }

    .timeline-date {
      font-weight: 600;
      margin-bottom: var(--spacing-xs);
    }

    .timeline-instruction {
      font-size: 0.875rem;
      color: var(--gray-600);
    }

    /* Footer */
    .footer {
      background: var(--gray-100);
      border-top: 1px solid var(--gray-300);
      margin-top: auto;
      padding: var(--spacing-lg) var(--spacing-md);
    }

    .footer-content {
      max-width: 900px;
      margin: 0 auto;
    }

    .footer-version {
      font-size: 0.875rem;
      color: var(--gray-600);
    }

    .footer-version strong {
      color: var(--primary-blue);
      font-weight: 600;
    }

    .footer-disclaimer {
      font-size: 0.75rem;
      color: var(--gray-600);
      line-height: 1.5;
      margin-top: var(--spacing-md);
      padding-top: var(--spacing-md);
      border-top: 1px solid var(--gray-200);
    }

    /* Footer styles */
    .footer-main {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: var(--spacing-md);
      margin-bottom: var(--spacing-md);
    }

    .footer-links {
      display: flex;
      flex-wrap: wrap;
      gap: 6px 10px;
      font-size: 0.95rem;
    }
    .footer-links a{ 
      text-decoration: none; 
    }

    .footer-links a:hover, .footer-links a:focus{ 
      text-decoration: underline; 
    }

    .footer-link {
      color: var(--primary-light);
      text-decoration: none;
      font-size: 0.875rem;
      font-weight: 500;
      transition: color 0.3s ease;
    }

    .footer-link:hover {
      color: var(--primary-blue);
      text-decoration: underline;
    }

    .footer-credits {
      margin-top: var(--spacing-sm);
    }

    .credits-toggle {
      color: var(--primary-light);
      cursor: pointer;
      font-size: 0.75rem;
      display: inline-flex;
      align-items: center;
      gap: var(--spacing-xs);
    }

    .credits-toggle:hover {
      color: var(--primary-blue);
    }

    .credits-icon {
      transition: transform 0.3s ease;
      font-size: 0.625rem;
    }

    .credits-expanded .credits-icon {
      transform: rotate(180deg);
    }

    .credits-content {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease;
      font-size: 0.75rem;
      color: var(--gray-600);
    }

    .credits-expanded .credits-content { 
      margin-top: var(--spacing-sm); 
    }

    .credits-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: var(--spacing-sm);
      margin-top: var(--spacing-sm);
    }

    /* Utilities */
    .hidden{display:none!important}
    .muted{color:var(--gray-600)}
    .text-sm{font-size:0.9rem}
    .mt-8{margin-top:8px}
    .flex{display:flex}
    .items-center{align-items:center}
    .gap-8{gap:8px}
    .m-0{margin:0!important}
    .mr-12{margin-right:12px!important}
    .mb-lg{margin-bottom:var(--spacing-lg)!important}
    .mt-12{margin-top:12px!important}

    
    /* Mobile select appearance aid */
    select.form-input { -webkit-appearance: menulist; }
/* Mobile Responsiveness */
    @media (max-width: 640px) {
      .header h1 {
        font-size: 1.25rem;
      }
      
      .progress-label {
        display: none;
      }
      
      .nav-buttons {
        gap: var(--spacing-sm);
      }
      
      .btn {
        min-width: 100px;
        padding: var(--spacing-sm) var(--spacing-md);
      }

      .footer-main {
        flex-direction: column;
        align-items: flex-start;
      }
      
      .footer-links {
        flex-direction: column;
        gap: var(--spacing-sm);
      }
    }

