/* ──────────────────────────────────────────────────────────────
   Tourist Profile Card + Activity Card — static implementation of the
   Claude Design "Tourist Profile Card.html" (Spark design system).
   Namespace: .tc-   ·   Tokens mirrored from tokens.jsx (Spark).
   ────────────────────────────────────────────────────────────── */
:root {
    --tc-navy900: #15234c;
    --tc-navy800: #1c2d5f;
    --tc-navy700: #2b3e73;
    --tc-ink: #1e1a3d;
    --tc-ink2: #4a4d6b;
    --tc-mute: #8a8fa3;
    --tc-line: #e7e8ee;
    --tc-line2: #efeff4;
    --tc-bg: #f5f4f8;
    --tc-surface2: #fafafd;

    --tc-magenta: #e5377a;
    --tc-coral: #f26e55;
    --tc-amber: #f0b83f;
    --tc-mint: #2dbe82;
    --tc-sky: #2a90e2;
    --tc-violet: #6b5bd2;

    --tc-magenta-t: #fceaf1;
    --tc-coral-t: #fdede7;
    --tc-amber-t: #fdf3dd;
    --tc-mint-t: #e0f6eb;
    --tc-sky-t: #e2f0fc;
    --tc-violet-t: #ece9fa;

    --tc-warm-grad: linear-gradient(96deg, #f59849 0%, #ee5c7a 55%, #e5377a 100%);
    --tc-navy-grad: linear-gradient(150deg, #1c2d5f 0%, #2b3e73 100%);
    --tc-podium-grad: linear-gradient(160deg, #1c2d5f 0%, #3a2a63 55%, #6e2a57 100%);
    --tc-gold-grad: linear-gradient(135deg, #ffd86b, #e59412);
    --tc-silver-grad: linear-gradient(135deg, #d2d8e0, #9aa4b2);
    --tc-bronze-grad: linear-gradient(135deg, #e0a972, #b7793f);

    --tc-tg: #229ed9;
    --tc-tg-text: #1b7daa;

    --tc-shadow-sm: 0 1px 2px rgba(21, 35, 76, 0.04), 0 1px 3px rgba(21, 35, 76, 0.06);
    --tc-shadow-md: 0 4px 12px rgba(21, 35, 76, 0.06), 0 12px 32px rgba(21, 35, 76, 0.08);
}

/* card shells */
.tc-card,
.tc-activity {
    width: 420px;
    max-width: 100%;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--tc-line2);
    box-shadow: var(--tc-shadow-md);
    position: relative;
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
/* Dashboard desktop only: let the owner card fill its column.
   Leaderboard (no .tc-dash-card wrapper) and mobile (<992px) keep 420px. */
@media (min-width: 992px) {
    .tc-dash-card .tc-card { width: 100%; }
}
.tc-card *,
.tc-activity * { box-sizing: border-box; }
/* Force the site's Sarabun font on every element inside the card, overriding any
   global tag rules (h1-h6, strong, button, input…) that would otherwise win. */
.tc-card,
.tc-activity,
.tc-card *,
.tc-activity * {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
}

/* ── cover + level/score badge ── */
.tc-cover {
    height: 64px;
    background: var(--tc-warm-grad);
    position: relative;
}
.tc-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.18;
    background: radial-gradient(360px 120px at 78% -30%, #fff, transparent 60%);
}
.tc-levelscore {
    position: absolute;
    top: 12px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--tc-navy700);
    white-space: nowrap;
}
.tc-levelscore-sep {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding-left: 7px;
    margin-left: 1px;
    border-left: 1px solid var(--tc-line2);
    color: var(--tc-navy700);
}
.tc-levelscore-sep .tc-muted { color: var(--tc-mute); font-weight: 700; }

/* ── identity row ── */
.tc-id { padding: 0 16px; margin-top: 10px; }
.tc-id-row { display: flex; align-items: center; gap: 16px; }

.tc-avatar-wrap { position: relative; flex-shrink: 0; margin-top: -30px; }
.tc-avatar {
    width: 80px;
    height: 80px;
    border-radius: 40px;
    overflow: hidden;
    border: 3.5px solid #fff;
    background: var(--tc-navy-grad);
    box-shadow: var(--tc-shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tc-avatar-initial { font-size: 28px; font-weight: 700; color: #fff; }
.tc-avatar-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    border-radius: 14px;
    border: 2.5px solid #fff;
    background: var(--tc-warm-grad);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(229, 55, 122, 0.4);
}

.tc-id-main { flex: 1; min-width: 0; }
.tc-name-row { display: flex; align-items: center; gap: 8px; }
.tc-nick {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 19px;
    font-weight: 700;
    color: var(--tc-ink);
    letter-spacing: -0.01em;
    line-height: 1.35;
}
.tc-age,
.tc-meta { flex-shrink: 0; font-size: 14px; font-weight: 700; color: var(--tc-ink2); white-space: nowrap; }
.tc-name-spacer { flex: 1; }

/* small icon button */
.tc-iconbtn {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    background: var(--tc-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 4-cell stat row */
.tc-statrow {
    display: flex;
    align-items: stretch;
    margin-top: 7px;
    background: var(--tc-bg);
    border: 1px solid var(--tc-line2);
    border-radius: 10px;
    overflow: hidden;
}
.tc-statcell {
    flex: 1;
    min-width: 0;
    padding: 4px 3px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.05;
    text-decoration: none;
}
a.tc-statcell:hover { text-decoration: none; background: var(--tc-line2); }
.tc-statcell + .tc-statcell { border-left: 1px solid var(--tc-line2); }
.tc-statcell-v { font-size: 13px; font-weight: 700; color: var(--tc-ink); }
.tc-statcell-l {
    font-size: 8.5px;
    font-weight: 700;
    color: var(--tc-mute);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ── points strip ── */
.tc-points {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 9px;
    padding: 6px 8px 6px 11px;
    border-radius: 10px;
    background: var(--tc-magenta-t);
    border: 1px solid rgba(229, 55, 122, 0.13);
}
.tc-points-text { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--tc-ink2); }
.tc-points-text b { font-size: 13.5px; font-weight: 700; color: var(--tc-ink); }
.tc-points-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 26px;
    padding: 0 11px;
    border-radius: 13px;
    border: none;
    cursor: pointer;
    background: var(--tc-warm-grad);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* ── gender nudge ── */
.tc-nudge {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 8px 6px 11px;
    border-radius: 10px;
    border: 1px solid var(--tc-amber);
    background: var(--tc-amber-t);
    cursor: pointer;
    text-align: left;
}
.tc-nudge-text { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--tc-ink2); }
.tc-nudge-text b { font-weight: 700; color: var(--tc-ink); }
.tc-nudge-add {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 11px;
    border-radius: 13px;
    background: var(--tc-amber);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* ── action buttons ── */
.tc-btn-send {
    width: 100%;
    height: 42px;
    margin-top: 13px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: var(--tc-warm-grad);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 16px rgba(229, 55, 122, 0.28);
    text-decoration: none;
}
.tc-btn-send:hover { color: #fff; text-decoration: none; }
/* anchor brand buttons shouldn't underline */
a.tc-brandbtn { text-decoration: none; }
a.tc-brandbtn:hover { text-decoration: none; }
/* disabled reach-out button (logged in but handle not set) */
.tc-btn-send.is-disabled,
.tc-brandbtn.is-disabled {
    opacity: 0.45; cursor: not-allowed; pointer-events: none; box-shadow: none;
}
@keyframes tcFade { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }

/* ── contact · option 1 (compact row: Send + LINE + "+2") ── */
.tc-contact-combined { margin-top: 13px; }
.tc-contact-row { display: flex; gap: 9px; }
.tc-contact-row .tc-btn-send { margin-top: 0; }
.tc-btn-send--flex { width: auto; flex: 1; }
/* space between the redeem/points strip and this button row */
.tc-contact-row--spaced { margin-top: 13px; }

/* Both buttons on ONE row (desktop + mobile), equal height (58px), no clipping.
   The community button holds a title + "31k active members" line inside it. */
.tc-contact-row--spaced { flex-wrap: nowrap; align-items: stretch; gap: 9px; }
.tc-contact-row--spaced > a { flex: 1 1 0; min-width: 0; }
.tc-contact-row--spaced .tc-btn-admin--flex {
    width: auto; margin-top: 0; height: 58px !important;
}
/* "Join Our Community" button: title (with icon) on line 1, members badge line 2,
   the whole block vertically + horizontally centered in the button. */
.tc-brandbtn--community {
    flex: 1 1 0; min-width: 0; height: 58px !important;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 6px 8px; line-height: 1; text-align: center; overflow: hidden;
}
/* line 1: Telegram icon + title on one centered row */
.tc-community-title {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 14px; font-weight: 700;
}
.tc-community-title img { flex-shrink: 0; display: block; }
/* line 2: members badge, centered under the title */
.tc-brandbtn--community .tc-live-count { margin: 0; }
.tc-brandbtn--community .tc-live-count {
    margin-left: 0; font-size: 10px; padding: 0 6px; background: rgba(255,255,255,0.22);
    white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 480px) {
    .tc-btn-admin--flex { font-size: 13px; }
    .tc-brandbtn--community { font-size: 12px; }
    .tc-brandbtn--community .tc-live-count { font-size: 9.5px; }
}

.tc-brandbtn {
    flex: 1;
    min-width: 0;
    height: 46px;
    border-radius: 12px;
    border: 1.5px solid color-mix(in srgb, var(--tc-brand) 20%, transparent);
    cursor: pointer;
    background: color-mix(in srgb, var(--tc-brand) 6%, #fff);
    color: var(--tc-brand);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: background 0.15s ease, color 0.15s ease;
}
.tc-brandbtn svg { flex-shrink: 0; }
.tc-brandbtn:hover { background: var(--tc-brand); color: #fff; }
.tc-brandbtn:hover svg path { fill: #fff; }

/* solid (direct colour) brand button — filled background, no border, no hover-fill.
   Placed AFTER .tc-brandbtn so it wins at equal specificity (source order). */
.tc-brandbtn--solid,
.tc-brandbtn--solid:hover,
.tc-brandbtn--solid:focus {
    background: var(--tc-brand) !important;
    color: #fff !important;
    border: none !important;
}
/* live active-users badge on the Telegram button (e.g. "31k") */
.tc-live-count {
    display: inline-flex; align-items: center;
    margin-left: 6px; padding: 1px 8px; border-radius: 10px;
    background: rgba(255, 255, 255, 0.22); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 1.6;
}

.tc-more-toggle {
    flex-shrink: 0;
    width: 52px;
    height: 46px;
    border-radius: 12px;
    border: 1.5px solid var(--tc-line2);
    cursor: pointer;
    background: var(--tc-surface2);
    color: var(--tc-ink2);
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.tc-more-toggle .tc-more-plus { display: inline-flex; align-items: center; gap: 2px; }
.tc-more-toggle .tc-more-x { display: none; }
.tc-more-toggle.is-open { background: var(--tc-navy800); color: #fff; }
.tc-more-toggle.is-open .tc-more-plus { display: none; }
.tc-more-toggle.is-open .tc-more-x { display: inline-flex; align-items: center; }

.tc-more-row { display: flex; gap: 9px; margin-top: 9px; animation: tcFade 0.18s ease-out; }
.tc-more-row[hidden] { display: none; }

/* ── contact · option 2 (editable LINE / Telegram / WhatsApp fields) ── */
.tc-btn-admin {
    width: 100%;
    height: 42px;
    margin-top: 13px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: var(--tc-navy-grad);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 16px rgba(43, 62, 115, 0.28);
    text-decoration: none;
}
.tc-btn-admin:hover { color: #fff; text-decoration: none; }
/* realtime unread count badge on the Contact admin button */
.tc-btn-admin-count {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: #fff; color: var(--tc-navy700); font-size: 12px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.tc-contact-block { margin-top: 13px; }
.tc-contact-fields { display: flex; gap: 8px; }
.tc-contact-pill {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 9px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    border: 1.5px dashed color-mix(in srgb, var(--tc-brand) 55%, transparent);
    background: var(--tc-surface2);
}
.tc-contact-pill.has-val {
    border-style: solid;
    border-color: color-mix(in srgb, var(--tc-brand) 33%, transparent);
    background: color-mix(in srgb, var(--tc-brand) 5%, #fff);
}
.tc-contact-ic {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--tc-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tc-contact-main { min-width: 0; flex: 1; overflow: hidden; }
.tc-contact-name { display: block; font-size: 10px; font-weight: 700; color: var(--tc-mute); line-height: 1.1; }
.tc-contact-val {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--tc-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-contact-pill:not(.has-val) .tc-contact-val { color: var(--tc-brand); }
.tc-contact-pill:not(.has-val) .tc-contact-val::before { content: '+ '; font-weight: 700; }

.tc-contact-edit { display: flex; align-items: center; gap: 8px; margin-top: 9px; animation: tcFade 0.18s ease-out; }
.tc-contact-edit-ic {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tc-contact-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1.5px solid var(--tc-navy700);
    border-radius: 9px;
    padding: 0 11px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-ink);
    outline: none;
    background: #fff;
}

/* ── design-review layout: the two contact options, side by side ── */
.tc-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 36px;
}
.tc-option { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tc-option-head { text-align: center; max-width: 420px; }
.tc-option-tag {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 12px;
    border-radius: 13px;
    background: var(--tc-navy800);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.tc-option-title { font-size: 16px; font-weight: 700; color: var(--tc-ink); margin-top: 8px; }
.tc-option-desc { font-size: 12.5px; color: var(--tc-mute); font-weight: 500; margin-top: 2px; line-height: 1.45; }

/* ── field block ── */
.tc-field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--tc-mute);
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.tc-field-label .tc-count { letter-spacing: 0; text-transform: none; font-size: 11px; font-weight: 700; }

/* about */
.tc-about { margin-top: 16px; }
.tc-about-row { display: flex; align-items: flex-start; gap: 8px; }
.tc-about-row p { flex: 1; margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--tc-ink2); font-weight: 500; }
/* "not filled yet" placeholder — shown as an empty pill, same as the location fallback */
.tc-about-row p.tc-empty-text {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; height: 32px;
    padding: 0 12px; border-radius: 16px;
    background: var(--tc-surface2); border: 1px solid var(--tc-line2);
    color: var(--tc-mute) !important; font-size: 12.5px; font-weight: 600; line-height: 1;
}

/* detail fields */
.tc-fields { padding: 14px 16px 4px; display: flex; flex-direction: column; gap: 12px; }

.tc-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 6px 0 11px;
    border-radius: 16px;
    background: var(--tc-bg);
    color: var(--tc-ink);
    border: 1px solid var(--tc-line2);
    font-size: 12.5px;
    font-weight: 700;
}
.tc-chip-x {
    width: 18px;
    height: 18px;
    border-radius: 9px;
    border: none;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.06);
    color: var(--tc-mute);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tc-chip-add {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 11px;
    border-radius: 16px;
    border: 1.4px dashed var(--tc-line);
    background: #fff;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tc-mute);
}

/* photo gallery */
.tc-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.tc-photo-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--tc-navy-grad);
    cursor: grab;
}
.tc-photo-tile img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.tc-photo-tile.tc-dragging { opacity: 0.45; cursor: grabbing; }
/* first tile = profile picture: subtle marker */
.tc-photos .tc-photo-tile:first-child::after {
    content: "★"; position: absolute; left: 5px; top: 3px; font-size: 11px;
    color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.tc-photo-hint { font-size: 11px; color: var(--tc-mute); margin-top: 6px; }
/* disabled top-slot (avatar) button when 5 photos exist */
.tc-avatar-btn.is-disabled, .tc-avatar-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.tc-photo-x {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 11px;
    border: none;
    cursor: pointer;
    background: rgba(15, 15, 30, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tc-photo-add {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 1.6px dashed var(--tc-line);
    background: var(--tc-surface2);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.tc-photo-add span { font-size: 10.5px; font-weight: 700; color: var(--tc-mute); }

/* ── top fans podium ── */
.tc-fans { padding: 2px 16px 18px; }
.tc-fans-block {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: var(--tc-podium-grad);
}
.tc-fans-block::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 160px;
    background: radial-gradient(circle, rgba(245, 182, 56, 0.32), transparent 68%);
    pointer-events: none;
}
.tc-fans-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px 0;
}
.tc-fans-title { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.tc-fans-viewall {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.14);
    border: none;
    cursor: pointer;
    border-radius: 13px;
    padding: 5px 11px;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
}
.tc-rot { display: inline-flex; transform: rotate(-90deg); }

.tc-podium { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 8px; padding: 6px 12px 10px; }
.tc-podium-item {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 6px;
}
.tc-podium-item--gold { margin-bottom: 0; }
.tc-podium-crown { font-size: 14px; margin-bottom: 1px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); }
.tc-podium-avwrap { position: relative; }
.tc-podium-ring { padding: 2.5px; border-radius: 999px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25); }
.tc-podium-item--gold .tc-podium-ring { box-shadow: 0 6px 18px rgba(245, 182, 56, 0.45); }
.tc-ring--gold { background: var(--tc-gold-grad); }
.tc-ring--silver { background: var(--tc-silver-grad); }
.tc-ring--bronze { background: var(--tc-bronze-grad); }
.tc-podium-ring-inner { padding: 2px; border-radius: 999px; background: #1c2d5f; }
.tc-podium-av {
    border-radius: 999px;
    overflow: hidden;
    background: var(--tc-navy-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}
.tc-podium-av img { width: 100%; height: 100%; object-fit: cover; }
.tc-podium-rank {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #2a2152;
    color: #fff;
}
.tc-podium-rank--gold { color: #6a4500; }
.tc-podium-name {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin-top: 8px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-podium-item--gold .tc-podium-name { font-size: 12px; }
.tc-podium-pts {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
}
.tc-podium-pts--gold { background: var(--tc-gold-grad); }
.tc-podium-pts-v { font-size: 11px; font-weight: 700; color: #fff; }
.tc-podium-pts--gold .tc-podium-pts-v { color: #5a3a00; }
.tc-podium-pts-u { font-size: 8px; font-weight: 700; color: rgba(255, 255, 255, 0.75); }
.tc-podium-pts--gold .tc-podium-pts-u { color: #7a5200; }

/* ── activity card ── */
.tc-activity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--tc-line2);
}
.tc-activity-title { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--tc-ink); letter-spacing: -0.01em; }
.tc-activity-viewall {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tc-magenta);
}
.tc-activity-list { padding: 4px 18px 14px; }
.tc-activity-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 8px;
    margin: 0 -8px;
    border-radius: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid var(--tc-line2);
}
.tc-activity-row:last-child { border-bottom: none; }
.tc-activity-ic { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tc-activity-text { flex: 1; min-width: 0; }
.tc-activity-text .tc-at-main { display: block; font-size: 13.5px; font-weight: 500; color: var(--tc-ink2); line-height: 1.35; }
.tc-activity-text .tc-at-time { display: block; font-size: 11px; font-weight: 600; color: var(--tc-mute); margin-top: 2px; }
.tc-activity-chev { display: inline-flex; align-items: center; transform: rotate(-90deg); flex-shrink: 0; opacity: 0.45; }

/* tone tints (icon tiles) */
.tc-tone-sky { background: var(--tc-sky-t); }
.tc-tone-amber { background: var(--tc-amber-t); }
.tc-tone-violet { background: var(--tc-violet-t); }
.tc-tone-mint { background: var(--tc-mint-t); }
.tc-tone-magenta { background: var(--tc-magenta-t); }

/* ────────── interaction layer (JS) ────────── */
.tc-iconbtn { transition: filter 0.12s; }
.tc-iconbtn:hover { filter: brightness(0.96); }
.tc-iconbtn--ok { background: var(--tc-mint); }

/* inline edit input */
.tc-edit-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1.5px solid var(--tc-magenta);
    border-radius: 10px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    color: var(--tc-ink);
    outline: none;
    background: #fff;
}
.tc-edit-textarea {
    min-height: 56px;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
    resize: none;
    border-color: var(--tc-navy700);
}

/* chip add input */
.tc-chip-input {
    width: 130px;
    height: 32px;
    border: 1.5px solid var(--tc-navy700);
    border-radius: 16px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tc-ink);
    outline: none;
}

/* toast */
.tc-toast {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translate(-50%, 8px);
    background: var(--tc-navy800);
    color: #fff;
    padding: 9px 16px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 10px 26px rgba(15, 15, 30, 0.3);
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
}
.tc-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* leaderboard overlay + gender sheet share the card as a positioning context */
.tc-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: #fff;
    display: none;
    flex-direction: column;
}
.tc-overlay.is-open { display: flex; }
.tc-lb-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 13px;
    border-bottom: 1px solid var(--tc-line2);
}
.tc-lb-back {
    width: 34px;
    height: 34px;
    border-radius: 17px;
    border: none;
    background: var(--tc-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tc-lb-title { font-size: 16px; font-weight: 700; color: var(--tc-ink); display: flex; align-items: center; gap: 7px; }
.tc-lb-sub { font-size: 11.5px; color: var(--tc-mute); margin-top: 1px; }
.tc-lb-list { flex: 1; overflow-y: auto; padding: 8px 12px 18px; }
.tc-lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--tc-line2); }
.tc-lb-row:last-child { border-bottom: none; }
.tc-lb-rank { width: 22px; text-align: center; font-size: 12px; font-weight: 700; color: var(--tc-mute); flex-shrink: 0; }
.tc-lb-rank--1 { background: #f5b638; color: #fff; border-radius: 11px; height: 22px; line-height: 22px; }
.tc-lb-rank--2 { background: #aeb7c2; color: #fff; border-radius: 11px; height: 22px; line-height: 22px; }
.tc-lb-rank--3 { background: #c98a4b; color: #fff; border-radius: 11px; height: 22px; line-height: 22px; }
.tc-lb-av { width: 40px; height: 40px; border-radius: 20px; overflow: hidden; background: var(--tc-navy-grad); flex-shrink: 0; }
.tc-lb-av img { width: 100%; height: 100%; object-fit: cover; }
.tc-lb-main { flex: 1; min-width: 0; }
.tc-lb-name { font-size: 14px; font-weight: 700; color: var(--tc-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-lb-since { font-size: 11.5px; color: var(--tc-mute); margin-top: 1px; }
.tc-lb-pts { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 14px; background: var(--tc-magenta-t); flex-shrink: 0; }
.tc-lb-pts-v { font-size: 13px; font-weight: 700; color: var(--tc-magenta); }
.tc-lb-pts-u { font-size: 9.5px; font-weight: 700; color: var(--tc-magenta); }

/* gender bottom sheet */
.tc-sheet-wrap {
    /* fixed → anchored to the viewport, so the sheet sits at the bottom of the
       visible screen (not the bottom of the tall card). Works desktop + mobile. */
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(15, 15, 30, 0.4);
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.tc-sheet-wrap.is-open { display: flex; }
/* cap the sheet width on desktop so it doesn't stretch full-screen */
.tc-sheet {
    width: 100%; max-width: 460px; background: #fff;
    border-radius: 20px 20px 0 0; padding: 16px 16px 20px;
    max-height: 85vh; overflow-y: auto;
}
.tc-sheet-handle { width: 38px; height: 4px; border-radius: 2px; background: var(--tc-line); margin: 0 auto 12px; }
.tc-sheet-title { font-size: 16px; font-weight: 700; color: var(--tc-ink); }
.tc-sheet-note { font-size: 12px; color: var(--tc-mute); margin: 2px 0 14px; display: inline-flex; align-items: center; gap: 5px; }
.tc-sheet-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 48px;
    padding: 0 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1.4px solid var(--tc-line2);
    background: #fff;
    cursor: pointer;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--tc-ink);
}
.tc-sheet-opt:hover { border-color: var(--tc-magenta); background: var(--tc-magenta-t); }

/* activity rows hidden until "view all" */
.tc-activity-row.is-hidden { display: none; }

/* ──────────────────────────────────────────────────────────────
   Editable-card additions: name+age editor, char counter, WhatsApp
   ISD select, upload spinners, and the province/location modal.
   ────────────────────────────────────────────────────────────── */

.tc-field-label--row { display: flex; align-items: center; justify-content: space-between; }

/* about char counter */
.tc-charcount { font-size: 11px; color: var(--tc-mute); margin: 0 6px; white-space: nowrap; }
/* about counter: small, full-width, below the textarea, right-aligned */
.tc-about-row[data-editing] { flex-wrap: wrap; }
.tc-charcount--below { order: 99; width: 100%; text-align: right; margin: 3px 2px 0 0; }

/* name inline editor (name only; age + gender stay visible next to it) */
.tc-nick-edit { display: inline-flex; align-items: center; gap: 6px; }
.tc-nick-input { width: 150px; }

/* WhatsApp editor — one clean row: [icon] [ISD ▾] [number] [✓] [✕] */
.tc-contact-edit--wa { flex-wrap: nowrap; align-items: center; gap: 8px; }
.tc-contact-edit--wa .tc-contact-input { flex: 1 1 auto; min-width: 0; }

/* fallback (no select2): plain compact select — NOT applied once select2 hides it */
.tc-contact-isd:not(.select2-hidden-accessible) {
    flex: 0 0 92px; width: 92px; height: 38px;
    border: 1.5px solid var(--tc-line); border-radius: 9px;
    padding: 0 24px 0 10px; font-size: 12.5px; font-weight: 600; background: #fff; color: var(--tc-ink);
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8fa3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat; background-position: right 8px center;
    outline: none;
}
.tc-contact-isd:not(.select2-hidden-accessible):focus { border-color: var(--tc-navy700); }
/* when select2 is active, fully collapse the original <select> (no stray box) */
.tc-contact-isd.select2-hidden-accessible { border: 0 !important; width: 1px !important; flex: 0 0 auto; padding: 0; }
/* The container span (select2 4.0.5 gives it BOTH .select2 and .select2-container).
   The layout's global ".select2" rule adds its own border/padding/height — that was
   the OUTER box. Neutralize it so only the inner selection box shows. */
.tc-contact-edit--wa .select2.select2-container {
    flex: 0 0 96px; width: 96px !important; height: 38px !important;
    padding: 0 !important; border: 0 !important; border-radius: 0 !important;
    background: none !important; box-shadow: none !important;
}
/* the ONLY visible box, height-matched to the number input */
.tc-contact-edit--wa .select2-container--default .select2-selection--single {
    height: 38px; border: 1.5px solid var(--tc-line); border-radius: 9px;
    display: flex; align-items: center; background: #fff; transition: border-color 0.15s ease;
    outline: none; box-sizing: border-box;
}
.tc-contact-edit--wa .select2-container--default.select2-container--focus .select2-selection--single,
.tc-contact-edit--wa .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--tc-navy700);
}
.tc-contact-edit--wa .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px; padding-left: 10px; padding-right: 24px; font-size: 13px; font-weight: 600; color: var(--tc-ink);
}
.tc-contact-edit--wa .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--tc-mute); font-weight: 500;
}
.tc-contact-edit--wa .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px; right: 6px !important; top: 1px;
}
.tc-contact-edit--wa .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--tc-mute) transparent transparent transparent;
}

/* search dropdown: only a little wider than the box, tight to the content.
   Override the layout's global .select2-dropdown top/left offset too. */
.tc-contact-block .select2-container--open .select2-dropdown {
    width: 210px; min-width: 210px; z-index: 1090; left: 0 !important; top: 0 !important;
}
.tc-contact-block .select2-dropdown {
    border: 1px solid var(--tc-line); border-radius: 12px; overflow: hidden;
    box-shadow: 0 12px 30px rgba(16,24,40,0.14); background: #fff;
}
/* search field — no extra gap below it */
.tc-contact-block .select2-search--dropdown { padding: 8px 8px 4px; }
.tc-contact-block .select2-search--dropdown .select2-search__field {
    height: 36px; border: 1.5px solid var(--tc-line); border-radius: 8px;
    padding: 0 12px; font-size: 13px; outline: none; box-sizing: border-box;
}
.tc-contact-block .select2-search--dropdown .select2-search__field:focus { border-color: var(--tc-navy700); }
/* result list */
.tc-contact-block .select2-results__options { max-height: 230px; padding: 3px; }
.tc-contact-block .select2-results__option {
    font-size: 12.5px; padding: 7px 9px; color: var(--tc-ink2);
    border-radius: 8px; margin: 1px 0;
}
.tc-contact-block .select2-results__option--highlighted[aria-selected] {
    background: var(--tc-magenta); color: #fff;
}
.tc-contact-block .select2-results__option[aria-selected="true"] {
    background: var(--tc-magenta-t); color: var(--tc-ink); font-weight: 700;
}
.tc-contact-block .select2-results__option--highlighted[aria-selected="true"] {
    background: var(--tc-magenta); color: #fff;
}
/* result row layout: +code | ISO | name  (e.g. "+93 AF Afghanistan") */
.tc-isd-opt { display: flex; align-items: center; gap: 6px; }
.tc-isd-code { flex: 0 0 auto; font-weight: 700; min-width: 38px; }
.tc-isd-iso { flex: 0 0 auto; font-weight: 700; color: var(--tc-mute); }
.tc-isd-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.select2-results__option--highlighted .tc-isd-iso,
.select2-results__option--highlighted .tc-isd-name { color: rgba(255,255,255,0.9); }

/* spinner (photo tiles + avatar) */
.tc-spinner {
    width: 22px; height: 22px; border: 2.5px solid var(--tc-line);
    border-top-color: var(--tc-magenta); border-radius: 50%;
    animation: tc-spin 0.7s linear infinite; display: inline-block;
}
@keyframes tc-spin { to { transform: rotate(360deg); } }
.tc-photo-tile--loading {
    display: flex; align-items: center; justify-content: center;
    background: var(--tc-surface2); border: 1px dashed var(--tc-line);
}
.tc-avatar.is-loading { position: relative; }
.tc-avatar.is-loading::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: rgba(255,255,255,0.65)
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23e5377a' stroke-width='2.5' stroke-linecap='round'><path d='M12 3a9 9 0 1 0 9 9'><animateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.7s' repeatCount='indefinite'/></path></svg>")
        center / 22px no-repeat;
}

/* province / locations modal */
.tc-modal-wrap {
    position: fixed; inset: 0; z-index: 1080; display: none;
    align-items: center; justify-content: center; padding: 16px;
    background: rgba(20, 22, 45, 0.45);
}
.tc-modal-wrap.is-open { display: flex; }
.tc-modal {
    width: 100%; max-width: 440px; background: #fff; border-radius: 16px;
    box-shadow: 0 18px 50px rgba(16,24,40,0.25);
    /* not overflow:hidden — that would clip the select2 dropdowns */
    position: relative; z-index: 1; overflow: visible;
}
.tc-modal-head { border-radius: 16px 16px 0 0; }
.tc-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px; border-bottom: 1px solid var(--tc-line2);
}
.tc-modal-title { font-weight: 700; font-size: 15px; color: var(--tc-ink); }
.tc-modal-close { background: none; border: none; cursor: pointer; padding: 4px; line-height: 0; }
.tc-modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.tc-modal-field label { font-size: 12.5px; font-weight: 700; color: var(--tc-ink2); margin-bottom: 6px; display: block; }
.tc-modal-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 18px; border-top: 1px solid var(--tc-line2);
}
.tc-modal-btn {
    border: none; border-radius: 9px; padding: 9px 18px; font-weight: 700;
    font-size: 13.5px; cursor: pointer;
}
.tc-modal-btn--ghost { background: var(--tc-line2); color: var(--tc-ink2); }
.tc-modal-btn--primary { background: var(--tc-magenta); color: #fff; }
/* Province chip: filled navy pill so it stands out from the grey city chips */
.tc-chip--province {
    background: var(--tc-navy700); color: #fff; border-color: var(--tc-navy700); font-weight: 700;
}
.tc-chip--empty { background: var(--tc-surface2); color: var(--tc-mute); font-weight: 600; }

/* ── select2 inside the modal (province + cities) ──
   The layout's global ".select2" rule adds its own border/padding/height,
   which produced a nested "double box". Neutralize that container so only the
   inner selection box shows, and style everything to match the ISD dropdown. */
.tc-modal .select2.select2-container {
    width: 100% !important; height: auto !important; min-height: 40px;
    padding: 0 !important; border: 0 !important; border-radius: 0 !important;
    background: none !important; box-shadow: none !important;
}
/* the visible box */
.tc-modal .select2-container--default .select2-selection--single,
.tc-modal .select2-container--default .select2-selection--multiple {
    min-height: 40px; border: 1.5px solid var(--tc-line); border-radius: 9px;
    background: #fff; display: flex; align-items: center; padding: 0 8px;
    box-sizing: border-box; transition: border-color 0.15s ease;
}
.tc-modal .select2-container--default.select2-container--focus .select2-selection,
.tc-modal .select2-container--default.select2-container--open .select2-selection {
    border-color: var(--tc-navy700);
}
.tc-modal .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px; padding-left: 2px; font-size: 13.5px; color: var(--tc-ink);
}
.tc-modal .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px; right: 8px !important; top: 1px;
}
.tc-modal .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--tc-mute) transparent transparent transparent;
}
/* raw native multi-select (before select2 initializes, or as fallback):
   force it to look like the single-line province box, not a tall listbox */
.tc-modal-city:not(.select2-hidden-accessible) {
    height: 40px !important; min-height: 40px; overflow: hidden;
    border: 1.5px solid var(--tc-line); border-radius: 9px;
    padding: 0 10px; font-size: 13.5px; background: #fff; color: var(--tc-ink);
    box-sizing: border-box; appearance: none; -webkit-appearance: none;
}
.tc-modal-city:not(.select2-hidden-accessible) option { padding: 4px 0; }

/* multi-select (cities): chips */
.tc-modal .select2-container--default .select2-selection--multiple {
    padding: 4px 8px; flex-wrap: wrap; min-height: 40px;
}
.tc-modal .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--tc-magenta-t); color: var(--tc-ink); border: none;
    border-radius: 6px; padding: 2px 8px; font-size: 12.5px; font-weight: 600; margin: 2px 4px 2px 0;
}
.tc-modal .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--tc-magenta); margin-right: 5px; font-weight: 700;
}

