:root {
    --color-brand: #d946ef;
    --color-cta: #f59e0b;
    --text-muted: #888;
    --border: #ddd;
}

html, body {
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

img, video, iframe, svg, canvas {
    max-width: 100%;
    height: auto;
}

.article-main {
    overflow-x: hidden;
}

.article-hero {
    background: #1a1a1a;
    color: #fff;
    padding: 80px 0 60px;
    text-align: center;
}

.article-hero__inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.article-hero h1 {
    font-size: 2.2em;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 16px;
}

.article-hero h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-brand);
    margin: 24px auto 0;
}

.article-hero h1,
.article-hero p,
.article-hero span,
.article-hero a {
    color: #fff;
}

.article-hero__subtitle {
    font-size: 1.1em;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.article-hero__meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    color: #999;
    font-size: 14px;
    line-height: 1.6;
}

.article-body {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px;
    padding-bottom: 40px;
}

.article-featured-img {
    margin: 40px -24px 0;
    overflow: hidden;
}

.article-featured-img img {
    width: 100%;
    height: auto;
    display: block;
}

.article-intro {
    margin: 40px 0 48px;
}

.article-intro p {
    font-size: 17px;
    color: #333;
    line-height: 1.7;
    margin-bottom: 16px;
}

.article-intro p:first-child::first-letter {
    float: left;
    font-size: 3.4em;
    line-height: 0.8;
    padding-right: 10px;
    padding-top: 6px;
    color: var(--color-brand);
    font-weight: 700;
}

.prose-section {
    margin-bottom: 48px;
}

.prose-section h2 {
    font-size: 1.75em;
    font-weight: 700;
    color: var(--color-brand);
    margin-top: 48px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.prose-section h3 {
    font-size: 1.25em;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 32px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.prose-section p {
    font-size: 17px;
    color: #333;
    line-height: 1.7;
    margin-bottom: 16px;
}

.prose-section ul,
.prose-section ol {
    margin: 16px 0 24px;
    padding-left: 24px;
}

.prose-section li {
    font-size: 17px;
    color: #333;
    line-height: 1.7;
    margin-bottom: 8px;
}

.prose-section strong {
    font-weight: 700;
    color: #1a1a1a;
}

.prose-section blockquote {
    border-left: 2px solid #ccc;
    padding-left: 20px;
    margin: 24px 0;
}

.prose-section blockquote p {
    font-size: 17px;
    color: #555;
    font-style: italic;
    margin-bottom: 8px;
}

.prose-section blockquote cite {
    font-size: 14px;
    color: var(--text-muted);
    font-style: normal;
    line-height: 1.6;
}

.prose-section a {
    color: var(--color-brand);
    text-decoration: underline;
}

.prose-section a:hover {
    color: #b530d4;
}

.routine-phase {
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid #eee;
}

.routine-phase:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0 24px;
}

.routine-table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    border-top: 3px solid var(--color-brand);
}

.routine-table th,
.data-table th {
    background: #2d2d2d;
    color: #fff;
    font-weight: 700;
    padding: 12px 16px;
    text-align: left;
    line-height: 1.5;
}

.routine-table td,
.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
    color: #333;
    line-height: 1.6;
}

.routine-table tbody tr:nth-child(even),
.data-table tbody tr:nth-child(even) {
    background: #f7f7f7;
}

.calc-section {
    margin: 48px 0;
}

.calc-section h2 {
    font-size: 1.75em;
    font-weight: 700;
    color: var(--color-brand);
    margin-bottom: 12px;
    line-height: 1.3;
}

.calc-section > p {
    font-size: 17px;
    color: #555;
    margin-bottom: 24px;
    line-height: 1.6;
}

.calc-card {
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 32px;
}

.calc-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.calc-field {
    flex: 1;
    min-width: 200px;
}

.calc-field label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.5;
}

.calc-field select,
.calc-field input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    color: #333;
    background: #fff;
    line-height: 1.5;
}

.calc-field select:focus,
.calc-field input[type="number"]:focus {
    outline: 2px solid var(--color-brand);
    outline-offset: 1px;
    border-color: var(--color-brand);
}

.calc-btn {
    background: var(--color-cta);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.5;
}

.calc-btn:hover {
    background: #e08e09;
}

