/* SLEEP CALCULATOR - STYLESHEET - Indigo Night Theme */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-bg: #eef2ff;
  --secondary: #1e1b4b;
  --accent: #f59e0b;
  --sleep-light: #c7d2fe;
  --sleep-deep: #4338ca;
  --sleep-rem: #7c3aed;
  --awake: #fbbf24;
  --success: #22c55e;
  --success-bg: #dcfce7;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --error: #ef4444;
  --error-bg: #fee2e2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); font-size: 16px; line-height: 1.6; color: var(--gray-800); background: var(--gray-50); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-weight: 600; line-height: 1.3; color: var(--gray-900); }
h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; }
p { margin-bottom: 1rem; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.content-narrow { max-width: 800px; margin: 0 auto; }
main { flex: 1; padding: 2rem 0 3rem; }

/* Header */
.header { background: var(--secondary); border-bottom: 1px solid var(--primary-dark); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.125rem; color: white; text-decoration: none; }
.logo:hover { text-decoration: none; color: var(--sleep-light); }
.logo-icon { width: 32px; height: 32px; color: var(--primary-light); }
.nav-desktop { display: flex; align-items: center; gap: 1.5rem; }
.nav-desktop a { font-size: 0.9375rem; font-weight: 500; color: rgba(255,255,255,0.8); padding: 0.5rem 0; border-bottom: 2px solid transparent; }
.nav-desktop a:hover, .nav-desktop a.active { color: white; text-decoration: none; border-bottom-color: var(--primary-light); }
.nav-toggle { display: none; background: none; border: none; padding: 0.5rem; cursor: pointer; color: white; }
.nav-toggle svg { width: 24px; height: 24px; }
.nav-mobile { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--secondary); border-bottom: 1px solid var(--primary-dark); padding: 1rem; box-shadow: var(--shadow-lg); }
.nav-mobile.active { display: block; }
.nav-mobile a { display: block; padding: 0.5rem 1rem; color: rgba(255,255,255,0.9); font-weight: 500; border-radius: var(--radius-md); }
@media (max-width: 768px) { .nav-desktop { display: none; } .nav-toggle { display: block; } }

/* Nav Dropdown */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-toggle { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.9375rem; font-weight: 500; color: rgba(255,255,255,0.8); padding: 0.5rem 0; border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; font-family: inherit; }
.nav-dropdown-toggle:hover, .nav-dropdown-toggle.active { color: white; text-decoration: none; border-bottom-color: var(--primary-light); }
.nav-dropdown-toggle svg { width: 14px; height: 14px; transition: transform 0.2s ease; }
.nav-dropdown.open .nav-dropdown-toggle svg { transform: rotate(180deg); }
.nav-dropdown-menu { position: absolute; top: calc(100% + 0.5rem); left: 50%; transform: translateX(-50%); display: none; min-width: 220px; background: var(--gray-800); border: 1px solid var(--gray-700); border-radius: var(--radius-md); padding: 0.375rem 0; box-shadow: 0 8px 24px rgba(0,0,0,0.3); z-index: 200; }
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: 0.5rem 1rem; font-size: 0.875rem; color: rgba(255,255,255,0.8); white-space: nowrap; }
.nav-dropdown-menu a:hover { background: var(--primary-dark); color: white; text-decoration: none; }
.nav-dropdown-divider { height: 1px; margin: 0.375rem 0; background: var(--gray-700); }
/* Mobile dropdown */
.nav-mobile .nav-dropdown { display: block; }
.nav-mobile .nav-dropdown-toggle { display: flex; width: 100%; padding: 0.5rem 1rem; color: rgba(255,255,255,0.9); font-size: 1rem; border-bottom: none; border-radius: var(--radius-md); }
.nav-mobile .nav-dropdown-menu { position: static; transform: none; display: none; min-width: 0; background: transparent; border: none; box-shadow: none; padding: 0 0 0 1rem; }
.nav-mobile .nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-mobile .nav-dropdown:hover .nav-dropdown-menu { display: none; }
.nav-mobile .nav-dropdown.open:hover .nav-dropdown-menu { display: block; }
.nav-mobile .nav-dropdown-menu a { padding: 0.375rem 1rem; font-size: 0.875rem; border-radius: var(--radius-md); }
.nav-mobile .nav-dropdown-divider { display: none; }

