/* Big Creative Training — policies site */

:root {
    --brand: #00abb1;
    --brand-strong: #00787c;
    --brand-ink: #006c70;
    --brand-soft: #e2f5f5;
    --brand-softer: #f1fafa;

    --bg: #f5f8f8;
    --surface: #ffffff;
    --ink: #13252b;
    --muted: #5a6b71;
    --line: #dde7e8;
    --line-strong: #c6d5d7;

    --staff: #8a5a00;
    --staff-soft: #fff3dc;

    --pdf: #c23b2b;
    --pdf-soft: #fdecea;
    --sheet: #1d7442;
    --sheet-soft: #e3f3e9;
    --word: #2a5cb0;
    --word-soft: #e6eefb;

    --danger: #a12a1d;
    --danger-soft: #fdecea;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgb(16 40 48 / 0.05), 0 6px 20px rgb(16 40 48 / 0.06);
    --shadow-lift: 0 2px 4px rgb(16 40 48 / 0.06), 0 14px 32px rgb(16 40 48 / 0.10);

    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --brand-strong: #009096;
        --brand-ink: #5fd3d7;
        --brand-soft: #113236;
        --brand-softer: #0f2629;

        --bg: #0c1618;
        --surface: #132124;
        --ink: #e5eef0;
        --muted: #9cb0b5;
        --line: #22363a;
        --line-strong: #2f4a4f;

        --staff: #f2c46d;
        --staff-soft: #3a2c10;

        --pdf: #ff9787;
        --pdf-soft: #3b1d19;
        --sheet: #7fd9a3;
        --sheet-soft: #15301f;
        --word: #9dbcf5;
        --word-soft: #1a2640;

        --danger: #ffaa9e;
        --danger-soft: #3b1d19;

        --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 6px 20px rgb(0 0 0 / 0.25);
        --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.35), 0 14px 32px rgb(0 0 0 / 0.35);
        color-scheme: dark;
    }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 16px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-ink); }

h1, h2, p { margin: 0; }

h1 {
    font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
    font-weight: 700;
}

:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: 6px;
}

[hidden] { display: none !important; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.icon {
    width: 1.15em;
    height: 1.15em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------------------------------------------------------------- layout */

.wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 20px 24px 72px;
}

.wrap.narrow { max-width: 460px; }
.wrap.center { text-align: center; }
.wrap.center > * + * { margin-top: 16px; }
.wrap.center .logo { margin: 48px auto 8px; }

.topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    margin-bottom: 20px;
    font-size: 0.94rem;
}

.topline--end { justify-content: flex-end; }

.back,
.topline-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 0 -12px;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.topline-link { margin: 0 -12px 0 0; }

.back:hover,
.topline-link:hover {
    color: var(--brand-ink);
    background: var(--brand-soft);
}

.logo {
    display: block;
    flex: none;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: #fff;
}

.logo--sm { width: 64px; height: 64px; }

.eyebrow {
    margin-bottom: 8px;
    color: var(--brand-ink);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lede {
    margin-top: 10px;
    max-width: 60ch;
    color: var(--muted);
    font-size: 1.05rem;
}

.small {
    color: var(--muted);
    font-size: 0.875rem;
}

/* ---------------------------------------------------------------- home hero */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 36px 40px;
    margin-bottom: 24px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    /* Own compositing layer: stops Safari leaving bits of the ring behind when the page width changes */
    isolation: isolate;
    transform: translateZ(0);
}

/* Echoes the ring in the logo */
.hero::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -110px;
    width: 340px;
    height: 340px;
    border: 44px solid var(--brand-soft);
    border-radius: 50%;
    pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.page-head {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 28px;
}

.page-head .eyebrow { margin-bottom: 10px; }

/* ---------------------------------------------------------------- badges */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
}

.badge .icon { width: 1em; height: 1em; stroke-width: 2.2; }
.badge--public { background: var(--brand-soft); color: var(--brand-ink); }
.badge--staff { background: var(--staff-soft); color: var(--staff); }

