/* ==========================================================================
   INTERIOR.CSS - Interior Page Specific Styles
   ========================================================================== */

/* PAGE HERO (Interior variant with background image) */
.page-hero {
    background: linear-gradient(rgba(15, 23, 42, 0.9), rgba(30, 64, 175, 0.85)), var(--hero-bg-image, none);
    background-size: cover;
    background-position: center;
    color: white;
    padding: 3.5rem 0;
    margin-bottom: 0;
    text-align: left;
    position: relative;
}

.page-hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

/* LAST UPDATED TIMESTAMP */
.page-hero .last-updated {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.75rem;
    font-weight: 400;
}

.page-hero .last-updated i {
    font-size: 0.8rem;
}

/* BREADCRUMBS */
.breadcrumb {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.breadcrumb a:hover {
    color: var(--accent-gold);
    text-decoration: underline;
}

/* HERO PRINT BUTTON */
.hero-print-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}
.hero-print-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* ARTICLE ALERT */
.article-alert {
    background-color: var(--warning-bg);
    border-left: 4px solid var(--warning-border);
    color: var(--warning-text);
    padding: 1.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
}
.article-alert h3 {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.article-alert i {
    font-size: 1.25rem;
}
.article-alert a {
    font-weight: 600;
    text-decoration: underline;
    color: var(--warning-text);
}
.article-alert a:hover {
    color: var(--accent-gold);
}

/* ARTICLE CONTENT */
.article-content {
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 0;
    box-shadow: var(--shadow-sm);
}
.article-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-subtle);
}
.article-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.article-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.article-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}
.article-content p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
}
.article-content ul,
.article-content ol {
    color: var(--text-muted);
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}
.article-content ul {
    list-style-type: disc;
}
.article-content ol {
    list-style-type: decimal;
}
.article-content li {
    margin-bottom: 0.5rem;
}
.article-content li p {
    margin-bottom: 0.25rem;
}
.article-content a {
    color: var(--primary-blue);
    font-weight: 500;
}
.article-content a:hover {
    text-decoration: underline;
    color: var(--text-main);
}
.article-content strong {
    font-weight: 700;
    color: var(--text-main);
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}
.article-content th,
.article-content td {
    border: 1px solid var(--border-subtle);
    padding: 0.75rem;
    text-align: left;
}
.article-content th {
    background: var(--bg-off-white);
    font-weight: 600;
    color: var(--text-main);
}
.article-content td {
    color: var(--text-muted);
}

/* ARTICLE LAYOUT WITH TOC */
.article-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 1024px) {
    .article-layout {
        grid-template-columns: 200px 1fr;
        gap: 2rem;
    }
    /* Place all content items in column 2 */
    .article-layout .toc-mobile,
    .article-layout .article-content,
    .article-layout .section-container,
    .article-layout .nav-grid-container,
    .article-layout .ref-box,
    .article-layout .partners-container {
        grid-column: 2;
    }
}

