:root {
    --oa-blue: #1f438f;
    --oa-blue-2: #2f63c7;
    --oa-blue-3: #3d7dff;
    --oa-navy: #071c49;
    --oa-ink: #14223d;
    --oa-muted: #66738d;
    --oa-line: rgba(31, 67, 143, .14);
    --oa-line-strong: rgba(31, 67, 143, .24);
    --oa-bg: #f6f9ff;
    --oa-card: rgba(255, 255, 255, .88);
    --oa-shadow: 0 24px 70px rgba(13, 35, 80, .13);
    --oa-soft-shadow: 0 12px 34px rgba(13, 35, 80, .09);
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    overflow: hidden;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--oa-ink);
    background:
        radial-gradient(circle at 12% 0%, rgba(61, 125, 255, .16), transparent 34rem),
        radial-gradient(circle at 100% 20%, rgba(31, 67, 143, .13), transparent 30rem),
        linear-gradient(135deg, #ffffff 0%, #f4f8ff 44%, #ffffff 100%);
}

button,
textarea,
select,
input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .66; }
h1, p { margin: 0; }

.app-shell {
    width: min(1160px, calc(100% - 28px));
    height: 100dvh;
    margin: 0 auto;
    padding: 14px 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    min-width: 0;
}

.topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border: 1px solid var(--oa-line);
    border-radius: 24px;
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--oa-soft-shadow);
    backdrop-filter: blur(18px);
}

.brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}
.brand-logo {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(31, 67, 143, .12);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(31, 67, 143, .10);
}
.brand-logo img { width: 36px; height: 36px; object-fit: contain; }
.brand-text { display: grid; gap: 3px; min-width: 0; }
.brand-text strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.08rem;
    line-height: 1.1;
    letter-spacing: -.035em;
    color: var(--oa-navy);
}
.brand-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--oa-muted);
    font-weight: 800;
    font-size: .82rem;
}
.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}
.connection-pill,
.nav-button,
.utility-button,
.settings-button,
.model-pill,
#sendButton {
    border: 0;
    border-radius: 999px;
    font-weight: 900;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.connection-pill {
    height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 14px;
    border: 1px solid var(--oa-line);
    background: #fff;
    color: var(--oa-navy);
    box-shadow: 0 8px 20px rgba(31, 67, 143, .06);
    white-space: nowrap;
}
.connection-pill i {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #d8a600;
    box-shadow: 0 0 0 5px rgba(216, 166, 0, .12);
}
.connection-pill.online i { background: #15a46d; box-shadow: 0 0 0 5px rgba(21,164,109,.12); }
.connection-pill.offline i { background: #dd3b52; box-shadow: 0 0 0 5px rgba(221,59,82,.12); }
.connection-pill span { font-size: .88rem; }
.nav-button {
    height: 42px;
    padding: 0 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--oa-blue), var(--oa-blue-3));
    box-shadow: 0 12px 28px rgba(31, 67, 143, .22);
    white-space: nowrap;
}
.nav-button:hover,
.utility-button:hover,
.settings-button:hover,
.model-pill:hover,
#sendButton:hover { transform: translateY(-1px); }

