:root {
    /* AK Data Solutions theme (matches the company website) */
    --background: #f5eee1;      /* cream */
    --background-deep: #ebe0cf; /* warmer cream lower on the page */
    --surface: #fffaf2;         /* cards and inputs */
    --surface-light: #f1e7d6;
    --border: #e0d1b6;
    --text: #0b1530;            /* navy */
    --muted: #5a6478;
    --accent: #2ee6c5;          /* teal, as the "Book a call" button */
    --accent-dark: #14b89b;
    --accent-light: #5c61de;    /* blue-violet */
    --brand-teal: #1f7a7a;
    --blue: #1f6feb;
    --success: #18a957;
    --error: #d64545;
}


* {
    box-sizing: border-box;
}


body {

    margin: 0;

    background:
        linear-gradient(
            180deg,
            var(--background) 0%,
            var(--background-deep) 100%
        );

    min-height: 100vh;

    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    min-height: 100vh;
}


.app-shell {

    width: min(
        1100px,
        calc(100% - 32px)
    );

    margin: 0 auto;

    padding: 28px 0 40px;
}


/* Header */

.topbar {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 80px;
}


.brand {

    display: flex;

    align-items: center;

    gap: 14px;
}


.brand-icon {

    width: 42px;

    height: 42px;

    display: grid;

    place-items: center;

    border-radius: 12px;

    background: var(--accent);

    color: white;

    font-size: 22px;

    box-shadow:
        0 0 30px
        rgba(11, 21, 48, 0.25);
}


.brand h1 {

    margin: 0;

    font-size: 18px;

}


.brand p {

    margin: 3px 0 0;

    color: var(--muted);

    font-size: 13px;

}


.system-status {

    display: flex;

    align-items: center;

    gap: 8px;

    color: var(--muted);

    font-size: 13px;

}


.status-dot {

    width: 8px;

    height: 8px;

    border-radius: 50%;

    background: var(--success);

    box-shadow:
        0 0 12px
        rgba(73, 209, 125, 0.7);
}


/* Hero */

.hero {

    max-width: 760px;

    margin-bottom: 36px;
}


.eyebrow,
.section-label {

    color: var(--accent-light);

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 0.16em;
}


.hero h2 {

    margin: 14px 0;

    font-size: clamp(
        40px,
        6vw,
        68px
    );

    line-height: 1.02;

    letter-spacing: -0.04em;
}


.hero h2 span {

    font-family: "Playfair Display", Georgia, serif;

    font-style: italic;

    font-weight: 700;

    letter-spacing: -0.01em;

    background: linear-gradient(90deg, var(--brand-teal), var(--accent-light));

    -webkit-background-clip: text;

    background-clip: text;

    color: transparent;
}


.hero-text {

    color: var(--muted);

    font-size: 17px;

    line-height: 1.7;

    max-width: 650px;
}


/* Research Input */

.research-card,
.result-card {

    background:
        rgba(255, 250, 242, 0.92);

    border: 1px solid var(--border);

    border-radius: 20px;

    padding: 24px;

    backdrop-filter: blur(16px);

    box-shadow:
        0 20px 70px
        rgba(11, 21, 48, 0.08);
}


.research-card label {

    display: block;

    margin-bottom: 12px;

    font-size: 13px;

    font-weight: 600;
}


textarea {

    width: 100%;

    min-height: 150px;

    resize: vertical;

    border: 1px solid var(--border);

    border-radius: 14px;

    background: var(--surface);

    color: var(--text);

    padding: 18px;

    font: inherit;

    font-size: 16px;

    line-height: 1.6;

    outline: none;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}


textarea:focus {

    border-color: var(--accent);

    box-shadow:
        0 0 0 3px
        rgba(46, 230, 197, 0.25);
}


.input-footer {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-top: 14px;
}


#characterCount {

    color: var(--muted);

    font-size: 12px;
}


