﻿* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background: #111318;
    color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat {
    width: min(900px, 94vw);
    height: min(780px, 92vh);
    background: #1a1d24;
    border: 1px solid #2a2f39;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat__header {
    padding: 18px 22px;
    border-bottom: 1px solid #2a2f39;
}

.chat__header h1 {
    margin: 0;
    font-size: 24px;
}

.chat__header p {
    margin: 4px 0 0;
    color: #9ea6b2;
    font-size: 14px;
}

.chat__messages {
    flex: 1;
    padding: 22px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat__messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 190, 120, 0.45) transparent;
}

.joi-state {
    -webkit-user-select: none;
    user-select: none;
}
.chat__messages::-webkit-scrollbar {
    width: 6px;
}

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

.chat__messages::-webkit-scrollbar-thumb {
    background: rgba(255, 190, 120, 0.38);
    border-radius: 999px;
}

.chat__messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 190, 120, 0.58);
}

.message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.message a {
    color: #d9a066;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.message a:hover {
    color: #f0c79b;
}

.message--joi {
    align-self: flex-start;
    background: #292e38;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    min-height: 20px;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 190, 120, 0.9);
    box-shadow: 0 0 8px rgba(255, 190, 120, 0.35);
    animation: joi-thinking 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes joi-thinking {
    0%,
    60%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

.message--user {
    align-self: flex-end;
    background: #3a4658;
}

.chat__form {
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid #2a2f39;
}

.chat__input {
    flex: 1;
    min-width: 0;
    border: 1px solid #343a46;
    border-radius: 12px;
    padding: 12px 14px;
    background: #111318;
    color: #ffffff;
    outline: none;
}

.chat__input:focus {
    border-color: #69778f;
}

.chat__input:empty::before {
    content: attr(data-placeholder);
    color: #7f8794;
    pointer-events: none;
}

.chat__form button {
    border: none;
    border-radius: 12px;
    padding: 0 18px;
    cursor: pointer;
    font-weight: 600;
}

.chat__form button:hover {
    opacity: 0.9;
}
.chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background:
        linear-gradient(
            180deg,
            rgba(255, 177, 92, 0.06),
            rgba(255, 177, 92, 0)
        );
}

.chat__header h1 {
    letter-spacing: 0.08em;
    font-weight: 500;
}

.chat__header button {
    border: 1px solid rgba(255, 184, 112, 0.28);
    background: transparent;
    color: #f0c79b;
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
}

.chat__header button:hover {
    background: rgba(255, 184, 112, 0.08);
}

.joi-state {
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255, 184, 112, 0.14);
    background:
        linear-gradient(
            90deg,
            rgba(255, 170, 85, 0.06),
            rgba(255, 170, 85, 0.015)
        );
}

.joi-state__main {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.joi-state__label {
    font-size: 10px;
    letter-spacing: 0.22em;
    color: #8d929c;
}

.joi-state__mood {
    font-size: 16px;
    font-weight: 500;
    color: #f0c79b;
}

.joi-state__energy {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #b8bec8;
}

.joi-state__bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.joi-state__bar-fill {
    width: 0;
    height: 100%;
    background:
        linear-gradient(
            90deg,
            #9e734d,
            #e6b982
        );
    transition: width 0.4s ease;
}

.joi-state__emotions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.joi-state__emotions span {
    padding: 5px 9px;
    border: 1px solid rgba(255, 184, 112, 0.16);
    border-radius: 999px;
    font-size: 11px;
    color: #c6a989;
    background: rgba(255, 184, 112, 0.035);
}
.joi-state__energy + .joi-state__energy {
    margin-top: 9px;
}

.joi-state__energy {
    grid-template-columns: 80px 180px 42px;
    justify-content: start;
}

/* ===== Joi onboarding ===== */

.onboarding-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(255, 170, 85, 0.08),
            transparent 45%
        ),
        #090b0f;
}