.workspace {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--oa-line);
    border-radius: 28px;
    background: rgba(255, 255, 255, .72);
    box-shadow: var(--oa-shadow);
    backdrop-filter: blur(18px);
}
.hero {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 22px;
    padding: 34px 22px;
    text-align: center;
}
.hero.hidden { display: none; }
.hero-card {
    width: min(760px, 100%);
    display: grid;
    justify-items: center;
    gap: 13px;
}
.hero-logo {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    border: 1px solid rgba(31, 67, 143, .12);
    background: #fff;
    box-shadow: 0 18px 46px rgba(31, 67, 143, .13);
}
.hero-logo img { width: 56px; height: 56px; object-fit: contain; }
.eyebrow {
    color: var(--oa-blue-2);
    font-size: .74rem;
    font-weight: 950;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.hero h1 {
    max-width: 760px;
    color: var(--oa-navy);
    font-size: clamp(2.35rem, 6vw, 5.2rem);
    line-height: .94;
    letter-spacing: -.075em;
}
.hero p:not(.eyebrow) {
    max-width: 590px;
    color: var(--oa-muted);
    font-size: 1rem;
    line-height: 1.6;
}
.prompt-grid {
    width: min(860px, 100%);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.prompt-grid button {
    min-height: 104px;
    padding: 16px;
    border: 1px solid var(--oa-line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .9);
    color: var(--oa-ink);
    text-align: left;
    box-shadow: 0 12px 30px rgba(31, 67, 143, .08);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.prompt-grid button:hover {
    transform: translateY(-2px);
    border-color: var(--oa-line-strong);
    box-shadow: 0 18px 40px rgba(31,67,143,.13);
}
.prompt-grid strong,
.prompt-grid span { display: block; }
.prompt-grid strong { margin-bottom: 7px; color: var(--oa-navy); }
.prompt-grid span { color: var(--oa-muted); font-size: .9rem; line-height: 1.4; }

.chat {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 28px 20px 22px;
    scroll-behavior: smooth;
}
.chat:empty { display: none; }
.chat::-webkit-scrollbar,
.hero::-webkit-scrollbar { width: 10px; }
.chat::-webkit-scrollbar-thumb,
.hero::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: rgba(31, 67, 143, .26);
    background-clip: padding-box;
}
.message {
    width: min(880px, 100%);
    margin: 0 auto 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.message.user { flex-direction: row-reverse; }
.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--oa-blue), var(--oa-blue-3));
    box-shadow: 0 10px 24px rgba(31, 67, 143, .14);
    font-size: .72rem;
    font-weight: 950;
}
.message.assistant .avatar {
    border: 1px solid rgba(31, 67, 143, .12);
    background: #fff;
}
.avatar img { width: 28px; height: 28px; object-fit: contain; }
.bubble {
    max-width: min(760px, calc(100% - 50px));
    min-width: 0;
    padding: 15px 17px;
    border: 1px solid var(--oa-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(31, 67, 143, .08);
    color: var(--oa-ink);
    line-height: 1.62;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.message.user .bubble {
    color: #fff;
    border: 0;
    background: linear-gradient(135deg, var(--oa-blue), var(--oa-blue-3));
    box-shadow: 0 16px 36px rgba(31,67,143,.22);
}
.bubble pre {
    max-width: 100%;
    margin: 12px 0;
    padding: 14px;
    border-radius: 16px;
    overflow-x: auto;
    background: #0c1d43;
    color: #f4f7ff;
    white-space: pre;
}
.bubble code {
    padding: 2px 6px;
    border-radius: 7px;
    background: rgba(31, 67, 143, .09);
    color: var(--oa-navy);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .92em;
}
.bubble pre code { padding: 0; background: transparent; color: inherit; }
.message.user .bubble code { color: #fff; background: rgba(255,255,255,.16); }
.typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 20px;
}
.typing span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--oa-blue-2);
    animation: pulse 1s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .12s; }
