:root {
    --lp-primary: #12AEE2;
    --lp-primary-dark: #0d8bb5;
    --lp-primary-light: #e3f5fc;

    --lp-green: #93C842;
    --lp-green-dark: #79a836;
    --lp-green-light: #eff7e0;

    --lp-orange: #FFAE16;
    --lp-orange-dark: #d68f00;
    --lp-orange-light: #fff3d6;

    --lp-red: #FF4B35;
    --lp-red-dark: #d83824;
    --lp-red-light: #ffe1dc;

    --lp-ink: #16232b;
    --lp-muted: #55707c;
    --lp-bg: #ffffff;
    --lp-surface: #f4fafd;
    --lp-border: #dfeef4;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Open Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--lp-ink);
    background: var(--lp-bg);
    line-height: 1.65;
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .display-1, .display-2, .display-3, .display-4 {
    font-family: 'Titillium Web', 'Open Sans', sans-serif;
    font-weight: 700;
    color: var(--lp-ink);
    letter-spacing: -0.01em;
}

a { color: var(--lp-primary); text-decoration: none; }
a:hover { color: var(--lp-primary-dark); text-decoration: underline; }

.skip-link {
    position: absolute; left: -9999px; top: auto;
    padding: 0.5rem 1rem; background: var(--lp-primary); color: #fff; z-index: 1080;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Header / nav */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--lp-border);
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.navbar-brand {
    display: inline-flex; align-items: center; gap: 0.75rem;
    color: var(--lp-ink) !important; font-size: 1.15rem;
}
.brand-text { font-weight: 700; }
.navbar .nav-link {
    color: var(--lp-ink);
    font-weight: 600;
    padding: 0.5rem 0.95rem;
    margin: 0 0.15rem;
    border-radius: 8px;
    position: relative;
    transition: background-color .15s ease, color .15s ease;
}
.navbar .nav-link:hover, .navbar .nav-link:focus {
    color: var(--lp-primary);
    background: rgba(18, 174, 226, 0.09);
    text-decoration: none;
}
.navbar .nav-link.active {
    color: var(--lp-primary);
    background: rgba(18, 174, 226, 0.09);
}
.navbar .nav-link.active::after {
    content: "";
    position: absolute;
    left: 0.95rem; right: 0.95rem; bottom: 4px;
    height: 2px; border-radius: 2px;
    background: var(--lp-primary);
}
.navbar .nav-link.btn-cta.active::after { display: none; }
@media (max-width: 991.98px) {
    .navbar .nav-link { margin: 0.15rem 0; }
    .navbar .nav-link.active::after { display: none; }
}
.btn-cta {
    background: var(--lp-primary); color: #fff !important;
    padding: 0.5rem 1.1rem !important; border-radius: 999px;
    margin-left: 0.5rem;
}
.btn-cta:hover, .btn-cta:focus { background: var(--lp-primary-dark); }

/* Hero */
.hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(900px 400px at 85% -10%, rgba(18,174,226,0.14), transparent 60%),
        radial-gradient(700px 400px at -10% 110%, rgba(147,200,66,0.14), transparent 60%),
        linear-gradient(180deg, #ffffff 0%, var(--lp-surface) 100%);
    padding: 1.1rem 0 0.85rem;
    border-bottom: 1px solid var(--lp-border);
}
.hero h1 { font-size: clamp(1.65rem, 3vw, 2.65rem); margin-bottom: 0.65rem; }
.hero h1 .accent-1 { color: var(--lp-primary); }
.hero h1 .accent-2 { color: var(--lp-green-dark); }
.hero h1 .accent-3 { color: var(--lp-orange-dark); }
.hero .lead { font-size: 1rem; color: var(--lp-muted); max-width: 760px; margin-bottom: 0; }
.hero .eyebrow {
    display: inline-block; text-transform: uppercase; letter-spacing: 0.12em;
    font-size: 0.8rem; font-weight: 700; color: var(--lp-primary-dark);
    background: var(--lp-primary-light); padding: 0.35rem 0.75rem; border-radius: 999px;
    margin-bottom: 1rem;
}
.hero-image {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow:
        0 20px 45px rgba(18, 174, 226, 0.18),
        0 6px 18px rgba(13, 27, 35, 0.10);
    transform: rotate(0.5deg);
    max-height: 260px;
}
.hero-image img {
    display: block; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover;
}
.hero-image::after {
    content: ""; position: absolute; inset: 0;
    border-radius: 1rem;
    box-shadow: inset 0 0 0 1px rgba(18,174,226,0.15);
    pointer-events: none;
}
@media (max-width: 991.98px) {
    .hero { padding: 1.25rem 0 1.5rem; }
    .hero-image { margin-top: 0.75rem; transform: none; }
    .hero .lead { font-size: 1rem; }
}
@media (max-width: 575.98px) {
    .hero { padding: 1rem 0 1.25rem; }
    .hero h1 { font-size: 1.75rem; }
    .hero .lead { line-height: 1.5; }
    .hero .btn { display: block; width: 100%; margin: 0 0 0.5rem 0 !important; }
}

/* Buttons */
.btn-primary, .btn-primary:visited {
    background: var(--lp-primary); border-color: var(--lp-primary);
    padding: 0.65rem 1.4rem; font-weight: 600; border-radius: 0.4rem;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: var(--lp-primary-dark) !important; border-color: var(--lp-primary-dark) !important;
}
.btn-outline-primary {
    color: var(--lp-primary); border-color: var(--lp-primary); background: transparent;
    padding: 0.65rem 1.4rem; font-weight: 600; border-radius: 0.4rem;
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background: var(--lp-primary); color: #fff; border-color: var(--lp-primary);
}

/* Sections */
section { padding: 2.35rem 0; }
section.alt { background: var(--lp-surface); }
.section-heading { text-align: center; margin-bottom: 2rem; }
.section-heading h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.section-heading p { color: var(--lp-muted); max-width: 720px; margin: 0.5rem auto 0; }
@media (max-width: 575.98px) {
    section { padding: 2rem 0; }
    .section-heading { margin-bottom: 1.5rem; }
}

/* Homepage project fit checker */
.ask-section {
    background:
        linear-gradient(135deg, rgba(147, 200, 66, 0.18), rgba(18, 174, 226, 0.10)),
        var(--lp-green-light);
    border-top: 1px solid color-mix(in srgb, var(--lp-green) 45%, var(--lp-border));
    border-bottom: 1px solid color-mix(in srgb, var(--lp-green) 45%, var(--lp-border));
    padding: 2rem 0;
}
.ask-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.75fr) minmax(300px, 1fr);
    gap: 1.5rem;
    align-items: start;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid color-mix(in srgb, var(--lp-green) 38%, var(--lp-border));
    border-radius: 0.85rem;
    padding: 1.35rem;
    box-shadow: 0 18px 44px rgba(22, 35, 43, 0.10);
}
.ask-copy {
    padding-top: 0.8rem;
}
.ask-copy h2 {
    font-size: clamp(1.6rem, 2.8vw, 2.25rem);
    margin-bottom: 0.45rem;
}
.ask-copy p {
    color: var(--lp-muted);
    font-size: 1.02rem;
    line-height: 1.5;
    margin: 0;
    max-width: 560px;
}
.ask-form {
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--lp-green) 35%, var(--lp-border));
    border-radius: 0.75rem;
    padding: 0.8rem;
    box-shadow: 0 10px 26px rgba(22, 35, 43, 0.08);
}
.ask-form textarea {
    resize: vertical;
    min-height: 4.75rem;
    line-height: 1.45;
}
.ask-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.6rem;
}
.ask-status {
    color: var(--lp-muted);
    font-size: 0.95rem;
}
.ask-answer {
    margin-top: 0.75rem;
    padding: 0.8rem;
    border-left: 4px solid var(--lp-green);
    background: var(--lp-green-light);
    color: var(--lp-ink);
}
.ask-answer p {
    margin: 0 0 0.65rem;
}
.ask-answer p:last-child,
.ask-answer ul:last-child {
    margin-bottom: 0;
}
.ask-answer ul {
    margin: 0 0 0.65rem;
    padding-left: 1.25rem;
}
.ask-answer li {
    margin-bottom: 0.25rem;
}
@media (max-width: 991.98px) {
    .ask-section {
        padding: 1.6rem 0;
    }
    .ask-panel {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.1rem;
        align-items: start;
    }
    .ask-copy {
        padding-top: 0;
    }
    .ask-copy h2 {
        font-size: 1.65rem;
        margin-bottom: 0.35rem;
    }
    .ask-copy p {
        font-size: 0.98rem;
        line-height: 1.5;
    }
    .ask-form {
        margin: 0;
        padding: 0.8rem;
        background: #fff;
        border: 1px solid color-mix(in srgb, var(--lp-green) 35%, var(--lp-border));
        border-radius: 0.6rem;
        box-shadow: 0 8px 20px rgba(22, 35, 43, 0.06);
    }
    .ask-form textarea {
        min-height: 4.75rem;
        font-size: 1rem;
        line-height: 1.45;
        background: #fff;
    }
    .ask-actions {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
        margin-top: 0.6rem;
    }
    .ask-actions .btn {
        width: auto;
        min-width: 6rem;
    }
    .ask-status {
        min-height: 1.35rem;
        text-align: left;
        font-size: 0.9rem;
        align-self: center;
    }
    .ask-answer {
        margin-top: 0.75rem;
        padding: 0.85rem;
        font-size: 0.95rem;
        line-height: 1.5;
        background: #fff;
    }
}

