/* =========================================================
   PART 1 OF 3
   GLOBAL STYLES, NAVIGATION, HERO, TOPICS & ARTICLES
   ========================================================= */


/* =========================================================
   1. GOOGLE FONTS
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&family=DM+Mono:wght@400;500;700&display=swap');


/* =========================================================
   2. ROOT VARIABLES & THEMES
   ========================================================= */

:root {
    --accent: #24785b;
    --accent-rgb: 36, 120, 91;

    --ink: #19231f;
    --muted: #68766f;
    --line: #e3e9e5;

    --paper: #fff;
    --soft: #f5f8f6;
    --canvas: #fbfcfb;
    --header: rgba(255, 255, 255, 0.88);

    --shadow: 0 18px 50px rgba(25, 54, 40, 0.08);
    --radius: 22px;

    --font: 'DM Sans', sans-serif;
    --display: 'Manrope', sans-serif;
}


/* Classic Font Theme */

body[data-font="classic"] {
    --font: Georgia, serif;
    --display: Georgia, serif;
}


/* Accessible Font Theme */

body[data-font="accessible"] {
    font-size: 18px;
    line-height: 1.75;
}


/* Dark Theme */

html[data-theme="dark"] {
    --ink: #e7eee9;
    --muted: #a0b0a7;
    --line: #303d36;

    --paper: #1a2420;
    --soft: #202d26;
    --canvas: #131b17;
    --header: rgba(19, 27, 23, 0.9);

    --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}


/* =========================================================
   3. GLOBAL RESET & BASE STYLES
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);

    font: 15px/1.65 var(--font);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
select {
    touch-action: manipulation;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(var(--accent-rgb), 0.28);
    outline-offset: 3px;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

[hidden] {
    display: none !important;
}


/* Main Container */

.wrap {
    width: min(1160px, calc(100% - 48px));
    margin-inline: auto;
}


/* =========================================================
   4. TOP NAVIGATION BAR
   ========================================================= */

.topbar {
    height: 82px;

    padding: 0 max(24px, calc((100vw - 1260px) / 2));

    display: flex;
    align-items: center;
    gap: 38px;

    border-bottom: 1px solid var(--line);

    background: var(--header);
    backdrop-filter: blur(18px);

    position: sticky;
    top: 0;
    z-index: 20;
}


/* Brand */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}

.brand-symbol {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: 14px;

    background: var(--accent);
    color: #fff;

    font: 800 25px var(--display);
    letter-spacing: -2px;
}

.brand strong {
    display: block;

    font: 800 18px var(--display);
    letter-spacing: -0.6px;
}

.brand small {
    display: block;

    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.2px;
}


/* Desktop Navigation */

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 27px;
    margin: auto;
}

.nav-item {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;

    transition: color 0.2s;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent);
}


/* Navigation Actions */

.top-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}


/* Buttons */

.button {
    border: 1px solid transparent;
    border-radius: 11px;

    padding: 10px 16px;

    font-size: 12px;
    font-weight: 700;

    transition:
        transform 0.18s,
        background 0.18s,
        border-color 0.18s;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    white-space: nowrap;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--accent);
    color: white;
}

.button-primary:hover {
    filter: brightness(1.06);
}

.button-outline {
    border-color: var(--line);
    background: var(--paper);
    color: var(--ink);
}

.button-outline:hover,
.button-quiet:hover {
    border-color: rgba(var(--accent-rgb), 0.35);
    background: rgba(var(--accent-rgb), 0.06);
}

.button-quiet {
    background: transparent;
    color: var(--muted);
}


/* Icon & Mobile Menu Buttons */

.icon-button,
.mobile-menu {
    width: 40px;
    height: 40px;

    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);

    border-radius: 12px;
    font-size: 23px;
}

.mobile-menu,
.mobile-nav {
    display: none;
}


/* =========================================================
   5. ANNOUNCEMENT BAR
   ========================================================= */

.announcement {
    padding: 9px 24px;

    text-align: center;

    background: var(--accent);
    color: white;

    font-size: 13px;
}

.announcement button {
    border: 0;
    background: none;
    color: white;

    margin-left: 12px;
    font-size: 19px;
}


/* =========================================================
   6. HERO SECTION
   ========================================================= */

.hero {
    min-height: 560px;

    padding-top: 84px;
    padding-bottom: 62px;

    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;

    align-items: center;
}

.hero-copy {
    max-width: 600px;
}


/* Eyebrow Labels */

.eyebrow,
.kicker {
    font-size: 10px;
    letter-spacing: 1.8px;
    font-weight: 800;
    color: var(--accent);
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
}


/* Pulse Indicator */

.pulse {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--accent);

    box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.1);
}


/* Hero Heading */

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

.hero h1 {
    font: 800 clamp(42px, 5.1vw, 67px) / 1.1 var(--display);

    letter-spacing: -3px;
    margin: 20px 0 19px;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}


/* Hero Description */

.hero-copy > p {
    font-size: 16px;
    max-width: 500px;

    color: var(--muted);
    line-height: 1.85;
}


/* =========================================================
   7. HERO SEARCH BOX
   ========================================================= */

.search-box {
    position: relative;

    margin-top: 28px;
    max-width: 550px;
    height: 62px;

    border: 1px solid var(--line);
    border-radius: 16px;

    background: var(--paper);

    box-shadow: 0 10px 30px rgba(20, 45, 32, 0.05);

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 16px;
    z-index: 5;
}

.search-glyph {
    font-size: 26px;
    color: var(--accent);
}

.search-box input {
    min-width: 0;
    flex: 1;

    border: 0;
    outline: 0;

    background: transparent;
    color: var(--ink);

    font-size: 13px;
}

.search-box kbd {
    border: 1px solid var(--line);
    border-radius: 6px;

    padding: 3px 6px;

    color: var(--muted);
    font-size: 10px;

    white-space: nowrap;
}


/* Search Suggestions */

.search-suggestions {
    position: absolute;

    top: calc(100% + 8px);
    left: 0;
    right: 0;

    background: var(--paper);

    border: 1px solid var(--line);
    border-radius: 14px;

    box-shadow: var(--shadow);

    padding: 7px;

    max-height: 320px;
    overflow: auto;
}

.suggestion-item {
    display: flex;
    flex-direction: column;

    text-align: left;
    width: 100%;

    padding: 10px 12px;

    border: 0;
    border-radius: 9px;

    background: transparent;
    color: var(--ink);
}

.suggestion-item:hover {
    background: var(--soft);
}

.suggestion-item small {
    color: var(--muted);
}


/* =========================================================
   8. HERO FOOTNOTE & AVATARS
   ========================================================= */