/* Calculator Card */
.intro-text { font-size: 1.125rem; color: var(--gray-600); margin-bottom: 1.5rem; max-width: 700px; }
.calculator-card { background: white; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); margin-bottom: 1.5rem; overflow: hidden; max-width: 720px; margin-left: auto; margin-right: auto; }

.calc-tabs { display: flex; background: var(--secondary); border-bottom: 1px solid var(--primary-dark); overflow-x: auto; }
.calc-tab { flex: 1; min-width: 80px; padding: 0.875rem 0.5rem; font-size: 0.75rem; font-weight: 500; color: rgba(255,255,255,0.7); background: transparent; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; border-bottom: 3px solid transparent; }
.calc-tab:hover { color: white; background: rgba(255,255,255,0.1); }
.calc-tab.active { color: white; background: rgba(99,102,241,0.3); border-bottom-color: var(--primary-light); }
.calc-tab svg { width: 20px; height: 20px; }
.calc-panel { display: none; padding: 1.25rem; }
.calc-panel.active { display: block; }
.calculator-card > .calc-panel:first-child { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }

/* Form Elements */
.form-grid { display: grid; gap: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 600px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-label { font-size: 0.875rem; font-weight: 500; color: var(--gray-700); }
.form-hint { font-size: 0.75rem; color: var(--gray-500); }
.form-input { width: 100%; height: 44px; padding: 0 1rem; font-size: 1rem; color: var(--gray-800); background: white; border: 1px solid var(--gray-300); border-radius: var(--radius-md); }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.form-select { height: 44px; padding: 0 1rem; font-size: 1rem; color: var(--gray-800); background: white; border: 1px solid var(--gray-300); border-radius: var(--radius-md); cursor: pointer; width: 100%; }

.time-input-group { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.time-input { width: 70px; text-align: center; flex-shrink: 0; }
.time-separator { font-size: 1.25rem; font-weight: 600; color: var(--gray-400); }
.ampm-select { width: 80px; flex-shrink: 0; }

.calculate-btn { width: 100%; height: 48px; margin-top: 1rem; font-size: 1rem; font-weight: 600; color: white; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); border: none; border-radius: var(--radius-lg); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4); }
.calculate-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.5); }

/* Results Section */
.results-section { display: none; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-200); max-width: 800px; margin-left: auto; margin-right: auto; }
.results-section.visible { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.result-primary { text-align: center; padding: 1.25rem; margin-bottom: 1rem; background: linear-gradient(135deg, var(--primary-bg) 0%, var(--sleep-light) 100%); border-radius: var(--radius-lg); border: 2px solid var(--primary-light); }
.result-label { font-size: 0.75rem; font-weight: 500; color: var(--gray-500); text-transform: uppercase; margin-bottom: 0.25rem; }
.result-value { font-size: 2.5rem; font-weight: 700; color: var(--primary-dark); line-height: 1.2; }
.result-unit { font-size: 1rem; font-weight: 500; color: var(--gray-500); }
.result-sublabel { font-size: 0.875rem; color: var(--gray-600); margin-top: 0.25rem; }

/* Sleep Time Options */
.sleep-times { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0; }
.sleep-time-option { display: flex; align-items: center; justify-content: space-between; padding: 1rem; background: var(--gray-50); border-radius: var(--radius-lg); border: 2px solid transparent; cursor: pointer; transition: all 0.2s; }
.sleep-time-option:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.sleep-time-option.recommended { border-color: var(--primary); background: var(--primary-bg); }
.sleep-time-option.recommended::after { content: '⭐ Recommended'; font-size: 0.6875rem; font-weight: 600; color: var(--primary-dark); background: white; padding: 0.25rem 0.5rem; border-radius: var(--radius-full); }
.sleep-time-info { display: flex; flex-direction: column; }
.sleep-time-value { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); }
.sleep-time-cycles { font-size: 0.8125rem; color: var(--gray-500); }
.sleep-time-duration { font-size: 0.875rem; font-weight: 500; color: var(--primary-dark); }

