:root {
    --bg: #f9f9fb;
    --surface: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e5e7eb;
    --radius: 12px;
    --max-width: 1200px;
    --surface-border: #e3e8f0;
    --text: #1b1f27;
    --accent-soft: #e8effe;
    --green: #4CAF50;
    --green-soft: #eaf6ea;
    --mono-bg: #10131a;
    --mono-text: #dfe6f3;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

div.main {
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 90%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.iframe-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(255, 255, 255, 0.95));
}

.iframe-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.iframe-url-box,
.iframe-snippet {
    padding: 0.8rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    overflow-x: auto;
}

.iframe-url-box code,
.iframe-snippet code {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
}

.embed-shell {
    width: 100%;
    padding: 1rem;
}

.embed-attribution {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.embed-attribution a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.embed-attribution a:hover {
    text-decoration: underline;
}

.external-script-status {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-align: center;
}

.external-script-status.is-error {
    color: #b42318;
}

/* 2. Navigation */
header {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

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

.logo,
.logo * {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-main);
}

/* 3. Main Dashboard & Sidebar Grid Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding-top: 2rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.main-content {
    min-width: 0;
    width: 100%;
}

/* 4. Hero Section & Large SVG */
.hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 550px;
    margin: 0 auto 2rem;
}

/* Center SVG Container */
.svg-container {
    max-width: 900px;
    margin: 0 auto;
}


/* Section Wrappers */
.content-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

/* 5. Form Styling */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group.full-width {
    grid-column: span 2;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    background-color: var(--bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background-color: var(--surface);
}

.settings-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem 0 0;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-main);
}

.toggle-row input {
    width: auto;
    margin: 0;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.color-control {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.color-control-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
}

.color-control-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.color-control input[type="color"] {
    flex: 1;
    min-height: 3rem;
    padding: 0.25rem;
    background: var(--surface);
    border-radius: calc(var(--radius) - 4px);
}

.color-reset-btn {
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #f8fafc;
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.color-reset-btn:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.export-actions select {
    flex: 1 1 220px;
    max-width: 220px;
}

.export-actions .btn {
    flex-shrink: 0;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    display: inline-block;
    background-color: var(--accent);
    color: #ffffff;
    padding: 0.8rem 1.75rem;
    border: none;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: var(--accent-hover);
}

/* 6. Responsive Table Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.table-responsive th,
.table-responsive td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    white-space: normal;
    word-break: break-word;
}

.table-responsive th,
.table-responsive tfoot td {
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-responsive tr:last-child td {
    border-bottom: none;
}


.table-responsive thead tr:first-child th,
.table-responsive tfoot td {
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}

.table-responsive thead tr:last-child th {
    background: #fafafa;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.table-responsive .status-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.table-responsive .status-active {
    background: #dbeafe;
    color: #1e40af;
}

.table-responsive .status-pending {
    background: #fef3c7;
    color: #92400e;
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

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

    .color-control-label {
        flex-wrap: wrap;
    }

    .export-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .export-actions select,
    .export-actions .btn {
        width: 100%;
        max-width: none;
    }
}

.table-responsive .table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table-responsive th.empty {
    background-color: white !important;
}

.table-responsive th.year {
    font-size: 0.75rem !important;
    padding: 0 !important;
    text-align: center;
    border-top: 1px solid var(--border);
}

.table-responsive td.name {
    max-width: 12rem;
    overflow-wrap: anywhere;
}



/* 8. Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

main {
    padding-bottom: 2rem !important;
}

.badges {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-start;
    padding-bottom: 1rem;
}

.badge {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .5rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #dbeafe;
    color: #1e40af;
    border: none;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.badge:hover {
    color: #dbeafe;
    background-color: #1e40af;
}


/* Map tooltips */

.svgMap-tooltip .svgMap-tooltip-content table tr:has(> td:first-child:empty),
.svgMap-persistent-tooltip .svgMap-tooltip-content table tr:has(> td:first-child:empty) {
    display: none;
}

/* Chart & map display */

.render {
    border-radius: var(--radius);
    padding: 1.4rem;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

#render-preview {
    background: transparent;
}

.map-header {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 1.25rem;
}

.render-heading {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.render-kicker {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.map-header h2 {
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
    text-align: left;
    color: var(--text-main);
    line-height: 1.25;
}

.render-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 38rem;
}

.render-metric-grid {
    display: flex;
    flex-direction: row;
    gap: 0.8rem;
}

.render-metric-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.8rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: calc(var(--radius) - 6px);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
}

.render-chart-shell {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 7rem;
}

.render-metric-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: center;
}

.render-metric-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.render-metric-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.render-map-shell {
    padding: 0.85rem;
    border-radius: calc(var(--radius) - 4px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.render .svg-container {
    max-width: none;
    margin: 0;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.9rem 1.25rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.legend-swatch {
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    flex-shrink: 0;
}

.donut-chart {
    width: min(7rem, 100%);
    aspect-ratio: 1;
    margin: 0 auto;
}

.donut-chart svg {
    display: block;
    width: 100%;
    height: 100%;
}


/* ********************************************************************************** */
/* Documentation                                                                      */
/* ********************************************************************************** */

.documentation {
    margin-top: 2rem;
}

.documentation .doc-hero {
    margin-bottom: 56px;
}

.documentation a {
    color: var(--accent);
    text-decoration: none;
}

.documentation a:hover {
    text-decoration: underline;
}

.documentation a:focus-visible,
.documentation button:focus-visible,
.documentation .copy-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.documentation code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    padding: 0.1em 0.45em;
    border-radius: 5px;
}

.documentation .layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    max-width: 1180px;
    margin: 0 auto;
}

.documentation nav.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 40px 20px;
    border-right: 1px solid var(--surface-border);
    overflow-y: auto;
}



.documentation nav.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 28px;
}