button {

    border: 0;

    border-radius: 12px;

    padding: 13px 20px;

    background: var(--accent);

    color: var(--text);

    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s,
        opacity 0.2s,
        box-shadow 0.2s;
}


button:hover {

    transform: translateY(-1px);

    box-shadow:
        0 10px 30px
        rgba(46, 230, 197, 0.35);
}


button:disabled {

    opacity: 0.55;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;
}


/* Capabilities */

.capabilities {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 12px;

    margin: 14px 0 30px;
}


.capability {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 16px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 14px;
}


.capability-icon {

    width: 32px;

    height: 32px;

    display: grid;

    place-items: center;

    border-radius: 9px;

    background: var(--surface-light);

    color: var(--accent-light);
}


.capability strong {

    display: block;

    font-size: 13px;
}


.capability small {

    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
}


/* Results */

.result-card {

    margin-top: 18px;
}


.section-heading {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;
}


.section-heading h3 {

    margin: 7px 0 0;

    font-size: 22px;
}


.progress-line {

    height: 5px;

    overflow: hidden;

    background: var(--surface-light);

    border-radius: 99px;
}


.progress-fill {

    width: 35%;

    height: 100%;

    background: var(--accent);

    border-radius: inherit;

    animation:
        progressMove 1.4s
        ease-in-out infinite alternate;
}


@keyframes progressMove {

    from {
        width: 20%;
    }

    to {
        width: 85%;
    }
}


.research-status {

    margin-top: 14px;

    color: var(--muted);

    font-size: 14px;
}


.spinner {

    width: 20px;

    height: 20px;

    border: 2px solid var(--border);

    border-top-color: var(--accent);

    border-radius: 50%;

    animation:
        spin 0.8s linear infinite;
}


@keyframes spin {

    to {
        transform: rotate(360deg);
    }
}


.report {

    color: var(--text);

    font-size: 15px;

    line-height: 1.8;

    white-space: pre-wrap;
}


.error-message {

    margin-top: 18px;

    padding: 14px 16px;

    border: 1px solid
        rgba(214, 69, 69, 0.3);

    background:
        rgba(214, 69, 69, 0.06);

    color: var(--error);

    border-radius: 12px;

    font-size: 14px;
}


.hidden {

    display: none;
}


footer {

    margin-top: 50px;

    text-align: center;

    color: var(--muted);

    font-size: 12px;
}


@media (max-width: 760px) {

    .topbar {

        margin-bottom: 50px;
    }


    .capabilities {

        grid-template-columns:
            repeat(2, 1fr);
    }


    .hero h2 {

        font-size: 42px;
    }


    .input-footer {

        align-items: stretch;

        flex-direction: column;

        gap: 12px;
    }


    button {

        width: 100%;
    }

}


@media (max-width: 480px) {

    .capabilities {

        grid-template-columns: 1fr;
    }

}


.activity-list {

    display: flex;

    flex-direction: column;

    gap: 10px;

    margin-top: 18px;
}


.activity-item {

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 10px 12px;

    border-radius: 10px;

    background: var(--surface);

    color: var(--text);

    font-size: 13px;
}


.activity-icon {

    color: var(--accent-light);

    font-weight: 700;
}


.mode-hint {

    margin: -2px 0 14px;

    padding: 10px 14px;

    border-left: 3px solid var(--blue);

    border-radius: 8px;

    background: rgba(31, 111, 235, 0.08);

    color: var(--text);

    font-size: 16px;

    line-height: 1.5;
}


.mode-hint strong {

    color: var(--blue);

    font-size: 19px;

    font-weight: 800;

    padding: 0 2px;
}


/* Brand logo and hero image */

.brand-logo {

    height: 96px;

    width: auto;

    border-radius: 12px;
}


.visually-hidden {

    position: absolute;

    width: 1px;

    height: 1px;

    overflow: hidden;

    clip: rect(0 0 0 0);

    white-space: nowrap;
}