.onboarding {
    width: min(920px, 100%);
    padding: 38px;
    border: 1px solid rgba(255, 184, 112, 0.16);
    border-radius: 18px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 177, 92, 0.045),
            rgba(255, 177, 92, 0.01)
        ),
        rgba(12, 15, 20, 0.94);

    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.onboarding__intro {
    max-width: 660px;
    margin-bottom: 32px;
}

.onboarding__eyebrow {
    margin-bottom: 14px;
    font-size: 10px;
    letter-spacing: 0.28em;
    color: #8d929c;
}

.onboarding h1 {
    margin: 0 0 14px;
    font-size: 38px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: #f0c79b;
}

.onboarding__text {
    margin: 0;
    max-width: 580px;
    font-size: 18px;
    line-height: 1.6;
    color: #d4d8df;
}

.onboarding__hint {
    margin: 12px 0 0;
    max-width: 580px;
    font-size: 13px;
    line-height: 1.6;
    color: #858b95;
}

.relationship-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.relationship-card {
    position: relative;
    min-height: 150px;
    padding: 22px;
    text-align: left;
    cursor: pointer;

    border: 1px solid rgba(255, 184, 112, 0.14);
    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            rgba(255, 177, 92, 0.045),
            rgba(255, 177, 92, 0.008)
        );

    color: inherit;

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.relationship-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 184, 112, 0.36);

    background:
        linear-gradient(
            135deg,
            rgba(255, 177, 92, 0.09),
            rgba(255, 177, 92, 0.02)
        );

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.22),
        inset 0 0 22px rgba(255, 177, 92, 0.025);
}

.relationship-card:focus-visible {
    outline: 1px solid #e6b982;
    outline-offset: 3px;
}

.relationship-card:disabled {
    cursor: wait;
    opacity: 0.55;
}

.relationship-card__number {
    display: block;
    margin-bottom: 18px;
    font-size: 10px;
    letter-spacing: 0.22em;
    color: #8d929c;
}

.relationship-card__title {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 500;
    color: #f0c79b;
}

.relationship-card__description {
    display: block;
    max-width: 330px;
    font-size: 13px;
    line-height: 1.5;
    color: #989ea8;
}

.onboarding__error {
    min-height: 18px;
    margin: 18px 0 0;
    font-size: 12px;
    color: #d7a18e;
}

@media (max-width: 680px) {
    .onboarding-page {
        padding: 20px 12px;
    }

    .onboarding {
        padding: 26px 20px;
    }

    .onboarding h1 {
        font-size: 32px;
    }

    .relationship-options {
        grid-template-columns: 1fr;
    }
}

/* ===== Joi auth ===== */

.auth-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(
            circle at 50% 18%,
            rgba(255, 170, 85, 0.08),
            transparent 42%
        ),
        #090b0f;
}

.auth-panel {
    width: min(460px, 100%);
    padding: 38px;
    border: 1px solid rgba(255, 184, 112, 0.16);
    border-radius: 18px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 177, 92, 0.045),
            rgba(255, 177, 92, 0.01)
        ),
        rgba(12, 15, 20, 0.94);

    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.auth-panel__eyebrow {
    margin-bottom: 16px;
    font-size: 10px;
    letter-spacing: 0.28em;
    color: #8d929c;
}

.auth-panel h1 {
    margin: 0;
    font-size: 42px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: #f0c79b;
}

.auth-panel__title {
    margin: 14px 0 0;
    font-size: 20px;
    color: #d4d8df;
}

.auth-panel__description {
    margin: 10px 0 28px;
    font-size: 13px;
    line-height: 1.6;
    color: #858b95;
}

.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-form label {
    margin: 0 0 7px;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8d929c;
}