.documentation nav.sidebar .brand .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--green));
    flex-shrink: 0;
}

.documentation nav.sidebar ul {
    list-style: none;
    margin: 0 0 22px 0;
    padding: 0;
}

.documentation nav.sidebar .group-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 8px 2px;
    font-weight: 600;
}


nav.sidebar li a {
    display: block;
    padding: 6px 8px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
}

.documentation nav.sidebar li a:hover {
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}

.documentation .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 5px 11px;
    border-radius: 100px;
    margin-bottom: 18px;
}

.documentation h1 {
    font-size: 2.3rem;
    line-height: 1.15;
    margin: 0 0 14px;
    letter-spacing: -0.02em;
}

.documentation .lead {
    font-size: 1.08rem;
    color: var(--text-muted);
    margin: 0;
}

.documentation section {
    margin-bottom: 64px;
    scroll-margin-top: 24px;
}

.documentation h2 {
    font-size: 1.4rem;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}

.documentation h2 .step-index {
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 8px;
}

.documentation .section-desc {
    color: var(--text-muted);
    margin: 0 0 24px;
    max-width: 680px;
}

.documentation h3 {
    font-size: 1rem;
    margin: 32px 0 14px;
    color: var(--text);
}

/* Code blocks */
.documentation .code-block {
    position: relative;
    background: var(--mono-bg);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0 0 20px;
}

.documentation .code-block .code-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: var(--font-mono);
    font-size: 12px;
    color: #8b95a8;
}

.documentation .code-block pre {
    margin: 0;
    padding: 18px 20px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--mono-text);
}

.documentation .copy-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #dfe6f3;
    font-family: var(--font-sans);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.documentation .copy-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.documentation .copy-btn.copied {
    color: #7CD992;
    border-color: #7CD992;
}

.documentation .token {
    color: #7dd3fc;
}

.documentation .token-string {
    color: #a5e3a5;
}

.documentation .token-comment {
    color: #6b7385;
}


/* Param table */
.documentation .param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    margin-bottom: 8px;
}

.documentation .param-table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 14px 10px;
    border-bottom: 1px solid var(--surface-border);
}

.documentation .param-table td {
    padding: 14px;
    border-bottom: 1px solid var(--surface-border);
    vertical-align: top;
}

.documentation .param-table tr:last-child td {
    border-bottom: none;
}

.documentation .param-name {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
}

.documentation .param-desc {
    color: var(--text-muted);
}

.documentation .param-default {
    font-family: var(--font-mono);
    font-size: 13px;
    white-space: nowrap;
}

.documentation .swatch-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.documentation .swatch {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.documentation .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 100px;
}

.documentation .pill.on {
    background: var(--green-soft);
    color: #2f7a33;
}

.documentation .pill.on::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
}

.documentation .table-wrap {
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    margin-bottom: 12px;
}

