/* =========================================================
   MINECOFIN PUBLIC BASE CSS
   Full Dark / Light Theme Support
========================================================= */


/* ================================
   THEME VARIABLES
================================ */

:root {
    --public-bg-main: #020b22;
    --public-bg-header: #08152f;
    --public-bg-sidebar: #0a1731;
    --public-bg-card: #071933;
    --public-bg-panel: #061b33;
    --public-bg-soft: rgba(255, 255, 255, 0.02);
    --public-bg-hover: rgba(79, 140, 255, 0.08);
    --public-bg-input: #061b33;

    --public-text-main: #f5f7fb;
    --public-text-heading: #ffffff;
    --public-text-muted: #c6d2e3;
    --public-text-soft: #b7c4d8;

    --public-border: rgba(255, 255, 255, 0.08);
    --public-border-strong: rgba(255, 255, 255, 0.12);
    --public-border-soft: rgba(255, 255, 255, 0.06);

    --public-primary: #00c7c7;
    --public-primary-hover: #00a6a6;

    --public-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);

    --public-success-bg: rgba(34, 197, 94, 0.14);
    --public-success-text: #c9f7d7;
    --public-success-border: rgba(34, 197, 94, 0.35);

    --public-error-bg: rgba(239, 68, 68, 0.14);
    --public-error-text: #ffd4d4;
    --public-error-border: rgba(239, 68, 68, 0.35);

    --public-warning-bg: rgba(245, 158, 11, 0.14);
    --public-warning-text: #ffe4b3;
    --public-warning-border: rgba(245, 158, 11, 0.35);

    --public-info-bg: rgba(59, 130, 246, 0.14);
    --public-info-text: #d7e8ff;
    --public-info-border: rgba(59, 130, 246, 0.35);
}


[data-theme="light"] {
    --public-bg-main: #f4f7fb;
    --public-bg-header: #ffffff;
    --public-bg-sidebar: #ffffff;
    --public-bg-card: #ffffff;
    --public-bg-panel: #eef4fb;
    --public-bg-soft: #f8fafc;
    --public-bg-hover: rgba(0, 199, 199, 0.12);
    --public-bg-input: #ffffff;

    --public-text-main: #0f2747;
    --public-text-heading: #071b33;
    --public-text-muted: #4f6690;
    --public-text-soft: #64748b;

    --public-border: rgba(15, 39, 71, 0.14);
    --public-border-strong: rgba(15, 39, 71, 0.22);
    --public-border-soft: rgba(15, 39, 71, 0.10);

    --public-primary: #00c7c7;
    --public-primary-hover: #00a6a6;

    --public-shadow: 0 14px 30px rgba(15, 39, 71, 0.12);

    --public-success-bg: rgba(34, 197, 94, 0.12);
    --public-success-text: #166534;
    --public-success-border: rgba(34, 197, 94, 0.35);

    --public-error-bg: rgba(239, 68, 68, 0.12);
    --public-error-text: #991b1b;
    --public-error-border: rgba(239, 68, 68, 0.35);

    --public-warning-bg: rgba(245, 158, 11, 0.14);
    --public-warning-text: #92400e;
    --public-warning-border: rgba(245, 158, 11, 0.35);

    --public-info-bg: rgba(59, 130, 246, 0.12);
    --public-info-text: #1d4ed8;
    --public-info-border: rgba(59, 130, 246, 0.35);
}


/* ================================
   GLOBAL RESET
================================ */

* {
    box-sizing: border-box;
}


/*
   Theme changes should happen as one visual state change.
   Normal hover, zoom and interaction transitions remain enabled.
*/
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
    transition: none !important;
}


html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--public-bg-main);
    color: var(--public-text-main);
}


body.public-layout {
    margin: 0;

    font-family: Arial, Helvetica, sans-serif;

    background: var(--public-bg-main);
    color: var(--public-text-main);

    /*
       public_base.js should replace this fallback
       with the real rendered header height.
    */
    padding-top: var(--public-header-height, 76px);
}


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


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