.auth-form input {
    width: 100%;
    height: 46px;
    margin-bottom: 18px;
    padding: 0 14px;

    border: 1px solid rgba(255, 184, 112, 0.16);
    border-radius: 10px;

    background: rgba(7, 9, 13, 0.7);
    color: #f5f5f5;

    font-size: 14px;
    outline: none;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.auth-form input::placeholder {
    color: #555c66;
}

.auth-form input:focus {
    border-color: rgba(255, 184, 112, 0.48);
    background: rgba(12, 15, 20, 0.92);

    box-shadow:
        0 0 0 3px rgba(255, 184, 112, 0.04);
}

.auth-form button {
    height: 46px;
    margin-top: 4px;

    border: 1px solid rgba(255, 184, 112, 0.3);
    border-radius: 10px;

    background:
        linear-gradient(
            90deg,
            rgba(158, 115, 77, 0.3),
            rgba(230, 185, 130, 0.18)
        );

    color: #f0c79b;
    font-weight: 500;
    letter-spacing: 0.06em;

    cursor: pointer;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.auth-form button:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 184, 112, 0.48);

    background:
        linear-gradient(
            90deg,
            rgba(158, 115, 77, 0.42),
            rgba(230, 185, 130, 0.24)
        );
}

.auth-form__error {
    min-height: 18px;
    margin: 12px 0 0;
    font-size: 12px;
    color: #d7a18e;
}

.beta-access {
    margin: 4px 0 18px;
    padding: 16px;

    border: 1px solid rgba(255, 184, 112, 0.18);
    border-radius: 10px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 177, 92, 0.035),
            rgba(255, 177, 92, 0.01)
        ),
        rgba(7, 9, 13, 0.55);
}

.beta-access__eyebrow {
    margin-bottom: 10px;

    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;

    color: #cfa87e;
}

.beta-access__text {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 10px;

    font-size: 12px;
    line-height: 1.65;

    color: #8d929c;
}

.beta-access__text h3 {
    margin: 0 0 8px;

    font-size: 13px;
    font-weight: 500;

    color: #d4d8df;
}

.beta-access__text p {
    margin: 0 0 12px;
}

.beta-access__text strong {
    color: #c9cdd4;
    font-weight: 500;
}

.beta-access__text::-webkit-scrollbar {
    width: 4px;
}

.beta-access__text::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: rgba(255, 184, 112, 0.25);
}

.beta-access__accept {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    margin-top: 14px !important;

    font-size: 11px !important;
    line-height: 1.5;
    letter-spacing: 0 !important;
    text-transform: none !important;

    color: #a6abb3 !important;
    cursor: pointer;
}

.auth-form .beta-access__accept input {
    width: 16px;
    height: 16px;
    min-width: 16px;

    margin: 1px 0 0;
    padding: 0;

    accent-color: #cfa87e;
    cursor: pointer;
}

.auth-panel__footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 184, 112, 0.1);

    font-size: 12px;
    color: #777e88;
}

.auth-panel__footer a {
    margin-left: 4px;
    color: #cfa87e;
    text-decoration: none;
}

.auth-panel__footer a:hover {
    color: #f0c79b;
}

@media (max-width: 520px) {
    .auth-page {
        padding: 20px 12px;
    }

    .auth-panel {
        padding: 28px 22px;
    }

    .auth-panel h1 {
        font-size: 36px;
    }
}

/* ===== Joi mobile chat ===== */

@media (max-width: 680px) {
    body {
        min-height: 100dvh;
        align-items: stretch;
        justify-content: stretch;
    }

    .chat {
        width: 100%;
        height: 100dvh;
        border: none;
        border-radius: 0;
    }

    .chat__header {
        padding:
            calc(14px + env(safe-area-inset-top))
            16px
            14px;
    }

    .chat__header h1 {
        font-size: 21px;
    }

    .chat__header button {
        padding: 8px 12px;
    }

    .joi-state {
        padding: 12px 16px;
    }

    .joi-state__main {
        margin-bottom: 10px;
    }

    .joi-state__mood {
        font-size: 14px;
    }

    .joi-state__energy {
        grid-template-columns: 72px minmax(0, 1fr) 38px;
        width: 100%;
        gap: 8px;
    }

    .joi-state__emotions {
        gap: 6px;
        margin-top: 10px;
    }

    .joi-state__emotions span {
        padding: 4px 7px;
        font-size: 10px;
    }

    .chat__messages {
        padding: 14px;
        gap: 10px;
    }

    .message {
        max-width: 88%;
        padding: 10px 13px;
        font-size: 15px;
        line-height: 1.45;
    }

    .chat__form {
        gap: 8px;
        padding:
            10px
            10px
            calc(10px + env(safe-area-inset-bottom));
    }

    .chat__input {
        min-width: 0;
        padding: 12px;
        font-size: 16px;
    }

    .chat__form button {
        padding: 0 14px;
    }
}
.joi-state {
    position: relative;
}