/* ---------------------------------------------------------------- search */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-bottom: 16px;
}

.toolbar .search { flex: 1 1 320px; }

.search {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--muted);
}

.search > .icon {
    position: absolute;
    left: 16px;
    pointer-events: none;
}

.search input {
    width: 100%;
    height: 48px;
    padding: 0 48px 0 46px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    box-shadow: var(--shadow);
    -webkit-appearance: none;
    appearance: none;
}

.search input::placeholder { color: var(--muted); opacity: 1; }

.search input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgb(0 171 177 / 0.2);
}

.search--lg { margin-bottom: 16px; }
.search--lg input { height: 58px; font-size: 1.06rem; border-radius: 14px; padding-left: 50px; }
.search--lg > .icon { left: 18px; width: 1.3em; height: 1.3em; }

.search-key {
    position: absolute;
    right: 14px;
    padding: 1px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--muted);
    font: 600 0.8rem var(--font);
    pointer-events: none;
}

.search input:focus ~ .search-key,
.search input:not(:placeholder-shown) ~ .search-key { display: none; }

.hint {
    margin: -4px 0 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

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

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font: 600 0.9rem var(--font);
    cursor: pointer;
}

.chip span {
    color: var(--muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.chip:hover { border-color: var(--brand); }

.chip[aria-pressed="true"] {
    border-color: var(--brand-strong);
    background: var(--brand-strong);
    color: #fff;
}

.chip[aria-pressed="true"] span { color: rgb(255 255 255 / 0.8); }

/* ---------------------------------------------------------------- category cards */

.group { margin-top: 36px; }

.group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 16px;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--brand);
    box-shadow: var(--shadow-lift);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand-ink);
}

.card-icon .icon { width: 24px; height: 24px; }

.card--staff .card-icon {
    background: var(--staff-soft);
    color: var(--staff);
}

.card-arrow {
    color: var(--line-strong);
    transition: color 0.15s ease, transform 0.15s ease;
}

.card:hover .card-arrow {
    color: var(--brand-ink);
    transform: translateX(3px);
}