/* =========================================================
   HEADER
   Always one horizontal row:
   LOGO + MENU | TITLE | THEME
========================================================= */

.public-site-header {
    background: var(--public-bg-header);
    border-bottom: 1px solid var(--public-border);

    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    width: 100%;

    height: auto;

    z-index: 10000;
}


/*
   Three-column layout:

   LEFT:
   MINECOFIN Logo + hamburger

   CENTER:
   Rwanda Economic Indicators

   RIGHT:
   Theme button

   Equal left and right columns keep the title
   centered in the viewport.
*/
.public-header-inner {
    width: 100%;
    max-width: none;

    margin: 0;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);

    align-items: center;

    gap: 20px;

    padding: 10px 20px;

    box-sizing: border-box;

    /*
       Important:
       header never changes to a second row.
    */
    white-space: nowrap;
}


/* =========================================================
   HEADER LEFT
   LOGO + SIDEBAR TOGGLE
========================================================= */

.public-brand-wrap {
    display: flex;

    align-items: center;

    gap: 14px;

    justify-self: start;

    min-width: 0;
    max-width: 100%;
}


.public-brand {
    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;

    color: var(--public-text-heading);
}


.public-brand-logo {
    display: flex;

    align-items: center;

    flex: 0 1 auto;

    min-width: 0;
}


/*
   Desktop appearance is intentionally kept
   close to your current working design.
*/
.public-brand-logo img {
    width: 110px;
    height: 45px;

    object-fit: contain;

    display: block;

    max-width: 100%;

    /*
       Preserve your current large-logo
       desktop appearance.
    */
    transform: translateX(-35px) scale(1.5);

    transform-origin: left center;
}


/* =========================================================
   OPTIONAL BRAND TEXT
========================================================= */

.public-brand-text-wrap {
    display: flex;

    flex-direction: column;

    gap: 2px;

    min-width: 0;
}


.public-brand-title {
    font-size: 1.7rem;

    font-weight: 800;

    line-height: 1;

    color: var(--public-text-heading);

    letter-spacing: 0.04em;
}


.public-brand-subtitle {
    font-size: 0.96rem;

    color: var(--public-text-muted);
}


/* =========================================================
   HEADER CENTER
========================================================= */

.public-header-center {
    display: flex;

    justify-content: center;
    align-items: center;

    justify-self: center;

    min-width: 0;
    max-width: 100%;

    text-align: center;

    white-space: nowrap;

    overflow: hidden;
}