#voiceModeButton {
    position: static;
    margin-left: auto;
    margin-right: 10px;

    padding: 7px 14px;

    background: rgba(20, 22, 27, 0.85);
    border: 1px solid rgba(218, 151, 85, 0.55);
    border-radius: 14px;

    color: #d9a066;
    font-size: 12px;
    letter-spacing: 0.4px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

#voiceModeButton:hover {
    background: rgba(218, 151, 85, 0.08);
    border-color: rgba(218, 151, 85, 0.9);
}

#voiceModeButton.voice-active {
    background: rgba(218, 151, 85, 0.14);
    border-color: #d9a066;
    box-shadow: 0 0 12px rgba(218, 151, 85, 0.22);
}

#systemMenu {
    position: absolute;
    top: 58px;
    right: 22px;

    display: flex;
    flex-direction: column;
    gap: 0;

    min-width: 220px;
    padding: 6px;

    background: rgba(20, 22, 27, 0.98);
    border: 1px solid rgba(218, 151, 85, 0.35);
    border-radius: 14px;

    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);

    z-index: 20;
}

#systemMenu[hidden] {
    display: none;
}

.joi-dialog[hidden] {
    display: none;
}

.joi-dialog {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.joi-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 7, 10, 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.joi-dialog__panel {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    max-height: min(680px, calc(100dvh - 40px));
    overflow-y: auto;
    padding: 28px;
    background: #15181e;
    border: 1px solid rgba(218, 151, 85, 0.38);
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
}

.joi-dialog__panel {
    scrollbar-width: thin;
    scrollbar-color: rgba(218, 151, 85, 0.55) rgba(255, 255, 255, 0.035);
}

.joi-dialog__panel::-webkit-scrollbar {
    width: 7px;
}

.joi-dialog__panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.035);
    border-radius: 999px;
}

.joi-dialog__panel::-webkit-scrollbar-thumb {
    background: rgba(218, 151, 85, 0.48);
    border-radius: 999px;
}

.joi-dialog__panel::-webkit-scrollbar-thumb:hover {
    background: rgba(218, 151, 85, 0.72);
}

.joi-dialog__panel::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.joi-dialog__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #c8cdd5;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.joi-dialog__close:hover {
    background: rgba(218, 151, 85, 0.1);
    color: #f0c79b;
}

.joi-dialog__eyebrow {
    margin-bottom: 8px;
    padding-right: 40px;
    color: #d9a066;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.joi-dialog h2 {
    margin: 0 0 18px;
    color: #f4e7d8;
    font-size: 24px;
}

.joi-dialog p {
    margin: 0 0 14px;
    color: #c8cdd5;
    font-size: 14px;
    line-height: 1.6;
}

.joi-dialog__section {
    margin-top: 22px;
}

.joi-dialog__section h3 {
    margin: 0 0 8px;
    color: #e4b47f;
    font-size: 14px;
    font-weight: 600;
}

.joi-dialog__section p {
    margin-bottom: 0;
}

.joi-dialog__note {
    margin-top: 24px !important;
    padding: 12px 14px;
    background: rgba(218, 151, 85, 0.07);
    border-left: 2px solid rgba(218, 151, 85, 0.7);
    border-radius: 8px;
}

.joi-dialog__version {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #2a2f39;
    color: #858d99;
    font-size: 12px;
}

body.dialog-open {
    overflow: hidden;
}

#systemMenu button {
    width: 100%;
    padding: 10px 12px;

    border: none;
    border-radius: 8px;

    background: transparent;
    color: #f0c79b;

    text-align: left;
    font-size: 13px;

    cursor: pointer;
}