/* Sleep Cycle Timeline */
.cycle-timeline { margin: 1.5rem 0; }
.cycle-timeline-bar { display: flex; height: 40px; border-radius: var(--radius-lg); overflow: hidden; }
.cycle-stage { display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 600; color: white; }
.cycle-stage.awake { background: var(--awake); }
.cycle-stage.light { background: var(--sleep-light); color: var(--gray-700); }
.cycle-stage.deep { background: var(--sleep-deep); }
.cycle-stage.rem { background: var(--sleep-rem); }
.cycle-legend { display: flex; justify-content: center; gap: 1rem; margin-top: 0.75rem; font-size: 0.75rem; }
.cycle-legend-item { display: flex; align-items: center; gap: 0.375rem; }
.cycle-legend-dot { width: 12px; height: 12px; border-radius: 50%; }

/* Results Grid */
.results-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-top: 1rem; }
.results-grid-3 { grid-template-columns: repeat(3, 1fr); }
.results-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) { .results-grid, .results-grid-3, .results-grid-4 { grid-template-columns: repeat(2, 1fr); } }
.result-item { padding: 0.875rem; background: var(--gray-50); border-radius: var(--radius-md); text-align: center; }
.result-item-label { font-size: 0.6875rem; color: var(--gray-500); margin-bottom: 0.25rem; text-transform: uppercase; }
.result-item-value { font-size: 1.125rem; font-weight: 600; color: var(--gray-800); }