.hero {

    max-width: none;

    display: grid;

    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);

    gap: 40px;

    align-items: center;
}


.hero-image {

    width: 100%;

    height: auto;

    border-radius: 20px;

    border: 1px solid var(--border);

    box-shadow:
        0 20px 60px
        rgba(11, 21, 48, 0.18);
}


@media (max-width: 760px) {

    .brand-logo {

        height: 72px;
    }


    .hero {

        grid-template-columns: 1fr;

        gap: 24px;
    }
}


/* Demo notice */

.demo-banner {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 12px;

    padding: 10px 16px;

    background: var(--text);

    color: #f5eee1;

    font-size: 14px;

    line-height: 1.45;

    text-align: left;
}


.demo-badge {

    flex: none;

    padding: 3px 10px;

    border-radius: 999px;

    background: var(--accent);

    color: var(--text);

    font-size: 12px;

    font-weight: 800;

    letter-spacing: 0.12em;
}


@media (max-width: 760px) {

    .demo-banner {

        align-items: flex-start;

        font-size: 13px;
    }
}


/* Policy link and policy page */

.demo-link {

    margin-left: 6px;

    color: var(--accent);

    font-weight: 700;

    text-decoration: underline;

    text-underline-offset: 3px;
}


footer a {

    color: var(--blue);

    font-weight: 600;
}


a.brand {

    color: inherit;

    text-decoration: none;
}


.policy {

    max-width: 760px;

    margin: 0 auto;

    padding: 32px 36px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 20px;

    font-size: 16px;

    line-height: 1.7;
}


.policy h2 {

    margin: 8px 0 4px;

    font-size: 32px;
}


.policy h3 {

    margin: 28px 0 6px;

    font-size: 19px;
}


.policy a {

    color: var(--blue);

    font-weight: 600;
}


.policy-meta {

    margin-top: 0;

    color: var(--muted);

    font-size: 14px;
}


.policy-note {

    padding: 12px 16px;

    border-left: 3px solid var(--blue);

    border-radius: 8px;

    background: rgba(31, 111, 235, 0.08);
}


@media (max-width: 760px) {

    .policy {

        padding: 22px 18px;
    }
}


/* Deep blue buttons and capability tiles */

:root {

    --brand-blue: #1e40af;
    --brand-blue-dark: #172f80;
}


button {

    background: var(--brand-blue);

    color: #ffffff;
}


button:hover {

    background: var(--brand-blue-dark);

    box-shadow:
        0 10px 30px
        rgba(30, 64, 175, 0.30);
}


.capability {

    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);

    border-color: var(--brand-blue-dark);

    color: #ffffff;
}


.capability-icon {

    background: rgba(255, 255, 255, 0.16);

    color: #ffffff;
}


.capability small {

    color: #c9d6f5;
}


/* Research flow: tiles joined by arrows */

.capabilities {

    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;

    align-items: center;

    gap: 10px;
}


.flow-arrow {

    display: grid;

    place-items: center;

    color: var(--brand-blue);
}


@media (max-width: 900px) {

    .capabilities {

        grid-template-columns: 1fr;

        justify-items: stretch;

        gap: 6px;
    }


    .flow-arrow svg {

        transform: rotate(90deg);
    }
}


/* Blue instead of teal everywhere */

:root {

    --accent: #2563eb;           /* progress bar, spinner, focus ring */
}


.demo-badge {

    background: #3b82f6;

    color: #ffffff;
}


.demo-link {

    color: #93c5fd;
}


textarea:focus {

    border-color: var(--brand-blue);

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.18);
}


/* Green buttons and flow tiles */

:root {

    --brand-green: #369379;      /* 20% lighter */
    --brand-green-dark: #387f6b;

    /* Button color (test) - to go back to green, set these to
       var(--brand-green) and var(--brand-green-dark) */
    --button-color: #E05A47;
    --button-color-dark: #c94a38;
}


button {

    background: var(--button-color);

    color: #ffffff;
}


