.noa-chat {
    --noa-ink: #142023;
    --noa-gold: #e6bd66;
    --noa-edge: 1.25rem;
    position: fixed;
    z-index: 9990;
    inset-inline-end: max(var(--noa-edge), env(safe-area-inset-right, 0px));
    inset-block-end: max(var(--noa-edge), env(safe-area-inset-bottom, 0px));
    color: var(--noa-ink);
    font-size: .95rem;
    line-height: 1.45;
}
.noa-chat [hidden] { display: none !important; }
.noa-chat .noa-launcher {
    display: grid;
    place-items: center;
    width: 3.75rem;
    height: 3.75rem;
    padding: 0;
    border-radius: 50%;
    color: var(--noa-ink);
    background: var(--noa-gold);
    box-shadow: 0 .4rem 1.3rem #14202338;
}
.noa-chat svg { display: block; width: 1.45rem; height: 1.45rem; }
.noa-chat .noa-launcher svg { width: 1.9rem; height: 1.9rem; }
.noa-chat .noa-panel {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: min(25rem, calc(100vw - 2 * var(--noa-edge)));
    height: 34rem;
    max-height: calc(100vh - 2 * var(--noa-edge));
    max-height: calc(100dvh - 2 * var(--noa-edge) - env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    border: 1px solid #e4e1da;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 .7rem 2.5rem #14202335;
}
.noa-chat .noa-header {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .75rem 1rem;
    background: var(--noa-ink);
    color: #fff;
}
.noa-chat .noa-header h2 { margin: 0; color: inherit; font: inherit; font-weight: 700; }
.noa-chat .noa-header h2, .noa-chat .noa-bubble strong { overflow-wrap: anywhere; }
.noa-chat .noa-header > div { min-width: 0; }
.noa-chat .noa-attach { flex: 0 0 2.75rem; height: 2.75rem; border-radius: 50%; padding: 0; font-size: 1.6rem; }
.noa-chat .noa-image-consent { font-size: .8rem; }
.noa-chat .noa-image-consent button { margin: .35rem .35rem 0 0; }
.noa-chat .noa-header p { margin: 0; color: #f1d9a3; font-size: .8rem; }
.noa-chat .noa-avatar { color: var(--noa-ink); background: var(--noa-gold); padding: .5rem; border-radius: 50%; }
.noa-chat .noa-close { margin-inline-start: auto; min-width: 2.75rem; min-height: 2.75rem; padding: 0; font-size: 1.6rem; }
.noa-chat .noa-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    background-color: #f3eee5;
    background-image: radial-gradient(#b98a361c 1px, transparent 1px);
    background-size: 15px 15px;
}
.noa-chat .noa-messages { display: flex; flex-direction: column; gap: .65rem; }
.noa-chat .noa-bubble {
    align-self: flex-start;
    box-sizing: border-box;
    max-width: 88%;
    padding: .55rem .75rem;
    background: #fff;
    border-radius: .2rem .85rem .85rem .85rem;
    box-shadow: 0 1px 2px #14202322;
    overflow-wrap: anywhere;
}
.noa-chat .noa-outgoing { align-self: flex-end; background: #f7e4b5; border-radius: .85rem .2rem .85rem .85rem; }
.noa-chat .noa-bubble p { margin: 0; white-space: pre-wrap; }
.noa-chat .noa-bubble strong { display: block; font-size: .75rem; margin-bottom: .2rem; }
.noa-chat .noa-composer { padding: .7rem .85rem; background: #fff; border-top: 1px solid #e4e1da; }
.noa-chat .noa-message-form { display: flex; gap: .5rem; align-items: flex-end; margin: 0; }
.noa-chat label { display: block; font-weight: 600; }
.noa-chat textarea, .noa-chat select, .noa-chat input:not([type=checkbox]) {
    width: 100%;
    box-sizing: border-box;
    margin-top: .25rem;
    padding: .55rem;
    border: 1px solid #858983;
    border-radius: .4rem;
    background: #fff;
    color: var(--noa-ink);
    font: inherit;
}
.noa-chat .noa-help { font-size: .9rem; margin: .4rem 0 .8rem; }
.noa-chat .noa-composer .noa-help { font-size: .75rem; margin: .4rem 0 0; }
.noa-chat .noa-message-form textarea { min-width: 0; min-height: 2.75rem; margin: 0; resize: vertical; max-height: 6rem; }
.noa-chat button {
    color: #fff;
    background: var(--noa-ink);
    border: 0;
    border-radius: .5rem;
    padding: .65rem 1rem;
    cursor: pointer;
}
.noa-chat button:disabled { opacity: .6; cursor: wait; }
.noa-chat .noa-lookup-toggle { margin-bottom: .45rem; padding: .2rem 0; background: transparent; color: var(--noa-ink); font-size: .82rem; text-decoration: underline; }
.noa-chat .noa-message-form button { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; padding: 0; border-radius: 50%; }
.noa-chat .noa-review { max-width: 100%; }
.noa-chat .noa-review dl {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .35rem .75rem;
    margin: 0 0 .75rem;
}
.noa-chat .noa-review dt { font-weight: 600; }
.noa-chat .noa-review dd { margin: 0; }
.noa-chat .noa-review p { font-size: .85rem; }
.noa-chat .noa-review-actions { display: flex; gap: .5rem; margin-top: .65rem; }
.noa-chat .noa-review-actions button + button { color: var(--noa-ink); background: #f3eee5; }
.noa-chat .noa-document-card { max-width: 100%; width: 100%; margin: 0; }
.noa-chat .noa-document-card label + label { margin-top: .65rem; }
.noa-chat .noa-document-card p { margin-top: .65rem; font-size: .82rem; }
.noa-chat .noa-document-card button { margin-top: .75rem; }
.noa-chat .noa-document-card fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.noa-chat .noa-document-card legend { font-weight: 700; }
.noa-chat .noa-status { margin: 0 0 .5rem; font-size: .85rem; }
.noa-chat :focus-visible { outline: 2px solid var(--noa-gold); outline-offset: 2px; }
@media (max-width: 480px) {
    .noa-chat { --noa-edge: .75rem; }
}
