* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f0f7f5 0%, #dceee8 100%);
    min-height: 100vh;
    padding: 40px 20px;
    color: #1e293b;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(6,38,71,0.12);
    padding: 40px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #062647;
    text-align: center;
    font-weight: 700;
}

.subtitle {
    text-align: center;
    color: #5a7a8a;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.controller {
    background: linear-gradient(135deg, #062647 0%, #0a3a6b 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(6,38,71,0.3);
}

.ctrl-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; font-size: 1.2rem; font-weight: 600; }
.ctrl-day { font-size: 1.8rem; font-weight: 700; }

.slider { width: 100%; height: 8px; border-radius: 5px; background: rgba(255,255,255,0.3); outline: none; -webkit-appearance: none; margin: 20px 0; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%; background: white; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.2); transition: transform 0.1s; }
.slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.slider::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: white; cursor: pointer; border: none; box-shadow: 0 2px 8px rgba(0,0,0,0.2); transition: transform 0.1s; }
.slider::-moz-range-thumb:hover { transform: scale(1.2); }

.ctrl-info { display: flex; justify-content: space-between; font-size: 0.95rem; opacity: 0.95; }

.section-title { font-size: 1.8rem; margin: 40px 0 20px 0; color: #062647; border-bottom: 3px solid #00a985; padding-bottom: 10px; font-weight: 700; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 25px; margin-bottom: 30px; }
.card { background: #fafcfb; border: 1px solid #d4e5de; border-radius: 10px; padding: 20px; box-shadow: 0 4px 12px rgba(6,38,71,0.06); transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(6,38,71,0.10); }
.card-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 15px; color: #062647; }
.patient-label { display: inline-block; background: #062647; color: white; padding: 4px 10px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; margin-right: 8px; }
.demand-type { display: inline-block; font-size: 0.85rem; padding: 4px 8px; border-radius: 4px; background: #e0f2ed; color: #062647; font-weight: 500; }
.chart-container { position: relative; height: 300px; margin-bottom: 6px; }

.html-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 6px 0 2px; font-size: 0.8rem; color: #64748b; }
.html-legend .leg-item { display: flex; align-items: center; gap: 5px; }
.html-legend .leg-swatch { width: 14px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.html-legend .leg-line { width: 18px; height: 0; border-top: 2.5px solid; flex-shrink: 0; }
.html-legend .leg-dash { width: 18px; height: 0; border-top: 2px dashed; flex-shrink: 0; }

.algo-table { width: 100%; border-collapse: collapse; margin-top: 30px; background: white; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.algo-table thead { background: #062647; color: white; }
.algo-table th, .algo-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.algo-table tbody tr:hover { background: #f8fafc; }
.algo-table tbody tr:last-child td { border-bottom: none; }

.legend { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; padding: 15px; background: #f8fafc; border-radius: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }
.legend-color { width: 20px; height: 20px; border-radius: 4px; }
.legend-gradient { width: 40px; height: 20px; border-radius: 4px; background: linear-gradient(to right, rgba(0,169,133,0.5), rgba(0,169,133,0.05)); }

@media (max-width: 768px) {
    .container { padding: 20px; }
    h1 { font-size: 1.8rem; }
    .cards-grid { grid-template-columns: 1fr; }
    .ctrl-info { flex-direction: column; gap: 8px; }
}

/* Computing / loading state */
body.computing { cursor: wait; }
body.computing input, body.computing button, body.computing .slider, body.computing .unc-btn { pointer-events: none; opacity: 0.55; transition: opacity 0.15s ease; }
body.computing canvas { opacity: 0.85; transition: opacity 0.15s ease; }
#computingIndicator { position: fixed; top: 20px; right: 20px; background: rgba(6, 38, 71, 0.96); color: #fff; padding: 11px 20px 11px 16px; border-radius: 999px; font-size: 0.88rem; font-weight: 600; z-index: 99999; box-shadow: 0 8px 24px rgba(6, 38, 71, 0.25); display: none; align-items: center; gap: 10px; pointer-events: none; letter-spacing: 0.01em; }
body.computing #computingIndicator { display: inline-flex; }
.computing-spinner { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, 0.28); border-top-color: #00a985; border-radius: 50%; animation: computingSpin 0.7s linear infinite; }
@keyframes computingSpin { to { transform: rotate(360deg); } }

/* Email gate modal */
body.locked .container > *:not(#leadGate) { filter: blur(6px) saturate(0.7); pointer-events: none; user-select: none; }
#leadGate { position: fixed; inset: 0; background: rgba(6,38,71,0.55); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; backdrop-filter: blur(4px); }
body.locked #leadGate { display: flex; }

/* Step 1 / Step 2 visibility */
#leadGate .lead-gate-card { display: block; }
#leadGate .thanks-card { display: none; }
#leadGate.thanks .lead-gate-card { display: none; }
#leadGate.thanks .thanks-card { display: block; }

.lead-gate-card { background: white; border-radius: 14px; padding: 36px; max-width: 460px; width: 100%; box-shadow: 0 30px 80px rgba(6,38,71,0.4); }
.lead-gate-card h2 { color: #062647; font-size: 1.5rem; margin-bottom: 8px; font-weight: 700; }
.lead-gate-card p { color: #64748b; font-size: 0.95rem; margin-bottom: 22px; line-height: 1.5; }
.lead-gate-card label { display: block; font-size: 0.85rem; font-weight: 600; color: #334155; margin-bottom: 4px; margin-top: 14px; }
.lead-gate-card input { width: 100%; padding: 10px 12px; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 0.95rem; font-family: inherit; transition: border-color 0.15s; }
.lead-gate-card input:focus { outline: none; border-color: #00a985; }
.lead-gate-card .actions { margin-top: 22px; display: flex; gap: 10px; align-items: center; }
.lead-gate-card button { background: #00a985; color: white; border: none; padding: 10px 22px; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background 0.15s; font-family: inherit; }
.lead-gate-card button:hover { background: #008a6e; }
.lead-gate-card button:disabled { background: #94a3b8; cursor: not-allowed; }
.lead-gate-card .privacy { font-size: 0.75rem; color: #94a3b8; margin-top: 16px; line-height: 1.4; }
.lead-gate-card .error { color: #DC2626; font-size: 0.85rem; margin-top: 10px; min-height: 1.2em; }

/* Step 2: thanks + LinkedIn CTA */
.thanks-card { background: white; border-radius: 14px; padding: 36px; max-width: 460px; width: 100%; box-shadow: 0 30px 80px rgba(6,38,71,0.4); text-align: center; }
.thanks-card .thanks-checkmark { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: #d1fae5; color: #00a985; font-size: 28px; font-weight: 700; margin-bottom: 14px; box-shadow: 0 0 0 6px rgba(0,169,133,0.08); }
.thanks-card h2 { color: #062647; font-size: 1.45rem; margin-bottom: 10px; font-weight: 700; }
.thanks-card p { color: #475569; font-size: 0.95rem; margin-bottom: 22px; line-height: 1.55; }
.thanks-card .actions { display: flex; justify-content: center; }
.thanks-card button { display: inline-flex; align-items: center; gap: 10px; background: #0a66c2; color: white; border: none; padding: 12px 22px; border-radius: 8px; font-size: 0.98rem; font-weight: 600; cursor: pointer; transition: background 0.15s, transform 0.05s; font-family: inherit; box-shadow: 0 6px 18px rgba(10,102,194,0.25); }
.thanks-card button:hover { background: #08518f; }
.thanks-card button:active { transform: translateY(1px); }
.thanks-card button .arrow { font-size: 0.85em; opacity: 0.9; }
.thanks-card .skip-link { display: inline-block; margin-top: 16px; color: #94a3b8; font-size: 0.82rem; text-decoration: none; border-bottom: 1px dashed #cbd5e1; padding-bottom: 1px; }
.thanks-card .skip-link:hover { color: #64748b; }
