/* ====== TokenSearch Shared Auth Styles ====== */

/* ---- Sign In Button (logged-out state) ---- */
.ts-login-btn {
 display: flex;
 align-items: center;
 gap: 6px;
 padding: 0 10px;
 border-radius: 8px;
 border: 1px solid rgba(139,92,246,.35);
 background: rgba(70,60,140,.55);
 color: #fff;
 font-size: .85rem;
 font-weight: 700;
 cursor: pointer;
 transition: all .2s;
 white-space: nowrap;
 font-family: inherit;
 box-shadow: 0 2px 10px rgba(0,0,0,.4), 0 0 8px rgba(124,58,237,.2);
 box-sizing: border-box;
 height: 32px;
 min-height: 32px;
}
.ts-login-btn:hover {
 border-color: rgba(139,92,246,.8);
 background: rgba(20,15,40,0.95);
 color: #ddd6fe;
 box-shadow: 0 2px 10px rgba(0,0,0,.5), 0 0 14px rgba(124,58,237,.4);
}

/* ---- User Avatar Button (logged-in state) ---- */
.ts-user-btn {
 display: flex;
 align-items: center;
 gap: 7px;
 padding: 4px 10px;
 border-radius: 8px;
 border: 1px solid rgba(99,102,241,.35);
 background: rgba(99,102,241,.08);
 cursor: pointer;
 transition: all .2s;
 position: relative;
 font-family: inherit;
}
.ts-user-btn:hover {
 border-color: rgba(139,92,246,.5);
 background: rgba(99,102,241,.14);
}
.ts-user-avatar {
 width: 22px;
 height: 22px;
 border-radius: 50%;
 object-fit: cover;
 border: 1px solid rgba(139,92,246,.4);
}
.ts-user-name {
 font-size: .85rem;
 font-weight: 600;
 color: #fff;
 max-width: 100px;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}
.ts-user-caret {
 opacity: .4;
 font-size: 8px;
 color: #94a3b8;
}