@media (max-width: 575.98px) {
    .ask-panel {
        display: block;
        padding: 1rem;
    }
    .ask-copy h2 {
        font-size: 1.45rem;
    }
    .ask-copy p {
        font-size: 0.95rem;
    }
    .ask-actions {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }
    .ask-actions .btn {
        width: 100%;
    }
    .ask-status {
        text-align: center;
    }
}

/* Service cards with accent color variants */
.service-card {
    --accent: var(--lp-primary);
    --accent-dark: var(--lp-primary-dark);
    --accent-light: var(--lp-primary-light);
    position: relative;
    background: #fff; border: 1px solid var(--lp-border); border-radius: 0.85rem;
    padding: 1.5rem; height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    overflow: hidden;
}
.service-card::before {
    content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 100%;
    background: var(--accent);
}
.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(18,174,226,0.10);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--lp-border));
}
.service-card .icon {
    width: 40px; height: 40px; border-radius: 8px;
    display: block;
    margin-bottom: 1rem;
    object-fit: contain;
}
.service-card h3 { font-size: 1.35rem; margin-bottom: 0.6rem; }
.service-card p { color: var(--lp-muted); margin: 0; }
.service-card a.arrow {
    display: inline-block; margin-top: 1rem; font-weight: 600;
    color: var(--accent-dark);
}
.service-card a.arrow:hover { color: var(--accent); }