.tc-modal-field { position: relative; }

/* ── modal select2 dropdown ──
   The dropdown is appended to <body> by select2 (correct viewport positioning)
   and tagged with .tc-modal-select2-drop. It lives OUTSIDE .tc-modal-wrap, so
   these rules are NOT scoped to the modal — they target the body-level dropdown
   directly and give it a z-index above the modal overlay (1080). */
/* z-index above the modal overlay (1080) — target the open container however the
   class lands (select2 4.0.5 applies dropdownCssClass to container + dropdown). */
.select2-container--open.tc-modal-select2-drop,
.tc-modal-select2-drop.select2-container--open,
.select2-container--open:has(> .tc-modal-select2-drop) {
    z-index: 1200 !important;
}
.tc-modal-select2-drop.select2-dropdown,
.tc-modal-select2-drop .select2-dropdown {
    border: 1px solid var(--tc-line); border-radius: 12px; overflow: hidden;
    box-shadow: 0 12px 30px rgba(16,24,40,0.18); background: #fff;
    z-index: 1200; /* ensure the dropdown paints above the modal (1080) */
}
.tc-modal-select2-drop .select2-search--dropdown { padding: 8px 8px 4px; }
.tc-modal-select2-drop .select2-search--dropdown .select2-search__field {
    height: 36px; border: 1.5px solid var(--tc-line); border-radius: 8px;
    padding: 0 12px; font-size: 13px; outline: none; box-sizing: border-box;
}
.tc-modal-select2-drop .select2-search--dropdown .select2-search__field:focus { border-color: var(--tc-navy700); }
.tc-modal-select2-drop .select2-results__options { max-height: 240px; padding: 3px; }
.tc-modal-select2-drop .select2-results__option {
    font-size: 13px; padding: 8px 10px; color: var(--tc-ink2); border-radius: 8px; margin: 1px 0;
}
.tc-modal-select2-drop .select2-results__option--highlighted[aria-selected] { background: var(--tc-magenta); color: #fff; }
.tc-modal-select2-drop .select2-results__option[aria-selected="true"] { background: var(--tc-magenta-t); color: var(--tc-ink); font-weight: 700; }
.tc-modal-select2-drop .select2-results__option--highlighted[aria-selected="true"] { background: var(--tc-magenta); color: #fff; }
