:root,
body {
    --bg: #ffffff;
    --opposite: #000000;
    --accent-bg: #f6f4ef;
    --text: #1f2d2c;
    --text-light: #4c5f5d;
    --border: #8f9d8a;
    --accent: #176b63;
    --accent-hover: #229181;
    --accent-text: var(--bg);
    --code: #9d2e5d;
    --preformatted: #324443;
    --marked: #b47828;
    --disabled: #ededec;
    /* Derived from --text at 8% opacity */
    --disabled-text: #96a1a0;
    /* Muted text tone */
    --error: #b22b2b;
    --success: #2b8a4b;
    --warning: #d68910;
    --critical: #d35400;

    --sans-font: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir, "Nimbus Sans L", Roboto, "Noto Sans", "Segoe UI", Arial, Helvetica, "Helvetica Neue", sans-serif;
    --heading-font: "Literata", "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir, "Nimbus Sans L", Roboto, "Noto Sans", "Segoe UI", Arial, Helvetica, "Helvetica Neue", sans-serif;
    --mono-font: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;

    --border-radius: 12px;
    --small-radius: 5px;

    /* Light mode specific card accents */
    --card-accent-1: #6b4c9a;
    --card-port-accent: #176b63;
    --card-accent-2: #b24b2b;
}

body.dark-mode {
    --bg: #0e1718;
    --opposite: #ffffff;
    --accent-bg: #182627;
    --text: #d9e5e3;
    --text-light: #9fb4b1;
    --border: #4a605d;
    --accent: #79d2c2;
    --accent-hover: #508b80;
    --accent-text: var(--bg);
    --code: #ff9ec3;
    --preformatted: #c3d4d2;
    --disabled: #1c2628;
    /* Derived from --text at 8% opacity */
    --disabled-text: #546664;
    /* Muted text tone */
    --error: #f88b8b;
    --success: #85d6a3;
    --warning: #f39c12;
    --critical: #e74c3c;

    /* Dark mode specific card accents */
    --card-accent-1: #b4a2f8;
    --card-port-accent: #79d2c2;
    --card-accent-2: #f8b4a2;
}

/* Base Typography */
body {
    font-family: var(--sans-font);
    background-color: var(--bg);
    color: var(--text);
    max-width: 800px;
    margin: 0 auto;
    font-size: 17.6px;
    line-height: 1.5;
    transition: background-color 0.2s ease, color 0.2s ease;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    font-family: var(--heading-font);
    color: var(--text);
    line-height: 1.1;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 0.32px;
    margin-top: 0;
}

h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

h3 {
    font-size: 20px;
    font-weight: 800;
}

h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

p {
    font-size: 17.6px;
    line-height: 1.68;
    margin-bottom: 1.5em;
}

small {
    font-size: 16px;
    color: var(--text-light);
}

a {
    color: var(--accent);
    text-decoration: underline;
    transition: all 0.15s ease;
}

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

/* Layout */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 16px;
    font-size: 16px;
}

nav a {
    color: var(--text);
    text-decoration: none;
    padding: 8px;
    font-weight: 700;
}

header {
    padding: 24px 16px 48px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

header p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

main {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
}

footer {
    border-top: 1px solid var(--border);
    padding: 24px 16px;
    font-size: 14.4px;
    color: var(--text-light);
    text-align: center;
    margin-top: 48px;
}

/* Page load slide-up animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

nav,
header,
main,
footer {
    animation: slideUp 0.3s ease-out both;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg);
    color: var(--text);
    border: 2px dashed var(--border);
    border-radius: 0px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
}

/* Generic Card Styles (Reading/Dashboard) */
.card {
    background: var(--accent-bg);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

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

/* Grid Layouts */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

/* Specific main dashboard card styles */
.card h3 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 4px;
}

.card p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.4;
    flex-grow: 1;
    margin-bottom: 12px;
}

.icon-box {
    width: 36px;
    height: 36px;
    padding-bottom: 0px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--small-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.icon-box svg {
    width: 20px;
    height: 20px;
}

.card:hover .icon-box {
    border-color: var(--accent-hover);
}

.card-action {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    margin-top: auto;
    color: var(--accent);
}

.card-action svg {
    margin-left: 4px;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.card:hover .card-action svg {
    transform: translateX(4px);
}

.card.net:hover .card-action {
    color: var(--card-accent-1);
}

.card.net:hover {
    border-color: var(--card-accent-1);
}

.card.net .icon-box {
    color: var(--card-accent-1);
}

.card.port:hover .card-action {
    color: var(--card-port-accent);
}

.card.port:hover {
    border-color: var(--card-port-accent);
}

.card.port .icon-box {
    color: var(--card-port-accent);
}

.card.read:hover .card-action {
    color: var(--card-accent-2);
}

.card.read:hover {
    border-color: var(--card-accent-2);
}

.card.read .icon-box {
    color: var(--card-accent-2);
}


/* Filter Buttons */
.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
    justify-content: center;
}

.filter-btn {
    background: var(--bg);
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: var(--small-radius);
    padding: 8px 16px;
    cursor: pointer;
    font-family: var(--sans-font);
    font-size: 16px;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    border-color: var(--accent-hover);
    color: var(--text);
}

.filter-btn.active {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
    font-weight: 700;
}

/* Content List specific reading elements */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.card-title-group {
    flex: 1;
}

.card-title {
    margin: 0 0 4px 0;
}

.card-author {
    margin: 0;
    color: var(--text-light);
    font-size: 16px;
}

.badge-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--small-radius);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.badge.jit {
    color: var(--accent);
    border-color: var(--accent);
}