/* DESKTOP TOC SIDEBAR */
.toc-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .toc-sidebar {
        display: block;
        grid-column: 1;
        grid-row: 1 / span 10; /* Span enough rows for typical page content */
        align-self: start;
        position: sticky;
        top: 100px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

.toc-nav h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-list li {
    margin-bottom: 0.25rem;
}

.toc-list a {
    display: block;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-left: 2px solid var(--border-subtle);
    transition: all 0.15s;
}

.toc-list a:hover {
    color: var(--primary-blue);
}

.toc-list a.active {
    color: var(--primary-blue);
    border-left-color: var(--primary-blue);
    font-weight: 600;
}

.toc-list .toc-h3 a {
    padding-left: 1.25rem;
    font-size: 0.8rem;
}

/* MOBILE TOC */
.toc-mobile {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 1rem calc(50vw - 50%);
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-bottom: 1rem;
    position: sticky;
    top: 60px;
    background: var(--bg-main);
    z-index: 10;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.toc-mobile::-webkit-scrollbar {
    display: none;
}

@media (min-width: 1024px) {
    .toc-mobile {
        display: none;
    }
}

.toc-chip {
    flex-shrink: 0;
    padding: 0.4rem 0.9rem;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    transition: all 0.15s;
}

.toc-chip:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.toc-chip.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

/* ==========================================================================
   ARTICLE ACTIONS BAR
   ========================================================================== */
.article-actions {
    background: var(--surface-white);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 0;
    margin-bottom: 2rem;
}

.article-actions .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.actions-left,
.actions-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Reading Time Badge */
.reading-time {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.reading-time i {
    font-size: 0.9rem;
}

/* Action Buttons (Focus, Listen, Share) */
.action-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: var(--bg-off-white);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.action-btn i {
    font-size: 0.9rem;
}

.action-label {
    display: none;
}

@media (min-width: 768px) {
    .action-label {
        display: inline;
    }
}

/* Mobile: center actions if stacked */
@media (max-width: 480px) {
    .article-actions .container {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-left {
        justify-content: center;
    }

    .actions-right {
        justify-content: center;
    }
}

/* ==========================================================================
   SHARE DROPDOWN
   ========================================================================== */
.share-wrapper {
    position: relative;
}

.share-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 0.5rem 0;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.share-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.share-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.share-option:hover {
    background: var(--bg-off-white);
}

.share-option i {
    width: 16px;
    color: var(--text-muted);
}

.share-divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 0.5rem 0;
}

/* ==========================================================================
   FOCUS MODE
   ========================================================================== */
body.focus-mode header,
body.focus-mode .crisis-banner,
body.focus-mode .toc-sidebar,
body.focus-mode .toc-mobile,
body.focus-mode .article-actions,
body.focus-mode .partners-container,
body.focus-mode .breadcrumb,
body.focus-mode footer,
body.focus-mode #go-top,
body.focus-mode .scroll-progress {
    display: none !important;
}

body.focus-mode .page-hero {
    padding: 2rem 0;
}

body.focus-mode .article-layout {
    display: block;
    max-width: 750px;
    margin: 0 auto;
}

body.focus-mode .article-content {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* Focus mode exit button */
.focus-exit-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
}

.focus-exit-btn:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

body.focus-mode .focus-exit-btn {
    display: flex;
}

/* ==========================================================================
   SCROLL PROGRESS INDICATOR
   ========================================================================== */
.scroll-progress {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    width: 48px;
    height: 48px;
    z-index: 799;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

.scroll-progress.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: var(--surface-white);
    stroke: var(--border-subtle);
    stroke-width: 3;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--primary-blue);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-main);
}

/* ==========================================================================
   COPY TOAST NOTIFICATION
   ========================================================================== */
.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary-navy);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.copy-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* REFERENCE BOX */
.ref-box {
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-sm);
}
.ref-box h3 {
    color: var(--text-main);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ref-list li {
    margin-bottom: 0.75rem;
}
.ref-list a {
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}
.ref-list a:hover {
    color: var(--text-main);
    text-decoration: underline;
}

/* NAVIGATION GRID */
.nav-grid-container {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 0;
}
.nav-grid-header {
    background: var(--surface-white);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.nav-grid-header i {
    color: var(--accent-gold);
    font-size: 1rem;
}
.nav-grid-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}
.nav-grid-body {
    padding: .5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* LINK ITEMS (Interior page style) */
.nav-grid-body .link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: var(--bg-off-white);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.nav-grid-body .link-item:hover {
    background-color: var(--border-subtle);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    transform: translateX(4px);
}
.nav-grid-body .link-item.hidden {
    display: none;
}
.nav-grid-body .link-item.highlight-match {
    background-color: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}
.nav-grid-body .link-item i {
    font-size: 0.75rem;
    color: var(--accent-gold);
}

/* ==========================================================================
   SECTION CONTAINERS (FAQ, Related Guides, References)
   Consistent styling matching nav-grid-container pattern
   ========================================================================== */
.section-container {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 0;
}

.section-header {
    background: var(--surface-white);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header i {
    color: var(--primary-navy);
    font-size: 1rem;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.section-body {
    padding: 1.5rem;
}

/* FAQ section body adjustments */
.section-body .faq-accordion {
    margin: 0;
}

/* Related guides section body adjustments */
.section-body .quick-links {
    margin: 0;
}

/* Reference section styling */
.section-body .ref-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.section-body .ref-list li {
    margin-bottom: 0.75rem;
}

.section-body .ref-list li:last-child {
    margin-bottom: 0;
}

.section-body .ref-list a {
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.section-body .ref-list a:hover {
    color: var(--text-main);
    text-decoration: underline;
}

.section-body .ref-list a i {
    color: var(--text-muted);
    font-size: 0.85rem;
    width: 1rem;
    flex-shrink: 0;
}

/* HERO PARAGRAPH */
.page-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
}

.page-hero .hero-subtitle {
    margin: 0;
}

/* STEPS GRID (Start Here page) */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 4rem;
}
.step-card {
    background: var(--surface-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue);
}
.step-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--bg-off-white);
    position: absolute;
    top: -10px;
    right: 10px;
    -webkit-text-stroke: 1px var(--border-subtle);
    z-index: 0;
    pointer-events: none;
}
[data-theme="dark"] .step-number {
    opacity: 0.5;
}
.step-content {
    position: relative;
    z-index: 1;
}
.step-icon {
    color: var(--accent-gold);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: var(--bg-off-white);
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
[data-theme="dark"] .step-icon {
    background: #334155;
}
.step-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.step-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}
.step-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.9rem;
}
.step-link:hover {
    text-decoration: underline;
    color: var(--text-main);
}