.typing span:nth-child(3) { animation-delay: .24s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.composer {
    position: relative;
    width: min(940px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 8px;
    padding: 0 2px 2px;
}
.model-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.model-pill,
.settings-button,
.utility-button {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--oa-line);
    background: rgba(255, 255, 255, .92);
    color: var(--oa-navy);
    box-shadow: 0 10px 24px rgba(31, 67, 143, .08);
}
.model-pill {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    padding: 0 14px;
}
.model-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--oa-blue-3);
    box-shadow: 0 0 0 5px rgba(61,125,255,.12);
}
.model-pill-text {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.model-pill small {
    color: var(--oa-muted);
    font-size: .76rem;
    font-weight: 900;
}
.model-pill strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--oa-navy);
    font-size: .88rem;
}
.settings-button,
.utility-button { flex: 0 0 auto; padding: 0 14px; }
.settings-button[aria-expanded="true"],
.model-pill[aria-expanded="true"] { border-color: rgba(31,67,143,.34); background: #fff; }

.settings-panel {
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: calc(100% + 10px);
    z-index: 20;
    padding: 16px;
    border: 1px solid var(--oa-line-strong);
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 24px 80px rgba(13, 35, 80, .20);
    backdrop-filter: blur(20px);
}
.settings-panel[hidden] { display: none; }
.settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.settings-header strong {
    display: block;
    color: var(--oa-navy);
    font-size: 1rem;
    letter-spacing: -.02em;
}
.settings-header small {
    display: block;
    margin-top: 3px;
    color: var(--oa-muted);
    font-weight: 700;
}
#closeSettings {
    width: 34px;
    height: 34px;
    border: 1px solid var(--oa-line);
    border-radius: 999px;
    background: #fff;
    color: var(--oa-navy);
    font-size: 1.25rem;
    line-height: 1;
}
.settings-grid {
    display: grid;
    grid-template-columns: 1fr minmax(220px, .42fr);
    gap: 12px;
}
.field {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--oa-line);
    border-radius: 18px;
    background: #fff;
}
.field span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--oa-navy);
    font-size: .82rem;
    font-weight: 950;
}
.field b { color: var(--oa-blue); }
select,
input[type="range"] { width: 100%; }
select {
    height: 44px;
    min-width: 0;
    padding: 0 13px;
    border: 1px solid rgba(31, 67, 143, .16);
    border-radius: 14px;
    color: var(--oa-navy);
    background: #f8fbff;
    outline: 0;
    font-weight: 850;
    text-overflow: ellipsis;
}
select:focus,
textarea:focus { border-color: rgba(47, 95, 189, .55); box-shadow: 0 0 0 4px rgba(47, 95, 189, .12); }
input[type="range"] { accent-color: var(--oa-blue); }
.composer-box {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(31, 67, 143, .18);
    border-radius: 24px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 20px 50px rgba(31,67,143,.15);
    backdrop-filter: blur(18px);
}
textarea {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 48px;
    max-height: 180px;
    resize: none;
    border: 1px solid transparent;
    outline: 0;
    padding: 13px 14px;
    border-radius: 17px;
    background: #f7faff;
    color: var(--oa-ink);
    line-height: 1.45;
}
textarea::placeholder { color: #7c879d; }
#sendButton {
    flex: 0 0 auto;
    min-width: 94px;
    height: 48px;
    color: #fff;
    background: linear-gradient(135deg, var(--oa-blue), var(--oa-blue-3));
    box-shadow: 0 14px 30px rgba(31, 67, 143, .24);
}
.disclaimer {
    margin: 0;
    padding: 0 8px;
    text-align: center;
    color: var(--oa-muted);
    font-size: .78rem;
    line-height: 1.35;
}

@media (max-width: 740px) {
    body { overflow: hidden; }
    .app-shell { width: calc(100% - 18px); padding: 9px 0; gap: 8px; }
    .topbar { min-height: 60px; border-radius: 20px; padding: 8px; }
    .brand-logo { width: 42px; height: 42px; border-radius: 14px; }
    .brand-logo img { width: 32px; height: 32px; }
    .brand-text strong { font-size: .98rem; }
    .brand-text small { font-size: .74rem; }
    .connection-pill { display: none; }
    .nav-button { height: 40px; padding: 0 12px; }
    .workspace { border-radius: 22px; }
    .hero { padding: 24px 14px; }
    .hero h1 { font-size: clamp(2.15rem, 12vw, 4rem); }
    .prompt-grid { grid-template-columns: 1fr; }
    .prompt-grid button { min-height: 86px; }
    .chat { padding: 18px 12px 14px; }
    .message { gap: 9px; margin-bottom: 14px; }
    .avatar { width: 34px; height: 34px; border-radius: 12px; }
    .bubble { max-width: calc(100% - 43px); padding: 13px 14px; }
    .composer { gap: 7px; }
    .model-strip { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; }
    .settings-button, .utility-button { width: 40px; padding: 0; font-size: 0; }
    .settings-button span { font-size: 1rem; }
    .utility-button::before { content: '⇩'; font-size: 1rem; }
    .model-pill-text { display: grid; gap: 0; }
    .model-pill small { font-size: .7rem; }
    .model-pill strong { font-size: .82rem; }
    .settings-panel { border-radius: 20px; padding: 14px; }
    .settings-grid { grid-template-columns: 1fr; }
    .composer-box { border-radius: 20px; gap: 7px; }
    textarea { min-height: 46px; padding: 12px; }
    #sendButton { min-width: 76px; height: 46px; }
    .disclaimer { font-size: .72rem; }
}