#systemMenu button:hover {
    background: rgba(218, 151, 85, 0.09);
}

#deleteDataButton {
    color: #e28a62;
}

#deleteDataButton:hover {
    background: rgba(226, 92, 62, 0.12);
    color: #ff9a70;
}

#voiceRecordButton {
    min-width: 48px;
    height: 42px;

    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;
    line-height: 1;

    border: 1px solid rgba(218, 151, 85, 0.55);
    border-radius: 12px;

    background: rgba(20, 22, 27, 0.9);
    color: #d9a066;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.1s ease;
}

#voiceRecordButton:hover {
    background: rgba(218, 151, 85, 0.10);
    border-color: #d9a066;
}

#voiceRecordButton.recording {
    background: rgba(218, 151, 85, 0.16);
    border-color: #d9a066;
    box-shadow: 0 0 14px rgba(218, 151, 85, 0.30);
    transform: scale(0.96);
}

#voiceRecordButton {
    position: relative;
}


/* Joi state tooltips */
.joi-state [data-tooltip] {
    position: relative;
    cursor: help;
}

.joi-state [data-tooltip]::after {
    content: attr(data-tooltip);

    position: absolute;
    z-index: 1000;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);

    width: max-content;
    max-width: 260px;
    padding: 7px 10px;

    background: rgba(20, 22, 27, 0.98);
    border: 1px solid rgba(218, 151, 85, 0.55);
    border-radius: 8px;

    color: #d9a066;
    font-size: 12px;
    line-height: 1.35;
    text-align: left;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        visibility 0.15s ease;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.joi-state [data-tooltip]:hover::after,
.joi-state [data-tooltip]:focus::after,
.joi-state [data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Keep tooltips inside the viewport on narrow screens. */
@media (max-width: 600px) {
    .joi-state [data-tooltip]::after {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 92px;

        width: auto;
        max-width: none;

        transform: translateY(4px);
        text-align: center;
    }

    .joi-state [data-tooltip]:hover::after,
    .joi-state [data-tooltip]:focus::after,
    .joi-state [data-tooltip]:focus-visible::after {
        transform: translateY(0);
    }
}
#voiceRecordButton::after {
    content: attr(data-tooltip);

    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);

    padding: 7px 10px;
    white-space: nowrap;

    background: rgba(20, 22, 27, 0.98);
    border: 1px solid rgba(218, 151, 85, 0.55);
    border-radius: 8px;

    color: #d9a066;
    font-size: 12px;
    font-weight: 400;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        visibility 0.15s ease;

    z-index: 30;
}

#voiceRecordButton:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

#sendButton {
    background: rgba(20, 22, 27, 0.9);
    border: 1px solid rgba(218, 151, 85, 0.55);
    color: #d9a066;

    border-radius: 12px;
    padding: 0 18px;

    font-size: 13px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

#sendButton:hover {
    background: rgba(218, 151, 85, 0.10);
    border-color: #d9a066;
    box-shadow: 0 0 12px rgba(218, 151, 85, 0.18);
}

#menuButton {
    background: rgba(20, 22, 27, 0.9);
    border: 1px solid rgba(218, 151, 85, 0.55);
    color: #d9a066;
}

#menuButton:hover {
    background: rgba(218, 151, 85, 0.10);
    border-color: #d9a066;
    box-shadow: 0 0 12px rgba(218, 151, 85, 0.18);
}

#voiceBetaNotice {
    position: absolute;
    top: 64px;
    right: 82px;

    display: flex;
    flex-direction: column;
    gap: 4px;

    width: 290px;
    padding: 12px 14px;

    background: rgba(20, 22, 27, 0.98);
    border: 1px solid rgba(218, 151, 85, 0.55);
    border-radius: 12px;

    color: #d9a066;
    font-size: 12px;
    line-height: 1.4;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);

    z-index: 30;
}

#voiceBetaNotice strong {
    color: #f0c79b;
    font-size: 13px;
}