.badge.jic {
    color: var(--text-light);
}

.notes-block {
    font-style: italic;
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    margin: 0;
    color: var(--text);
}

.insights-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--small-radius);
    padding: 16px;
    margin-top: 8px;
}

.insights-list {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
    color: var(--text-light);
}

.insights-list li {
    margin-bottom: 8px;
    font-size: 16px;
}

.insights-list li:last-child {
    margin-bottom: 0;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
    font-size: 14px;
    color: var(--text-light);
    margin-top: 16px;
}

/* Generic Utilities */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-light);
    border: 1px dashed var(--border);
    border-radius: var(--border-radius);
    display: none;
}

.loading {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-light);
}

/* Collapsible Sections */
.collapsible-section summary::-webkit-details-marker {
    display: none;
}

.collapsible-section summary::marker {
    display: none;
    content: '';
}

.collapsible-section summary:hover {
    opacity: 0.8;
}

.collapsible-section[open] .chevron-icon {
    transform: rotate(180deg);
}

/* System Status — ambient glow */
.system-status {
    --glow-color: 180, 120, 40;
    animation: statusGlow 3s ease-in-out infinite;
    overflow: visible;
    border-color: rgba(180, 120, 40, 0.25);
}

body.dark-mode .system-status {
    --glow-color: 255, 215, 106;
    border-color: rgba(255, 215, 106, 0.25);
}

@keyframes statusGlow {

    0%,
    100% {
        box-shadow:
            0 0 12px rgba(var(--glow-color), 0.15),
            0 0 30px rgba(var(--glow-color), 0.08);
        border-color: var(--border);
    }

    50% {
        box-shadow:
            0 0 20px rgba(var(--glow-color), 0.4),
            0 0 60px rgba(var(--glow-color), 0.18);
        border-color: rgba(var(--glow-color), 0.45);
    }
}

/* ACTIVE badge pulse dot */
@keyframes badgePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.status-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 6px;
    animation: badgePulse 2s ease-in-out infinite;
}

/* ─── Priority Banner ────────────────────────────────────────────── */

.priority-section {
    margin-bottom: 32px;
}

.priority-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.priority-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--marked);
    white-space: nowrap;
}

.priority-section-rule {
    flex: 1;
    height: 1px;
    background: rgba(180, 120, 40, 0.25);
}

body.dark-mode .priority-section-rule {
    background: rgba(255, 215, 106, 0.2);
}

.priority-banner {
    background: var(--accent-bg);
    border: 2px solid var(--marked);
    border-radius: var(--border-radius);
    padding: 20px 24px;
    position: relative;
}

body.dark-mode .priority-banner {
    border-color: rgba(255, 215, 106, 0.6);
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--marked);
    background: rgba(180, 120, 40, 0.1);
    border: 1px solid rgba(180, 120, 40, 0.35);
    padding: 3px 9px;
    border-radius: 4px;
    margin-bottom: 12px;
}

body.dark-mode .priority-badge {
    color: rgba(255, 215, 106, 0.9);
    background: rgba(255, 215, 106, 0.08);
    border-color: rgba(255, 215, 106, 0.3);
}

.priority-banner-title {
    font-family: var(--heading-font);
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.priority-banner-desc {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-light);
    margin: 0 0 14px 0;
}

.priority-banner-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.priority-meta-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 4px;
}

/* Command Center — dashboard priority strip */
.command-center-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.command-card {
    background: var(--accent-bg);
    border: 1px solid rgba(180, 120, 40, 0.35);
    border-radius: var(--border-radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s ease, background 0.2s ease;
}

body.dark-mode .command-card {
    border-color: rgba(255, 215, 106, 0.2);
}

.command-card:hover {
    border-color: var(--marked);
    background: var(--bg);
}

body.dark-mode .command-card:hover {
    border-color: rgba(255, 215, 106, 0.5);
}

.command-card-category {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--marked);
    margin-bottom: 6px;
}

body.dark-mode .command-card-category {
    color: rgba(255, 215, 106, 0.8);
}

.command-card-title {
    font-family: var(--heading-font);
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 6px 0;
    line-height: 1.25;
}

.command-card-desc {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-light);
    margin: 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}