.property-assistant,
.property-assistant * {
    box-sizing: border-box;
}

.property-assistant {
    --assistant-yellow: #f4ce28;
    --assistant-yellow-soft: #ffecaa;
    --assistant-ink: #101010;
    --assistant-border: #dedbd4;
    --assistant-avatar-image: url("./michael.png");
    --assistant-edge: 1rem;

    position: fixed;
    z-index: 50;
    right: max(var(--assistant-edge), env(safe-area-inset-right));
    bottom: max(var(--assistant-edge), env(safe-area-inset-bottom));
    display: grid;
    justify-items: end;
    width: min(27rem, calc(100vw - 2 * var(--assistant-edge)));
    color: var(--assistant-ink);
    pointer-events: none;
}

.property-assistant [hidden] {
    display: none !important;
}

.property-assistant button {
    font: inherit;
    cursor: pointer;
}

.property-assistant :is(button, a, input):focus-visible {
    outline: 2px solid #795c00;
    outline-offset: 3px;
}

.assistant-launch,
.assistant-panel {
    pointer-events: auto;
}

.assistant-launch {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    max-width: 100%;
    padding: .45rem .95rem .45rem .5rem;
    border: 2px solid var(--assistant-yellow);
    border-radius: 999px;
    background: #fff;
    color: var(--assistant-ink);
    text-align: left;
    box-shadow: 0 8px 24px #10101026;
}

.assistant-launch:hover {
    background: #fffaf0;
}

.assistant-avatar {
    display: block;
    flex: none;
    border-radius: 50%;
    background: var(--assistant-yellow);
    object-fit: cover;
}

.assistant-launch .assistant-avatar {
    width: 46px;
    height: 46px;
}

.assistant-heading .assistant-avatar {
    width: 56px;
    height: 56px;
}

.assistant-launch-copy,
.assistant-heading-copy {
    display: grid;
    min-width: 0;
    gap: .1rem;
}

.assistant-launch-copy strong {
    font-size: 1rem;
    line-height: 1.2;
}

.assistant-launch-copy small,
.assistant-heading-copy p {
    margin: 0;
    color: #403c34;
    font-size: .8rem;
    line-height: 1.35;
}

.assistant-launch-icon {
    flex: none;
    margin-left: .2rem;
}

.assistant-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    height: min(36rem, calc(100vh - 2 * var(--assistant-edge)));
    height: min(36rem, calc(100dvh - max(var(--assistant-edge), env(safe-area-inset-bottom)) - var(--assistant-edge)));
    border: 1px solid var(--assistant-border);
    border-radius: 1.3rem;
    background: #fff;
    box-shadow: 0 16px 44px #10101030;
}

.assistant-heading {
    display: flex;
    flex: none;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    background: var(--assistant-yellow-soft);
}

.assistant-heading h2 {
    margin: 0;
    font: inherit;
    font-size: 1.25rem;
    font-weight: 750;
    line-height: 1.2;
}

.property-assistant .assistant-close {
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 1.6rem;
    line-height: 1;
}

.assistant-close:hover {
    background: #1010100d;
}

.assistant-log {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .9rem;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem;
}

.assistant-entry {
    position: relative;
    display: grid;
    flex: none;
    justify-items: start;
    gap: .55rem;
    padding-left: 2.5rem;
}

.assistant-entry:not(.assistant-outgoing)::before {
    content: "";
    position: absolute;
    top: .1rem;
    left: 0;
    width: 1.95rem;
    height: 1.95rem;
    border-radius: 50%;
    background: var(--assistant-yellow) var(--assistant-avatar-image) center / cover no-repeat;
}

.assistant-message {
    min-width: 0;
    max-width: 100%;
    padding: .65rem .8rem;
    border-radius: .85rem;
    background: #f1efec;
    font-size: .9rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.assistant-message p {
    margin: 0;
}

.assistant-message a {
    display: block;
    margin-top: .35rem;
    color: #684f00;
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: .15em;
}

.assistant-outgoing {
    justify-items: end;
    padding-left: 0;
}

.assistant-outgoing .assistant-message {
    max-width: 88%;
    background: var(--assistant-yellow-soft);
}

.assistant-entry .assistant-listing {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    min-width: 0;
    padding: .6rem;
    border: 1px solid var(--assistant-border);
    border-radius: .85rem;
    background: #fff;
    color: var(--assistant-ink);
    text-decoration: none;
}

.assistant-entry .assistant-listing:hover {
    border-color: #b88c00;
    background: #fffaf0;
}

.assistant-listing img {
    display: block;
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
    border-radius: .55rem;
    object-fit: cover;
}

.assistant-listing-copy {
    display: grid;
    min-width: 0;
    gap: .2rem;
    overflow-wrap: anywhere;
}

.assistant-listing-copy strong {
    font-size: .9rem;
    line-height: 1.3;
}

.assistant-listing-copy small {
    color: #4b4841;
    font-size: .8rem;
    line-height: 1.35;
}

.assistant-listing-copy .assistant-listing-price {
    color: var(--assistant-ink);
    font-weight: 750;
}

.assistant-listing-action {
    color: #795c00;
    font-size: .8rem;
    font-weight: 700;
}

.assistant-prompts {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .45rem .85rem .6rem;
}

.assistant-prompts button {
    padding: .3rem .6rem;
    border: 1px solid var(--assistant-border);
    border-radius: 999px;
    background: #fff;
    color: var(--assistant-ink);
    font-size: .75rem;
    line-height: 1.3;
}

.assistant-prompts button:hover {
    background: #fff7d6;
}

.assistant-form {
    display: flex;
    flex: none;
    align-items: center;
    gap: .55rem;
    margin: 0;
    padding: .75rem;
    border-top: 1px solid #eeeae2;
    background: #fff;
}

.assistant-form input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: .55rem .75rem;
    border: 1px solid #c8c5bd;
    border-radius: .75rem;
    background: #fff;
    color: var(--assistant-ink);
    font: inherit;
    font-size: 16px;
}

.assistant-form button {
    display: grid;
    flex: 0 0 44px;
    place-items: center;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: .75rem;
    background: var(--assistant-yellow);
    color: var(--assistant-ink);
}

.assistant-form button:disabled {
    opacity: .55;
    cursor: wait;
}

.assistant-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .property-assistant {
        --assistant-edge: .65rem;
    }

    .assistant-heading {
        padding: .7rem .8rem;
    }

    .assistant-heading .assistant-avatar {
        width: 46px;
        height: 46px;
    }

    .assistant-log {
        padding: .75rem;
    }

    .assistant-listing img {
        flex-basis: 60px;
        width: 60px;
        height: 60px;
    }
}