.card-title {
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card-desc {
    flex: 1;
    color: var(--muted);
    font-size: 0.94rem;
}

.card-meta {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---------------------------------------------------------------- document list */

.doc-list {
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.doc {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 6px;
}

.doc + .doc { border-top: 1px solid var(--line); }
.doc:hover { background: var(--brand-softer); }

.doc-main {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 12px 10px;
    border-radius: var(--radius-sm);
    color: var(--ink);
    text-decoration: none;
}

.doc-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 48px;
    border-radius: 8px;
    background: var(--pdf-soft);
    color: var(--pdf);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.doc-icon--sheet { background: var(--sheet-soft); color: var(--sheet); }
.doc-icon--word { background: var(--word-soft); color: var(--word); }

.doc-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.doc-name {
    font-weight: 600;
    line-height: 1.35;
}

.doc-main:hover .doc-name { color: var(--brand-ink); }

.doc-meta {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.84rem;
}

.icon-btn {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    margin-right: 6px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.icon-btn .icon { width: 22px; height: 22px; }

.icon-btn:hover {
    background: var(--brand-soft);
    color: var(--brand-ink);
}

.empty {
    padding: 40px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

/* ---------------------------------------------------------------- buttons, forms */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: var(--brand-strong);
    color: #fff;
    font: 600 0.95rem var(--font);
    text-decoration: none;
    cursor: pointer;
}

.btn:hover { background: var(--brand-ink); }

@media (prefers-color-scheme: dark) {
    .btn:hover { background: #00a5ab; }
}

.btn-quiet {
    background: transparent;
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn-quiet:hover {
    background: var(--brand-soft);
    color: var(--brand-ink);
}

.btn-block { width: 100%; height: 50px; }

.panel {
    padding: 36px 32px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.login {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

.login .logo { margin: 0 auto 4px; width: 80px; height: 80px; }
.login .lede { margin: -6px auto 4px; font-size: 1rem; }

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    font-weight: 600;
    font-size: 0.92rem;
}

.field input {
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font: 400 1rem var(--font);
}

.field input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgb(0 171 177 / 0.2);
}

.field input[aria-invalid="true"] { border-color: var(--danger); }

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--danger-soft);
    color: var(--danger);
    font-weight: 600;
    font-size: 0.94rem;
}

/* ---------------------------------------------------------------- preview dialog */

.viewer {
    width: min(1120px, 96vw);
    height: 94vh;
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 30px 80px rgb(0 0 0 / 0.35);
    overflow: hidden;
}

.viewer[open] {
    display: flex;
    flex-direction: column;
}

.viewer::backdrop {
    background: rgb(8 20 22 / 0.6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.viewer-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 10px 20px;
    border-bottom: 1px solid var(--line);
}

.viewer-bar .btn { height: 40px; padding: 0 14px; font-size: 0.9rem; }
.viewer-bar .icon-btn { margin: 0; }

.viewer-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.viewer iframe {
    flex: 1;
    width: 100%;
    border: 0;
    background: #525659;
}

/* ---------------------------------------------------------------- small screens */

@media (max-width: 640px) {
    .wrap { padding: 12px 16px 56px; }

    .hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 24px 22px;
        border-radius: 20px;
    }

    .hero::after { right: -140px; top: -150px; }
    .hero .logo { width: 76px; height: 76px; }

    .page-head { align-items: flex-start; gap: 16px; }
    .page-head .logo { width: 52px; height: 52px; }

    .search-key { display: none; }
    .search input { padding-right: 16px; }

    .cards { grid-template-columns: 1fr; gap: 12px; }

    .doc-main { gap: 12px; padding: 12px 8px; }
    .doc-icon { width: 38px; height: 44px; }
    .icon-btn { margin-right: 2px; }

    .panel { padding: 28px 20px; }

    .viewer-bar .btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

/* ---------------------------------------------------------------- AI assistant */

.ask-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin: -2px 0 8px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(100deg, var(--brand-soft), var(--surface) 70%);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.ask-cta:hover { border-color: var(--brand); transform: translateY(-1px); }
.ask-cta > .icon { color: var(--brand-ink); }

.ask-cta-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--brand-strong);
    color: #fff;
}

.ask-cta-text { display: flex; flex: 1; flex-direction: column; }
.ask-cta-text span { color: var(--muted); font-size: 0.92rem; }

.chat-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 22px 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--brand-strong);
    color: #fff;
    font: 700 0.98rem var(--font);
    box-shadow: 0 10px 30px rgb(0 80 84 / 0.35);
    cursor: pointer;
}

.chat-launcher:hover { background: var(--brand-ink); }
.chat-launcher .icon { width: 24px; height: 24px; }
.chat.is-open .chat-launcher { display: none; }

.chat-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 41;
    display: flex;
    flex-direction: column;
    width: min(420px, calc(100vw - 32px));
    height: min(680px, calc(100vh - 48px));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--bg);
    box-shadow: 0 24px 70px rgb(8 30 34 / 0.28);
}

.chat-panel[hidden] { display: none; }

.chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.chat-head .icon-btn { margin: 0; width: 38px; height: 38px; }
.chat-head .icon-btn .icon { width: 20px; height: 20px; }
.chat-logo { flex: none; border-radius: 50%; background: #fff; }
.chat-head-text { flex: 1; min-width: 0; }
.chat-title { font-weight: 700; }
.chat-sub { color: var(--muted); font-size: 0.8rem; }

.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overscroll-behavior: contain;
}

.chat-welcome p { color: var(--ink); }

.chat-examples {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
}

.chat-example {
    padding: 9px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--surface);
    color: var(--brand-ink);
    font: 600 0.9rem var(--font);
    text-align: left;
    cursor: pointer;
}

.chat-example:hover { border-color: var(--brand); background: var(--brand-softer); }