.public-header-center p {
    margin: 0;

    color: var(--public-text-heading);

    font-size: 1.8rem !important;

    font-weight: 700;

    line-height: 1.15;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================================================
   HEADER RIGHT
========================================================= */

.public-header-actions {
    display: flex;

    align-items: center;
    justify-content: flex-end;

    justify-self: end;

    gap: 10px;

    min-width: 0;

    white-space: nowrap;
}


/* ================================
   HEADER BUTTONS
================================ */

.sidebar-toggle,
.theme-toggle {
    flex: 0 0 auto;

    background: var(--public-bg-card);

    color: var(--public-text-main);

    border: 1px solid var(--public-border-strong);

    cursor: pointer;

    white-space: nowrap;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}


.sidebar-toggle {
    padding: 6px 9px;

    font-size: 0.85rem;

    line-height: 1;

    border-radius: 8px;
}


.theme-toggle {
    border-radius: 999px;

    padding: 4px 8px;

    font-size: 0.7rem;

    font-weight: 600;

    line-height: 1.2;
}


.sidebar-toggle:hover,
.theme-toggle:hover {
    background: var(--public-primary);

    color: #001f33;

    border-color: var(--public-primary);
}


/* ================================
   TOP NAVIGATION
================================ */

.public-top-nav {
    display: flex;

    gap: 18px;

    flex-wrap: wrap;

    justify-content: flex-end;
}


.public-top-nav a {
    color: var(--public-text-main);

    font-size: 0.95rem;
}


.public-top-nav a:hover {
    color: var(--public-text-heading);
}


/* ================================
   LAYOUT
================================ */

.public-shell {
    display: grid;

    grid-template-columns: 250px 1fr;

    min-height: calc(100vh - 140px);

    background: var(--public-bg-main);

    transition: grid-template-columns 0.2s ease;
}


.public-shell.sidebar-collapsed {
    grid-template-columns: 0 1fr;
}


.public-sidebar {
    background: var(--public-bg-sidebar);

    border-right: 1px solid var(--public-border-soft);

    overflow: hidden;

    transition:
        width 0.2s ease,
        opacity 0.2s ease;
}


.public-sidebar.collapsed {
    width: 0;

    opacity: 0;

    border-right: none;
}


.public-sidebar-inner {
    padding: 22px 18px;
}


.public-sidebar-inner h3 {
    margin: 0 0 16px;

    font-size: 1rem;

    color: var(--public-text-heading);
}


.public-sidebar-nav {
    display: grid;

    gap: 10px;
}


.sidebar-link {
    display: block;

    padding: 10px 12px;

    border-radius: 10px;

    color: var(--public-text-muted);

    background: var(--public-bg-soft);

    border: 1px solid transparent;

    transition: all 0.2s ease;
}


.sidebar-link:hover {
    color: var(--public-text-heading);

    background: var(--public-bg-hover);

    border-color: var(--public-border-soft);
}


.sidebar-link.active,
.sidebar-link[aria-current="page"] {
    color: #001f33;

    background: var(--public-primary);

    border-color: var(--public-primary);
}


.public-page-wrapper {
    min-width: 0;

    background: var(--public-bg-main);

    color: var(--public-text-main);
}


/* ================================
   MESSAGES
================================ */

.public-message-container {
    width: min(1240px, 96%);

    margin: 18px auto 0;
}


.public-message {
    margin-bottom: 10px;

    padding: 12px 14px;

    border-radius: 10px;

    font-size: 0.95rem;

    line-height: 1.5;
}


.public-message.success {
    background: var(--public-success-bg);

    color: var(--public-success-text);

    border: 1px solid var(--public-success-border);
}


.public-message.error {
    background: var(--public-error-bg);

    color: var(--public-error-text);

    border: 1px solid var(--public-error-border);
}


.public-message.warning {
    background: var(--public-warning-bg);

    color: var(--public-warning-text);

    border: 1px solid var(--public-warning-border);
}


.public-message.info {
    background: var(--public-info-bg);

    color: var(--public-info-text);

    border: 1px solid var(--public-info-border);
}


/* ================================
   GENERAL COMPONENT SUPPORT
================================ */

.card,
.public-card,
.dashboard-card,
.indicator-card,
.metric-card,
.summary-card,
.kpi-card,
.stat-card,
.filter-card,
.filters-card,
.filter-panel,
.filters-panel,
.dashboard-filters,
.filter-box,
.table-card,
.chart-card,
.content-card,
.dataset-card,
.dataset-section,
.indicator-detail-card,
.indicator-panel,
.details-card,
.series-card,
.result-card,
.analysis-card,
.data-card,
.visual-card,
.indicator-item {
    background: var(--public-bg-card);

    color: var(--public-text-main);

    border-color: var(--public-border);

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


input,
select,
textarea,
.form-control,
.form-select,
.filter-select,
.dashboard-select {
    background: var(--public-bg-input);

    color: var(--public-text-main);

    border: 1px solid var(--public-border);
}


input::placeholder,
textarea::placeholder {
    color: var(--public-text-soft);
}


select option {
    background: var(--public-bg-input);

    color: var(--public-text-main);
}


label,
p,
span,
li,
td,
th {
    color: inherit;
}


h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--public-text-heading);
}


table {
    color: var(--public-text-main);
}


thead,
th {
    background: var(--public-bg-panel);

    color: var(--public-text-heading);
}


tbody tr {
    border-color: var(--public-border-soft);
}