.documentation .table-wrap .param-table {
    margin-bottom: 0;
}

.documentation .table-wrap .param-table th {
    padding-top: 14px;
    background: var(--surface);
}

.documentation .note {
    display: flex;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 18px;
}

.documentation .note strong {
    color: var(--text);
}

/* Live preview strip */
.documentation .preview-strip {
    display: flex;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--surface-border);
    margin-top: 8px;
}

.documentation .preview-swatch {
    flex: 1;
    min-width: 0;
    padding: 20px 14px 14px;
    color: rgba(0, 0, 0, 0.55);
    font-family: var(--font-mono);
    font-size: 11px;
}

.documentation .preview-swatch .name {
    display: block;
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 2px;
}


.privacy-page,
.about-page,
.terms-page {
    margin-top: 5rem;
}

.about-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-page>p {
    width: 100%;
    text-align: justify;
    font-size: 1.125rem;
}

.about-page p.author {
    font-weight: bold;
}

.about-page p.company {
    font-style: italic;
    font-size: 1rem;
    ;
}

.about-page hr {
    background-color: lightslategray;
}

.terms-page {
    --text: #1a1a1a;
    --muted: #555;
    --bg: #fff;
    --accent: #1a4d8f;
    --border: #e2e2e2;
    --soft-bg: #f7f9fc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    line-height: 1.65;
    padding: 0;
}

.terms-page .wrap {
    max-width: 840px;
    margin: 0 auto;
    padding: 48px 24px 96px;
}

.terms-page .header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
}

.terms-page .header h1 {
    font-size: 1.9rem;
    margin: 0 0 8px;
}

.terms-page .header p {
    color: var(--muted);
    margin: 0;
    font-size: 0.95rem;
}

.terms-page nav {
    background: var(--soft-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 40px;
}

.terms-page nav h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin: 0 0 10px;
}

.terms-page nav ul {
    margin: 0;
    padding-left: 20px;
    columns: 2;
}

.terms-page nav a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
}

.terms-page nav a:hover {
    text-decoration: underline;
}

.terms-page>div {
    margin-bottom: 44px;
    scroll-margin-top: 20px;
}

.terms-page>div>h2 {
    font-size: 1.3rem;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
    margin-bottom: 16px;
}

.terms-page h3 {
    font-size: 1.05rem;
    margin-top: 24px;
    margin-bottom: 8px;
}

.terms-page p,
.terms-page li {
    font-size: 0.98rem;
    color: #2a2a2a;
}


.terms-page ul {
    padding-left: 22px;
}

.terms-page li {
    margin-bottom: 6px;
}

.terms-page .callout {
    background: var(--soft-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    padding: 14px 18px;
    font-size: 0.9rem;
    color: var(--muted);
    margin: 16px 0;
}

.terms-page .placeholder {
    background: #fff8e6;
    border: 1px solid #f0d78c;
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 600;
    color: #7a5c00;
    font-size: 0.9em;
}

.terms-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.92rem;
}

.terms-page th,
td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.terms-page th {
    background: var(--soft-bg);
    font-weight: 600;
}

.terms-page .footer {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    color: var(--muted);
    font-size: 0.85rem;
}

.terms-page .last-updated {
    font-size: 0.85rem;
    color: var(--muted);
    font-style: italic;
}

.terms-page .content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.terms-page .content > ul {
    width: 100%;
}

/* ********************************************************************************** */
/* Responsive                                                                         */
/* ********************************************************************************** */


/* Mobile Breakpoints */
@media (max-width: 1200px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        /* Collapse sidebar to bottom on tablets/mobile */
    }

}

@media (max-width: 640px) {
    .render {
        padding: 1rem;
    }

    .iframe-card {
        padding: 0.9rem;
    }

    .iframe-url-box,
    .iframe-snippet {
        padding: 0.7rem;
    }

    .content-section {
        padding: 1.5rem;
    }

    .form-grid,
    .settings-grid,
    .color-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .map-header {
        grid-template-columns: 1fr;
    }

    .render-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .legend {
        justify-content: flex-start;
        flex-direction: column;
        align-items: flex-start;
    }

    .render-metric-grid {
        grid-template-columns: 1fr;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 860px) {
    .documentation .layout {
        grid-template-columns: 1fr;
    }

    .documentation nav.sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--surface-border);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }
}