.hero-footnote {
    display: flex;
    align-items: center;
    gap: 13px;

    margin-top: 23px;

    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.hero-footnote strong {
    color: var(--ink);
    font-size: 12px;
}

.avatar-stack {
    display: flex;
    padding-left: 4px;
}

.avatar-stack i {
    font-style: normal;

    width: 29px;
    height: 29px;

    margin-left: -4px;

    border: 2px solid var(--canvas);
    border-radius: 50%;

    background: #d8e7df;
    color: #245f49;

    display: grid;
    place-items: center;

    font-size: 11px;
    font-weight: 800;
}

.avatar-stack i:nth-child(2) {
    background: #e8e0f1;
    color: #65458b;
}

.avatar-stack i:nth-child(3) {
    background: #f3e4d4;
    color: #89552d;
}


/* =========================================================
   9. HERO ILLUSTRATION
   ========================================================= */

.hero-art {
    height: 420px;

    position: relative;

    display: grid;
    place-items: center;

    isolation: isolate;
}

.hero-art::before {
    content: '';

    position: absolute;

    width: 320px;
    height: 320px;

    background: radial-gradient(
        circle,
        rgba(var(--accent-rgb), 0.12),
        rgba(var(--accent-rgb), 0) 70%
    );

    border-radius: 50%;
    z-index: -2;
}


/* Decorative Orbits */

.orbit {
    position: absolute;

    border: 1px solid rgba(var(--accent-rgb), 0.17);
    border-radius: 50%;

    transform: rotate(-25deg);
}

.orbit-one {
    width: 400px;
    height: 220px;
}

.orbit-two {
    width: 330px;
    height: 330px;

    transform: rotate(28deg);
}

.orbit-three {
    width: 470px;
    height: 280px;

    transform: rotate(63deg);
}


/* Center Illustration */

.art-center {
    width: 145px;
    height: 145px;

    border-radius: 42px;

    background: linear-gradient(
        145deg,
        var(--accent),
        #174d3b
    );

    color: white;

    box-shadow: 0 25px 55px rgba(var(--accent-rgb), 0.28);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    transform: rotate(-7deg);
}

.art-center span {
    font: 800 70px / 0.8 var(--display);
    letter-spacing: -9px;
}

.art-center small {
    font-size: 9px;
    letter-spacing: 3px;

    margin-top: 10px;
    text-align: center;
}


/* Floating Cards */

.float-card {
    position: absolute;

    display: flex;
    align-items: center;
    gap: 11px;

    padding: 13px 16px;

    background: var(--paper);

    border: 1px solid var(--line);
    border-radius: 15px;

    box-shadow: var(--shadow);

    min-width: 190px;

    animation: float 6s ease-in-out infinite;
}

.float-card b,
.float-card small {
    display: block;
}

.float-card b {
    font-size: 11px;
}

.float-card small {
    font-size: 9px;
    color: var(--muted);

    margin-top: 2px;
}


/* Floating Card Icons */

.float-icon {
    width: 36px;
    height: 36px;

    border-radius: 11px;

    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);

    display: grid;
    place-items: center;

    font-size: 22px;
}


/* Floating Card Positions */

.card-dna {
    top: 38px;
    left: 0;
}

.card-book {
    right: -5px;
    top: 145px;

    animation-delay: -2s;
}

.card-data {
    bottom: 35px;
    left: 45px;

    animation-delay: -4s;
}


/* Decorative Dots */

.art-dot {
    position: absolute;
    border-radius: 50%;
    background: var(--accent);
}

.dot-a {
    width: 9px;
    height: 9px;

    top: 40px;
    right: 85px;
}

.dot-b {
    width: 6px;
    height: 6px;

    bottom: 70px;
    right: 20px;

    background: #dca76b;
}

.dot-c {
    width: 12px;
    height: 12px;

    top: 180px;
    left: 22px;

    background: #8c75c8;
}


/* Floating Animation */

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}


/* =========================================================
   10. METRICS SECTION
   ========================================================= */

.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr) 1.3fr;

    border: 1px solid var(--line);
    border-radius: 18px;

    background: var(--paper);

    padding: 22px 28px;

    align-items: center;

    box-shadow: 0 8px 24px rgba(20, 45, 32, 0.025);
}

.metrics > div:not(.metrics-note) {
    display: flex;
    align-items: baseline;
    gap: 10px;

    border-right: 1px solid var(--line);

    padding-left: 15px;
}

.metrics > div:first-child {
    padding-left: 0;
}

.metrics strong {
    font: 800 24px var(--display);
    letter-spacing: -1px;
}

.metrics span {
    font-size: 11px;
    color: var(--muted);
}

.metrics-note {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;

    font-size: 11px;
    color: var(--muted);
}

.status-dot {
    width: 7px;
    height: 7px;

    background: #3caa7a;
    border-radius: 50%;
}


/* =========================================================
   11. GENERAL SECTION STYLES
   ========================================================= */

.section {
    padding-top: 100px;
    padding-bottom: 92px;
}

.section-soft {
    background: var(--soft);
    margin-top: 0;
}


/* Section Headings */

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 32px;
}

.section-heading h2,
.about-section h2 {
    font: 800 clamp(27px, 3vw, 37px) / 1.2 var(--display);

    letter-spacing: -1.4px;
    margin: 9px 0;
}

.section-heading p {
    margin: 0;

    color: var(--muted);
    font-size: 13px;
}


/* Text Links */

.text-link {
    border: 0;
    background: transparent;

    color: var(--accent);

    font-size: 12px;
    font-weight: 800;

    padding: 8px 0;
}

.text-link span {
    margin-left: 7px;
}


/* =========================================================
   12. TOPIC GRID & TOPIC CARDS
   ========================================================= */

.topic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.topic-card {
    border: 1px solid var(--line);
    background: var(--paper);

    border-radius: 18px;
    padding: 22px;

    min-height: 188px;

    text-align: left;

    display: flex;
    flex-direction: column;

    transition:
        transform 0.2s,
        border-color 0.2s,
        box-shadow 0.2s;

    color: var(--ink);
}

.topic-card:hover {
    transform: translateY(-4px);

    border-color: rgba(var(--accent-rgb), 0.35);

    box-shadow: var(--shadow);
}


/* Topic Icons */

.topic-icon {
    width: 43px;
    height: 43px;

    border-radius: 13px;

    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);

    display: grid;
    place-items: center;

    font-size: 23px;

    margin-bottom: 20px;
}


/* Topic Text */

.topic-card h3 {
    font: 750 15px var(--display);
    margin: 0 0 7px;
}

