.ttrc {
    --ttrc-accent: #FF3B0F;
    --ttrc-accent-soft: #FFECE6;
    --ttrc-ink: #0E1113;
    --ttrc-ink-soft: #3a4046;
    --ttrc-muted: #8A9199;
    --ttrc-bg: #ffffff;
    --ttrc-bg-soft: #f4f5f6;
    --ttrc-line: #e2e5e7;
    --ttrc-bubble-in: #f1f3f4;
    --ttrc-bubble-out: #0E1113;
    --ttrc-bubble-out-text: #ffffff;
    --ttrc-radius: 16px;
    --ttrc-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: var(--ttrc-bg);
    font-family: var(--ttrc-font);
    color: var(--ttrc-ink);
    overflow: hidden;
}

.ttrc-status {
    padding: 8px 14px;
    background: #FFF4E0;
    color: #8a5a00;
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
    flex-shrink: 0;
}

.ttrc-head {
    display: flex;
    justify-content: flex-end;
    padding: 6px 10px 0;
    flex-shrink: 0;
}

.ttrc-mute {
    background: none;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 6px;
    opacity: .65;
    transition: opacity .15s, background .15s;
}

.ttrc-mute:hover { opacity: 1; background: var(--ttrc-bg-soft); }

.ttrc-mute.muted { opacity: 1; }

.ttrc-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.ttrc-day {
    align-self: center;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ttrc-muted);
    background: var(--ttrc-bg-soft);
    border-radius: 999px;
    padding: 4px 12px;
    margin: 10px 0 4px;
}

.ttrc-msg { display: flex; }
.ttrc-msg.own { justify-content: flex-end; }

.ttrc-bubble {
    position: relative;
    max-width: min(78%, 560px);
    background: var(--ttrc-bubble-in);
    border-radius: var(--ttrc-radius) var(--ttrc-radius) var(--ttrc-radius) 4px;
    padding: 9px 12px 6px;
    font-size: 14.5px;
    line-height: 1.45;
    word-break: break-word;
}

.ttrc-msg.own .ttrc-bubble {
    background: var(--ttrc-bubble-out);
    color: var(--ttrc-bubble-out-text);
    border-radius: var(--ttrc-radius) var(--ttrc-radius) 4px var(--ttrc-radius);
}

.ttrc-sender {
    font-size: 12px;
    font-weight: 800;
    color: var(--ttrc-accent);
    margin-bottom: 2px;
}

.ttrc-text { white-space: pre-wrap; }

.ttrc-link { color: inherit; text-decoration: underline; }
.ttrc-msg:not(.own) .ttrc-link { color: var(--ttrc-accent); }

.ttrc-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 10.5px;
    opacity: .6;
}

.ttrc-ticks { font-size: 11px; letter-spacing: -2px; }

.ttrc-quote {
    border-left: 3px solid var(--ttrc-accent);
    background: rgba(0, 0, 0, .05);
    border-radius: 8px;
    padding: 5px 9px;
    margin-bottom: 6px;
    font-size: 12.5px;
}
.ttrc-msg.own .ttrc-quote { background: rgba(255, 255, 255, .12); }
.ttrc-quote-name { font-weight: 800; color: var(--ttrc-accent); font-size: 11.5px; }
.ttrc-msg.own .ttrc-quote-name { color: #ffb59e; }
.ttrc-quote-text { opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }

.ttrc-reply-btn {
    position: absolute;
    top: 6px;
    right: -30px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--ttrc-muted);
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    transition: opacity .15s;
}
.ttrc-msg:hover .ttrc-reply-btn { opacity: 1; }
.ttrc-reply-btn:hover { background: var(--ttrc-bg-soft); color: var(--ttrc-ink); }
.ttrc-msg.own .ttrc-reply-btn { right: auto; left: -30px; }

.ttrc-atch-img img {
    max-width: 260px;
    max-height: 200px;
    border-radius: 10px;
    display: block;
}
.ttrc-atch-file {
    display: flex;
    align-items: center;
    gap: 9px;
    color: inherit;
    text-decoration: none;
    background: rgba(0, 0, 0, .05);
    border-radius: 10px;
    padding: 8px 12px;
}
.ttrc-msg.own .ttrc-atch-file { background: rgba(255, 255, 255, .12); }
.ttrc-atch-icon { font-size: 18px; }
.ttrc-atch-info { display: flex; flex-direction: column; min-width: 0; }
.ttrc-atch-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.ttrc-atch-size { font-size: 11px; opacity: .6; }

.ttrc-sys { display: flex; justify-content: center; margin: 6px 0; }