button:hover {

    background: var(--button-color-dark);

    box-shadow:
        0 10px 30px
        rgba(224, 90, 71, 0.30);
}


.capability {

    background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-dark) 100%);

    border-color: var(--brand-green-dark);
}


.capability small {

    color: #e8f8f1;
}


.flow-arrow {

    color: var(--brand-green);
}


/* Sample questions */

.samples {

    margin: -4px 0 14px;
}


.samples summary {

    cursor: pointer;

    color: var(--muted);

    font-size: 15px;
}


.samples summary span {

    color: var(--blue);

    font-weight: 700;

    text-decoration: underline;

    text-underline-offset: 3px;
}


.samples[open] {

    padding: 12px 16px 16px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: var(--surface);
}


.sample-tip {

    margin: 10px 0 4px;

    color: var(--muted);

    font-size: 13px;
}


.sample-group {

    margin: 14px 0 6px;

    color: var(--text);

    font-size: 13px;

    font-weight: 700;
}


button.sample-q {

    display: block;

    width: 100%;

    margin: 6px 0;

    padding: 9px 12px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: #ffffff;

    color: var(--text);

    font: inherit;

    font-size: 14px;

    font-weight: 500;

    text-align: left;
}


button.sample-q:hover {

    background: rgba(4, 120, 87, 0.08);

    border-color: var(--brand-green);

    box-shadow: none;

    transform: none;
}


/* ---------- Charts ---------- */

.charts {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}

.charts:empty {
    display: none;
}

.chart-card {
    margin: 0;
    padding: 20px;
    background: #ffffff;
    border: 1px solid rgba(11, 21, 48, 0.1);
    border-radius: 14px;
}

.chart-card h4 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: var(--text);
}

.chart-holder {
    position: relative;
    height: 320px;
}

.chart-card figcaption {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #5b6478;
}

@media (max-width: 600px) {
    .chart-holder {
        height: 260px;
    }
}


/* Testing-phase speed note */

.speed-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 14px 0 0;
    padding: 10px 14px;
    border-left: 3px solid var(--button-color);
    border-radius: 8px;
    background: rgba(224, 90, 71, 0.08);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

.speed-note strong {
    color: var(--button-color-dark);
}

.speed-icon {
    flex: none;
}


/* App version (set in version.py) */

.app-version {
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(11, 21, 48, 0.08);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}


/* Report headings and dividers (see renderReport in app.js) */

.report-heading {
    display: inline-block;
    margin-top: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.report-rule {
    border: none;
    border-top: 1px solid rgba(11, 21, 48, 0.12);
    margin: 0;
}

.report strong {
    font-weight: 700;
}


/* Download as Excel button (results header) */

.section-heading .download-button {
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
}

.download-button.hidden {
    display: none;
}


/* Result buttons and the PDF / print layout */

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.print-header {
    display: none;
}

@media print {

    @page {
        margin: 16mm;
    }

    body {
        background: #ffffff !important;
    }

    /* Hide everything except the report */
    .demo-banner,
    .topbar,
    .hero,
    .research-card,
    .capabilities,
    #progressSection,
    #error,
    footer,
    .result-actions {
        display: none !important;
    }

    .app-shell,
    main,
    .result-card {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: #ffffff !important;
        max-width: none !important;
    }

    .print-header {
        display: flex;
        align-items: center;
        gap: 14px;
        margin-bottom: 18px;
        padding-bottom: 12px;
        border-bottom: 2px solid #0b1530;
    }

    .print-header img {
        width: 56px;
        height: 56px;
        border-radius: 8px;
    }

    .print-question {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
        color: #0b1530;
    }

    .print-meta {
        margin: 4px 0 0;
        font-size: 11px;
        color: #5b6478;
    }

    .chart-card {
        break-inside: avoid;
        border: 1px solid #d8dbe3;
    }

    .report {
        font-size: 12px;
        line-height: 1.6;
    }
}
