/* Core Styles */
:root { --accent-color: #00C9FF; --bg-main: #1a202c; --bg-article: #1f2937; --border-color: #4a5568; --text-color: #e2e8f0; --text-muted: #a0aec0; --code-bg: #2d3748; }
html { height: 100%; width: 100%; overflow-x: hidden; scroll-behavior: smooth; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { background-color: var(--bg-main); background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3e%3crect width='10' height='10' fill='%231a202c'/%3e%3cpath d='M0 0L10 10M10 0L0 10' stroke='%232d3748' stroke-width='0.2'/%3e%3c/svg%3e"); background-repeat: repeat; min-height: 100vh; margin: 0; padding: 0; box-sizing: border-box; color: var(--text-color); display: flex; flex-direction: column; }

/* Home Button */
.home-back-btn { position: absolute; top: 20px; left: 20px; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 600; padding: 8px 12px; border-radius: 6px; background: rgba(31, 41, 55, 0.8); border: 1px solid var(--border-color); backdrop-filter: blur(4px); z-index: 100; transition: all 0.2s; }
.home-back-btn:hover { color: #fff; border-color: var(--accent-color); background: rgba(31, 41, 55, 1); }

/* Reading Progress Bar */
.reading-progress-container { position: fixed; top: 0; left: 0; width: 100%; height: 4px; background: transparent; z-index: 10000; pointer-events: none; }
.reading-progress-bar { height: 100%; width: 0%; background: var(--accent-color); transition: width 0.1s ease-out; box-shadow: 0 0 8px var(--accent-color); }

/* Main Content & Layout */
.main-content-wrapper { flex-grow: 1; padding: 60px 20px 40px; box-sizing: border-box; width: 100%; max-width: 1200px; margin: 0 auto; }
.article-layout { display: grid; grid-template-columns: 1fr 280px; gap: 4rem; align-items: start; }
.article-container { min-width: 0; }

.article-header { border-bottom: 1px solid var(--border-color); margin-bottom: 2.5rem; padding-bottom: 1.5rem; margin-top: 2rem; }
.article-header h1 { font-size: clamp(2rem, 4vw, 2.8rem); color: #fff; line-height: 1.2; margin: 0 0 1rem 0; text-wrap: balance; font-weight: 800; }
.article-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; color: var(--accent-color); font-size: 0.95rem; font-weight: 600; }

/* Table of Contents */
.toc-container { position: sticky; top: 40px; background-color: var(--bg-article); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; display: flex; flex-direction: column; max-height: calc(100vh - 80px); overflow-y: auto; }
.toc-title { font-size: 1.2rem; color: #fff; margin-top: 0; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; font-weight: bold; }
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin-bottom: 0.75rem; font-size: 0.9rem; line-height: 1.4; }
.toc-list a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; display: block; }
.toc-list a:hover { color: var(--accent-color); }

/* Typography */
article { font-size: 1.15rem; line-height: 1.8; }
article h2 { font-size: 2rem; color: #fff; border-bottom: 2px solid var(--border-color); padding-bottom: 0.5rem; margin-top: 3.5rem; margin-bottom: 1.5rem; scroll-margin-top: 40px; }
article h3 { font-size: 1.5rem; color: var(--text-color); margin-top: 2.5rem; margin-bottom: 1rem; scroll-margin-top: 40px; }
article p, article li { margin-bottom: 1.5rem; }
article strong { color: #fff; font-weight: 700; }
article ul, article ol { padding-left: 25px; }

/* Images & Screenshots */
.image-wrapper { text-align: center; margin: 2rem 0; }
.article-image { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 4px 15px rgba(0,0,0,0.4); }
.screenshot-sm { max-width: 300px; display: block; margin: 0 auto; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 8px 25px rgba(0,0,0,0.5); }
.screenshot-md { max-width: 600px; }
.image-caption { font-size: 0.9rem; color: var(--text-muted); margin-top: 10px; font-style: italic; }
.mt-15 { margin-top: 15px; }

/* Callouts & App Promo */
.callout { padding: 25px; border-radius: 12px; margin: 2.5rem 0; border-left: 5px solid; background-color: var(--code-bg); }
.callout-title { font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; font-size: 1.2rem; color: #fff; }
.callout p:last-child { margin-bottom: 0; }
.doctor-tip { border-left-color: #38bdf8; }
.did-you-know { border-left-color: #a855f7; }
.family-tip { border-left-color: var(--accent-color); }

.app-promo-box { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); padding: 40px; border-radius: 16px; margin: 4rem 0; border: 1px solid var(--accent-color); box-shadow: 0 10px 30px rgba(0, 201, 255, 0.1); }
.app-promo-box h3 { color: #fff; margin-top: 0; font-size: 1.8rem; text-align: center; margin-bottom: 20px;}
.app-promo-box > p { text-align: center; margin-bottom: 30px; }
.promo-flex { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; justify-content: center; }
.promo-img { max-width: 250px; flex-shrink: 0; }
.promo-content { flex: 1; min-width: 280px; }
.benefit-list { list-style: none; padding: 0; margin-bottom: 25px; }
.benefit-list li { margin-bottom: 10px; font-weight: 600; color: #fff; }

.family-flex { display: flex; align-items: center; gap: 30px; flex-wrap: wrap-reverse; }
.family-text { flex: 1; min-width: 280px; }

/* CTAs */
.download-btn { display: inline-block; background: var(--accent-color); color: #000; padding: 15px 30px; border-radius: 8px; font-weight: 800; text-decoration: none; transition: transform 0.2s, background 0.2s, box-shadow 0.2s; box-shadow: 0 4px 15px rgba(0, 201, 255, 0.3); text-align: center; }
.download-btn:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4); text-decoration: none; color: #000; }
.cta-small { padding: 12px 24px; font-size: 1rem; margin-top: 15px; }
.cta-large { padding: 20px 40px; font-size: 1.2rem; border-radius: 12px; }

/* Clinical Tables */
.table-wrapper { overflow-x: auto; margin: 2.5rem 0; border-radius: 8px; border: 1px solid var(--border-color); }
table { width: 100%; border-collapse: collapse; background: var(--bg-article); text-align: left; font-size: 1rem; }
th { background: var(--code-bg); color: #fff; padding: 15px; font-weight: 600; border-bottom: 1px solid var(--border-color); }
td { padding: 15px; border-bottom: 1px solid var(--border-color); }

/* FAQ Accordion */
.faq-section { margin-bottom: 3rem; }
details.faq-item { background: var(--bg-article); border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 12px; padding: 18px; cursor: pointer; transition: background-color 0.2s; }
details.faq-item:hover { background: var(--code-bg); }
details.faq-item summary { font-weight: 600; color: #fff; outline: none; list-style: none; display: flex; justify-content: space-between; align-items: center; font-size: 1.1rem; }
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: '+'; font-size: 1.5rem; color: var(--accent-color); }
details.faq-item[open] summary::after { content: '−'; }
details.faq-item p { margin-top: 15px; color: var(--text-color); margin-bottom: 0; }

/* Author Badge */
.author-trust-badge { background-color: var(--code-bg); padding: 25px; border-radius: 12px; display: flex; align-items: center; gap: 20px; margin-top: 4rem; border: 1px solid var(--border-color); }
.author-avatar { width: 70px; height: 70px; min-width: 70px; border-radius: 50%; background-color: var(--accent-color); display: flex; justify-content: center; align-items: center; font-size: 2rem; }
.author-trust-badge h4 { margin: 0 0 5px 0; color: #fff; font-size: 1.2rem; }
.author-trust-badge p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }

/* Social Share */
.social-share { display: flex; align-items: center; gap: 15px; }
.native-share-btn { color: var(--text-muted); background: none; border: 1px solid var(--border-color); padding: 6px 12px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; transition: all 0.2s; }
.native-share-btn:hover { color: var(--accent-color); border-color: var(--accent-color); }
.native-share-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* Sticky Mobile CTA */
.mobile-app-cta { position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); border-top: 1px solid var(--border-color); padding: 12px 20px; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; z-index: 9999; }
.mobile-app-cta-left { display: flex; align-items: center; gap: 12px; }
.mobile-app-cta-icon { width: 45px; height: 45px; border-radius: 10px; }
.mobile-app-cta-title { color: white; font-weight: bold; font-size: 1rem; line-height: 1.2; }
.mobile-app-cta-subtitle { color: var(--accent-color); font-size: 0.85rem; font-weight: 600;}
.mobile-app-cta-btn { background: var(--accent-color); color: #000; padding: 10px 24px; border-radius: 8px; font-weight: bold; font-size: 0.95rem; text-decoration: none; }

@media (min-width: 993px) { .mobile-app-cta { display: none !important; } }

/* Responsive Styles */
@media (max-width: 1024px) {
    .article-layout { grid-template-columns: 1fr; }
    .toc-container { display: none; }
}
@media (max-width: 768px) {
    .main-content-wrapper { padding: 60px 15px 80px; }
    .app-promo-box { padding: 30px 20px; }
    .home-back-btn { top: 10px; left: 10px; font-size: 0.8rem; padding: 6px 10px; }
}