.topic-card p {
    font-size: 11px;
    color: var(--muted);

    line-height: 1.6;
    margin: 0;
}


/* Topic Footer */

.topic-card .topic-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-top: auto;
    padding-top: 15px;

    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
}


/* =========================================================
   13. SUBTOPIC NAVIGATION
   ========================================================= */

.subtopic-bar {
    margin-top: 17px;
    padding: 14px;

    border: 1px solid var(--line);
    border-radius: 13px;

    background: var(--paper);

    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.subtopic-chip {
    border: 1px solid var(--line);

    background: var(--soft);

    border-radius: 20px;
    padding: 6px 12px;

    font-size: 11px;
    color: var(--ink);
}


/* =========================================================
   14. ARTICLE LIST CONTROLS
   ========================================================= */

.list-controls {
    display: flex;
    gap: 8px;
}

.list-controls select,
.field-label input,
.field-label select,
.field-label textarea,
.admin-search,
.inline-add input,
.inline-add select {
    border: 1px solid var(--line);
    border-radius: 10px;

    background: var(--paper);
    color: var(--ink);

    padding: 10px 12px;
}

.list-controls select {
    font-size: 11px;
}


/* =========================================================
   15. ARTICLE GRID & ARTICLE CARDS
   ========================================================= */

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 17px;
}

.article-card {
    background: var(--paper);

    border: 1px solid var(--line);
    border-radius: 18px;

    overflow: hidden;

    display: flex;
    flex-direction: column;

    min-height: 260px;

    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}


/* Article Cover */

.article-cover {
    height: 125px;

    background: linear-gradient(
        135deg,
        rgba(var(--accent-rgb), 0.14),
        rgba(var(--accent-rgb), 0.035)
    );

    position: relative;
    overflow: hidden;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-cover::after {
    content: 'O.';

    position: absolute;

    right: 17px;
    bottom: -26px;

    font: 800 105px var(--display);
    letter-spacing: -12px;

    color: rgba(var(--accent-rgb), 0.13);
}


/* Article Card Body */

.article-card-body {
    padding: 18px;

    display: flex;
    flex: 1;
    flex-direction: column;
}


/* Article Category Label */

.article-label {
    font-size: 9px;
    letter-spacing: 1.2px;

    text-transform: uppercase;

    color: var(--accent);
    font-weight: 800;
}


/* Article Heading */

.article-card h3 {
    font: 750 16px / 1.45 var(--display);

    letter-spacing: -0.25px;
    margin: 9px 0;
}

.article-card h3 button {
    font: inherit;

    text-align: left;

    color: var(--ink);

    border: 0;
    padding: 0;

    background: none;
}


/* Article Description */

.article-card p {
    font-size: 11px;
    line-height: 1.7;

    color: var(--muted);

    margin-bottom: 16px;
}


/* Article Metadata */

.article-card-meta {
    margin-top: auto;

    border-top: 1px solid var(--line);

    padding-top: 12px;

    display: flex;
    justify-content: space-between;

    color: var(--muted);
    font-size: 10px;
}


/* =========================================================
   16. CENTERED ACTIONS & EMPTY STATES
   ========================================================= */

.center-action {
    text-align: center;
    margin-top: 32px;
}


/* General Empty State */

.empty-state {
    text-align: center;

    padding: 50px 20px;

    color: var(--muted);
}

.empty-state > span {
    font-size: 35px;
    color: var(--accent);
}

.empty-state h3 {
    color: var(--ink);
    margin: 8px 0;
}

.empty-state p {
    font-size: 13px;
}

/* =========================================================
   PART 2 OF 3
   ABOUT, FOOTER, ARTICLE READER, FORMS & ADMIN WORKSPACE
   ========================================================= */


/* =========================================================
   17. ABOUT SECTION
   ========================================================= */

.about-section {
    display: grid;
    grid-template-columns: 110px 1fr 1fr;
    gap: 30px;
    align-items: center;

    padding-top: 100px;
    padding-bottom: 100px;
}

.about-mark {
    font: 800 75px var(--display);
    letter-spacing: -10px;
    color: var(--accent);
}

.about-section p {
    max-width: 490px;

    color: var(--muted);
    font-size: 13px;
    line-height: 1.9;
}


/* About Points */

.about-points {
    border-left: 1px solid var(--line);
    padding-left: 32px;

    display: grid;
    gap: 17px;
}

.about-points div {
    display: grid;
    grid-template-columns: 28px 1fr;
    column-gap: 10px;
}

.about-points span {
    grid-row: span 2;

    color: var(--accent);
    font: 700 11px 'DM Mono', monospace;
}

.about-points b {
    font-size: 12px;
}

.about-points small {
    color: var(--muted);
    font-size: 10px;
}


/* =========================================================
   18. FOOTER
   ========================================================= */

.footer {
    border-top: 1px solid var(--line);
    background: var(--paper);
}


/* Main Footer */

.footer-main {
    display: flex;
    align-items: center;
    gap: 35px;

    padding-top: 32px;
    padding-bottom: 28px;
}

.footer-main > p {
    margin: 0;

    color: var(--muted);
    font-size: 11px;

    flex: 1;
}


/* Footer Links */

.footer-links {
    display: flex;
    gap: 18px;

    color: var(--muted);
    font-size: 11px;
}

.footer-links button {
    border: 0;
    background: none;

    color: inherit;
    padding: 0;
}


/* Footer Bottom */

.footer-bottom {
    border-top: 1px solid var(--line);

    padding-top: 17px;
    padding-bottom: 17px;

    display: flex;
    justify-content: space-between;

    color: var(--muted);
    font-size: 10px;
}


/* =========================================================
   19. ARTICLE READER PAGE
   ========================================================= */

.reader-view {
    padding-top: 32px;
    padding-bottom: 90px;

    min-height: 70vh;
}


/* Back Button */

.back-link {
    border: 0;
    background: none;

    color: var(--muted);
    font-size: 12px;

    padding: 10px 0;
    margin-bottom: 28px;
}


/* Reader Layout */

.reader-layout {
    display: grid;
    grid-template-columns: minmax(0, 780px) 250px;

    gap: 60px;
    justify-content: center;
}


/* Article Heading */

.reader-article h1 {
    font: 800 clamp(32px, 4vw, 49px) / 1.15 var(--display);

    letter-spacing: -1.8px;
    margin: 18px 0;
}


/* Article Metadata */

.reader-meta {
    display: flex;
    align-items: center;
    gap: 14px;

    font-size: 10px;
    color: var(--muted);

    flex-wrap: wrap;
}


/* Category Pill */

.pill {
    border-radius: 20px;

    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);

    padding: 5px 10px;
    font-weight: 700;
}


