.conversation {
    scrollbar-gutter: stable;
}

.conversation::-webkit-scrollbar {
    width: 10px;
}

.conversation::-webkit-scrollbar-track {
    background: transparent;
}

.conversation::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.42);
    background-clip: padding-box;
}

.send-button {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    line-height: 1;
}

.send-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(2, 6, 23, 0.3);
    border-top-color: rgb(2, 6, 23);
    border-radius: 999px;
    background: transparent;
    animation: spin 800ms linear infinite;
}

.send-button.is-loading .send-icon {
    display: none;
}

.send-button.is-loading .send-spinner {
    display: block;
}

.exchange {
    animation: rise-in 200ms ease both;
}

.message-row {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.message-row-user {
    justify-content: flex-end;
}

.message-row-assistant {
    justify-content: flex-start;
}

.avatar {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 0.95rem;
    font-size: 0.75rem;
    font-weight: 900;
}

.avatar-user {
    background: rgba(255, 255, 255, 0.08);
    color: rgb(226, 232, 240);
}

.avatar-assistant {
    background: rgb(34, 211, 238);
    color: rgb(2, 6, 23);
    box-shadow: 0 16px 34px rgba(34, 211, 238, 0.18);
}

.message {
    width: fit-content;
    max-width: min(92ch, calc(100% - 3rem));
    padding: 0.9rem 1rem;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}

.message-user {
    border-radius: 1.25rem 1.25rem 0.35rem 1.25rem;
    border: 1px solid rgba(34, 211, 238, 0.20);
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.44), rgba(79, 70, 229, 0.34));
    color: white;
}

.message-assistant {
    border-radius: 1.25rem 1.25rem 1.25rem 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.065);
    color: rgb(226, 232, 240);
    backdrop-filter: blur(14px);
}

.message-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
    color: rgb(148, 163, 184);
    font-size: 0.72rem;
    font-weight: 700;
}

.message-text {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.65;
}

.message-pending {
    color: rgb(148, 163, 184);
    font-style: italic;
}

.message-error {
    color: rgb(252, 165, 165);
}

.suggested-questions {
    margin-top: 1rem;
    white-space: normal;
}

.suggested-questions-title {
    margin-bottom: 0.5rem;
    color: rgb(148, 163, 184);
    font-size: 0.78rem;
    font-weight: 800;
}

.suggested-questions-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggested-question {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid rgba(103, 232, 249, 0.24);
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.08);
    color: rgb(165, 243, 252);
    cursor: pointer;
    padding: 0.45rem 0.7rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.suggested-question:hover {
    border-color: rgba(103, 232, 249, 0.46);
    background: rgba(34, 211, 238, 0.14);
    color: rgb(236, 254, 255);
}

.message time {
    flex: 0 0 auto;
    color: rgb(100, 116, 139);
    font-weight: 500;
}

.law-link {
    color: rgb(103, 232, 249);
    font-weight: 700;
    text-decoration: none;
    transition: color 140ms ease;
}

.law-link:hover {
    color: rgb(165, 243, 252);
}

.law-source-link {
    display: inline-flex;
    margin-top: 0.75rem;
    color: rgb(125, 211, 252);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.law-source-link:hover {
    color: rgb(186, 230, 253);
}

.receipt-upload {
    max-width: 42rem;
}

.receipt-dropzone {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 7rem;
    border: 1px dashed rgba(94, 234, 212, 0.32);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.055);
    cursor: pointer;
    padding: 1.1rem;
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.receipt-dropzone:hover {
    border-color: rgba(94, 234, 212, 0.58);
    background: rgba(20, 184, 166, 0.10);
    transform: translateY(-1px);
}

.blocky-icon-button,
.blocky-action,
.blocky-primary,
.blocky-secondary,
.blocky-tab {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    font: inherit;
    line-height: 1;
    white-space: nowrap;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.blocky-icon-button {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.045);
    color: rgb(203, 213, 225);
}

.blocky-icon-button:hover,
.blocky-action:hover,
.blocky-secondary:hover,
.blocky-tab:hover {
    border-color: rgba(94, 234, 212, 0.32);
    background: rgba(20, 184, 166, 0.09);
    color: white;
}

.blocky-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.blocky-counts {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    gap: 0.75rem;
    color: rgb(100, 116, 139);
    font-size: 0.74rem;
    font-weight: 750;
    white-space: nowrap;
}

.blocky-action,
.blocky-secondary,
.blocky-primary {
    min-height: 2.35rem;
    border-radius: 0.55rem;
    padding: 0.62rem 0.82rem;
    color: rgb(226, 232, 240);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
}

.blocky-action,
.blocky-secondary {
    background: rgba(255, 255, 255, 0.045);
}

.blocky-primary {
    border-color: rgba(94, 234, 212, 0.56);
    background: rgb(94, 234, 212);
    color: rgb(2, 6, 23);
}

.blocky-primary:hover {
    background: rgb(153, 246, 228);
}

.blocky-primary:disabled,
.blocky-secondary:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.blocky-stat {
    min-height: 4.35rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.85rem 1rem;
}

.blocky-stat span {
    display: block;
    color: rgb(100, 116, 139);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.blocky-stat strong {
    display: block;
    margin-top: 0.25rem;
    color: white;
    font-size: 1.3rem;
    line-height: 1;
}

.blocky-tab {
    min-height: 2rem;
    border-radius: 0.5rem;
    background: transparent;
    color: rgb(148, 163, 184);
    cursor: pointer;
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.blocky-tab.is-active {
    border-color: rgba(94, 234, 212, 0.34);
    background: rgba(20, 184, 166, 0.12);
    color: rgb(204, 251, 241);
}

.blocky-table-wrap {
    height: calc(100svh - 6.65rem);
    min-height: 26rem;
    overflow: auto;
    scrollbar-gutter: stable;
}

.blocky-table {
    width: 100%;
    min-width: 72rem;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.78rem;
}

.blocky-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    background: rgb(13, 16, 21);
    color: rgb(100, 116, 139);
    padding: 0.65rem 0.55rem;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.68rem;
    font-weight: 900;
}

.blocky-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    padding: 0.42rem 0.55rem;
    vertical-align: middle;
}

.blocky-table tr {
    transition: background 120ms ease;
}

.blocky-table tbody tr:hover,
.blocky-table tbody tr.is-selected {
    background: rgba(20, 184, 166, 0.075);
}

.blocky-cell-input {
    width: 100%;
    min-width: 4.2rem;
    border: 1px solid transparent;
    border-radius: 0.4rem;
    background: transparent;
    color: rgb(226, 232, 240);
    font: inherit;
    line-height: 1.3;
    padding: 0.38rem 0.42rem;
}

.blocky-cell-input:focus {
    border-color: rgba(94, 234, 212, 0.45);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.blocky-check {
    width: 1rem;
    height: 1rem;
    accent-color: rgb(94, 234, 212);
}

.blocky-empty {
    height: 12rem;
    color: rgb(100, 116, 139);
    text-align: center;
}

.blocky-preview {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1rem;
    overflow: auto;
    padding: 1rem;
}

.blocky-page {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 0.65rem;
    background: white;
}

.blocky-page img {
    display: block;
    width: 100%;
    height: auto;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 680px) {
    .message-row {
        gap: 0.55rem;
    }

    .avatar {
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 0.8rem;
    }

    .message {
        max-width: calc(100% - 2.4rem);
        padding: 0.8rem 0.9rem;
    }

    .message-head {
        flex-direction: column;
        gap: 0.12rem;
    }
}