/* ---- User Dropdown ---- */
.ts-user-dropdown {
 position: absolute;
 top: calc(100% + 6px);
 right: 0;
 background: rgba(13,16,28,.97);
 border: 1px solid rgba(139,92,246,.3);
 border-radius: 10px;
 min-width: 190px;
 z-index: 2000;
 box-shadow: 0 8px 32px rgba(0,0,0,.6);
 backdrop-filter: blur(14px);
 display: none;
 overflow: hidden;
}
.ts-user-dropdown.open { display: block; }
.ts-user-dropdown-header {
 padding: 12px 14px 8px;
 border-bottom: 1px solid rgba(139,92,246,.12);
}
.ts-user-dropdown-name {
 font-size: 13px;
 font-weight: 700;
 color: #e2e8f0;
}
.ts-user-dropdown-sub {
 font-size: 10px;
 color: #64748b;
 margin-top: 2px;
}
.ts-user-dropdown-signout {
 font-size: 11px;
 color: #ffffff;
 margin-top: 6px;
 cursor: pointer;
 opacity: .8;
 transition: opacity .15s;
 display: inline-block;
}
.ts-user-dropdown-signout:hover { opacity: 1; }
.ts-user-dropdown-item {
 display: flex;
 align-items: center;
 gap: 9px;
 padding: 9px 14px;
 font-size: 12px;
 color: #94a3b8;
 cursor: pointer;
 transition: all .15s;
 text-decoration: none;
}
.ts-user-dropdown-item:hover {
 background: rgba(139,92,246,.1);
 color: #e2e8f0;
}
.ts-user-dropdown-divider {
 border: none;
 border-top: 1px solid rgba(139,92,246,.1);
 margin: 4px 0;
}
.ts-user-dropdown-legal {
 display: flex;
 align-items: center;
 gap: 6px;
 padding: 7px 14px 10px;
 font-size: 10px;
 color: #475569;
}
.ts-user-dropdown-legal a {
 color: #475569;
 text-decoration: none;
 transition: color .15s;
}
.ts-user-dropdown-legal a:hover { color: #94a3b8; }

/* ---- Mobile: Sign In button matches hamburger icon style ---- */
@media (max-width: 768px) {
 .ts-login-btn {
 width: 36px;
 height: 36px;
 min-height: 36px;
 padding: 0;
 gap: 0;
 justify-content: center;
 background: rgba(10,12,28,0.92);
 border: 1px solid rgba(139,92,246,0.5);
 border-radius: 8px;
 box-shadow: 0 2px 10px rgba(0,0,0,0.4), 0 0 8px rgba(124,58,237,0.2);
 font-size: 0;
 overflow: hidden;
 }
 .ts-login-btn svg {
 width: 16px;
 height: 16px;
 flex-shrink: 0;
 }
 .ts-user-btn {
 padding: 0;
 border: none;
 background: none;
 }
 .ts-user-name {
 display: none;
 }
 .ts-user-btn .ts-user-btn-toggle {
 width: 36px;
 height: 36px;
 display: flex;
 align-items: center;
 justify-content: center;
 background: rgba(10,12,28,0.92);
 border: 1px solid rgba(139,92,246,0.5);
 border-radius: 8px;
 box-shadow: 0 2px 10px rgba(0,0,0,0.4), 0 0 8px rgba(124,58,237,0.2);
 gap: 0;
 }
 .ts-user-btn .ts-user-caret {
 display: none !important;
 width: 0;
 overflow: hidden;
 }
}
.ts-user-dropdown-legal span { opacity: .5; }

/* ---- Modal Overlay ---- */
.ts-auth-overlay {
 position: fixed;
 inset: 0;
 background: rgba(0,0,0,.75);
 z-index: 9000;
 display: flex;
 align-items: center;
 justify-content: center;
 backdrop-filter: blur(6px);
 animation: tsOverlayIn .2s ease;
}
@keyframes tsOverlayIn {
 from { opacity: 0; }
 to { opacity: 1; }
}

/* ---- Main Auth Modal ---- */
.ts-auth-modal {
 background: linear-gradient(160deg, #0d1022, #111528);
 border: 1px solid rgba(139,92,246,.28);
 border-radius: 20px;
 padding: 36px 30px 28px;
 width: 360px;
 max-width: 92vw;
 box-shadow: 0 32px 100px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.04);
 text-align: center;
 animation: tsModalIn .25s cubic-bezier(.34,1.56,.64,1);
 position: relative;
}
@keyframes tsModalIn {
 from { opacity: 0; transform: scale(.92) translateY(12px); }
 to { opacity: 1; transform: scale(1) translateY(0); }
}
.ts-auth-modal-close-x {
 position: absolute;
 top: 14px;
 right: 16px;
 background: none;
 border: none;
 color: #475569;
 font-size: 18px;
 cursor: pointer;
 line-height: 1;
 padding: 4px;
 transition: color .15s;
}
.ts-auth-modal-close-x:hover { color: #94a3b8; }
.ts-auth-logo {
 width: 80px;
 height: auto;
 max-height: 80px;
 border-radius: 14px;
 margin: 0 auto 12px;
 display: block;
 filter: drop-shadow(0 0 16px rgba(99,102,241,.4));
}
.ts-auth-title {
 font-size: 20px;
 font-weight: 800;
 color: #e2e8f0;
 margin: 0 0 7px;
 letter-spacing: -.01em;
}
.ts-auth-subtitle {
 font-size: 12.5px;
 color: #64748b;
 margin: 0 0 16px;
 line-height: 1.5;
}
.ts-auth-optional-badge {
 display: inline-flex;
 align-items: center;
 gap: 5px;
 padding: 4px 11px;
 background: rgba(99,102,241,.08);
 border: 1px solid rgba(99,102,241,.25);
 border-radius: 20px;
 font-size: 10.5px;
 font-weight: 600;
 color: #a5b4fc;
 margin-bottom: 22px;
}

/* ---- OAuth Buttons ---- */
.ts-oauth-btn {
 display: flex;
 align-items: center;
 justify-content: center;
 gap: 11px;
 width: 100%;
 padding: 12px 16px;
 border-radius: 10px;
 border: 1px solid;
 font-size: 13px;
 font-weight: 600;
 cursor: pointer;
 transition: all .2s;
 margin-bottom: 10px;
 background: rgba(255,255,255,.03);
 font-family: inherit;
 text-align: center;
}
.ts-oauth-btn:last-of-type { margin-bottom: 0; }
.ts-oauth-google {
 border-color: rgba(255,255,255,.18);
 color: #e2e8f0;
}
.ts-oauth-google:hover {
 background: rgba(255,255,255,.07);
 border-color: rgba(255,255,255,.35);
}
.ts-oauth-github {
 border-color: rgba(255,255,255,.18);
 color: #e2e8f0;
}
.ts-oauth-github:hover {
 background: rgba(255,255,255,.07);
 border-color: rgba(255,255,255,.35);
}
.ts-oauth-twitter {
 border-color: rgba(255,255,255,.18);
 color: #e2e8f0;
}
.ts-oauth-twitter:hover {
 background: rgba(255,255,255,.07);
 border-color: rgba(255,255,255,.35);
}
.ts-oauth-x {
 border-color: rgba(255,255,255,.18);
 color: #e2e8f0;
}
.ts-oauth-x:hover {
 background: rgba(255,255,255,.07);
 border-color: rgba(255,255,255,.35);
}
.ts-oauth-btn:disabled {
 opacity: .55;
 cursor: not-allowed;
 pointer-events: none;
}
.ts-oauth-btn-divider {
 display: flex;
 align-items: center;
 gap: 10px;
 margin: 14px 0 12px;
 color: #374151;
 font-size: 11px;
}
.ts-oauth-btn-divider::before,
.ts-oauth-btn-divider::after {
 content: '';
 flex: 1;
 height: 1px;
 background: rgba(255,255,255,.07);
}

/* ---- Auth Footer ---- */
.ts-auth-footer-text {
 font-size: 10.5px;
 color: #374151;
 margin: 20px 0 0;
 line-height: 1.5;
}
.ts-auth-footer-text a {
 color: #6366f1;
 text-decoration: none;
}
.ts-auth-footer-text a:hover { text-decoration: underline; }
.ts-auth-skip {
 display: block;
 margin: 12px auto 0;
 background: none;
 border: none;
 color: #475569;
 font-size: 11.5px;
 cursor: pointer;
 font-family: inherit;
 transition: color .15s;
}
.ts-auth-skip:hover { color: #94a3b8; }

/* Mobile: sign-in button matches hamburger icon style */
@media(max-width:768px) {
 .ts-login-btn {
 width: 36px;
 height: 36px;
 min-height: 36px;
 padding: 0;
 gap: 0;
 font-size: 0;
 justify-content: center;
 background: rgba(10,12,28,0.92);
 border-color: rgba(139,92,246,0.5);
 flex-shrink: 0;
 }
 .ts-login-btn svg {
 width: 18px;
 height: 18px;
 flex-shrink: 0;
 }
}

/* Desktop: match clear button style */
@media(min-width: 769px) {
 .ts-login-btn {
 font-size: .85rem;
 padding: 0 16px;
 height: 38px;
 min-height: 38px;
 gap: 8px;
 border-radius: 8px;
 border-width: 1px;
 box-sizing: border-box;
 }
 .ts-login-btn svg {
 width: 14px;
 height: 14px;
 }
}

/* ---- Favorites Lock Dialog ---- */
.ts-fav-dialog {
 background: linear-gradient(160deg, #0d1022, #111528);
 border: 1px solid rgba(139,92,246,.28);
 border-radius: 16px;
 padding: 28px 24px 22px;
 width: 300px;
 max-width: 90vw;
 box-shadow: 0 24px 80px rgba(0,0,0,.8);
 text-align: center;
 animation: tsModalIn .25s cubic-bezier(.34,1.56,.64,1);
}
.ts-fav-icon {
 font-size: 36px;
 margin-bottom: 12px;
 display: block;
 filter: drop-shadow(0 0 8px rgba(251,191,36,.4));
}
.ts-fav-dialog h3 {
 font-size: 16px;
 font-weight: 800;
 color: #e2e8f0;
 margin: 0 0 8px;
}
.ts-fav-dialog p {
 font-size: 12px;
 color: #64748b;
 margin: 0 0 18px;
 line-height: 1.5;
}
.ts-fav-signin-btn {
 display: flex;
 align-items: center;
 justify-content: center;
 gap: 7px;
 width: 100%;
 padding: 11px 14px;
 border-radius: 9px;
 border: none;
 background: linear-gradient(135deg, #6366f1, #8b5cf6);
 color: #fff;
 font-size: 13px;
 font-weight: 700;
 cursor: pointer;
 transition: all .2s;
 margin-bottom: 10px;
 font-family: inherit;
 box-shadow: 0 4px 16px rgba(99,102,241,.35);
}
.ts-fav-signin-btn:hover {
 background: linear-gradient(135deg, #4f46e5, #7c3aed);
 box-shadow: 0 4px 20px rgba(99,102,241,.5);
}

/* ---- Email / OTP input form ---- */
.ts-auth-input-row {
 display: flex;
 gap: 8px;
 align-items: stretch;
}
.ts-auth-input {
 flex: 1;
 background: rgba(255,255,255,.05);
 border: 1px solid rgba(139,92,246,.3);
 border-radius: 9px;
 padding: 10px 13px;
 color: #e2e8f0;
 font-size: 13px;
 font-family: inherit;
 outline: none;
 transition: border-color .2s;
 min-width: 0;
}
.ts-auth-input:focus {
 border-color: rgba(139,92,246,.7);
 background: rgba(255,255,255,.07);
}
.ts-auth-input::placeholder { color: #475569; }
.ts-auth-otp-input {
 letter-spacing: .2em;
 font-size: 16px;
 font-weight: 700;
 text-align: center;
}
.ts-auth-input-btn {
 padding: 10px 14px;
 border-radius: 9px;
 border: none;
 background: linear-gradient(135deg, #6366f1, #8b5cf6);
 color: #fff;
 font-size: 12px;
 font-weight: 700;
 cursor: pointer;
 white-space: nowrap;
 font-family: inherit;
 transition: all .2s;
 flex-shrink: 0;
 box-shadow: 0 3px 12px rgba(99,102,241,.35);
}
.ts-auth-input-btn:hover:not(:disabled) {
 background: linear-gradient(135deg, #4f46e5, #7c3aed);
 box-shadow: 0 3px 16px rgba(99,102,241,.5);
}
.ts-auth-input-btn:disabled {
 opacity: .55;
 cursor: not-allowed;
}
.ts-auth-error {
 color: #f87171;
 font-size: 11.5px;
 margin: 7px 0 0;
 text-align: left;
}
.ts-auth-otp-hint {
 font-size: 12.5px;
 color: #64748b;
 margin: 0 0 12px;
 line-height: 1.5;
 text-align: center;
}

/* ---- Favorites locked state (not logged in) ---- */
body.ts-favs-locked .fav-btn,
body.ts-favs-locked .m-card-fav,
body.ts-favs-locked .s1-fav-btn {
 cursor: pointer !important;
 opacity: .35 !important;
 filter: grayscale(.4);
}
/* Unlocked (logged in): favorited star glows */
body:not(.ts-favs-locked) .s1-fav-btn.favorited {
 opacity: 1 !important;
 color: #fbbf24 !important;
 text-shadow: 0 0 8px #fbbf24, 0 0 18px rgba(251,191,36,.7) !important;
 filter: none !important;
}
body:not(.ts-favs-locked) .s1-fav-btn.favorited .fav-star-svg {
 fill: currentColor !important;
 stroke: none !important;
}

/* ====== Profile Center ====== */
.ts-profile-overlay {
 align-items: flex-start;
 overflow-y: auto;
 padding: 40px 16px;
}
.ts-profile-modal {
 background: linear-gradient(160deg, #0d1022, #111528);
 border: 1px solid rgba(139,92,246,.28);
 border-radius: 20px;
 width: 500px;
 max-width: 96vw;
 box-shadow: 0 32px 100px rgba(0,0,0,.85);
 position: relative;
 animation: tsModalIn .25s cubic-bezier(.34,1.56,.64,1);
 overflow: hidden;
}

/* Header */
.ts-profile-header {
 background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(139,92,246,.08));
 border-bottom: 1px solid rgba(139,92,246,.15);
 padding: 28px 24px 22px;
}
.ts-profile-header-inner {
 display: flex;
 align-items: center;
 gap: 16px;
}
.ts-profile-avatar {
 width: 56px;
 height: 56px;
 border-radius: 50%;
 object-fit: cover;
 border: 2px solid rgba(139,92,246,.5);
 flex-shrink: 0;
}
.ts-profile-avatar-placeholder {
 width: 56px;
 height: 56px;
 border-radius: 50%;
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 28px;
 background: rgba(99,102,241,.12);
 border: 2px solid rgba(139,92,246,.3);
 flex-shrink: 0;
}
.ts-profile-header-info { flex: 1; min-width: 0; }
.ts-profile-header-name {
 font-size: 17px;
 font-weight: 800;
 color: #e2e8f0;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
}
.ts-profile-header-sub {
 font-size: 11px;
 color: #64748b;
 margin-top: 3px;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
}
.ts-profile-signout-btn {
 background: none;
 border: none;
 color: #ffffff;
 font-size: 11.5px;
 font-family: inherit;
 cursor: pointer;
 padding: 0;
 margin-top: 7px;
 opacity: .75;
 transition: opacity .15s;
 display: block;
}
.ts-profile-signout-btn:hover { opacity: 1; }

/* Body */
.ts-profile-body {
 padding: 0;
 font-size: 12.5px;
 color: #94a3b8;
}
.ts-profile-section {
 padding: 20px 24px;
 border-bottom: 1px solid rgba(139,92,246,.1);
}
.ts-profile-section:last-child { border-bottom: none; }
.ts-profile-section-title {
 font-size: 10.5px;
 font-weight: 700;
 letter-spacing: .08em;
 text-transform: uppercase;
 background: linear-gradient(135deg, #818cf8, #c084fc);
 -webkit-background-clip: text;
 -webkit-text-fill-color: transparent;
 background-clip: text;
 margin-bottom: 14px;
}

/* Search History */
.ts-profile-history-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.ts-profile-history-item {
 display: flex;
 align-items: center;
 gap: 10px;
 padding: 9px 12px;
 background: rgba(255,255,255,.03);
 border: 1px solid rgba(139,92,246,.1);
 border-radius: 9px;
 transition: background .15s;
}
.ts-profile-history-item:hover { background: rgba(99,102,241,.07); }
.ts-profile-history-icon { font-size: 14px; flex-shrink: 0; }
.ts-profile-history-info { flex: 1; min-width: 0; }
.ts-profile-history-query {
 font-size: 12.5px;
 font-weight: 600;
 color: #fff;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
}
.ts-profile-history-meta {
 font-size: 10px;
 color: #475569;
 margin-top: 2px;
}
.ts-profile-run-btn {
 background: rgba(99,102,241,.15);
 border: 1px solid rgba(99,102,241,.3);
 border-radius: 7px;
 color: #a5b4fc;
 font-size: 10.5px;
 font-weight: 600;
 font-family: inherit;
 padding: 4px 10px;
 cursor: pointer;
 white-space: nowrap;
 flex-shrink: 0;
 transition: all .15s;
}
.ts-profile-run-btn:hover {
 background: rgba(99,102,241,.28);
 border-color: rgba(99,102,241,.5);
 color: #fff;
}
.ts-profile-empty {
 font-size: 12px;
 color: #475569;
 text-align: center;
 padding: 16px 0;
}

/* Preferences */
.ts-profile-pref-row {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 12px;
 margin-bottom: 12px;
}
.ts-profile-pref-row:last-child { margin-bottom: 0; }
.ts-profile-check-row {
 cursor: pointer;
 justify-content: flex-start;
 gap: 10px;
}
.ts-profile-check-row input[type=checkbox] { flex-shrink: 0; accent-color: #6366f1; width: 15px; height: 15px; cursor: pointer; }
.ts-profile-pref-label { font-size: 12.5px; color: #94a3b8; }
.ts-profile-platform-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ts-profile-platform-btn {
 display: flex;
 align-items: center;
 gap: 5px;
 padding: 5px 10px;
 border-radius: 7px;
 border: 1px solid rgba(139,92,246,.2);
 background: rgba(255,255,255,.03);
 color: #94a3b8;
 font-size: 11px;
 font-weight: 600;
 font-family: inherit;
 cursor: pointer;
 transition: all .15s;
}
.ts-profile-platform-btn:hover {
 border-color: rgba(139,92,246,.4);
 color: #fff;
 background: rgba(99,102,241,.08);
}
.ts-profile-platform-btn.active {
 border-color: #6366f1;
 background: rgba(99,102,241,.18);
 color: #a5b4fc;
}
.ts-terminal-priority {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 width: 16px;
 height: 16px;
 border-radius: 50%;
 background: #6366f1;
 color: #fff;
 font-size: 9px;
 font-weight: 700;
 flex-shrink: 0;
 line-height: 1;
}
.ts-profile-pref-sub {
 font-size: 11px;
 color: #64748b;
 line-height: 1.4;
 margin-top: 6px;
}

/* Leaderboard */
.ts-profile-lb-registered {
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 12px 14px;
 background: rgba(34,197,94,.07);
 border: 1px solid rgba(34,197,94,.2);
 border-radius: 10px;
}
.ts-profile-lb-reg-check {
 width: 28px;
 height: 28px;
 border-radius: 50%;
 background: rgba(34,197,94,.15);
 border: 1px solid rgba(34,197,94,.4);
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 14px;
 color: #22c55e;
 flex-shrink: 0;
}
.ts-profile-lb-reg-info { flex: 1; min-width: 0; }
.ts-profile-lb-reg-name { font-size: 12.5px; color: #94a3b8; }
.ts-profile-lb-reg-name strong { color: #c4b5fd; }
.ts-profile-lb-wallet { font-size: 10.5px; color: #475569; margin-top: 3px; font-family: monospace; }
.ts-profile-lb-form { }
.ts-profile-lb-desc { font-size: 12px; color: #64748b; margin: 0 0 12px; line-height: 1.5; }
.ts-profile-lb-success { color: #22c55e; font-size: 12px; margin-top: 8px; }

/* Legal footer */
.ts-profile-legal {
 display: flex;
 align-items: center;
 justify-content: center;
 gap: 8px;
 padding: 14px 24px 8px;
 font-size: 10.5px;
 color: #374151;
}
.ts-profile-legal a { color: #374151; text-decoration: none; transition: color .15s; }
.ts-profile-legal a:hover { color: #64748b; }
.ts-profile-legal span { opacity: .5; }

/* Save + Exit buttons */
.ts-profile-actions {
 display: flex;
 gap: 10px;
 padding: 12px 24px 20px;
 padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
.ts-profile-save-btn {
 flex: 1;
 padding: 10px 16px;
 border-radius: 10px;
 font-size: 13px;
 font-weight: 700;
 font-family: inherit;
 cursor: pointer;
 border: 1px solid #6366f1;
 background: linear-gradient(135deg, #6366f1, #8b5cf6);
 color: #fff;
 transition: all .2s;
 display: flex;
 align-items: center;
 justify-content: center;
 gap: 6px;
}
.ts-profile-save-btn:hover:not(:disabled) {
 background: linear-gradient(135deg, #818cf8, #a78bfa);
 box-shadow: 0 4px 16px rgba(99,102,241,.35);
}
.ts-profile-save-btn:disabled {
 cursor: default;
}
.ts-profile-save-btn.saved {
 background: rgba(34,197,94,.12);
 border-color: rgba(34,197,94,.3);
 color: #22c55e;
}
.ts-profile-save-icon {
 font-size: 14px;
 line-height: 1;
}
.ts-profile-exit-btn {
 padding: 10px 20px;
 border-radius: 10px;
 font-size: 13px;
 font-weight: 600;
 font-family: inherit;
 cursor: pointer;
 border: 1px solid rgba(139,92,246,.2);
 background: rgba(255,255,255,.04);
 color: #94a3b8;
 transition: all .15s;
}
.ts-profile-exit-btn:hover {
 border-color: rgba(139,92,246,.4);
 color: #fff;
 background: rgba(255,255,255,.08);
}

/* Hamburger legal sub-links */
.mob-ham-legal,
.adv-mob-ham-legal {
 display: flex;
 align-items: center;
 gap: 8px;
 padding: 8px 20px 12px;
 font-size: 10.5px;
 color: #374151;
}
.mob-ham-legal a,
.adv-mob-ham-legal a {
 color: #475569;
 text-decoration: none;
 transition: color .15s;
}
.mob-ham-legal a:hover,
.adv-mob-ham-legal a:hover { color: #94a3b8; }
.mob-ham-legal span,
.adv-mob-ham-legal span { opacity: .4; }

/* Profile center mobile responsive */
@media (max-width: 768px) {
 .ts-profile-modal {
 width: 100%;
 max-width: 100vw;
 border-radius: 16px 16px 0 0;
 max-height: 92vh;
 max-height: 92dvh;
 overflow: hidden; /* modal does NOT scroll - only .ts-profile-body does */
 display: flex;
 flex-direction: column;
 }
 .ts-profile-modal::before {
 content: '';
 display: block;
 width: 36px;
 height: 4px;
 background: rgba(148,163,184,.3);
 border-radius: 2px;
 margin: 10px auto 0;
 flex-shrink: 0;
 }
 .ts-auth-modal-close-x {
 /* On mobile keep the X button visible above the header - not affected by body scroll */
 position: sticky;
 position: -webkit-sticky;
 top: 0;
 z-index: 10;
 }
 .ts-profile-overlay {
 align-items: flex-end;
 padding: 0;
 }
 .ts-profile-header {
 padding: 12px 16px 16px;
 flex-shrink: 0;
 }
 .ts-profile-body {
 flex: 1;
 overflow-y: auto;
 -webkit-overflow-scrolling: touch;
 min-height: 0;
 }
 .ts-profile-section { padding: 16px; }
 .ts-profile-header-name { font-size: 15px; }
 .ts-profile-pref-row { flex-wrap: wrap; }
 .ts-profile-platform-btns { width: 100%; }
 .ts-profile-actions {
 padding: 12px 16px 16px;
 padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
 flex-shrink: 0;
 border-top: 1px solid rgba(139,92,246,.1);
 background: #0d1022;
 }
}

/* History table */
.ts-profile-history-table {
 width: 100%;
 border-collapse: collapse;
 font-size: 11.5px;
}
.ts-profile-history-table th {
 text-align: left;
 font-size: 9.5px;
 font-weight: 700;
 letter-spacing: .06em;
 text-transform: uppercase;
 color: #475569;
 padding: 0 8px 8px;
 border-bottom: 1px solid rgba(139,92,246,.15);
 white-space: nowrap;
}
.ts-profile-history-table td {
 padding: 7px 8px;
 border-bottom: 1px solid rgba(139,92,246,.06);
 font-size: 11.5px;
 vertical-align: middle;
}
.ts-profile-history-table tr:hover td {
 background: rgba(99,102,241,.05);
}

/* Platform dropdown */
.ts-profile-platform-select {
 background: #151929;
 color: #fff;
 border: 1px solid rgba(139,92,246,.3);
 border-radius: 8px;
 padding: 8px 12px;
 font-size: 12.5px;
 font-weight: 600;
 font-family: inherit;
 cursor: pointer;
 outline: none;
 width: 100%;
 max-width: 200px;
 appearance: none;
 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
 background-repeat: no-repeat;
 background-position: right 10px center;
 padding-right: 30px;
}
.ts-profile-platform-select:focus {
 border-color: rgba(139,92,246,.6);
}
.ts-profile-platform-select option {
 background: #111827;
 color: #fff;
}

/* Favorites in profile */
.ts-profile-fav-item {
 display: flex;
 align-items: center;
 gap: 10px;
 padding: 8px 10px;
 background: rgba(255,255,255,.03);
 border: 1px solid rgba(139,92,246,.1);
 border-radius: 8px;
 transition: background .15s;
}
.ts-profile-fav-item:hover {
 background: rgba(99,102,241,.07);
}

/* ===== Favorite Category Dialog ===== */
.ts-fav-cat-overlay {
 align-items: center;
 justify-content: center;
}
.ts-fav-cat-modal {
 background: linear-gradient(160deg, #0d1022, #111528);
 border: 1px solid rgba(139,92,246,.28);
 border-radius: 20px;
 width: 420px;
 max-width: 96vw;
 box-shadow: 0 32px 100px rgba(0,0,0,.85);
 position: relative;
 animation: tsModalIn .25s cubic-bezier(.34,1.56,.64,1);
 overflow: hidden;
 display: flex;
 flex-direction: column;
 max-height: 85vh;
}
.ts-fav-cat-handle {
 display: none;
}
.ts-fav-cat-title {
 font-size: 18px;
 font-weight: 800;
 color: #e2e8f0;
 text-align: center;
 padding: 24px 24px 0;
 margin: 0;
 letter-spacing: -.01em;
}
.ts-fav-cat-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 padding: 18px 24px 10px;
}
.ts-fav-cat-label {
 font-size: 14px;
 font-weight: 700;
 color: #e2e8f0;
}
.ts-fav-cat-new-btn {
 background: none;
 border: 1px solid rgba(139,92,246,.35);
 border-radius: 20px;
 color: #a5b4fc;
 font-size: 12px;
 font-weight: 600;
 font-family: inherit;
 padding: 6px 14px;
 cursor: pointer;
 transition: all .15s;
 white-space: nowrap;
}
.ts-fav-cat-new-btn:hover {
 border-color: rgba(139,92,246,.6);
 background: rgba(99,102,241,.1);
 color: #c4b5fd;
}
.ts-fav-cat-new-row {
 display: flex;
 gap: 8px;
 padding: 0 24px 12px;
 animation: tsModalIn .15s ease-out;
}
.ts-fav-cat-new-input {
 flex: 1;
 background: rgba(255,255,255,.05);
 border: 1px solid rgba(139,92,246,.3);
 border-radius: 10px;
 color: #fff;
 font-size: 13px;
 font-family: inherit;
 padding: 8px 12px;
 outline: none;
 transition: border-color .15s;
}
.ts-fav-cat-new-input:focus {
 border-color: #6366f1;
}
.ts-fav-cat-new-input::placeholder {
 color: #475569;
}
.ts-fav-cat-add-btn {
 background: linear-gradient(135deg, #6366f1, #8b5cf6);
 border: none;
 border-radius: 10px;
 color: #fff;
 font-size: 12px;
 font-weight: 700;
 font-family: inherit;
 padding: 8px 16px;
 cursor: pointer;
 transition: opacity .15s;
 white-space: nowrap;
}
.ts-fav-cat-add-btn:hover { opacity: .85; }
.ts-fav-cat-list {
 flex: 1;
 overflow-y: auto;
 padding: 0 24px;
 min-height: 60px;
 max-height: 340px;
}
.ts-fav-cat-item {
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 14px 0;
 border-bottom: 1px solid rgba(139,92,246,.08);
 cursor: pointer;
 transition: background .1s;
}
.ts-fav-cat-item:last-child { border-bottom: none; }
.ts-fav-cat-item:hover { background: rgba(99,102,241,.04); margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
.ts-fav-cat-item input[type=checkbox] {
 width: 20px;
 height: 20px;
 accent-color: #6366f1;
 cursor: pointer;
 flex-shrink: 0;
}
.ts-fav-cat-item-label {
 font-size: 15px;
 font-weight: 600;
 color: #e2e8f0;
 flex: 1;
}
.ts-fav-cat-item-count {
 font-size: 13px;
 color: #64748b;
 font-weight: 500;
}
.ts-fav-cat-item-delete {
 background: none;
 border: none;
 color: #475569;
 font-size: 14px;
 cursor: pointer;
 padding: 2px 4px;
 opacity: 0;
 transition: opacity .15s, color .15s;
}
.ts-fav-cat-item:hover .ts-fav-cat-item-delete { opacity: 1; }
.ts-fav-cat-item-delete:hover { color: #ef4444; }
.ts-fav-cat-actions {
 display: flex;
 gap: 10px;
 padding: 16px 24px 20px;
 border-top: 1px solid rgba(139,92,246,.12);
 padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
.ts-fav-cat-cancel {
 flex: 1;
 padding: 12px 16px;
 border-radius: 12px;
 font-size: 14px;
 font-weight: 700;
 font-family: inherit;
 cursor: pointer;
 border: 1px solid rgba(139,92,246,.2);
 background: rgba(255,255,255,.05);
 color: #e2e8f0;
 transition: all .15s;
}
.ts-fav-cat-cancel:hover {
 background: rgba(255,255,255,.1);
 border-color: rgba(139,92,246,.35);
}
.ts-fav-cat-save {
 flex: 1;
 padding: 12px 16px;
 border-radius: 12px;
 font-size: 14px;
 font-weight: 700;
 font-family: inherit;
 cursor: pointer;
 border: none;
 background: linear-gradient(135deg, #6366f1, #8b5cf6);
 color: #fff;
 transition: all .15s;
}
.ts-fav-cat-save:hover {
 background: linear-gradient(135deg, #818cf8, #a78bfa);
 box-shadow: 0 4px 20px rgba(99,102,241,.4);
}

/* Category dialog mobile */
@media (max-width: 768px) {
 .ts-fav-cat-overlay {
 align-items: flex-end;
 padding: 0;
 }
 .ts-fav-cat-modal {
 width: 100%;
 max-width: 100vw;
 border-radius: 20px 20px 0 0;
 max-height: 92dvh;
 }
 .ts-fav-cat-handle {
 display: block;
 width: 36px;
 height: 4px;
 background: rgba(148,163,184,.3);
 border-radius: 2px;
 margin: 10px auto 0;
 flex-shrink: 0;
 }
 .ts-fav-cat-title { padding-top: 14px; font-size: 16px; }
 .ts-fav-cat-header { padding: 14px 16px 8px; }
 .ts-fav-cat-new-row { padding: 0 16px 10px; }
 .ts-fav-cat-list { padding: 0 16px; }
 .ts-fav-cat-item:hover { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
 .ts-fav-cat-actions {
 padding: 14px 16px 16px;
 padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
 }
}

/* ===== Favorites Category Filter (advanced page) ===== */
.fav-cat-filter-drop {
 min-width: 180px;
 max-height: 300px;
 overflow-y: auto;
 padding: 6px 0;
}
.fav-cat-filter-item {
 display: flex;
 align-items: center;
 gap: 8px;
 padding: 7px 14px;
 font-size: 12px;
 font-weight: 600;
 color: #94a3b8;
 cursor: pointer;
 transition: background .1s;
 white-space: nowrap;
}
.fav-cat-filter-item:hover {
 background: rgba(99,102,241,.08);
 color: #e2e8f0;
}
.fav-cat-filter-item input[type=checkbox] {
 width: 14px;
 height: 14px;
 accent-color: #6366f1;
 cursor: pointer;
 flex-shrink: 0;
}
.fav-cat-filter-active {
 color: #a5b4fc !important;
}