/* Article Summary */

.reader-summary {
    font-size: 16px;

    color: var(--muted);
    line-height: 1.8;
}


/* Reader Actions */

.reader-actions {
    display: flex;
    gap: 8px;

    padding: 12px 0 26px;

    border-bottom: 1px solid var(--line);
}


/* =========================================================
   20. ARTICLE SIDEBAR & TABLE OF CONTENTS
   ========================================================= */

.reader-aside {
    padding-top: 20px;
}


/* Sidebar Card */

.aside-card {
    border: 1px solid var(--line);
    border-radius: 16px;

    background: var(--paper);

    padding: 19px;
    margin-bottom: 15px;

    position: sticky;
    top: 105px;
}

.aside-card nav {
    margin-top: 12px;
}


/* Table of Contents */

.toc-list {
    list-style: none;

    padding: 0;
    margin: 0;
}

.toc-list li {
    margin: 8px 0;
    font-size: 11px;
}

.toc-list a {
    color: var(--muted);
}

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


/* Sidebar Tip */

.aside-tip {
    position: static;
    background: rgba(var(--accent-rgb), 0.06);
}

.tip-icon {
    font-size: 23px;
    color: var(--accent);
}

.aside-tip b {
    display: block;

    margin: 10px 0 4px;
    font-size: 12px;
}

.aside-tip p {
    font-size: 11px;
    color: var(--muted);
}


/* =========================================================
   21. RELATED ARTICLES
   ========================================================= */

.related-wrap {
    border-top: 1px solid var(--line);

    margin-top: 55px;
    padding-top: 26px;
}

.related-wrap h3 {
    font: 750 20px var(--display);
}


/* Related Article Grid */

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}


/* Related Article Item */

.related-item {
    border: 1px solid var(--line);
    border-radius: 12px;

    background: var(--paper);

    padding: 14px;
    text-align: left;

    color: var(--ink);
}

.related-item b,
.related-item small {
    display: block;
}

.related-item b {
    font-size: 12px;
}

.related-item small {
    color: var(--muted);
    font-size: 10px;

    margin-top: 7px;
}


/* =========================================================
   22. MARKDOWN CONTENT
   ========================================================= */

.markdown-body {
    font-size: 15px;
    line-height: 1.9;

    overflow-wrap: anywhere;
}


/* Markdown Headings */

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    font-family: var(--display);
    line-height: 1.3;

    letter-spacing: -0.5px;

    margin: 1.7em 0 0.6em;
}

.markdown-body h1 {
    font-size: 2em;
}

.markdown-body h2 {
    font-size: 1.55em;

    border-bottom: 1px solid var(--line);
    padding-bottom: 0.4em;
}

.markdown-body h3 {
    font-size: 1.2em;
}


/* Markdown Paragraphs & Lists */

.markdown-body p,
.markdown-body li {
    color: var(--ink);
}


/* Markdown Blockquotes */

.markdown-body blockquote {
    margin: 22px 0;
    padding: 5px 20px;

    border-left: 3px solid var(--accent);

    background: var(--soft);
    color: var(--muted);
}


/* Markdown Images */

.markdown-body img {
    max-width: min(48%, 440px);
    height: auto;

    border-radius: 12px;

    margin: 6px 18px 14px 0;
    float: left;
}

.markdown-body img[width],
.markdown-body img[style*="width"] {
    max-width: 100%;
}

.markdown-body img:only-child {
    float: none;
    max-width: 100%;

    display: block;

    margin: 18px auto;
}


/* Markdown Code Blocks */

.markdown-body pre {
    background: #17231d;
    color: #e2eee6;

    border-radius: 12px;
    padding: 17px;

    overflow: auto;

    font: 12px/1.7 'DM Mono', monospace;
}

.markdown-body code {
    font-family: 'DM Mono', monospace;
    font-size: 0.9em;

    background: var(--soft);

    padding: 2px 5px;
    border-radius: 4px;
}

.markdown-body pre code {
    background: none;
    padding: 0;
}


/* Markdown Tables */

.markdown-body table {
    border-collapse: collapse;
    width: 100%;

    display: block;
    overflow: auto;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--line);

    padding: 9px;
    text-align: left;
}

.markdown-body th {
    background: var(--soft);
}


/* Markdown Links */

.markdown-body a {
    color: var(--accent);
    text-decoration: underline;
}


/* Markdown Horizontal Rules */

.markdown-body hr {
    border: 0;

    border-top: 1px solid var(--line);

    margin: 28px 0;
}


/* =========================================================
   23. DIALOGS & MODALS
   ========================================================= */

.dialog {
    width: min(560px, calc(100% - 28px));
    max-height: min(90vh, 900px);

    padding: 0;

    border: 1px solid var(--line);
    border-radius: 22px;

    background: var(--paper);
    color: var(--ink);

    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.25);
}


/* Dialog Backdrop */

.dialog::backdrop {
    background: rgba(11, 23, 17, 0.48);
    backdrop-filter: blur(4px);
}


/* Dialog Header */

.dialog-head {
    padding: 25px 27px 18px;

    display: flex;
    justify-content: space-between;
    gap: 20px;

    border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
    font: 800 24px var(--display);
    margin: 7px 0;
}

.dialog-head p {
    font-size: 11px;
    color: var(--muted);
    margin: 0;
}


/* Dialog Close Button */

.close-button {
    border: 0;

    background: var(--soft);
    color: var(--muted);

    width: 32px;
    height: 32px;

    border-radius: 10px;
    font-size: 22px;

    flex-shrink: 0;
}


/* Dialog Body */

.dialog-body {
    padding: 23px 27px 27px;
    overflow: auto;
}


/* =========================================================
   24. FORM FIELDS
   ========================================================= */

.field-label {
    display: flex;
    flex-direction: column;
    gap: 7px;

    font-size: 11px;
    font-weight: 700;

    color: var(--muted);
    min-width: 0;
}

.field-label input,
.field-label select,
.field-label textarea {
    width: 100%;

    font-size: 12px;
    font-weight: 400;

    color: var(--ink);

    resize: vertical;
}

.field-label input[type="file"] {
    padding: 8px;
}

.field-label small {
    font-weight: 400;
}


/* Full-Width Buttons */

.full-width {
    width: 100%;

    margin-top: 8px;
    padding: 12px;
}


/* =========================================================
   25. COLOR PICKER
   ========================================================= */

.color-choice-row {
    display: flex;
    gap: 10px;

    padding: 6px 0;
}

.color-choice {
    width: 29px;
    height: 29px;

    border-radius: 50%;

    background: var(--swatch);

    border: 3px solid var(--paper);

    box-shadow: 0 0 0 1px var(--line);
}