.service-card.accent-primary { --accent: var(--lp-primary); --accent-dark: var(--lp-primary-dark); --accent-light: var(--lp-primary-light); }
.service-card.accent-green   { --accent: var(--lp-green);   --accent-dark: var(--lp-green-dark);   --accent-light: var(--lp-green-light); }
.service-card.accent-orange  { --accent: var(--lp-orange);  --accent-dark: var(--lp-orange-dark);  --accent-light: var(--lp-orange-light); }
.service-card.accent-red     { --accent: var(--lp-red);     --accent-dark: var(--lp-red-dark);     --accent-light: var(--lp-red-light); }

/* Page headers with accent variants */
.page-header {
    color: #fff; padding: 2.75rem 0 2.25rem;
    background: linear-gradient(135deg, var(--lp-primary) 0%, var(--lp-primary-dark) 100%);
}
.page-header.accent-green  { background: linear-gradient(135deg, var(--lp-green)  0%, var(--lp-green-dark)  100%); }
.page-header.accent-orange { background: linear-gradient(135deg, var(--lp-orange) 0%, var(--lp-orange-dark) 100%); }
.page-header.accent-red    { background: linear-gradient(135deg, var(--lp-red)    0%, var(--lp-red-dark)    100%); }
.page-header h1 { color: #fff; font-size: clamp(1.75rem, 4vw, 3rem); }
.page-header p.lead { color: #fff; max-width: 780px; font-size: 1.05rem; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.15); }
@media (max-width: 575.98px) {
    .page-header { padding: 2rem 0 1.75rem; }
}

.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 1.75rem; }
.prose ul { padding-left: 1.25rem; }
.prose ul li { margin-bottom: 0.4rem; }
.prose { max-width: 820px; }

.feature-list { list-style: none; padding: 0; margin: 1.5rem 0; }
.feature-list li {
    padding-left: 2.25rem; position: relative; margin-bottom: 0.75rem;
}
.feature-list li::before {
    content: "✓"; position: absolute; left: 0; top: 0.15rem;
    color: #fff; font-weight: 700;
    background: var(--lp-primary);
    width: 1.5rem; height: 1.5rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
}
.feature-list.accent-green  li::before { background: var(--lp-green); }
.feature-list.accent-orange li::before { background: var(--lp-orange); }
.feature-list.accent-red    li::before { background: var(--lp-red); }

/* CTA band */
.cta-band {
    background: linear-gradient(135deg, var(--lp-primary) 0%, #0b7ea3 100%);
    color: #fff; padding: 2.5rem 0; text-align: center;
    position: relative; overflow: hidden;
}
.cta-band::before, .cta-band::after {
    content: ""; position: absolute; border-radius: 50%; opacity: 0.18;
}
.cta-band::before { width: 260px; height: 260px; background: var(--lp-orange); top: -80px; right: -60px; }
.cta-band::after  { width: 200px; height: 200px; background: var(--lp-green);  bottom: -70px; left: -50px; }
.cta-band .container { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; margin-bottom: 0.75rem; }
.cta-band p  { color: rgba(255,255,255,0.92); margin-bottom: 1.5rem; }
.cta-band .btn-primary {
    background: #fff; color: var(--lp-primary-dark); border-color: #fff;
}
.cta-band .btn-primary:hover, .cta-band .btn-primary:focus {
    background: var(--lp-orange) !important; color: #fff !important; border-color: var(--lp-orange) !important;
}

/* Footer */
.site-footer {
    background: #0d1b23; color: #d1e3ec;
    padding: 2.25rem 0 1.25rem;
    border-top: 4px solid var(--lp-primary);
}
.site-footer h5 { color: #fff; font-size: 1rem; margin-bottom: 0.75rem; }
.site-footer a { color: #9fc6d8; }
.site-footer a:hover { color: var(--lp-primary); }
.site-footer hr { border-color: #1e3644; margin: 1.5rem 0 1rem; }
.site-footer small { color: #7d99a6; }

/* Form */
.form-control:focus {
    border-color: var(--lp-primary);
    box-shadow: 0 0 0 0.2rem rgba(18,174,226,0.18);
}
label { font-weight: 600; }

/* Utilities */
.text-primary-accent { color: var(--lp-primary) !important; }
.text-green   { color: var(--lp-green-dark)  !important; }
.text-orange  { color: var(--lp-orange-dark) !important; }
.text-red     { color: var(--lp-red-dark)    !important; }

.badge-pill {
    display: inline-block; padding: 0.3rem 0.75rem; border-radius: 999px;
    font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-pill.primary { background: var(--lp-primary-light); color: var(--lp-primary-dark); }
.badge-pill.green   { background: var(--lp-green-light);   color: var(--lp-green-dark); }
.badge-pill.orange  { background: var(--lp-orange-light);  color: var(--lp-orange-dark); }
.badge-pill.red     { background: var(--lp-red-light);     color: var(--lp-red-dark); }

/* Capability grid — compact cards for detailed service pages */
.cap-group { margin: 2rem 0 1rem; }
.cap-group > h3 {
    font-size: 1.15rem; margin-bottom: 1rem;
    padding-left: 0.75rem; border-left: 4px solid var(--lp-primary);
}
.cap-group.accent-primary > h3 { border-left-color: var(--lp-primary); }
.cap-group.accent-green   > h3 { border-left-color: var(--lp-green); }
.cap-group.accent-orange  > h3 { border-left-color: var(--lp-orange); }
.cap-group.accent-red     > h3 { border-left-color: var(--lp-red); }

.cap-grid {
    display: grid; gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.cap-card {
    background: #fff; border: 1px solid var(--lp-border); border-radius: 0.6rem;
    padding: 0.85rem 1rem; font-size: 0.94rem; line-height: 1.45;
    display: flex; gap: 0.6rem; align-items: flex-start;
}
.cap-card::before {
    content: ""; flex: 0 0 6px; align-self: stretch;
    background: var(--lp-primary); border-radius: 3px;
}
.cap-group.accent-primary .cap-card::before { background: var(--lp-primary); }
.cap-group.accent-green   .cap-card::before { background: var(--lp-green); }
.cap-group.accent-orange  .cap-card::before { background: var(--lp-orange); }
.cap-group.accent-red     .cap-card::before { background: var(--lp-red); }
.cap-card strong { display: block; color: var(--lp-ink); margin-bottom: 0.15rem; }
.cap-card span { color: var(--lp-muted); font-size: 0.88rem; }

/* Pricing offer cards */
.offer-price {
    font-family: 'Titillium Web', 'Open Sans', sans-serif;
    font-weight: 700; color: var(--lp-ink);
    font-size: 1.75rem; line-height: 1; margin: 0.25rem 0 0.75rem;
}
.offer-price span {
    font-family: 'Open Sans', sans-serif;
    font-weight: 600; font-size: 0.95rem; color: var(--lp-muted);
}

.prose.wide { max-width: 1040px; }

/* Problem-framed capability cards (service pages) */
.problem-grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    margin: 1.5rem 0 0.5rem;
}
.problem-card {
    background: #fff;
    border: 1px solid var(--lp-border, #e5e7eb);
    border-left: 4px solid var(--lp-primary);
    border-radius: 10px;
    padding: 1.15rem 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.problem-card h3 {
    font-family: 'Titillium Web', 'Open Sans', sans-serif;
    font-size: 1.1rem; line-height: 1.3;
    margin: 0 0 0.4rem; color: var(--lp-ink, #0f172a);
}
.problem-card p {
    margin: 0; color: var(--lp-body, #334155);
    font-size: 0.97rem; line-height: 1.5;
}
.problem-card.accent-primary { border-left-color: var(--lp-primary); }
.problem-card.accent-green   { border-left-color: var(--lp-green); }
.problem-card.accent-orange  { border-left-color: var(--lp-orange); }
.problem-card.accent-red     { border-left-color: var(--lp-red); }

/* Expandable "some things I work with" block */
.more-details {
    background: #f8fafc;
    border: 1px solid var(--lp-border, #e5e7eb);
    border-radius: 10px;
    padding: 0.9rem 1.15rem;
}
.more-details > summary {
    cursor: pointer;
    font-family: 'Titillium Web', 'Open Sans', sans-serif;
    font-weight: 700; color: var(--lp-ink, #0f172a);
    list-style: none;
    padding: 0.15rem 0;
}
.more-details > summary::-webkit-details-marker { display: none; }
.more-details > summary::before {
    content: "+ "; color: var(--lp-primary); font-weight: 700;
}
.more-details[open] > summary::before { content: "\2013 "; }
.more-details .more-body { margin-top: 0.75rem; }
.more-details .more-body p { margin: 0 0 0.6rem; font-size: 0.95rem; color: var(--lp-body, #334155); }
.more-details .more-body p:last-child { margin-bottom: 0; }

/* About page: headshot + cert grid */
.headshot-card {
    background: #fff; border: 1px solid var(--lp-border); border-radius: 0.85rem;
    overflow: hidden; box-shadow: 0 6px 24px rgba(13,27,35,0.06);
    position: sticky; top: 1.5rem;
}
.headshot {
    display: block; width: 100%; height: auto;
    aspect-ratio: 1 / 1; object-fit: cover;
    border-bottom: 4px solid var(--lp-primary);
}
.headshot-body { padding: 1.25rem 1.25rem 1.5rem; }
.headshot-body h2 { font-size: 1.4rem; }
.headshot-body .text-muted { color: var(--lp-muted) !important; font-size: 0.95rem; }

.cert-grid {
    display: grid; gap: 0.75rem; margin: 1.5rem 0 0;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.cert-card {
    background: #fff; border: 1px solid var(--lp-border); border-radius: 0.6rem;
    padding: 0.9rem 1rem 0.9rem 3.2rem; position: relative;
}
.cert-card .cert-logo {
    position: absolute; left: 0.85rem; top: 0.95rem;
    width: 1.6rem; height: 1.6rem; object-fit: contain;
}
.cert-title { font-weight: 700; color: var(--lp-ink); font-size: 0.98rem; }
.cert-meta { color: var(--lp-muted); font-size: 0.85rem; margin-top: 0.15rem; }

@media (max-width: 991.98px) {
    .headshot-card { position: static; }
    .headshot { aspect-ratio: 16 / 10; object-position: center 25%; }
}


/* Site chat (agentic assistant on /About) */
.chat-chips { display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:1rem; }
.chat-chip {
    border: 1px solid rgba(18,174,226,.35);
    background: rgba(18,174,226,.06);
    color: var(--lp-primary-dark);
    border-radius: 999px;
    padding: .35rem .85rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.chat-chip:hover { background: rgba(18,174,226,.18); border-color: var(--lp-primary); }

.chat-log {
    max-height: 460px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-bottom: 1rem;
    padding: .25rem;
}
.chat-log:empty::before {
    content: "Ask anything about services, pricing, etc. I'll show which pages I read to answer.";
    color: var(--lp-muted);
    font-size: .9rem;
    padding: .5rem 0;
    display: block;
}

.chat-msg {
    border-radius: 14px;
    padding: .75rem 1rem;
    max-width: 92%;
    line-height: 1.5;
}
.chat-msg.chat-user {
    background: var(--lp-primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-msg.chat-bot {
    background: #f4f6f8;
    color: #1a2b3c;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    max-width: 100%;
}
.chat-msg p { margin: 0 0 .5rem; }
.chat-msg p:last-child { margin-bottom: 0; }
.chat-msg ul { margin: .25rem 0 .25rem 1.25rem; padding: 0; }
.chat-msg li { margin-bottom: .25rem; }

.chat-form { display: flex; gap: .5rem; }
.chat-form input { flex: 1; }

.chat-status {
    min-height: 1.25rem;
    font-size: .85rem;
    color: var(--lp-muted);
    margin-top: .5rem;
}

.chat-trace {
    margin-top: .75rem;
    border-top: 1px dashed rgba(0,0,0,.12);
    padding-top: .5rem;
    font-size: .8rem;
}
.chat-trace summary {
    cursor: pointer;
    color: var(--lp-muted);
    font-weight: 600;
    list-style: none;
}
.chat-trace summary::-webkit-details-marker { display: none; }
.chat-trace summary::before {
    content: "+";
    display: inline-block;
    width: 1rem;
    color: var(--lp-primary);
    font-weight: 700;
}
.chat-trace[open] summary::before { content: "–"; }

.chat-trace-line {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    padding: .4rem 0 .1rem;
}
.chat-trace-line code {
    background: #eef1f4;
    padding: .15rem .45rem;
    border-radius: 4px;
    color: #1a2b3c;
    font-size: .78rem;
}
.chat-trace-pages { display: flex; flex-wrap: wrap; gap: .35rem; }
.chat-trace-badge {
    text-decoration: none;
    background: rgba(147,200,66,.18);
    color: var(--lp-green-dark);
    border-radius: 999px;
    padding: .15rem .6rem;
    font-weight: 600;
    font-size: .78rem;
}
.chat-trace-badge:hover { background: rgba(147,200,66,.32); }

.chat-spinner {
    display: inline-block;
    letter-spacing: .2em;
    color: var(--lp-muted);
    animation: chat-pulse 1.2s infinite;
}
@keyframes chat-pulse {
    0%, 100% { opacity: .3; }
    50% { opacity: 1; }
}


/* Site chat overlay (thinking + cancel) */
.chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 26, 45, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}
.chat-overlay[hidden] { display: none; }
.chat-overlay-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 10px 32px rgba(0,0,0,.15);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    text-align: center;
    min-width: 240px;
    max-width: 340px;
}
.chat-overlay-spinner {
    display: inline-flex;
    gap: .4rem;
    margin-bottom: 1rem;
    justify-content: center;
}
.chat-overlay-spinner span {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--lp-primary);
    display: inline-block;
    animation: chat-overlay-bounce 1.2s infinite ease-in-out both;
}
.chat-overlay-spinner span:nth-child(2) { animation-delay: .15s; }
.chat-overlay-spinner span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-overlay-bounce {
    0%, 80%, 100% { transform: scale(0.5); opacity: .4; }
    40% { transform: scale(1); opacity: 1; }
}
.chat-overlay-label {
    margin: 0 0 1rem;
    color: #1a2b3c;
    font-weight: 600;
}


/* Chat page: expand the ask panel; scroll inside the log */
.chat-page main { display: flex; flex-direction: column; }
.chat-page .ask-section {
    min-height: calc(100vh - 110px);
    display: flex;
    align-items: stretch;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}
.chat-page .ask-section > .container {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.chat-page .ask-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    grid-template-columns: none;
}
.chat-page .ask-copy { flex: 0 0 auto; }
.chat-page .ask-copy p { max-width: none; }
.chat-page .chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}
.chat-page .chat-chips,
.chat-page .chat-form,
.chat-page .chat-status { flex: 0 0 auto; }
.chat-page .chat-form { width: 100%; gap: .75rem; }
.chat-page .chat-form input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: .75rem 1rem;
    font-size: 1.05rem;
}
.chat-page .chat-form button { flex: 0 0 auto; padding-left: 1.75rem; padding-right: 1.75rem; }
.chat-page .chat-log {
    flex: 1 1 0;
    min-height: 480px;
    max-height: none;
    overflow-y: auto;
}
@media (max-width: 991.98px) {
    .chat-page .ask-section {
        min-height: calc(100vh - 92px);
    }
    .chat-page .chat-log {
        min-height: 360px;
    }
}