tbody tr:hover {
    background: var(--public-bg-hover);
}


/* ================================
   FOOTER
================================ */

.public-site-footer {
    background: var(--public-bg-header);

    border-top: 1px solid var(--public-border);
}


.public-footer-inner {
    width: min(1280px, 96%);

    margin: 0 auto;

    padding: 20px 0;

    display: flex;

    justify-content: space-between;

    gap: 16px;

    flex-wrap: wrap;

    align-items: flex-start;
}


.public-footer-inner p {
    margin: 6px 0 0;

    color: var(--public-text-soft);

    line-height: 1.6;
}


.public-footer-links {
    display: flex;

    gap: 16px;

    flex-wrap: wrap;
}


.public-footer-links a {
    color: var(--public-text-main);
}


.public-footer-links a:hover {
    color: var(--public-text-heading);
}


/* =========================================================
   LIGHT MODE DASHBOARD FIXES
   These override dashboard-specific hardcoded dark styles
========================================================= */

[data-theme="light"] body,
[data-theme="light"] .public-layout,
[data-theme="light"] .public-shell,
[data-theme="light"] .public-page-wrapper,
[data-theme="light"] .public-dashboard,
[data-theme="light"] .dashboard-page,
[data-theme="light"] .dashboard-content,
[data-theme="light"] .dashboard-wrapper,
[data-theme="light"] .macro-dashboard,
[data-theme="light"] .tax-dashboard,
[data-theme="light"] .debt-dashboard {
    background: var(--public-bg-main) !important;

    color: var(--public-text-main) !important;
}


/* Force dashboard text to dark blue in light mode */

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6,
[data-theme="light"] p,
[data-theme="light"] span,
[data-theme="light"] label,
[data-theme="light"] small,
[data-theme="light"] strong,
[data-theme="light"] div,
[data-theme="light"] td,
[data-theme="light"] th {
    color: var(--public-text-main);
}


/* Header and sidebar */

[data-theme="light"] .public-site-header,
[data-theme="light"] .public-sidebar,
[data-theme="light"] .public-site-footer {
    background: var(--public-bg-header) !important;

    color: var(--public-text-main) !important;

    border-color: var(--public-border) !important;
}


[data-theme="light"] .public-sidebar {
    background: var(--public-bg-sidebar) !important;
}


[data-theme="light"] .public-brand-title,
[data-theme="light"] .public-header-center p {
    color: var(--public-text-heading) !important;
}


/* Sidebar links */

[data-theme="light"] .sidebar-link {
    color: var(--public-text-muted) !important;

    background: transparent !important;
}


[data-theme="light"] .sidebar-link:hover,
[data-theme="light"] .sidebar-link.active,
[data-theme="light"] .sidebar-link[aria-current="page"] {
    color: #001f33 !important;

    background: rgba(0, 199, 199, 0.16) !important;

    border-color: rgba(0, 199, 199, 0.45) !important;
}


/* Muted labels */

[data-theme="light"] .muted,
[data-theme="light"] .text-muted,
[data-theme="light"] .card-subtitle,
[data-theme="light"] .metric-subtitle,
[data-theme="light"] .indicator-subtitle,
[data-theme="light"] .latest-period,
[data-theme="light"] .date-range,
[data-theme="light"] .unit-label,
[data-theme="light"] .filter-label,
[data-theme="light"] .label,
[data-theme="light"] .subtitle {
    color: var(--public-text-muted) !important;
}


/* Filter panels */

[data-theme="light"] .filter-panel,
[data-theme="light"] .filters-panel,
[data-theme="light"] .dashboard-filters,
[data-theme="light"] .filter-card,
[data-theme="light"] .filters-card,
[data-theme="light"] .filter-box {
    background: var(--public-bg-card) !important;

    color: var(--public-text-main) !important;

    border: 1px solid var(--public-border) !important;

    box-shadow: var(--public-shadow) !important;
}