.chat-msg { display: flex; }
.chat-msg--user { justify-content: flex-end; }

.chat-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 0.95rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.chat-msg--user .chat-bubble {
    border-color: transparent;
    border-bottom-right-radius: 6px;
    background: var(--brand-strong);
    color: #fff;
}

.chat-msg--assistant .chat-bubble { border-bottom-left-radius: 6px; }
.chat-msg--error .chat-bubble { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

.chat-bubble p + p,
.chat-bubble p + ul,
.chat-bubble p + ol,
.chat-bubble ul + p,
.chat-bubble ol + p { margin-top: 8px; }
.chat-bubble ul, .chat-bubble ol { margin: 6px 0 0; padding-left: 20px; }
.chat-bubble li + li { margin-top: 4px; }

.chat-cite {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    margin-left: 3px;
    padding: 0 4px;
    border-radius: 6px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    vertical-align: 2px;
}

.chat-cite:hover { background: var(--brand-strong); color: #fff; }

.chat-sources {
    margin: -4px 0 0;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--brand-softer);
    font-size: 0.86rem;
}

.chat-sources-title {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.chat-sources ol { margin: 0; padding-left: 20px; }
.chat-sources li { margin: 3px 0; }
.chat-sources a { font-weight: 600; }
.chat-sources li span { display: block; color: var(--muted); font-size: 0.8rem; }

.chat-safe {
    padding: 14px 16px;
    border: 1px solid #f0c36d;
    border-radius: 14px;
    background: var(--staff-soft);
    font-size: 0.9rem;
}

.chat-safe p + p, .chat-safe ul + p { margin-top: 8px; }
.chat-safe-title { font-weight: 700; }
.chat-safe ul { margin: 8px 0 0; padding: 0; list-style: none; }
.chat-safe li { margin-top: 8px; }
.chat-safe li strong { display: block; }
.chat-safe li span { display: block; color: var(--muted); font-size: 0.82rem; }
.chat-safe a { color: var(--ink); font-weight: 600; }

.chat-typing { display: inline-flex; gap: 4px; padding: 4px 0; }

.chat-typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
    animation: chat-dot 1.2s infinite ease-in-out;
}

.chat-typing i:nth-child(2) { animation-delay: 0.15s; }
.chat-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes chat-dot {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px 6px;
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.chat-form textarea {
    flex: 1;
    min-height: 44px;
    max-height: 140px;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--bg);
    color: var(--ink);
    font: 400 1rem/1.4 var(--font); /* 16px or more stops iPhones zooming in on tap */
    resize: none;
}

.chat-form textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgb(0 171 177 / 0.2);
}

.chat-send {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--brand-strong);
    color: #fff;
    cursor: pointer;
}

.chat-send:disabled { opacity: 0.5; cursor: default; }
.chat-send .icon { width: 22px; height: 22px; }

.chat-foot {
    padding: 0 14px 10px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.74rem;
    text-align: center;
}

@media (max-width: 640px) {
    .chat-launcher { right: 16px; bottom: 16px; height: 50px; }
    .chat-panel { inset: 0; width: 100%; height: 100%; height: 100dvh; border: 0; border-radius: 0; }
    .ask-cta-text span { font-size: 0.86rem; }
}

@media (prefers-reduced-motion: reduce) {
    .chat-typing i { animation: none; opacity: 0.6; }
}

/* ---------------------------------------------------------------- AI index page */

.index-panel { margin-bottom: 28px; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin: 0 0 20px;
}

.stats div { padding: 14px 16px; border-radius: 12px; background: var(--brand-softer); }
.stats dt { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.stats dd { margin: 4px 0 0; font-size: 1.3rem; font-weight: 700; }
.index-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.index-panel .alert { margin-bottom: 16px; }
.index-list .doc-main { cursor: default; }

/* Leave room so the floating chat button never covers the last item. */
body:has(.chat) .wrap { padding-bottom: 110px; }