.color-choice.active {
    box-shadow: 0 0 0 2px var(--accent);
}


/* =========================================================
   26. AUTHENTICATION TABS & FORMS
   ========================================================= */

.auth-tabs {
    display: flex;
    gap: 5px;

    background: var(--soft);

    border-radius: 10px;
    padding: 4px;

    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;

    border: 0;
    border-radius: 8px;

    background: transparent;

    padding: 9px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 700;
}

.auth-tab.active {
    background: var(--paper);
    color: var(--ink);

    box-shadow: 0 2px 8px #0000000b;
}


/* Stacked Forms */

.stack-form {
    display: grid;
    gap: 15px;
}


/* Form Notes */

.form-note,
.security-note {
    font-size: 10px;
    color: var(--muted);

    line-height: 1.6;
}

.security-note {
    border-top: 1px solid var(--line);

    padding-top: 14px;
    margin: 18px 0 0;
}


/* =========================================================
   27. INLINE STATUS MESSAGES
   ========================================================= */

.inline-message {
    padding: 11px 13px;

    border-radius: 10px;

    background: var(--soft);
    color: var(--muted);

    font-size: 11px;

    margin-top: 14px;

    overflow-wrap: anywhere;
}

.inline-message.error {
    color: #b34444;
    background: #b3444410;
}

.inline-message.success {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.08);
}


/* =========================================================
   28. ADMIN WORKSPACE LAYOUT
   ========================================================= */

.workspace {
    min-height: 100vh;

    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);

    background: var(--soft);
}


/* Workspace Sidebar */

.workspace-sidebar {
    background: var(--paper);

    border-right: 1px solid var(--line);

    padding: 25px 15px;

    display: flex;
    flex-direction: column;

    min-height: 100vh;
}

.workspace-sidebar > .brand {
    padding: 0 10px 28px;
}


/* Workspace User */

.workspace-user {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 15px 10px;

    border-block: 1px solid var(--line);

    margin-bottom: 18px;
}


/* User Avatar */

.user-avatar {
    width: 35px;
    height: 35px;

    border-radius: 12px;

    background: rgba(var(--accent-rgb), 0.13);
    color: var(--accent);

    display: grid;
    place-items: center;

    font-weight: 800;
}

.workspace-user b,
.workspace-user small {
    display: block;
}

.workspace-user b {
    font-size: 11px;
}

.workspace-user small {
    font-size: 10px;
    color: var(--muted);
}


/* =========================================================
   29. WORKSPACE NAVIGATION
   ========================================================= */

.workspace-nav {
    display: grid;
    gap: 4px;
}

.workspace-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;

    text-align: left;

    border: 0;
    background: transparent;

    color: var(--muted);

    border-radius: 10px;
    padding: 12px 13px;

    font-size: 13px;
}

.workspace-nav-item span {
    font-size: 11px;
    font-weight: 600;
}

.workspace-nav-item:hover,
.workspace-nav-item.active {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}


/* Sidebar Bottom */

.sidebar-bottom {
    margin-top: auto;

    border-top: 1px solid var(--line);
    padding-top: 12px;
}


/* =========================================================
   30. WORKSPACE MAIN AREA
   ========================================================= */

.workspace-main {
    min-width: 0;

    padding: 30px clamp(20px, 4vw, 55px);

    max-width: 1600px;
    width: 100%;

    margin: 0 auto;
}


/* Workspace Header */

.workspace-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 25px;
}

.workspace-top h1 {
    font: 800 29px var(--display);
    margin: 4px 0;
}

.workspace-top-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}


/* Server Status */

.server-status {
    font-size: 10px;
    color: var(--muted);
}

.server-status i {
    display: inline-block;

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #dba34c;

    margin-right: 6px;
}


/* =========================================================
   31. WORKSPACE PANELS
   ========================================================= */

.workspace-panel {
    display: none;
}

.workspace-panel.active {
    display: block;
}


/* =========================================================
   32. WELCOME BANNER
   ========================================================= */

.welcome-banner {
    padding: 27px 31px;

    background: linear-gradient(
        120deg,
        rgba(var(--accent-rgb), 0.13),
        rgba(var(--accent-rgb), 0.035)
    );

    border: 1px solid rgba(var(--accent-rgb), 0.12);
    border-radius: 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    overflow: hidden;
}

.welcome-banner h2 {
    font: 800 24px var(--display);

    letter-spacing: -0.7px;
    margin: 8px 0;
}

.welcome-banner p {
    font-size: 11px;
    color: var(--muted);

    margin: 0;
}

.welcome-art {
    font: 800 100px var(--display);

    letter-spacing: -15px;

    color: rgba(var(--accent-rgb), 0.22);

    padding-right: 20px;
}


/* =========================================================
   33. ADMIN STATISTICS
   ========================================================= */

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 13px;

    margin: 20px 0;
}

.admin-stats > div {
    padding: 18px;

    background: var(--paper);

    border: 1px solid var(--line);
    border-radius: 14px;
}

.admin-stats small,
.admin-stats strong,
.admin-stats span {
    display: block;
}

.admin-stats small {
    font-size: 10px;
    color: var(--muted);
}

.admin-stats strong {
    font: 800 26px var(--display);

    margin: 7px 0;
}

.admin-stats span {
    font-size: 9px;
    color: var(--muted);
}


/* =========================================================
   34. WORKSPACE COLUMNS & CARDS
   ========================================================= */

.workspace-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.workspace-card {
    padding: 23px;

    background: var(--paper);

    border: 1px solid var(--line);
    border-radius: 16px;

    margin-bottom: 17px;

    min-width: 0;
}


/* Card Heading */

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 18px;
}

.card-heading h3 {
    font: 750 16px var(--display);
    margin: 0;
}

.card-heading p {
    font-size: 10px;
    color: var(--muted);

    margin: 5px 0 0;
}


/* =========================================================
   35. QUICK ACTIONS
   ========================================================= */

.quick-actions {
    display: grid;
    gap: 9px;
}

.quick-actions button {
    display: grid;
    grid-template-columns: 38px 1fr;

    text-align: left;
    align-items: center;

    column-gap: 11px;

    border: 1px solid var(--line);
    background: var(--paper);

    border-radius: 11px;
    padding: 12px;

    color: var(--ink);
}

.quick-actions button > span {
    grid-row: span 2;

    width: 36px;
    height: 36px;

    border-radius: 10px;

    background: var(--soft);
    color: var(--accent);

    display: grid;
    place-items: center;

    font-size: 18px;
}

.quick-actions b {
    font-size: 11px;
}

.quick-actions small {
    font-size: 9px;
    color: var(--muted);
}