@media (max-width: 420px) {
    .brand-text small { display: none; }
    .nav-button { font-size: .84rem; }
    .hero-logo { width: 64px; height: 64px; border-radius: 21px; }
    .hero-logo img { width: 50px; height: 50px; }
}

/* Online Audience brand refresh - Penny + cleaner public copy */
.brand-logo img {
    width: 40px;
    height: 28px;
    object-fit: contain;
}

.hero {
    padding: 28px 22px;
    gap: 18px;
}

.hero-panel {
    width: min(880px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    align-items: center;
    gap: 22px;
    padding: 24px;
    border: 1px solid rgba(31, 67, 143, .13);
    border-radius: 30px;
    background:
        radial-gradient(circle at 92% 22%, rgba(61, 125, 255, .16), transparent 18rem),
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(245,249,255,.92));
    box-shadow: 0 22px 60px rgba(13, 35, 80, .12);
    overflow: hidden;
    text-align: left;
}

.hero-copy {
    min-width: 0;
    display: grid;
    gap: 11px;
}

.hero-logo {
    width: 82px;
    height: 58px;
    border-radius: 20px;
}

.hero-logo img {
    width: 62px;
    height: auto;
    object-fit: contain;
}

.hero h1 {
    font-size: clamp(2.4rem, 5vw, 4.65rem);
    max-width: 640px;
}

.hero p:not(.eyebrow) {
    max-width: 570px;
    font-size: 1.04rem;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.hero-badges span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(31, 67, 143, .13);
    border-radius: 999px;
    background: #fff;
    color: var(--oa-navy);
    font-size: .78rem;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(31, 67, 143, .06);
}

.hero-mascot {
    position: relative;
    display: grid;
    justify-items: center;
    align-items: end;
    margin: 0;
    min-height: 235px;
}

.hero-mascot::before {
    content: '';
    position: absolute;
    inset: auto 8% 8px;
    height: 56px;
    border-radius: 999px;
    background: radial-gradient(ellipse, rgba(31,67,143,.17), transparent 68%);
    filter: blur(2px);
}

.hero-mascot img {
    position: relative;
    z-index: 1;
    width: min(230px, 100%);
    max-height: 260px;
    object-fit: contain;
    filter: drop-shadow(0 20px 34px rgba(31, 67, 143, .22));
}

.hero-mascot figcaption {
    position: absolute;
    right: 0;
    bottom: 18px;
    z-index: 2;
    max-width: 170px;
    padding: 9px 12px;
    border: 1px solid rgba(31, 67, 143, .14);
    border-radius: 16px 16px 16px 6px;
    background: rgba(255,255,255,.94);
    color: var(--oa-navy);
    font-size: .78rem;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(13, 35, 80, .12);
}

.avatar.penny-avatar img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    object-position: center;
}

.disclaimer {
    max-width: 900px;
    margin-inline: auto;
}

@media (max-width: 820px) {
    .hero-panel {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
        padding: 22px 18px;
    }

    .hero-copy {
        justify-items: center;
    }

    .hero-badges {
        justify-content: center;
    }

    .hero-mascot {
        min-height: 190px;
        width: min(310px, 100%);
    }

    .hero-mascot img {
        max-height: 220px;
    }

    .hero-mascot figcaption {
        right: 6px;
    }
}

@media (max-width: 740px) {
    .hero {
        padding: 18px 12px;
    }

    .hero-panel {
        border-radius: 24px;
        gap: 14px;
    }

    .hero h1 {
        font-size: clamp(2.15rem, 11vw, 3.8rem);
    }

    .hero p:not(.eyebrow) {
        font-size: .96rem;
    }

    .brand-logo img {
        width: 36px;
        height: 26px;
    }
}

@media (max-width: 520px) {
    .hero-mascot {
        display: none;
    }

    .hero-badges span {
        width: 100%;
        justify-content: center;
    }
}