.calc-btn:focus {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

.calc-result {
    margin-top: 24px;
}

.calc-result:empty {
    display: none;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    border-top: 3px solid var(--color-brand);
}

.result-table th {
    background: #2d2d2d;
    color: #fff;
    font-weight: 700;
    padding: 10px 14px;
    text-align: left;
    line-height: 1.5;
}

.result-table td {
    padding: 8px 14px;
    border-bottom: 1px solid #ddd;
    color: #333;
    line-height: 1.6;
}

.result-table tbody tr:nth-child(even) {
    background: #fff;
}

.result-table strong {
    color: var(--color-brand);
    font-weight: 700;
}

.result-highlight {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

.result-highlight p {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 8px;
}

.result-highlight p:last-child {
    margin-bottom: 0;
}

.result-highlight strong {
    color: var(--color-brand);
    font-weight: 700;
}

.progress-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin: 32px 0;
    text-align: center;
}

.progress-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.progress-item svg {
    max-width: 100%;
    height: auto;
}

.progress-label {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    line-height: 1.5;
}

.progress-note {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 16px;
    font-style: italic;
}

.faq-section {
    margin: 48px 0;
}

.faq-section h2 {
    font-size: 1.75em;
    font-weight: 700;
    color: var(--color-brand);
    margin-bottom: 24px;
    line-height: 1.3;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.faq-item h3 {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.5;
}

.faq-item p {
    font-size: 16px;
    color: #444;
    line-height: 1.7;
    margin-bottom: 0;
}

.article-disclaimer {
    margin: 48px 0 32px;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.article-disclaimer p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0;
}

.article-conclusion {
    margin-bottom: 0;
    padding-bottom: 20px;
}

.article-conclusion h2 {
    margin-top: 32px;
}

@media (max-width: 768px) {
    .article-hero {
        padding: 50px 0 40px;
    }

    .article-hero h1 {
        font-size: 1.6em;
    }

    .article-hero h1::after {
        margin-top: 18px;
    }

    .article-hero__subtitle {
        font-size: 1em;
        margin-bottom: 20px;
    }

    .article-hero__meta {
        gap: 12px;
        font-size: 13px;
    }

    .article-body {
        padding: 0 16px;
    }

    .article-featured-img {
        margin: 30px -16px 0;
    }

    .article-intro {
        margin: 30px 0 40px;
    }

    .prose-section h2 {
        font-size: 1.4em;
        margin-top: 36px;
    }

    .prose-section h3 {
        font-size: 1.15em;
        margin-top: 24px;
    }

    .prose-section p,
    .prose-section li,
    .article-intro p {
        font-size: 16px;
    }

    .progress-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .calc-card {
        padding: 20px;
    }

    .calc-form {
        flex-direction: column;
        align-items: stretch;
    }

    .calc-field {
        min-width: 100%;
    }

    .calc-btn {
        width: 100%;
    }

    .routine-table,
    .data-table,
    .result-table {
        font-size: 14px;
    }

    .routine-table th,
    .data-table th,
    .result-table th,
    .routine-table td,
    .data-table td,
    .result-table td {
        padding: 8px 10px;
    }

    .faq-list {
        gap: 20px;
    }

    .routine-phase {
        padding-bottom: 28px;
        margin-bottom: 28px;
    }
}

@media (max-width: 480px) {
    .article-hero {
        padding: 36px 0 30px;
    }

    .article-hero h1 {
        font-size: 1.35em;
    }

    .article-hero__meta {
        flex-direction: column;
        gap: 6px;
    }

    .progress-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .progress-item svg {
        width: 110px;
        height: 110px;
    }

    .progress-label {
        font-size: 14px;
    }

    .article-intro p:first-child::first-letter {
        font-size: 2.8em;
    }
}

/* ===== TYPOGRAPHY SPACING FIX (APS_ARTICLE_TYPO_REQUIRED_v2) ===== */
/* Defensive guard against universal * { margin: 0 } reset in global.css. */
/* body-scoped via :where() so specificity stays at 0,0,0,1 — beats * but
   loses to any component rule like .tip-box p / .faq-item p. */
body :where(p)              { margin-bottom: 1.1rem; }
body :where(h2)             { margin-top: 2.5rem; margin-bottom: 1rem; }
body :where(h3)             { margin-top: 1.75rem; margin-bottom: 0.75rem; }
body :where(h4)             { margin-top: 1.25rem; margin-bottom: 0.5rem; }
body :where(ul, ol)         { margin-bottom: 1.1rem; padding-left: 1.5rem; }
body :where(li)             { margin-bottom: 0.4rem; }
body :where(blockquote)     { margin: 1.5rem 0; }