/* Dropdowns, inputs, selects */

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="light"] .form-control,
[data-theme="light"] .form-select,
[data-theme="light"] .filter-select,
[data-theme="light"] .dashboard-select {
    background: #ffffff !important;

    color: var(--public-text-main) !important;

    border: 1px solid var(--public-border-strong) !important;
}


[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: var(--public-text-soft) !important;
}


[data-theme="light"] select option {
    background: #ffffff !important;

    color: var(--public-text-main) !important;
}


/* Buttons */

[data-theme="light"] .btn,
[data-theme="light"] button {
    color: var(--public-text-main);
}


[data-theme="light"] .btn-primary,
[data-theme="light"] .apply-btn,
[data-theme="light"] .active-tab,
[data-theme="light"] .tab-button.active {
    background: var(--public-primary) !important;

    color: #001f33 !important;

    border-color: var(--public-primary) !important;
}


[data-theme="light"] .reset-btn,
[data-theme="light"] .btn-secondary {
    background: transparent !important;

    color: var(--public-text-muted) !important;

    border-color: transparent !important;
}


/* Summary cards */

[data-theme="light"] .card,
[data-theme="light"] .public-card,
[data-theme="light"] .dashboard-card,
[data-theme="light"] .indicator-card,
[data-theme="light"] .metric-card,
[data-theme="light"] .summary-card,
[data-theme="light"] .kpi-card,
[data-theme="light"] .stat-card {
    background: var(--public-bg-card) !important;

    color: var(--public-text-main) !important;

    border: 1px solid var(--public-border) !important;

    box-shadow: var(--public-shadow) !important;
}


/* Card titles and values */

[data-theme="light"] .card-title,
[data-theme="light"] .indicator-title,
[data-theme="light"] .metric-title,
[data-theme="light"] .summary-title,
[data-theme="light"] .stat-title {
    color: var(--public-text-muted) !important;
}


[data-theme="light"] .card-value,
[data-theme="light"] .indicator-value,
[data-theme="light"] .metric-value,
[data-theme="light"] .summary-value,
[data-theme="light"] .stat-value,
[data-theme="light"] .value,
[data-theme="light"] .number {
    color: var(--public-text-heading) !important;
}


/* Chart section outer containers */

[data-theme="light"] .chart-section,
[data-theme="light"] .charts-section,
[data-theme="light"] .chart-wrapper,
[data-theme="light"] .chart-container,
[data-theme="light"] .chart-card,
[data-theme="light"] .indicator-detail-card,
[data-theme="light"] .indicator-panel,
[data-theme="light"] .details-card,
[data-theme="light"] .dataset-card,
[data-theme="light"] .dataset-section {
    background: var(--public-bg-card) !important;

    color: var(--public-text-main) !important;

    border: 1px solid var(--public-border) !important;

    box-shadow: var(--public-shadow) !important;
}


/* Inner chart boxes */

[data-theme="light"] .chart-box,
[data-theme="light"] .chart-area,
[data-theme="light"] .chart-body,
[data-theme="light"] .plot-container,
[data-theme="light"] .table-preview,
[data-theme="light"] .chart-preview,
[data-theme="light"] .indicator-chart,
[data-theme="light"] .indicator-table {
    background: var(--public-bg-soft) !important;

    color: var(--public-text-main) !important;

    border-color: var(--public-border) !important;
}


/* Dark cards holding charts */

[data-theme="light"] .series-card,
[data-theme="light"] .result-card,
[data-theme="light"] .analysis-card,
[data-theme="light"] .data-card,
[data-theme="light"] .visual-card,
[data-theme="light"] .indicator-item {
    background: #ffffff !important;

    color: var(--public-text-main) !important;

    border: 1px solid var(--public-border) !important;
}


/* Tables */

[data-theme="light"] table,
[data-theme="light"] thead,
[data-theme="light"] tbody,
[data-theme="light"] tr,
[data-theme="light"] td,
[data-theme="light"] th {
    color: var(--public-text-main) !important;

    border-color: var(--public-border) !important;
}