/* PITFALLS BOX */
.pitfalls-box {
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 4rem;
}
.pitfalls-box h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.pitfall-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.pitfall-item:last-child {
    margin-bottom: 0;
}
.pitfall-icon {
    color: var(--alert-red);
    font-size: 1.2rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.pitfall-text h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}
.pitfall-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* PARTNERS SECTION (Interior) */
.partners-container {
    margin-top: 3rem;
    padding-bottom: 4rem;
}
.partner-wrapper {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.partner-chip {
    background: var(--surface-white);
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    border: 1px solid var(--border-subtle);
}
.partner-chip:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    border-color: var(--primary-blue);
}

/* ==========================================================================
   SMART CALCULATOR
   ========================================================================== */
.smart-calculator {
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.smart-calc-header {
    background: var(--primary-navy);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.smart-calc-header i {
    color: var(--accent-gold);
}

.smart-calc-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.smart-calc-body {
    padding: 1rem;
}

/* Search Input */
.smart-calc-search-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.smart-calc-search {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background: var(--bg-off-white);
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.smart-calc-search:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.smart-calc-search::placeholder {
    color: var(--text-muted);
}

.smart-calc-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

/* Search Results Dropdown */
.smart-calc-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.smart-calc-results.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.smart-calc-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-subtle);
}

.smart-calc-result-item:last-child {
    border-bottom: none;
}

.smart-calc-result-item:hover,
.smart-calc-result-item.selected {
    background: var(--bg-off-white);
}

.smart-calc-result-item .result-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.smart-calc-result-item .result-name i {
    color: var(--accent-gold);
    font-size: 0.85rem;
}

.smart-calc-result-item .result-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-off-white);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Conditions List */
.smart-calc-list {
    min-height: 100px;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.smart-calc-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.smart-calc-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.smart-calc-empty p {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.smart-calc-empty span {
    font-size: 0.85rem;
}

.smart-calc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: var(--bg-off-white);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
}

.smart-calc-item.bilateral {
    border-color: var(--info-border);
    background: var(--info-bg);
}

.smart-calc-item .item-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.smart-calc-item .item-info i {
    color: var(--accent-gold);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.smart-calc-item .item-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bilateral-badge {
    font-size: 0.65rem;
    background: var(--info-text);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
    flex-shrink: 0;
}

.smart-calc-item .item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.smart-calc-item .item-rating {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 0.9rem;
}

.smart-calc-item .item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.15s;
}

.smart-calc-item .item-remove:hover {
    color: var(--alert-red);
}

/* Result Display */
.smart-calc-result {
    background: var(--primary-navy);
    color: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: 0.75rem;
}

.smart-calc-result-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.smart-calc-result-value {
    font-size: 2rem;
    font-weight: 800;
}

.smart-calc-result-actual {
    font-size: 0.85rem;
    opacity: 0.8;
}

.smart-calc-bilateral-note {
    font-size: 0.75rem;
    color: var(--accent-gold);
    margin-top: 0.25rem;
    display: none;
}

.smart-calc-clear {
    width: 100%;
    padding: 0.6rem;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.smart-calc-clear:hover {
    background: var(--alert-red);
    border-color: var(--alert-red);
    color: white;
}

/* Rating Picker Modal */
.smart-calc-rating-picker {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.smart-calc-rating-picker.open {
    opacity: 1;
    visibility: visible;
}

.picker-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.picker-content {
    position: relative;
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.smart-calc-rating-picker.open .picker-content {
    transform: scale(1);
}

.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.picker-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.picker-title i {
    color: var(--accent-gold);
}

.picker-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.picker-close:hover {
    color: var(--text-main);
}

.picker-meta {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-off-white);
    flex-wrap: wrap;
}

.picker-category {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--surface-white);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.picker-bilateral {
    font-size: 0.8rem;
    color: var(--info-text);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.picker-bilateral-toggle {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.picker-bilateral-toggle label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.picker-bilateral-toggle input {
    accent-color: var(--primary-blue);
}

.picker-ratings {
    padding: 1rem 1.25rem;
}

.picker-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.rating-option {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-off-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.rating-option:hover {
    border-color: var(--primary-blue);
    background: white;
}

.rating-value {
    font-weight: 700;
    color: var(--primary-blue);
    min-width: 45px;
}

.rating-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.picker-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border-subtle);
    color: var(--primary-blue);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s;
}

.picker-link:hover {
    background: var(--bg-off-white);
}

/* Mobile drawer calculator adjustments */
.drawer-calculator .smart-calculator {
    border: none;
    border-radius: 0;
}

.drawer-calculator .smart-calc-header {
    display: none;
}

.drawer-calculator .smart-calc-body {
    padding: 0;
}

.drawer-calculator .smart-calc-list {
    max-height: 180px;
}

/* Print: hide calculator */
@media print {
    .smart-calculator,
    .smart-calc-rating-picker {
        display: none !important;
    }
}

/* INTERIOR PRINT STYLES */
@media print {
    .page-hero {
        background: none;
        color: black;
        padding: 0;
        margin-bottom: 1rem;
    }
    .page-hero h1 {
        font-size: 24pt;
        color: black;
    }
    .breadcrumb {
        display: none;
    }
    .hero-print-btn {
        display: none !important;
    }
    .nav-grid-container {
        display: none;
    }
    .article-alert {
        border: 1px solid black;
        background: #eee;
        color: black;
    }
    .article-alert a {
        text-decoration: underline;
        color: black;
    }
    .ref-box {
        border: 1px solid #ccc;
        box-shadow: none;
    }
    .step-card, .pitfalls-box {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }
    .step-number {
        -webkit-text-stroke: 1px #000;
        color: white;
    }
    .article-content {
        border: 1px solid #ccc;
        box-shadow: none;
    }
    .article-content a {
        color: black;
        text-decoration: underline;
    }
    .partners-container {
        display: none;
    }
    .toc-sidebar,
    .toc-mobile {
        display: none !important;
    }
    .article-layout {
        display: block;
    }
    .article-actions {
        display: none !important;
    }
    .scroll-progress {
        display: none !important;
    }
    .focus-exit-btn {
        display: none !important;
    }
    .share-dropdown {
        display: none !important;
    }
    .copy-toast {
        display: none !important;
    }
}

/* INTERIOR MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .page-hero {
        padding: 2.5rem 0;
        text-align: center;
    }
    .breadcrumb {
        justify-content: center;
    }
    .nav-grid-body {
        grid-template-columns: 1fr;
    }
    /* 2-column layout for "Other Presumptive Conditions" on mobile */
    .nav-grid-body.mobile-2col {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .nav-grid-body.mobile-2col .link-item {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    .nav-grid-body.mobile-2col .link-item i {
        font-size: 0.65rem;
    }
    .hero-print-btn {
        display: none;
    }
    .steps-grid {
        grid-template-columns: 1fr;
    }

    /* ==========================================================================
       EDGE-TO-EDGE MOBILE LAYOUT
       Uses negative margins based on container padding (1rem on mobile)
       ========================================================================== */

    /* Article content - edge-to-edge */
    .article-content {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-left: -1rem;
        margin-right: -1rem;
        padding: 1.5rem 1rem;
    }

    /* Reduce list indentation */
    .article-content ul,
    .article-content ol {
        margin-left: 1.25rem;
    }

    /* Alert boxes - edge-to-edge */
    .article-alert {
        border-radius: 0;
    }

    /* Reference box, nav grid, and section containers - edge-to-edge */
    .ref-box,
    .nav-grid-container,
    .section-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        margin-bottom: 1.5rem;
    }

    /* Section container body padding adjustment */
    .section-container .section-body {
        padding: 1rem;
    }

    .section-container .section-header {
        padding: 1rem;
    }

    /* FAQ items tighter padding */
    .faq-item summary,
    .faq-answer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Quick links grid - tighter on mobile */
    .quick-links {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* Partners container - edge-to-edge */
    .partners-container {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ==========================================================================
   FAQ ACCORDION
   ========================================================================== */
.faq-accordion {
    margin: 1.5rem 0;
}

.faq-item {
    background: var(--bg-off-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    color: var(--text-main);
    list-style: none;
    transition: background 0.2s;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-blue);
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary:hover {
    background: var(--surface-white);
}

.faq-item[open] summary {
    border-bottom: 1px solid var(--border-subtle);
}

.faq-answer {
    padding: 1rem 1.25rem;
    background: var(--surface-white);
    color: var(--text-muted);
    line-height: 1.7;
}

.faq-answer p {
    margin-bottom: 0.75rem;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul, .faq-answer ol {
    margin-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.faq-answer a {
    color: var(--primary-blue);
    font-weight: 500;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE TABLES
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
}

.table-responsive table,
.article-content .table_component table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-responsive th,
.table-responsive td,
.article-content .table_component th,
.article-content .table_component td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-subtle);
    text-align: left;
}

.table-responsive th,
.article-content .table_component th {
    background: var(--primary-navy);
    color: white;
    font-weight: 600;
}

.table-responsive tr:nth-child(even),
.article-content .table_component tr:nth-child(even) td {
    background: var(--bg-off-white);
}

.table-responsive tr:nth-child(odd) td,
.article-content .table_component tr:nth-child(odd) td {
    background: var(--surface-white);
}

/* ==========================================================================
   TL;DR SUMMARY BOX
   ========================================================================== */
.tldr-box {
    background: var(--bg-off-white);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--primary-blue);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.tldr-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tldr-badge {
    background: var(--primary-navy);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.tldr-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1rem;
}

.tldr-points {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tldr-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.tldr-points li:last-child {
    margin-bottom: 0;
}

.tldr-points li i {
    color: var(--primary-blue);
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.tldr-points li strong {
    color: var(--text-main);
}

/* ==========================================================================
   PHASE DIVIDER
   ========================================================================== */
.phase-divider {
    display: flex;
    align-items: center;
    margin: 2.5rem 0 1rem;
    gap: 1rem;
}

.phase-divider::before,
.phase-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.phase-divider span {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    background: var(--surface-white);
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
}

/* ==========================================================================
   FAQ CATEGORIES
   ========================================================================== */
.faq-category {
    margin-bottom: 2rem;
}

.faq-category-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

/* ==========================================================================
   QUICK LINKS GRID
   ========================================================================== */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: var(--bg-off-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.quick-link:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

.quick-link i {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.quick-link:hover i {
    color: white;
}

/* ==========================================================================
   WARNING & TIP BOXES
   ========================================================================== */
.warning-box {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-left: 4px solid var(--warning-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}

.warning-box p {
    margin-bottom: 0.5rem;
    color: var(--warning-text);
}

.warning-box p:last-child {
    margin-bottom: 0;
}

.tip-box {
    background: var(--info-bg, #eff6ff);
    border: 1px solid var(--info-border, #bfdbfe);
    border-left: 4px solid var(--primary-blue, #2563eb);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin: 1rem 0 1.5rem;
    color: var(--info-text, #1e40af);
}

.tip-box strong {
    color: var(--info-text, #1e40af);
}

/* ==========================================================================
   CONTRACTOR LIST
   ========================================================================== */
.contractor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    align-items: center;
    margin: 0.5rem 0 1.5rem;
}

.contractor-list a {
    color: var(--primary-blue);
    font-weight: 500;
}

.contractor-list a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   START HERE CTA
   ========================================================================== */
.start-here-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    background: var(--bg-off-white);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--primary-blue);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.start-here-cta .cta-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.start-here-cta .cta-icon {
    font-size: 2rem;
    color: var(--primary-blue);
    flex-shrink: 0;
}

.start-here-cta .cta-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-heading);
}

.start-here-cta .cta-text p {
    font-size: 0.9rem;
    margin: 0;
    color: var(--text-muted);
}

.start-here-cta .cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-blue);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.start-here-cta .cta-button:hover {
    background: var(--primary-navy);
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .start-here-cta {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
    }

    .start-here-cta .cta-content {
        flex-direction: column;
    }

    .start-here-cta .cta-button {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   DARK MODE OVERRIDES - Interior Elements
   Fix elements that use --primary-navy as background (inverted in dark mode)
   ========================================================================== */

[data-theme="dark"] .table-responsive th,
[data-theme="dark"] .article-content .table_component th {
    background: #1e293b;
    color: #e2e8f0;
}

[data-theme="dark"] .smart-calc-header {
    background: #1e293b;
}

[data-theme="dark"] .smart-calc-result {
    background: #1e293b;
}

[data-theme="dark"] .tldr-badge {
    background: #1e293b;
}

[data-theme="dark"] .back-to-top-btn {
    background: #1e293b;
}