/* =========================================================
   36. COMPACT LISTS & CONTENT ROWS
   ========================================================= */

.compact-list,
.content-list,
.topic-manager {
    display: grid;
    gap: 8px;
}


/* Compact Row */

.compact-row,
.content-row,
.topic-row {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px;

    border: 1px solid var(--line);
    border-radius: 11px;

    min-width: 0;
}


/* Flexible Content Areas */

.compact-row > div,
.content-row-main,
.topic-row-main {
    flex: 1;
    min-width: 0;
}


/* Row Titles */

.compact-row b,
.content-row b,
.topic-row b {
    display: block;

    font-size: 11px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Row Descriptions */

.compact-row small,
.content-row small,
.topic-row small {
    display: block;

    color: var(--muted);
    font-size: 9px;

    margin-top: 4px;
}


/* =========================================================
   37. STATUS CHIPS
   ========================================================= */

.status-chip {
    border-radius: 20px;

    padding: 4px 8px;

    font-size: 9px;
    font-weight: 800;

    background: var(--soft);
    color: var(--muted);

    white-space: nowrap;
}

.status-chip.published {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}


/* =========================================================
   38. ROW ACTIONS & MINI BUTTONS
   ========================================================= */

.row-actions {
    display: flex;
    gap: 5px;

    flex-shrink: 0;
}

.mini-button {
    border: 1px solid var(--line);

    background: var(--paper);

    border-radius: 8px;
    padding: 6px 8px;

    font-size: 10px;
    color: var(--muted);
}

.mini-button:hover {
    color: var(--accent);
    border-color: var(--accent);
}


/* Button Rows */

.button-row {
    display: flex;
    gap: 7px;

    flex-wrap: wrap;
}


/* =========================================================
   39. ADMIN SEARCH & INLINE ADD FORMS
   ========================================================= */

.admin-search {
    width: 100%;
    margin-bottom: 15px;
}


/* Inline Add Form */

.inline-add {
    display: grid;
    grid-template-columns: 1.1fr 1.5fr 1fr auto;
    gap: 8px;

    margin-bottom: 20px;
}

.inline-add input,
.inline-add select {
    width: 100%;
    font-size: 11px;
}


/* =========================================================
   40. FOLDER IMPORT
   ========================================================= */

.folder-import {
    margin-top: 24px;
    padding: 20px;

    border: 1px dashed var(--line);
    border-radius: 13px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.folder-import h4 {
    margin: 0 0 5px;
    font-size: 12px;
}

.folder-import p {
    font-size: 10px;
    color: var(--muted);

    margin: 0;
    max-width: 600px;
}


/* =========================================================
   41. SETTINGS GRID
   ========================================================= */

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px;
}

.wide-field {
    grid-column: 1 / -1;
}


/* Form Actions */

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 8px;
}

.form-spacer {
    flex: 1;
}


/* =========================================================
   42. PROFILE PREVIEW
   ========================================================= */

.profile-preview {
    margin-top: 22px;

    border-top: 1px solid var(--line);

    padding-top: 22px;
}

.profile-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;

    padding: 18px;

    border: 1px solid var(--line);
    border-radius: 14px;
}

.profile-card img {
    width: 90px;
    height: 90px;

    border-radius: 14px;
    object-fit: cover;
}

.profile-card h4 {
    margin: 0;
}

.profile-card p {
    font-size: 11px;
    color: var(--muted);
}


/* =========================================================
   43. SUBHEADINGS & DEVELOPER TILES
   ========================================================= */

.subheading {
    font: 750 15px var(--display);

    margin: 28px 0 13px;
}


/* Developer Grid */

.developer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 13px;
}

.developer-tile {
    border: 1px solid var(--line);
    border-radius: 13px;

    padding: 18px;
}

.developer-tile > span {
    font: 700 10px 'DM Mono', monospace;
    color: var(--accent);
}

.developer-tile h4 {
    margin: 10px 0 5px;
    font-size: 13px;
}

.developer-tile p {
    font-size: 10px;
    color: var(--muted);

    min-height: 48px;
}


/* =========================================================
   44. DANGER ZONE
   ========================================================= */

.danger-zone {
    border-top: 1px solid var(--line);

    margin-top: 24px;
    padding-top: 20px;
}

.danger-zone h4 {
    font-size: 12px;
    margin-bottom: 4px;
}

.danger-zone p {
    font-size: 10px;
    color: var(--muted);
}


/* =========================================================
   PART 3 OF 3
   EDITOR, NESTED NAVIGATION, RESPONSIVE LAYOUTS & UTILITIES
   ========================================================= */


/* =========================================================
   45. EDITOR DIALOG
   ========================================================= */

.editor-dialog {
    width: min(1180px, calc(100% - 24px));
}

.editor-dialog .dialog-body {
    max-height: 75vh;
}


/* Editor Form */

.editor-form {
    display: grid;
    gap: 15px;
}


/* Two-Column Editor Layout */

.editor-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}


/* =========================================================
   46. EDITOR TOOLBAR
   ========================================================= */

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;

    border-bottom: 1px solid var(--line);

    padding-bottom: 10px;
}

.editor-toolbar > span {
    font-size: 11px;
    font-weight: 800;

    margin-right: auto;
}


/* File Upload Label */

.file-label {
    cursor: pointer;
}


/* =========================================================
   47. MARKDOWN EDITOR & LIVE PREVIEW
   ========================================================= */

.markdown-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}


/* Markdown Textarea */

.markdown-editor-grid textarea {
    min-height: 380px;

    font: 12px/1.7 'DM Mono', monospace;
}


/* Preview Pane */

.preview-pane {
    border: 1px solid var(--line);
    border-radius: 10px;

    padding: 15px;

    min-height: 380px;
    max-height: 530px;

    overflow: auto;
}


/* Preview Label */

.preview-label {
    font-size: 9px;
    letter-spacing: 1.5px;

    color: var(--muted);
    font-weight: 800;

    margin-bottom: 15px;
}


/* Preview Typography */

.preview-pane .markdown-body {
    font-size: 12px;
}

.preview-pane .markdown-body h1 {
    font-size: 23px;
}

.preview-pane .markdown-body h2 {
    font-size: 18px;
}


/* =========================================================
   48. TOAST NOTIFICATIONS
   ========================================================= */

.toast {
    position: fixed;

    right: 22px;
    bottom: 22px;

    z-index: 100;

    max-width: min(440px, calc(100% - 44px));

    background: #1a2a22;
    color: #fff;

    padding: 13px 18px;

    border-radius: 12px;

    box-shadow: var(--shadow);

    font-size: 12px;
}


