/* =========================================================
   TUKLASS V6 — CLEAN LANDING, WORDMARK, NAV ORDER, CHAT FIX
========================================================= */

/* The Logo1 artwork already includes the Tuklass wordmark. */
.public-header-simple .brand-logo-only {
    width: auto;
}

.public-header-simple .brand-logo-only img {
    width: 118px !important;
    height: auto !important;
    max-height: 42px;
    object-fit: contain !important;
    object-position: left center;
}

#dashboard .sidebar-brand {
    min-height: 54px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 2px 8px 16px !important;
}

#dashboard .sidebar-brand img {
    width: 124px !important;
    height: auto !important;
    max-height: 45px !important;
    object-fit: contain !important;
    object-position: left center !important;
}

/* =========================================================
   SIMPLIFIED LOGGED-OUT HOME
========================================================= */

.public-home-simple {
    min-height: calc(100vh - 74px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 70px 24px 90px;
    overflow: hidden;
}

.public-home-simple .public-simple-shell {
    width: min(760px, 100%);
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.public-hero-logo {
    display: block;
    width: clamp(230px, 36vw, 390px);
    height: auto;
    max-height: 150px;
    margin: 0 auto 38px;
    object-fit: contain;
}

.public-home-simple h1 {
    max-width: 720px;
    margin: 0;
    color: #111417;
    font-size: clamp(42px, 6vw, 76px);
    font-weight: 850;
    line-height: .98;
    letter-spacing: -.055em;
}

.public-home-simple .public-simple-shell > p {
    max-width: 590px;
    margin: 22px auto 0;
    color: #707981;
    font-size: clamp(15px, 1.7vw, 18px);
    line-height: 1.65;
}

.public-create-account {
    min-width: 176px;
    min-height: 48px;
    margin-top: 30px;
    border-radius: 14px !important;
}

/* Keep GIS' background render target alive without showing a second button. */
.public-google-render-target {
    position: fixed !important;
    left: -10000px !important;
    top: -10000px !important;
    width: 260px !important;
    height: 50px !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.account-modal-wordmark {
    width: 150px !important;
    height: auto !important;
    max-height: 60px !important;
}

/* =========================================================
   CHAT — NEW ISOLATED CLASS SYSTEM
   These names deliberately do not reuse the old .bubble,
   .message-row, or .bubble-wrapper selectors.
========================================================= */

.route-chat .chat-messages {
    display: block !important;
    padding: 22px 24px 34px !important;
}

.tk-chat-day-divider {
    width: 100%;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    margin: 20px 0 12px;
    color: #7d878f;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.tk-chat-day-time::before {
    content: "·";
    margin-right: 5px;
}

.tk-chat-row {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: flex-end !important;
    margin: 2px 0 !important;
    padding: 0 !important;
}

.tk-chat-row.is-mine {
    justify-content: flex-end !important;
}

.tk-chat-row.is-theirs {
    justify-content: flex-start !important;
}

.tk-chat-wrap {
    flex: 0 1 auto !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: min(66%, 520px) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tk-chat-row.is-mine .tk-chat-wrap {
    align-items: flex-end !important;
}

.tk-chat-row.is-theirs .tk-chat-wrap {
    align-items: flex-start !important;
}

.tk-chat-bubble {
    box-sizing: border-box !important;
    display: inline-flex !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: none !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    padding: 7px 11px !important;
    border: 0 !important;
    border-radius: 17px !important;
    box-shadow: none !important;
    font-size: 13px !important;
    line-height: 1.32 !important;
    vertical-align: top !important;
    overflow: visible !important;
}

.tk-chat-row.is-mine .tk-chat-bubble {
    background: #111417 !important;
    color: #ffffff !important;
    border-bottom-right-radius: 5px !important;
}

.tk-chat-row.is-theirs .tk-chat-bubble {
    background: #edf1f3 !important;
    color: #171b1e !important;
    border-bottom-left-radius: 5px !important;
}

.tk-chat-text {
    display: inline !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    font: inherit !important;
    line-height: inherit !important;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

.tk-chat-image {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: min(320px, 66vw) !important;
    max-height: 420px !important;
    margin: -2px !important;
    border-radius: 13px !important;
    object-fit: cover !important;
}

.tk-chat-time {
    display: block;
    margin: 1px 5px 0;
    color: #879098;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
}

.tk-chat-time.is-collapsed {
    display: none !important;
}

.tk-chat-time.is-collapsed.is-expanded {
    display: block !important;
}

.tk-chat-delivery {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 1px 5px 0;
    color: #7c858c;
    font-size: 9px;
    line-height: 1.2;
}

.tk-chat-row.is-sending .tk-chat-bubble {
    opacity: .72;
}

.tk-chat-row.is-failed .tk-chat-bubble {
    outline: 1px solid #d93025 !important;
}

.tk-chat-delivery.is-failed {
    color: #d93025;
}

.tk-chat-spinner {
    width: 9px;
    height: 9px;
    border: 1.5px solid #b5bdc3;
    border-top-color: #596168;
    border-radius: 50%;
    animation: tuklassV6Spin .7s linear infinite;
}

.tk-chat-retry {
    border: 0;
    background: transparent;
    color: #d93025;
    padding: 0;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

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

@media (max-width: 760px) {
    .public-header-simple .brand-logo-only img {
        width: 105px !important;
    }

    .public-home-simple {
        min-height: calc(100dvh - 68px);
        padding: 42px 20px 76px;
    }

    .public-hero-logo {
        width: min(300px, 78vw);
        margin-bottom: 28px;
    }

    .public-home-simple h1 {
        font-size: clamp(38px, 12vw, 58px);
    }

    #dashboard .sidebar-brand img {
        width: 112px !important;
    }

    .route-chat .chat-messages {
        padding: 18px 12px 26px !important;
    }

    .tk-chat-wrap {
        max-width: 78% !important;
    }

    .tk-chat-bubble {
        padding: 7px 10px !important;
        font-size: 13px !important;
    }
}