#voiceBetaNotice span {
    color: rgba(240, 199, 155, 0.82);
}

#voiceBetaNotice[hidden] {
    display: none;
}

.field-hint {
    margin-top: -4px;
    margin-bottom: 8px;

    color: rgba(218, 151, 85, 0.68);
    font-size: 11px;
    line-height: 1.35;
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.password-field input {
    width: 100%;
    margin-bottom: 0;
    padding-right: 48px;
    box-sizing: border-box;
}

.auth-form .password-toggle {
    all: unset;

    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: rgba(218, 151, 85, 0.72);
    font-size: 22px;
    line-height: 1;

    cursor: pointer;
    box-sizing: border-box;

    transition:
        color 0.18s ease,
        text-shadow 0.18s ease;
}

.auth-form .password-toggle:hover {
    border: none;
    background: transparent;
    box-shadow: none;

    color: #d9a066;
    text-shadow: 0 0 8px rgba(218, 151, 85, 0.55);

    transform: translateY(-50%);
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
    -webkit-text-fill-color: #f5f5f5;
    caret-color: #f5f5f5;

    -webkit-box-shadow:
        0 0 0 1000px #090b0f inset;

    box-shadow:
        0 0 0 1000px #090b0f inset;

    border: 1px solid rgba(255, 184, 112, 0.16);

    transition: background-color 9999s ease-out 0s;
}


.joi-dialog select,
.joi-dialog textarea {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
}

.joi-dialog textarea {
    resize: vertical;
    min-height: 110px;
}

.joi-feedback-card {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
}

.joi-feedback-card p {
    margin: 7px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}


/* Feedback dialog */

#feedbackDialog label {
    display: block;
    margin: 16px 0 7px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 600;
}

#feedbackDialog select,
#feedbackDialog textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(210, 148, 78, 0.38);
    border-radius: 10px;
    background: rgba(8, 11, 15, 0.72);
    color: rgba(255, 255, 255, 0.92);
    font: inherit;
    outline: none;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

#feedbackDialog select {
    min-height: 42px;
    padding: 0 38px 0 12px;
    cursor: pointer;
}

#feedbackDialog textarea {
    min-height: 120px;
    padding: 11px 12px;
    line-height: 1.45;
    resize: vertical;
}

#feedbackDialog textarea::placeholder {
    color: rgba(255, 255, 255, 0.32);
}

#feedbackDialog select:hover,
#feedbackDialog textarea:hover {
    border-color: rgba(224, 159, 84, 0.58);
}

#feedbackDialog select:focus,
#feedbackDialog textarea:focus {
    border-color: rgba(230, 164, 88, 0.88);
    background: rgba(10, 13, 18, 0.92);
    box-shadow: 0 0 0 3px rgba(210, 148, 78, 0.10);
}

#feedbackDialog select option {
    background: #15181e;
    color: rgba(255, 255, 255, 0.92);
}

#feedbackSubmitButton {
    margin-top: 12px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(210, 148, 78, 0.48);
    border-radius: 10px;
    background: rgba(210, 148, 78, 0.08);
    color: #e2ad72;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

#feedbackSubmitButton:hover {
    background: rgba(210, 148, 78, 0.15);
    border-color: rgba(224, 159, 84, 0.72);
}

#feedbackSubmitButton:active {
    transform: translateY(1px);
}

#feedbackSubmitButton:disabled {
    opacity: 0.5;
    cursor: default;
}

#feedbackDialog .joi-dialog__section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(210, 148, 78, 0.18);
}

#feedbackDialog .joi-dialog__section h3 {
    margin: 0 0 10px;
    color: #e2ad72;
    font-size: 14px;
}

#feedbackHistory > p {
    margin: 0;
    color: rgba(255, 255, 255, 0.52);
    font-size: 13px;
}

.joi-feedback-card {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(210, 148, 78, 0.20);
    border-radius: 10px;
    background: rgba(8, 11, 15, 0.42);
}