[data-theme="light"] thead,
[data-theme="light"] th {
    background: var(--public-bg-panel) !important;

    color: var(--public-text-heading) !important;
}


[data-theme="light"] tbody tr {
    background: #ffffff !important;
}


[data-theme="light"] tbody tr:hover {
    background: #f1f7fc !important;
}


/* Download / chart buttons */

[data-theme="light"] .download-btn,
[data-theme="light"] .chart-toggle-btn,
[data-theme="light"] .table-toggle-btn,
[data-theme="light"] .preview-btn,
[data-theme="light"] .export-btn {
    background: #ffffff !important;

    color: var(--public-text-main) !important;

    border: 1px solid var(--public-border) !important;
}


[data-theme="light"] .download-btn:hover,
[data-theme="light"] .chart-toggle-btn:hover,
[data-theme="light"] .table-toggle-btn:hover,
[data-theme="light"] .preview-btn:hover,
[data-theme="light"] .export-btn:hover {
    background: var(--public-primary) !important;

    color: #001f33 !important;

    border-color: var(--public-primary) !important;
}


/* Tabs: Macro / Debt / Tax */

[data-theme="light"] .dashboard-tabs,
[data-theme="light"] .tabs,
[data-theme="light"] .tab-list {
    background: transparent !important;
}


[data-theme="light"] .dashboard-tabs a,
[data-theme="light"] .tabs a,
[data-theme="light"] .tab-button,
[data-theme="light"] .tab-link {
    color: var(--public-text-muted) !important;

    background: transparent !important;

    border-color: transparent !important;
}


[data-theme="light"] .dashboard-tabs a.active,
[data-theme="light"] .tabs a.active,
[data-theme="light"] .tab-button.active,
[data-theme="light"] .tab-link.active {
    color: #001f33 !important;

    background: var(--public-primary) !important;

    border-color: var(--public-primary) !important;
}


/* ApexCharts support */

[data-theme="light"] .apexcharts-text,
[data-theme="light"] .apexcharts-title-text,
[data-theme="light"] .apexcharts-legend-text,
[data-theme="light"] .apexcharts-xaxis-label,
[data-theme="light"] .apexcharts-yaxis-label {
    fill: var(--public-text-main) !important;

    color: var(--public-text-main) !important;
}


[data-theme="light"] .apexcharts-gridline {
    stroke: #d7dee8 !important;
}


/* Chart.js support */

[data-theme="light"] canvas,
[data-theme="light"] .chartjs-render-monitor,
[data-theme="light"] .chart-legend,
[data-theme="light"] .legend,
[data-theme="light"] .legend-label {
    color: var(--public-text-main) !important;
}


/* =========================================================
   RESPONSIVE HEADER
   IMPORTANT:
   Header stays on ONE ROW at every breakpoint.
========================================================= */


/* =========================================================
   SMALL LAPTOP / LARGE TABLET
   <= 1100px
========================================================= */

@media (max-width: 1100px) {

    .public-header-inner {
        /*
           Keep the same three-column layout.
           Do NOT move the title to another row.
        */
        grid-template-columns:
            minmax(0, 1fr)
            auto
            minmax(0, 1fr);

        gap: 14px;

        padding: 9px 16px;
    }


    .public-brand-wrap {
        gap: 10px;
    }


    .public-brand-logo img {
        width: 100px;

        height: 42px;

        transform: translateX(-28px) scale(1.4);

        transform-origin: left center;
    }


    .public-header-center p {
        font-size: 1.6rem !important;
    }


    .sidebar-toggle {
        padding: 6px 8px;

        font-size: 0.82rem;
    }


    .theme-toggle {
        padding: 5px 8px;

        font-size: 0.68rem;
    }
}


/* =========================================================
   TABLET
   <= 900px
========================================================= */