/* Sleep Debt Meter */
.debt-meter { margin: 1rem 0; }
.debt-meter-bar { height: 24px; background: var(--gray-200); border-radius: var(--radius-full); overflow: hidden; position: relative; }
.debt-meter-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.5s ease; }
.debt-meter-fill.low { background: linear-gradient(90deg, #86efac, var(--success)); }
.debt-meter-fill.moderate { background: linear-gradient(90deg, #fde047, var(--warning)); }
.debt-meter-fill.high { background: linear-gradient(90deg, #fca5a5, var(--error)); }
.debt-meter-labels { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.75rem; color: var(--gray-500); }

/* Content Sections */
.content-section { background: white; border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: 1.5rem; margin-bottom: 1.5rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.content-section h2 { margin-top: 0; }
.content-section h2::after { content: ''; display: block; width: 60px; height: 3px; background: var(--primary); margin-top: 0.5rem; border-radius: var(--radius-full); }

/* Key Takeaways Box */
.key-takeaways { background: var(--primary-bg); border: 1px solid var(--primary-light); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 1.5rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.key-takeaways-title { font-weight: 600; color: var(--primary-dark); margin-bottom: 0.5rem; font-size: 0.9375rem; }
.key-takeaways ul { margin: 0; padding-left: 1.25rem; font-size: 0.875rem; }
.key-takeaways li { margin-bottom: 0.375rem; color: var(--gray-700); }
.key-takeaways li:last-child { margin-bottom: 0; }

/* Tables */
.table-responsive { overflow-x: auto; margin: 1rem 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th, .data-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
.data-table th { font-weight: 600; color: var(--gray-700); background: var(--gray-50); }
.data-table td { color: var(--gray-600); }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.faq-item { border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; }
.faq-question { width: 100%; padding: 1rem; display: flex; align-items: center; justify-content: space-between; font-size: 0.9375rem; font-weight: 500; text-align: left; color: var(--gray-800); background: var(--gray-50); border: none; cursor: pointer; }
.faq-question:hover { background: var(--gray-100); }
.faq-question svg { width: 18px; height: 18px; color: var(--gray-400); transition: transform 0.15s ease; flex-shrink: 0; }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer { display: none; padding: 1rem; background: white; font-size: 0.9375rem; }
.faq-item.open .faq-answer { display: block; }

/* Blog Grid */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-top: 1.5rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.blog-card { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.blog-card-content { padding: 1rem; }
.blog-card-meta { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 0.375rem; }
.blog-card h3 { margin: 0 0 0.375rem; font-size: 1rem; }
.blog-card h3 a { color: var(--gray-900); }
.blog-card p { font-size: 0.8125rem; color: var(--gray-600); margin-bottom: 0; }

/* Related Grid (Blog Articles) */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.related-card { display: block; padding: 1rem; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); text-decoration: none; transition: all 0.2s; }
.related-card:hover { border-color: var(--primary-light); background: var(--primary-bg); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.related-card-title { font-size: 0.9375rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.25rem; }
.related-card-desc { font-size: 0.8125rem; color: var(--gray-500); margin: 0; }

/* Table of Contents (Blog Articles) */
.toc { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.toc-title { font-size: 0.9375rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.75rem; }
.toc ol { padding-left: 1.25rem; margin: 0; }
.toc li { margin-bottom: 0.375rem; font-size: 0.875rem; }
.toc a { color: var(--primary-dark); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Tips Grid */
.tips-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 1rem 0; }
@media (max-width: 600px) { .tips-grid { grid-template-columns: 1fr; } }
.tip-item { display: flex; gap: 0.75rem; padding: 0.875rem; background: var(--gray-50); border-radius: var(--radius-md); }
.tip-icon { font-size: 1.25rem; flex-shrink: 0; }
.tip-content h4 { font-size: 0.875rem; margin: 0 0 0.25rem; color: var(--gray-800); }
.tip-content p { font-size: 0.8125rem; margin: 0; color: var(--gray-600); }

/* Footer */
.footer { background: var(--gray-900); color: var(--gray-400); padding: 2.5rem 0 1.5rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; max-width: 800px; margin-left: auto; margin-right: auto; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .logo { color: white; margin-bottom: 1rem; }
.footer-brand .logo-icon { color: var(--primary-light); }
.footer-brand p { font-size: 0.875rem; }
.footer-nav h4 { color: white; font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; margin-bottom: 1rem; }
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 0.5rem; }
.footer-nav a { font-size: 0.875rem; color: var(--gray-400); }
.footer-nav a:hover { color: white; text-decoration: none; }
.footer-bottom { padding-top: 1.5rem; border-top: 1px solid var(--gray-800); font-size: 0.8125rem; text-align: center; }

/* Print Button */
.print-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1rem; font-size: 0.875rem; color: var(--gray-600); background: var(--gray-100); border: 1px solid var(--gray-300); border-radius: var(--radius-md); cursor: pointer; margin-top: 1rem; }
.print-btn:hover { background: var(--gray-200); }

/* Horizontal Bar Chart */
.bar-chart { margin: 1.5rem 0; }
.bar-chart-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.bar-chart-label { width: 120px; font-size: 0.8125rem; color: var(--gray-700); text-align: right; flex-shrink: 0; }
.bar-chart-track { flex: 1; height: 28px; background: var(--gray-100); border-radius: var(--radius-md); overflow: hidden; }
.bar-chart-fill { height: 100%; border-radius: var(--radius-md); display: flex; align-items: center; padding-left: 0.5rem; font-size: 0.75rem; font-weight: 600; color: white; min-width: fit-content; }
.bar-chart-fill.primary { background: var(--primary); }
.bar-chart-fill.deep { background: var(--sleep-deep); }
.bar-chart-fill.rem { background: var(--sleep-rem); }
.bar-chart-fill.light { background: var(--sleep-light); color: var(--gray-700); }
.bar-chart-fill.accent { background: var(--accent); color: var(--gray-800); }
.bar-chart-fill.success { background: var(--success); }
.bar-chart-fill.warning { background: var(--warning); color: var(--gray-800); }
.bar-chart-fill.error { background: var(--error); }
@media (max-width: 600px) { .bar-chart-label { width: 80px; font-size: 0.75rem; } }

/* Stat Highlight Boxes */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.stat-box { text-align: center; padding: 1.25rem 1rem; background: var(--gray-50); border-radius: var(--radius-lg); border: 1px solid var(--gray-200); }
.stat-box.highlight { background: var(--primary-bg); border-color: var(--primary-light); }
.stat-box.warning { background: var(--warning-bg); border-color: var(--warning); }
.stat-box.error { background: var(--error-bg); border-color: var(--error); }
.stat-box.success { background: var(--success-bg); border-color: var(--success); }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary-dark); line-height: 1.2; }
.stat-label { font-size: 0.8125rem; color: var(--gray-600); margin-top: 0.25rem; }

/* Stacked Bar (Sleep Architecture Visualization) */
.stacked-bar-container { margin: 1rem 0; }
.stacked-bar-label { font-size: 0.8125rem; color: var(--gray-700); margin-bottom: 0.25rem; font-weight: 500; }
.stacked-bar { display: flex; height: 32px; border-radius: var(--radius-md); overflow: hidden; }
.stacked-bar > div { display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 600; color: white; }
.stacked-bar .awake { background: var(--awake); color: var(--gray-800); }
.stacked-bar .light { background: var(--sleep-light); color: var(--gray-700); }
.stacked-bar .deep { background: var(--sleep-deep); }
.stacked-bar .rem { background: var(--sleep-rem); }
.stacked-legend { display: flex; gap: 1rem; margin-top: 0.75rem; flex-wrap: wrap; }
.stacked-legend-item { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: var(--gray-600); }
.stacked-legend-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* Callout / Info Box */
.callout { padding: 1rem 1.25rem; border-radius: var(--radius-lg); margin: 1rem 0; font-size: 0.9375rem; line-height: 1.6; }
.callout p { margin-bottom: 0; }
.callout.info { background: var(--primary-bg); border-left: 4px solid var(--primary); }
.callout.warning { background: var(--warning-bg); border-left: 4px solid var(--warning); }
.callout.success { background: var(--success-bg); border-left: 4px solid var(--success); }
.callout.error { background: var(--error-bg); border-left: 4px solid var(--error); }

/* Comparison Grid */
.comparison-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.comparison-card { padding: 1.25rem; background: var(--gray-50); border-radius: var(--radius-lg); border: 1px solid var(--gray-200); }
.comparison-card h4 { font-size: 1rem; margin: 0 0 0.5rem; color: var(--gray-800); }
.comparison-card p { font-size: 0.875rem; margin: 0; color: var(--gray-600); }
.comparison-card.pro { border-left: 4px solid var(--success); }
.comparison-card.con { border-left: 4px solid var(--error); }
.comparison-card.neutral { border-left: 4px solid var(--primary); }

/* Numbered List with Details */
.steps-detailed { counter-reset: step-counter; list-style: none; padding: 0; }
.steps-detailed li { counter-increment: step-counter; padding: 1rem 1rem 1rem 3.5rem; margin-bottom: 0.75rem; background: var(--gray-50); border-radius: var(--radius-lg); position: relative; }
.steps-detailed li::before { content: counter(step-counter); position: absolute; left: 1rem; top: 1rem; width: 28px; height: 28px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8125rem; font-weight: 700; }

/* ========================================
   ENHANCED RESULTS VISUALIZATIONS
   ======================================== */

/* Results Enhanced Container */
.results-enhanced { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-200); }
.results-subtitle { font-size: 0.9375rem; font-weight: 600; color: var(--gray-700); margin: 0 0 1rem 0; }
.results-subtitle::after { display: none; }

/* Cycle Timeline Visualization */
.cycle-timeline { margin: 1.25rem 0; }
.cycle-timeline-header { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--gray-500); margin-bottom: 0.5rem; }
.cycle-timeline-bar { display: flex; height: 48px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); }
.cycle-timeline-labels { display: flex; justify-content: space-between; font-size: 0.8125rem; font-weight: 600; color: var(--gray-700); margin-top: 0.5rem; }

.cycle-block { position: relative; display: flex; flex-direction: column; justify-content: flex-end; border-right: 1px solid rgba(255,255,255,0.3); }
.cycle-block:last-child { border-right: none; }
.cycle-block .cycle-stages { display: flex; width: 100%; height: 100%; }
.cycle-block .stage { height: 100%; }
.cycle-block .stage.light { background: var(--sleep-light); }
.cycle-block .stage.deep { background: var(--sleep-deep); }
.cycle-block .stage.rem { background: var(--sleep-rem); }
.cycle-block .cycle-number { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 0.625rem; font-weight: 700; color: rgba(255,255,255,0.9); text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.cycle-block.partial { opacity: 0.6; }

.fall-asleep-block { background: var(--awake); display: flex; align-items: center; justify-content: center; }
.fall-asleep-block .block-label { font-size: 0.5625rem; color: var(--gray-700); text-transform: uppercase; writing-mode: vertical-rl; text-orientation: mixed; }

/* Sleep Stage Breakdown Bar */
.sleep-stage-breakdown { margin: 1.5rem 0; }
.stage-bar-container { margin-bottom: 0.75rem; }
.stage-bar { display: flex; height: 40px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.stage-segment { display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform 0.2s; }
.stage-segment:hover { transform: scaleY(1.05); z-index: 1; }
.stage-segment.light { background: linear-gradient(180deg, #dce3fb, var(--sleep-light)); }
.stage-segment.deep { background: linear-gradient(180deg, #5b4fd4, var(--sleep-deep)); }
.stage-segment.rem { background: linear-gradient(180deg, #9061ea, var(--sleep-rem)); }
.stage-segment .stage-label { font-size: 0.625rem; font-weight: 600; text-transform: uppercase; color: rgba(255,255,255,0.9); text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.stage-segment.light .stage-label { color: var(--gray-600); text-shadow: none; }
.stage-segment .stage-value { font-size: 0.75rem; font-weight: 700; color: white; }
.stage-segment.light .stage-value { color: var(--gray-700); }

/* Stage Legend */
.stage-legend { display: flex; flex-direction: column; gap: 0.375rem; margin-top: 0.75rem; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--gray-600); }
.legend-color { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.legend-color.light { background: var(--sleep-light); }
.legend-color.deep { background: var(--sleep-deep); }
.legend-color.rem { background: var(--sleep-rem); }

/* Compact Stat Row */
.stat-row.compact { gap: 0.75rem; margin: 1rem 0; }
.stat-box.small { padding: 0.875rem 0.75rem; }
.stat-box.small .stat-number { font-size: 1.375rem; }
.stat-box.small .stat-label { font-size: 0.6875rem; }

/* Results Tips List */
.results-tips { margin: 1.5rem 0; padding: 1rem; background: var(--gray-50); border-radius: var(--radius-lg); }
.tips-list { list-style: none; padding: 0; margin: 0; }
.tips-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--gray-200); font-size: 0.875rem; color: var(--gray-700); }
.tips-list li:last-child { border-bottom: none; padding-bottom: 0; }
.tips-list li strong { color: var(--gray-800); }

/* Quality Assessment Badge */
.quality-assessment { text-align: center; margin: 1.5rem 0; }
.quality-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.25rem; border-radius: var(--radius-full); font-weight: 600; }
.quality-badge.success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.quality-badge.warning { background: var(--warning-bg); color: #b45309; border: 1px solid var(--warning); }
.quality-badge.error { background: var(--error-bg); color: var(--error); border: 1px solid var(--error); }
.quality-icon { font-size: 1rem; letter-spacing: 2px; }
.quality-description { font-size: 0.875rem; color: var(--gray-600); margin-top: 0.75rem; }

/* Sleep Debt Severity Badge */
.debt-severity-badge { display: inline-flex; flex-direction: column; align-items: center; padding: 1rem 1.5rem; border-radius: var(--radius-lg); margin-bottom: 0.75rem; }
.debt-severity-badge.success { background: var(--success-bg); border: 1px solid var(--success); }
.debt-severity-badge.warning { background: var(--warning-bg); border: 1px solid var(--warning); }
.debt-severity-badge.error { background: var(--error-bg); border: 1px solid var(--error); }
.severity-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.debt-severity-badge.success .severity-label { color: var(--success); }
.debt-severity-badge.warning .severity-label { color: #b45309; }
.debt-severity-badge.error .severity-label { color: var(--error); }
.severity-value { font-size: 1.75rem; font-weight: 700; color: var(--gray-800); }
.severity-description { font-size: 0.875rem; color: var(--gray-600); margin-bottom: 1rem; }

/* Impact Bars (Sleep Debt) */
.impact-bars { margin: 1rem 0; }
.impact-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.625rem; }
.impact-label { width: 120px; font-size: 0.8125rem; color: var(--gray-600); flex-shrink: 0; }
.impact-track { flex: 1; height: 12px; background: var(--gray-200); border-radius: var(--radius-full); overflow: hidden; }
.impact-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.5s ease; }
.impact-value { width: 50px; font-size: 0.8125rem; font-weight: 600; color: var(--gray-700); text-align: right; }

/* Recovery Plan Timeline */
.recovery-plan { margin: 1.5rem 0; }
.plan-timeline { display: flex; flex-direction: column; gap: 0.75rem; }
.plan-step { display: flex; gap: 0.75rem; padding: 0.875rem; background: var(--gray-50); border-radius: var(--radius-md); border-left: 3px solid var(--primary); }
.step-number { width: 28px; height: 28px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8125rem; font-weight: 700; flex-shrink: 0; }
.step-content { flex: 1; font-size: 0.875rem; color: var(--gray-700); }
.step-content strong { display: block; color: var(--gray-800); margin-bottom: 0.125rem; }
.step-detail { display: block; font-size: 0.8125rem; color: var(--gray-500); margin-top: 0.25rem; }

/* Do's and Don'ts */
.dos-donts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 500px) { .dos-donts { grid-template-columns: 1fr; } }
.do-list, .dont-list { padding: 1rem; border-radius: var(--radius-md); }
.do-list { background: var(--success-bg); border: 1px solid #86efac; }
.dont-list { background: var(--error-bg); border: 1px solid #fca5a5; }
.do-list strong { color: var(--success); }
.dont-list strong { color: var(--error); }
.do-list .tips-list li, .dont-list .tips-list li { border-color: rgba(0,0,0,0.1); }

/* Sleep by Age - Status Badge */
.status-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1rem; border-radius: var(--radius-full); font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.5rem; }
.status-badge.success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.status-badge.warning { background: var(--warning-bg); color: #b45309; border: 1px solid var(--warning); }
.status-badge.error { background: var(--error-bg); color: var(--error); border: 1px solid var(--error); }
.status-icon { font-size: 1.125rem; }
.status-description { font-size: 0.875rem; color: var(--gray-600); margin-bottom: 1.25rem; }

/* Sleep Range Visual */
.sleep-range-visual { margin: 1rem 0 1.5rem; }
.range-track { position: relative; height: 32px; background: var(--gray-200); border-radius: var(--radius-full); margin-bottom: 0.5rem; }
.recommended-zone { position: absolute; top: 0; height: 100%; background: linear-gradient(90deg, var(--success-bg), #86efac); border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; }
.zone-label { font-size: 0.625rem; font-weight: 600; color: var(--success); text-transform: uppercase; letter-spacing: 0.5px; }
.current-marker { position: absolute; top: -6px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.marker-dot { width: 16px; height: 16px; border-radius: 50%; border: 3px solid white; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.current-marker.success .marker-dot { background: var(--success); }
.current-marker.warning .marker-dot { background: var(--warning); }
.current-marker.error .marker-dot { background: var(--error); }
.marker-value { font-size: 0.75rem; font-weight: 700; color: var(--gray-800); margin-top: 22px; white-space: nowrap; }
.range-labels { display: flex; justify-content: space-between; font-size: 0.6875rem; color: var(--gray-400); padding: 0 0.25rem; }
.range-labels .rec-label { color: var(--success); font-weight: 600; }

/* Age Comparison Chart */
.age-comparison-chart { margin: 1rem 0; }
.age-bar-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.375rem; padding: 0.375rem; border-radius: var(--radius-md); }
.age-bar-row.current { background: var(--primary-bg); border: 1px solid var(--primary-light); }
.age-label { width: 90px; font-size: 0.75rem; color: var(--gray-600); flex-shrink: 0; }
.age-bar-row.current .age-label { color: var(--primary-dark); font-weight: 600; }
.age-bar-track { flex: 1; height: 16px; background: var(--gray-100); border-radius: var(--radius-full); position: relative; overflow: hidden; }
.age-bar-range { height: 100%; background: linear-gradient(90deg, var(--primary-light), var(--primary)); border-radius: var(--radius-full); position: relative; }
.age-bar-min { height: 100%; background: var(--primary-dark); border-radius: var(--radius-full) 0 0 var(--radius-full); }
.age-bar-value { font-size: 0.6875rem; font-weight: 600; color: var(--gray-500); width: 55px; text-align: right; flex-shrink: 0; }

/* Action Plan */
.action-plan { margin-top: 1.5rem; padding: 1rem; background: var(--primary-bg); border-radius: var(--radius-lg); border: 1px solid var(--primary-light); }
.plan-steps { display: flex; flex-direction: column; gap: 0.5rem; }
.plan-steps .plan-step { background: white; border-left-color: var(--primary-light); }