.ttrc-sys-inner {
    max-width: 85%;
    background: var(--ttrc-bg-soft);
    border: 1px dashed var(--ttrc-line);
    color: var(--ttrc-ink-soft);
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 12.5px;
    text-align: center;
}
.ttrc-sys-payment { border-style: solid; border-color: #cdeddb; background: #F1FAF4; color: #1E8E5A; }
.ttrc-sys-title { font-weight: 800; margin-bottom: 2px; }

.ttrc-card {
    width: min(92%, 380px);
    background: var(--ttrc-bg);
    border: 1px solid var(--ttrc-line);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 4px 16px rgba(14, 17, 19, .06);
    text-align: left;
}
.ttrc-card-label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ttrc-accent);
    margin-bottom: 5px;
}
.ttrc-card-title { font-weight: 800; font-size: 15px; margin-bottom: 6px; color: var(--ttrc-ink); }
.ttrc-card-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--ttrc-ink-soft); font-weight: 600; }
.ttrc-card-status {
    background: var(--ttrc-accent-soft);
    color: var(--ttrc-accent);
    border-radius: 6px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
.ttrc-card-link {
    display: inline-block;
    margin-top: 9px;
    color: var(--ttrc-accent);
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
}
.ttrc-card-link:hover { text-decoration: underline; }
.ttrc-card-note { margin-top: 8px; font-size: 12.5px; color: var(--ttrc-muted); }
.ttrc-card-checklist { margin-top: 10px; border-top: 1px dashed var(--ttrc-line); padding-top: 8px; }
.ttrc-card-sub { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ttrc-muted); margin-bottom: 5px; }
.ttrc-card-check { font-size: 12.5px; color: var(--ttrc-ink-soft); padding: 1px 0; }
.ttrc-card-guiderow { display: flex; gap: 12px; align-items: center; }
.ttrc-card-guidephoto { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }

.ttrc-typing {
    padding: 2px 18px 6px;
    font-size: 12px;
    color: var(--ttrc-muted);
    font-style: italic;
    flex-shrink: 0;
}

.ttrc-reply {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-top: 1px solid var(--ttrc-line);
    background: var(--ttrc-bg-soft);
    flex-shrink: 0;
}
.ttrc-reply-quote { flex: 1; min-width: 0; border-left: 3px solid var(--ttrc-accent); padding-left: 10px; }
.ttrc-reply-name { font-size: 11.5px; font-weight: 800; color: var(--ttrc-accent); }
.ttrc-reply-text { font-size: 12.5px; color: var(--ttrc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttrc-reply-close { border: none; background: none; cursor: pointer; color: var(--ttrc-muted); font-size: 14px; padding: 4px; }
.ttrc-reply-close:hover { color: var(--ttrc-ink); }

.ttrc-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--ttrc-line);
    background: var(--ttrc-bg);
    flex-shrink: 0;
}