.joi-feedback-card strong {
    color: #e2ad72;
    font-size: 12px;
}

.joi-feedback-card p {
    margin: 7px 0 0;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Joi custom feedback select */

#feedbackType {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.joi-select {
    position: relative;
    width: 100%;
}

.joi-select__trigger {
    position: relative;
    width: 100%;
    min-height: 42px;
    padding: 0 52px 0 16px;
    border: 1px solid rgba(210, 148, 78, 0.48);
    border-radius: 10px;
    background: rgba(8, 11, 15, 0.72);
    color: rgba(255, 255, 255, 0.92);
    font: inherit;
    text-align: left;
    cursor: pointer;
    outline: none;
}

.joi-select__trigger:hover {
    border-color: rgba(224, 159, 84, 0.68);
}

.joi-select__trigger:focus,
.joi-select.is-open .joi-select__trigger {
    border-color: rgba(230, 164, 88, 0.90);
    background: rgba(10, 13, 18, 0.94);
    box-shadow: 0 0 0 3px rgba(210, 148, 78, 0.10);
}

.joi-select__arrow {
    position: absolute;
    top: 50%;
    right: 19px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #e2ad72;
    border-bottom: 2px solid #e2ad72;
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.18s ease;
}

.joi-select.is-open .joi-select__arrow {
    transform: translateY(-30%) rotate(225deg);
}

.joi-select__menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    padding: 5px;
    border: 1px solid rgba(210, 148, 78, 0.45);
    border-radius: 10px;
    background: #11151b;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}

.joi-select__option {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.joi-select__option:hover,
.joi-select__option:focus {
    background: rgba(210, 148, 78, 0.12);
    color: #f0c18d;
    outline: none;
}

.joi-select__option.is-selected {
    background: rgba(210, 148, 78, 0.18);
    color: #e8b77f;
}

/* Keep Joi dialogs inside their horizontal bounds */

.joi-dialog__panel {
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    overflow-x: hidden;
}

#feedbackDialog,
#feedbackDialog * {
    box-sizing: border-box;
}

#feedbackDialog .joi-select,
#feedbackDialog textarea,
#feedbackDialog select {
    max-width: 100%;
}



/* --- Chat attachments --- */

.chat__attachment-button {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    font-size: 21px;
    line-height: 1;
    opacity: 0.72;
    transition:
        opacity 0.15s ease,
        background 0.15s ease;
}

.chat__attachment-button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.chat__attachment-input {
    display: none;
}

.chat__attachment-chip {
    display: none;
    align-items: center;
    gap: 7px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    height: 32px;
    padding: 0 9px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 13px;
}

.chat__attachment-chip.is-visible {
    display: flex;
    order: -2;
    flex: 0 1 auto;
    width: max-content;
    max-width: 60%;
    margin-bottom: 6px;
}

.chat__form:has(.chat__attachment-chip.is-visible) {
    flex-wrap: wrap;
    row-gap: 0;
}

/* Keep the content-sized chip on its own row without stretching it. */
.chat__form:has(.chat__attachment-chip.is-visible)::before {
    content: "";
    order: -1;
    flex: 0 0 100%;
    height: 0;
}

@media (max-width: 680px) {
    .chat__attachment-chip.is-visible {
        max-width: 100%;
    }
}

.chat__form .chat__attachment-remove {
    width: 26px;
    height: 26px;
    padding: 0;
    color: #d9a066;
}

.chat__attachment-remove:focus-visible {
    outline: 1px solid #d9a066;
    outline-offset: -1px;
}

.chat__attachment-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat__attachment-remove {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    opacity: 0.7;
}

.chat__attachment-remove:hover {
    opacity: 1;
}



/* --- Joi compact composer controls --- */

.chat__form {
    gap: 8px;
    padding-left: 8px;
}

.chat__attachment-button {
    width: 34px;
    height: 42px;
    font-size: 0;
    color: #d9a066;
    opacity: 0.78;
}