/* Error Toast */

.toast.error {
    background: #8c3535;
}


/* =========================================================
   49. EMPTY LIST STATE
   ========================================================= */

.empty-list {
    padding: 25px;

    text-align: center;

    color: var(--muted);
    font-size: 11px;
}


/* =========================================================
   50. PUBLIC PROFILE VISIBILITY
   ========================================================= */

.profile-public {
    display: none;
}

.profile-public.visible {
    display: block;
}


/* =========================================================
   51. MOBILE NAVIGATION
   ========================================================= */

.mobile-nav.open {
    display: grid;

    position: sticky;
    top: 82px;

    z-index: 19;

    background: var(--paper);

    padding: 12px 24px;

    border-bottom: 1px solid var(--line);

    gap: 12px;
}

.mobile-nav a {
    font-size: 13px;
    color: var(--muted);
}


/* =========================================================
   52. NESTED FOLDER & FILE NAVIGATION
   ========================================================= */


/* Topic Tree Node */

.topic-tree-node {
    position: relative;
    margin-bottom: 8px;
}


/* Nested Articles Branch */

.nested-articles-branch {
    position: relative;

    margin-left: 24px;
    margin-top: 6px;
    margin-bottom: 6px;

    display: grid;
    gap: 4px;
}


/* Nested Article Rows */

.nested-articles-branch .compact-row {
    padding: 6px 12px;

    background: var(--paper);

    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);

    border-radius: 6px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    transition: background-color 0.15s ease;
}


/* Nested Article Hover */

.nested-articles-branch .compact-row:hover {
    background-color: var(--soft);
}


/* Nested Subtopics Branch */

.nested-subtopics-branch {
    position: relative;
    margin-top: 4px;
}


/* =========================================================
   53. RESPONSIVE LAYOUT — TABLETS & SMALL DESKTOPS
   Screen width: 1000px and below
   ========================================================= */

@media (max-width: 1000px) {

    /* Navigation */

    .topbar {
        gap: 20px;
    }

    .desktop-nav {
        gap: 14px;
    }


    /* Hero */

    .hero {
        grid-template-columns: 1fr 0.8fr;
    }

    .hero-art {
        transform: scale(0.88);
    }


    /* Topics */

    .topic-grid {
        grid-template-columns: repeat(2, 1fr);
    }


    /* Articles */

    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }


    /* About Section */

    .about-section {
        grid-template-columns: 70px 1fr;
    }

    .about-points {
        grid-column: 2;

        border-left: 0;
        padding-left: 0;

        grid-template-columns: repeat(3, 1fr);
    }


    /* Workspace */

    .workspace {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .workspace-columns {
        grid-template-columns: 1fr;
    }


    /* Reader */

    .reader-layout {
        grid-template-columns: minmax(0, 1fr) 200px;
        gap: 30px;
    }
}


/* =========================================================
   54. RESPONSIVE LAYOUT — MOBILE & TABLETS
   Screen width: 760px and below
   ========================================================= */

@media (max-width: 760px) {

    /* General Container */

    .wrap {
        width: min(100% - 32px, 600px);
    }


    /* Navigation Bar */

    .topbar {
        height: 72px;

        padding: 0 16px;
        gap: 12px;
    }

    .desktop-nav,
    .top-actions #openPublicSettings {
        display: none;
    }

    .top-actions {
        margin-left: auto;
    }

    .mobile-menu {
        display: block;
    }

    .top-actions .button {
        padding: 9px 12px;
    }


    /* Brand */

    .brand strong {
        font-size: 16px;
    }

    .brand small {
        font-size: 9px;
    }

    .brand-symbol {
        width: 38px;
        height: 38px;
    }


    /* Mobile Navigation */

    .mobile-nav.open {
        top: 72px;
    }


    /* Hero */

    .hero {
        padding-top: 54px;

        grid-template-columns: 1fr;
        gap: 5px;
    }

    .hero h1 {
        font-size: 47px;
        letter-spacing: -2px;
    }

    .hero-art {
        height: 330px;

        transform: scale(0.84);

        margin-top: -4px;
    }


    /* Metrics */

    .metrics {
        grid-template-columns: repeat(3, 1fr);

        padding: 17px 14px;
        gap: 10px;
    }

    .metrics > div:not(.metrics-note) {
        display: flex;
        flex-direction: column;
        gap: 0;

        padding-left: 10px;
    }

    .metrics strong {
        font-size: 21px;
    }

    .metrics-note {
        grid-column: 1 / -1;

        justify-content: flex-start;

        border-top: 1px solid var(--line);

        padding-top: 13px;
    }


    /* General Sections */

    .section {
        padding-top: 68px;
        padding-bottom: 65px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }


    /* Topic & Article Grids */

    .topic-grid,
    .article-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }


    /* Topic Cards */

    .topic-card {
        padding: 15px;
        min-height: 180px;
    }

    .topic-icon {
        margin-bottom: 13px;
    }

    .topic-card h3 {
        font-size: 13px;
    }

    .topic-card p {
        font-size: 10px;
    }


    /* Article Cards */

    .article-card h3 {
        font-size: 14px;
    }

    .article-card-body {
        padding: 13px;
    }

    .article-cover {
        height: 90px;
    }


    /* Article List Controls */

    .list-controls {
        width: 100%;
    }

    .list-controls select {
        flex: 1;
        min-width: 0;
    }


    /* About Section */

    .about-section {
        grid-template-columns: 1fr;
        gap: 10px;

        padding-top: 65px;
        padding-bottom: 65px;
    }

    .about-mark {
        font-size: 56px;
    }

    .about-points {
        grid-column: auto;

        grid-template-columns: 1fr;

        border-top: 1px solid var(--line);

        padding-top: 20px;
        margin-top: 10px;
    }


    /* Footer */

    .footer-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .footer-links {
        gap: 15px;
    }

    .footer-bottom {
        gap: 10px;
        flex-wrap: wrap;
    }


    /* Article Reader */

    .reader-layout {
        grid-template-columns: 1fr;
    }

    .reader-aside {
        display: none;
    }

    .reader-article h1 {
        font-size: 34px;
    }


    /* Markdown Images */

    .markdown-body img {
        max-width: 100%;

        float: none;
        display: block;

        margin: 15px auto;
    }


    /* Workspace Layout */

    .workspace {
        grid-template-columns: 1fr;
    }

    .workspace-sidebar {
        min-height: auto;

        padding: 14px;

        position: sticky;
        top: 0;

        z-index: 30;

        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .workspace-sidebar > .brand {
        padding: 0 5px 12px;
    }


    /* Hide User Information on Mobile */

    .workspace-user {
        display: none;
    }


    /* Horizontal Workspace Navigation */

    .workspace-nav {
        display: flex;

        overflow-x: auto;

        padding-bottom: 2px;
    }

    .workspace-nav-item {
        width: auto;

        white-space: nowrap;

        padding: 9px 10px;
    }

    .workspace-nav-item span {
        font-size: 10px;
    }


    /* Workspace Sidebar Bottom */

    .sidebar-bottom {
        display: flex;

        margin-top: 10px;
        padding-top: 8px;
    }

    .sidebar-bottom .workspace-nav-item {
        flex: 1;
    }


    /* Workspace Main */

    .workspace-main {
        padding: 20px 13px;
    }

    .workspace-top {
        align-items: flex-start;
    }

    .workspace-top h1 {
        font-size: 24px;
    }

    .server-status {
        display: none;
    }


    /* Admin Statistics */

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }


    /* Welcome Banner */

    .welcome-banner {
        padding: 20px;
    }

    .welcome-banner h2 {
        font-size: 20px;
    }

    .welcome-art {
        font-size: 60px;
    }


    /* Workspace Cards */

    .workspace-card {
        padding: 16px;
    }

    .card-heading {
        align-items: flex-start;
        flex-direction: column;
    }


    /* Inline Add Forms */

    .inline-add {
        grid-template-columns: 1fr;
    }


    /* Folder Import */

    .folder-import {
        align-items: flex-start;
        flex-direction: column;
    }


    /* Settings & Editor Grids */

    .settings-grid,
    .markdown-editor-grid,
    .editor-two-col {
        grid-template-columns: 1fr;
    }

    .wide-field {
        grid-column: auto;
    }


    /* Developer Tiles */

    .developer-grid {
        grid-template-columns: 1fr;
    }

    .developer-tile p {
        min-height: 0;
    }


    /* Markdown Editor */

    .markdown-editor-grid textarea {
        min-height: 280px;
    }

    .preview-pane {
        min-height: 260px;
    }


    /* Editor Dialog */

    .editor-dialog .dialog-body {
        max-height: 70vh;
    }


    /* Content Rows */

    .content-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .content-row-main {
        min-width: 55%;
    }

    .row-actions {
        margin-left: auto;
    }


    /* Dialogs */

    .dialog-head {
        padding: 20px;
    }

    .dialog-body {
        padding: 18px;
    }

    .auth-dialog .dialog-body {
        padding: 18px;
    }


    /* Related Articles */

    .related-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   55. RESPONSIVE LAYOUT — SMALL MOBILE DEVICES
   Screen width: 400px and below
   ========================================================= */