@media (max-width: 900px) {

    .public-header-inner {
        gap: 10px;

        padding: 8px 12px;
    }


    .public-brand-wrap {
        gap: 8px;
    }


    .public-brand-logo img {
        width: 92px;

        height: 40px;

        transform: translateX(-22px) scale(1.32);

        transform-origin: left center;
    }


    .public-header-center p {
        font-size: 1.45rem !important;
    }


    .sidebar-toggle {
        padding: 6px 8px;

        font-size: 0.8rem;
    }


    .theme-toggle {
        padding: 5px 8px;

        font-size: 0.66rem;
    }
}


/* =========================================================
   SMALL TABLET
   <= 768px
========================================================= */

@media (max-width: 768px) {

    .public-header-inner {
        gap: 8px;

        padding: 7px 10px;
    }


    .public-brand-wrap {
        gap: 6px;
    }


    /*
       At this size use the logo's real width instead
       of transform scaling so layout calculation
       remains reliable.
    */
    .public-brand-logo img {
        width: 125px;

        height: auto;

        transform: none;
    }


    .public-header-center p {
        font-size: 1.25rem !important;

        letter-spacing: -0.01em;
    }


    .sidebar-toggle {
        padding: 5px 7px;

        font-size: 0.76rem;
    }


    .theme-toggle {
        padding: 5px 7px;

        font-size: 0.64rem;
    }
}


/* =========================================================
   MOBILE
   <= 600px
========================================================= */

@media (max-width: 600px) {

    .public-header-inner {
        /*
           Still exactly:
           LEFT | CENTER | RIGHT
        */
        grid-template-columns:
            minmax(0, 1fr)
            auto
            minmax(0, 1fr);

        gap: 6px;

        padding: 7px 8px;
    }


    .public-brand-wrap {
        gap: 5px;
    }


    .public-brand-logo img {
        width: 95px;

        height: auto;

        transform: none;
    }


    .public-header-center p {
        font-size: 1rem !important;

        line-height: 1.1;

        letter-spacing: -0.01em;
    }


    .sidebar-toggle {
        padding: 5px 6px;

        font-size: 0.72rem;

        border-radius: 7px;
    }


    .theme-toggle {
        padding: 4px 6px;

        font-size: 0.6rem;
    }
}


/* =========================================================
   SMALL MOBILE
   <= 480px
========================================================= */

@media (max-width: 480px) {

    .public-header-inner {
        gap: 4px;

        padding: 6px;
    }


    .public-brand-wrap {
        gap: 4px;
    }


    .public-brand-logo img {
        width: 76px;

        height: auto;
    }


    .public-header-center p {
        font-size: 0.86rem !important;

        font-weight: 700;

        letter-spacing: -0.02em;
    }


    .sidebar-toggle {
        padding: 4px 5px;

        font-size: 0.68rem;
    }


    .theme-toggle {
        padding: 4px 5px;

        font-size: 0.56rem;
    }
}


/* =========================================================
   VERY SMALL MOBILE
   <= 400px
========================================================= */

@media (max-width: 400px) {

    .public-header-inner {
        gap: 3px;

        padding: 5px;
    }


    .public-brand-wrap {
        gap: 3px;
    }


    .public-brand-logo img {
        width: 65px;

        height: auto;
    }


    .public-header-center p {
        font-size: 0.76rem !important;

        letter-spacing: -0.025em;
    }


    .sidebar-toggle {
        padding: 4px;

        font-size: 0.64rem;
    }


    .theme-toggle {
        padding: 4px;

        font-size: 0.52rem;
    }
}


/* =========================================================
   EXTRA SMALL MOBILE
   <= 360px
========================================================= */

@media (max-width: 360px) {

    .public-header-inner {
        gap: 2px;

        padding: 5px 4px;
    }


    .public-brand-logo img {
        width: 58px;

        height: auto;
    }


    .public-header-center p {
        font-size: 0.68rem !important;

        letter-spacing: -0.03em;
    }


    .sidebar-toggle {
        padding: 3px 4px;

        font-size: 0.6rem;
    }


    .theme-toggle {
        padding: 3px 4px;

        font-size: 0.48rem;
    }
}