.chat__attachment-button::before {
    content: "";
    width: 18px;
    height: 18px;
    display: block;
    background: currentColor;
    -webkit-mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 11.5 11 21a6 6 0 0 1-8.5-8.5l10-10a4 4 0 0 1 5.7 5.6L8.7 17.6a2 2 0 0 1-2.8-2.8l8.8-8.8'/%3E%3C/svg%3E")
        center / contain no-repeat;
    mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 11.5 11 21a6 6 0 0 1-8.5-8.5l10-10a4 4 0 0 1 5.7 5.6L8.7 17.6a2 2 0 0 1-2.8-2.8l8.8-8.8'/%3E%3C/svg%3E")
        center / contain no-repeat;
}

#voiceRecordButton {
    min-width: 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 0;
    color: #d9a066;
}

#voiceRecordButton::before {
    content: "";
    width: 18px;
    height: 18px;
    display: block;
    background: currentColor;
    -webkit-mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 10a7 7 0 0 0 14 0M12 17v5M8 22h8'/%3E%3C/svg%3E")
        center / contain no-repeat;
    mask:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M5 10a7 7 0 0 0 14 0M12 17v5M8 22h8'/%3E%3C/svg%3E")
        center / contain no-repeat;
}

#voiceRecordButton.recording::before {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    -webkit-mask: none;
    mask: none;
    background: currentColor;
}

#sendButton {
    padding-left: 12px;
    padding-right: 12px;
}

@media (max-width: 680px) {
    .chat__form {
        gap: 6px;
        padding-left: 5px;
        padding-right: 7px;
    }

    .chat__attachment-button {
        width: 30px;
        min-width: 30px;
    }

    #voiceRecordButton {
        width: 38px;
        min-width: 38px;
    }

    #sendButton {
        padding-left: 9px;
        padding-right: 9px;
        font-size: 12px;
    }

    .chat__input {
        padding-left: 11px;
        padding-right: 11px;
    }
}

/* Attachment choices float above the existing composer without affecting its size. */
.chat__form {
    position: relative;
}

.chat__attachment-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 8px;
    z-index: 20;
    padding: 4px;
    border: 1px solid #594331;
    border-radius: 10px;
    background: #1b1e25;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.chat__attachment-menu[hidden] {
    display: none;
}

.chat__attachment-menu button {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border-radius: 6px;
    background: transparent;
    color: #ecd7c2;
    font-size: 13px;
    text-align: left;
}

.chat__attachment-menu button:hover,
.chat__attachment-menu button:focus-visible {
    background: rgba(217, 160, 102, 0.12);
    outline: 1px solid #d9a066;
    outline-offset: -1px;
}

.chat__form > .chat__attachment-button,
.chat__form > #voiceRecordButton,
.chat__form > #sendButton {
    align-self: flex-end;
    height: 42px;
}

/* Joi attachment menu tooltips */
.chat__attachment-menu [data-tooltip],
#attachmentButton[data-tooltip] {
    position: relative;
}

.chat__attachment-menu [data-tooltip]::after,
#attachmentButton[data-tooltip]::after {
    content: attr(data-tooltip);

    position: absolute;
    z-index: 1000;
    top: 50%;
    left: calc(100% + 8px);
    transform: translateY(-50%);

    width: max-content;
    max-width: 260px;
    padding: 7px 10px;

    background: rgba(20, 22, 27, 0.98);
    border: 1px solid rgba(218, 151, 85, 0.55);
    border-radius: 8px;

    color: #d9a066;
    font-size: 12px;
    line-height: 1.35;
    text-align: left;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        visibility 0.15s ease;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.chat__attachment-menu [data-tooltip]:hover::after,
#attachmentButton[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%);
}

@media (max-width: 600px) {
    .chat__attachment-menu [data-tooltip]::after,
    #attachmentButton[data-tooltip]::after {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 92px;
        top: auto;

        width: auto;
        max-width: none;

        transform: translateY(4px);
        text-align: center;
    }

    .chat__attachment-menu [data-tooltip]:hover::after,
    #attachmentButton[data-tooltip]:hover::after {
        transform: translateY(0);
    }
}