@media (max-width: 400px) {

    /* Single-Column Cards */

    .topic-grid,
    .article-grid {
        grid-template-columns: 1fr;
    }


    /* Smaller Hero Heading */

    .hero h1 {
        font-size: 40px;
    }


    /* Smaller Hero Illustration */

    .hero-art {
        margin-inline: -35px;
        transform: scale(0.72);
    }


    /* Navigation Buttons */

    .top-actions .button {
        font-size: 10px;
    }


    /* Metrics */

    .metrics > div:not(.metrics-note) {
        padding-left: 5px;
    }

    .metrics span {
        font-size: 9px;
    }
}


/* =========================================================
   56. PRINT STYLES
   ========================================================= */

@media print {

    /* Hide Navigation & Interactive Elements */

    .topbar,
    .footer,
    .reader-actions,
    .reader-aside,
    .back-link,
    .related-wrap {
        display: none !important;
    }


    /* Reader Layout */

    .reader-view {
        display: block !important;

        width: 100%;
        padding: 0;
    }

    .reader-layout {
        display: block;
    }


    /* Print Typography */

    .reader-article h1 {
        font-size: 28px;
    }

    .markdown-body {
        font-size: 11pt;
    }


    /* Print Colors */

    body {
        background: #fff;
        color: #000;
    }
}


/* =========================================================
   57. DEVELOPER SIGN-IN HINT
   ========================================================= */

.developer-signin-hint {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;

    padding: 0.85rem 1rem;

    border: 1px solid var(--line, #d7e4dd);
    border-radius: 12px;

    background: var(--soft, #f2f7f4);
    color: var(--text, #17352a);

    font-size: 0.9rem;

    width: 100%;

    text-align: left;

    cursor: pointer;

    font: inherit;
}


/* Developer Sign-In Heading */

.developer-signin-hint strong {
    font-size: 0.95rem;
}


/* Developer Sign-In Description */

.developer-signin-hint span {
    line-height: 1.45;
}


/* ==========================================================================
   Folder and Nested File Navigation Architecture Extensions
   ========================================================================== */
.topic-tree-node {
    position: relative;
    margin-bottom: 8px;
}
.nested-articles-branch {
    position: relative;
    margin-left: 24px;
    margin-top: 6px;
    margin-bottom: 6px;
    display: grid;
    gap: 4px;
}
.nested-articles-branch .compact-row {
    padding: 6px 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.15s ease;
}
.nested-articles-branch .compact-row:hover {
    background-color: var(--soft);
}
.nested-subtopics-branch {
    position: relative;
    margin-top: 4px;
}
.brand-symbol {
    overflow: hidden;
}
.brand-symbol img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}


/* OpenLearn modular content enhancements */
.source-manager { margin: 22px 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface, #fff); }
.article-main-media { margin: 0 0 1.5rem; }
.article-main-media img { display: block; width: 100%; max-height: 620px; object-fit: contain; border-radius: 14px; }
#readerBody h1 { color: var(--article-h1-color, #183c35); }
#readerBody h2 { color: var(--article-h2-color, #24785b); }
.code-copy-button { position: absolute; top: 8px; right: 8px; border: 1px solid #718096; border-radius: 7px; padding: 5px 9px; color: #f7fafc; background: #28333d; cursor: pointer; font: inherit; font-size: .78rem; }
#readerBody pre, #markdownPreview pre { padding-top: 42px; overflow: auto; }
#switchWorkspaceFromPublic { position: fixed; z-index: 1000; right: 18px; bottom: 18px; box-shadow: 0 8px 28px #0002; }
.announcement { overflow: hidden; }
.announcement #announcementText { display: inline-block; white-space: nowrap; animation: openlearn-marquee 22s linear infinite; }
@keyframes openlearn-marquee { from { transform: translateX(-100%); } to { transform: translateX(100vw); } }
@media (prefers-reduced-motion: reduce) { .announcement #announcementText { animation: none; white-space: normal; } }
#markdownPreview h1 { color: var(--article-h1-color, #183c35); }
#markdownPreview h2 { color: var(--article-h2-color, #24785b); }
