* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.9;
    color: #1a1a1a;
    background: #fafaf8;
    padding: 1.5rem 1rem 3rem;
    font-size: 1.25rem;
}
.container { max-width: 680px; margin: 0 auto; }

/* Header */
header {
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 1.2rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.2rem; }
.meta { font-size: 0.85rem; color: #666; }
.meta a { color: #666; text-decoration: underline; }

/* Language toggle */
.lang-toggle {
    display: flex;
    border: 2px solid #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.lang-toggle button {
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: #fafaf8;
    color: #666;
    transition: all 0.15s;
    min-height: 44px;
}
.lang-toggle button.active {
    background: #1a1a1a;
    color: #fafaf8;
}
.lang-toggle button:first-child { border-right: 1px solid #1a1a1a; }

/* Toolbar (font size + dark mode) */
.toolbar-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
}
.toolbar-label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}
.toolbar button {
    background: none;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    font-size: 0.95rem;
    color: #555;
    transition: all 0.15s;
}
.toolbar button:hover { border-color: #888; color: #1a1a1a; }

/* Summary box */
.summary {
    background: #f0f4e8;
    border-left: 4px solid #5a7a3a;
    padding: 1.2rem 1.4rem;
    margin-bottom: 2rem;
    border-radius: 0 8px 8px 0;
}
.summary h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: #3a5a2a;
}
.summary ul { list-style: none; padding: 0; }
.summary li {
    padding: 0.35rem 0;
    padding-left: 1.4rem;
    position: relative;
    font-size: 1.05rem;
}
.summary li::before {
    content: "\2192";
    position: absolute;
    left: 0;
    color: #5a7a3a;
    font-weight: bold;
}

/* Glossary hint */
.glossary-hint {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
    margin-bottom: 1.8rem;
    text-align: center;
}
.glossary-hint a { color: #888; }

/* Section headers */
h3.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.4rem;
    margin-bottom: 1.2rem;
    margin-top: 2rem;
}
h3.section-title:first-of-type { margin-top: 0; }

/* Content */
p { margin-bottom: 1.4rem; }
a {
    color: #1a6b3c;
    text-decoration: underline;
    text-decoration-color: #1a6b3c50;
    transition: text-decoration-color 0.2s;
}
a:hover { text-decoration-color: #1a6b3c; }
.content-block { display: none; }
.content-block.active { display: block; }

/* Inline explanations */
.expl {
    color: #777;
    font-size: 0.92em;
}

/* Glossary */
.glossary {
    background: #f5f3ee;
    border-radius: 8px;
    padding: 1.4rem 1.6rem;
    margin-top: 2.5rem;
}
.glossary h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #555;
}
.glossary dl { margin: 0; }
.glossary .glossary-item {
    margin-bottom: 0.7rem;
}
.glossary dt {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    display: inline;
}
.glossary dd {
    color: #555;
    font-size: 0.95rem;
    margin: 0;
    display: inline;
}

/* Footer */
.note {
    font-size: 0.8rem;
    color: #999;
    margin-top: 2rem;
    padding-top: 0.8rem;
    border-top: 1px solid #ddd;
    text-align: center;
}
.note a { color: #999; }
.disclosure { font-size: 0.95rem; color: #666; font-style: italic; }

/* Back link */
.back-link {
    display: inline-block;
    font-size: 0.9rem;
    color: #888;
    text-decoration: none;
    margin-bottom: 1rem;
}
.back-link:hover { color: #555; }

/* Reading time */
.reading-time {
    font-size: 0.85rem;
    color: #999;
    margin-left: 0.3rem;
}

/* WhatsApp share */
.share-bar {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}
.share-wa {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #25D366;
    color: #fff;
    text-decoration: none;
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.15s;
    min-height: 44px;
}
.share-wa:hover { background: #1da851; color: #fff; }
.share-wa svg { width: 20px; height: 20px; fill: #fff; flex-shrink: 0; }
body.dark .share-wa { background: #1da851; }
body.dark .share-wa:hover { background: #25D366; }

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #1a6b3c;
    color: #fff;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover { background: #145a30; }

/* Dark mode */
body.dark {
    background: #1a1a1a;
    color: #e0e0e0;
}
body.dark header { border-bottom-color: #555; }
body.dark .lang-toggle { border-color: #555; }
body.dark .lang-toggle button { background: #1a1a1a; color: #999; border-color: #555; }
body.dark .lang-toggle button.active { background: #e0e0e0; color: #1a1a1a; }
body.dark .summary { background: #2a3320; border-left-color: #5a7a3a; }
body.dark .summary h2 { color: #a0c880; }
body.dark a { color: #4daa6a; }
body.dark .meta, body.dark .meta a { color: #999; }
body.dark h3.section-title { color: #bbb; border-bottom-color: #444; }
body.dark .glossary { background: #252520; }
body.dark .glossary dt { color: #ddd; }
body.dark .glossary dd { color: #bbb; }
body.dark .note { border-top-color: #444; }
body.dark .toolbar button { border-color: #555; color: #bbb; }
body.dark .toolbar button:hover { border-color: #999; color: #e0e0e0; }
body.dark .toolbar-label { color: #777; }
body.dark .back-link { color: #999; }
body.dark .back-link:hover { color: #ddd; }
body.dark .expl { color: #999; }
body.dark .glossary-hint { color: #999; }
body.dark .glossary-hint a { color: #999; }
body.dark .back-to-top { background: #4daa6a; color: #1a1a1a; }
body.dark .back-to-top:hover { background: #3d9a5a; }
body.dark .subtitle a { color: #999 !important; }

/* Mobile */
@media (max-width: 600px) {
    body { padding: 1rem 0.8rem; }
    header { flex-direction: column; gap: 0.8rem; }
    .lang-toggle { align-self: flex-start; }
    .toolbar-group { align-self: flex-start; }
    .back-to-top { bottom: 1rem; right: 1rem; }
}