.ttrc-tools { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.ttrc-attach {
    border: none;
    background: none;
    color: var(--ttrc-muted);
    cursor: pointer;
    padding: 8px 4px;
    border-radius: 8px;
}
.ttrc-attach:hover { color: var(--ttrc-accent); background: var(--ttrc-accent-soft); }

.ttrc-counter { font-size: 10px; color: var(--ttrc-muted); white-space: nowrap; }

.ttrc-input {
    flex: 1;
    resize: none;
    border: 1.5px solid var(--ttrc-line);
    border-radius: 12px;
    padding: 10px 13px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    max-height: 140px;
    background: var(--ttrc-bg-soft);
    color: var(--ttrc-ink);
    transition: border-color .15s, background .15s;
}
.ttrc-input:focus { border-color: var(--ttrc-accent); background: #fff; }

.ttrc-send {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: none;
    border-radius: 12px;
    background: var(--ttrc-accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s, filter .12s;
}
.ttrc-send:hover { filter: brightness(1.1); transform: translateY(-1px); }
.ttrc-send:active { transform: translateY(0); }

.ttrc-failed .ttrc-bubble { outline: 2px solid #e74c3c; }

.ttrw-fab {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 998;
    display: none;
    align-items: center;
    gap: 10px;
    background: var(--fr-ink, #0E1113);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 15px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(14, 17, 19, .3);
    transition: transform .15s, background .15s;
}
.ttrw-fab:hover { background: var(--fr-accent, #FF3B0F); transform: translateY(-2px); }

.ttrw-inline {
    display: none;
    width: 100%;
    margin-top: 12px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: #fff;
    color: var(--fr-ink, #0E1113);
    border: 1.5px solid var(--fr-ink, #0E1113);
    border-radius: 12px;
    padding: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all .15s;
}
.ttrw-inline:hover { background: var(--fr-ink, #0E1113); color: #fff; }

.ttrw-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--fr-accent, #FF3B0F);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ttrw-badge[hidden] { display: none; }

.ttrw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 17, 19, .5);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.ttrw-overlay.open { opacity: 1; pointer-events: auto; }

.ttrw-drawer {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(430px, 100vw);
    background: #fff;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform .25s ease;
    box-shadow: -16px 0 48px rgba(14, 17, 19, .18);
    font-family: 'Inter', sans-serif;
}
.ttrw-drawer.open { transform: translateX(0); }

.ttrw-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #e2e5e7;
    flex-shrink: 0;
}
.ttrw-head-title { flex: 1; min-width: 0; }
.ttrw-head-title b { display: block; font-size: 16px; font-weight: 800; }
.ttrw-head-title span { font-size: 12.5px; color: #8A9199; font-weight: 600; }
.ttrw-close {
    border: none;
    background: #f1f3f4;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    color: #3a4046;
}
.ttrw-close:hover { background: #FFECE6; color: #FF3B0F; }

.ttrw-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ttrw-body .ttrc { border: none; }

.ttrw-form { padding: 22px 20px; overflow-y: auto; }
.ttrw-form p { font-size: 13.5px; color: #3a4046; margin: 0 0 16px; line-height: 1.5; }
.ttrw-field { margin-bottom: 14px; }
.ttrw-field label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #8A9199;
    margin-bottom: 6px;
}
.ttrw-field input,
.ttrw-field textarea {
    width: 100%;
    border: 1.5px solid #e2e5e7;
    border-radius: 11px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    background: #f7f8f9;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
}
.ttrw-field input:focus,
.ttrw-field textarea:focus { border-color: #FF3B0F; background: #fff; }

.ttrw-submit {
    width: 100%;
    border: none;
    border-radius: 12px;
    background: #FF3B0F;
    color: #fff;
    padding: 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: filter .15s;
}
.ttrw-submit:hover { filter: brightness(1.08); }
.ttrw-submit:disabled { opacity: .55; cursor: default; }

.ttrw-form-err { color: #c0392b; font-size: 13px; font-weight: 700; margin-top: 10px; }

.ttrw-fallback { padding: 30px 24px; text-align: center; }
.ttrw-fallback-icon { font-size: 34px; margin-bottom: 12px; }
.ttrw-fallback b { display: block; font-size: 16px; margin-bottom: 8px; }
.ttrw-fallback p { font-size: 13.5px; color: #3a4046; line-height: 1.55; }
.ttrw-fallback a { color: #FF3B0F; font-weight: 800; text-decoration: none; }

@media (min-width: 1024px) {
    .ttrw-fab { display: inline-flex; }
}
@media (max-width: 1023px) {
    .ttrw-inline { display: flex; }
    .ttrw-drawer { width: 100vw; }
}

.ttrp {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 0;
    height: calc(100vh - 130px);
    min-height: 480px;
    background: #fff;
    border: 1px solid #e2e5e7;
    border-radius: 20px;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.ttrp-list {
    border-right: 1px solid #e2e5e7;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #f7f8f9;
}

.ttrp-list-head {
    padding: 16px 18px 12px;
    font-weight: 800;
    font-size: 15px;
    border-bottom: 1px solid #e2e5e7;
    flex-shrink: 0;
}

.ttrp-items { flex: 1; overflow-y: auto; min-height: 0; }

.ttrp-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid #eceeef;
    font-family: inherit;
    transition: background .12s;
}
.ttrp-item:hover { background: #fff; }
.ttrp-item.active { background: #fff; box-shadow: inset 3px 0 0 #FF3B0F; }

.ttrp-item-top { display: flex; align-items: center; gap: 8px; }
.ttrp-item-name { flex: 1; min-width: 0; font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #0E1113; }
.ttrp-item-time { font-size: 11px; color: #8A9199; flex-shrink: 0; }
.ttrp-item-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 12.5px;
    color: #5e656b;
}
.ttrp-item-sub span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttrp-type {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 7px;
    border-radius: 6px;
    background: #EDF1FF;
    color: #3B5BFF;
}
.ttrp-type.presale { background: #FFF4E0; color: #E08A00; }
.ttrp-unread {
    flex-shrink: 0;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #FF3B0F;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ttrp-empty { padding: 40px 24px; text-align: center; color: #8A9199; font-size: 13.5px; }

.ttrp-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ttrp-thread-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e5e7;
    flex-shrink: 0;
}
.ttrp-back {
    display: none;
    border: none;
    background: #f1f3f4;
    border-radius: 9px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 15px;
}
.ttrp-thread-title { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttrp-thread-title small { display: block; font-size: 12px; color: #8A9199; font-weight: 600; }
.ttrp-placeholder { flex: 1; display: flex; align-items: center; justify-content: center; color: #8A9199; font-size: 14px; padding: 30px; text-align: center; }

@media (max-width: 860px) {
    .ttrp { grid-template-columns: 1fr; height: calc(100vh - 110px); }
    .ttrp-thread { display: none; }
    .ttrp.show-thread .ttrp-list { display: none; }
    .ttrp.show-thread .ttrp-thread { display: flex; }
    .ttrp.show-thread .ttrp-back { display: block; }
}

.ttrc-icon { display: inline-flex; align-items: center; justify-content: center; }
.ttrc-icon svg { width: 16px; height: 16px; display: block; }
.ttrc-atch-icon svg { width: 18px; height: 18px; }
.ttrc-mute { color: var(--ttrc-muted, #8A9199); }
.ttrc-mute.muted { color: var(--ttrc-accent, #FF3B0F); }
.ttrc-ticks-pending { letter-spacing: 0; opacity: .7; }

.ttrc-card-check { position: relative; padding-left: 20px; }
.ttrc-card-check::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 11px;
    height: 11px;
    border: 1.5px solid var(--ttrc-muted, #8A9199);
    border-radius: 3px;
}

.ttrw-body { position: relative; }
.ttrw-body #presaleChatBox { flex-direction: column; }
.ttrw-body #presaleChatBox .ttrc { flex: 1; min-height: 0; height: auto; }
