/* TikTok Profile Biolink */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --tt-bg: #000000;
    --tt-surface: #121212;
    --tt-text: #ffffff;
    --tt-text-muted: rgba(255, 255, 255, 0.65);
    --tt-border: rgba(255, 255, 255, 0.12);
    --tt-accent: #fe2c55;
    --tt-cyan: #25f4ee;
    --tt-btn-text: #ffffff;
    --tt-radius: 4px;
}

html, body {
    background: var(--tt-bg);
    color: var(--tt-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.tt-page { min-height: 100vh; background: var(--tt-bg); }

.tt-app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--tt-bg);
}

.tt-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 8px;
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--tt-bg);
}

.tt-topbar-title {
    font-size: 17px;
    font-weight: 700;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
}

.tt-topbar-actions { display: flex; gap: 4px; }

.tt-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--tt-text);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}

.tt-icon-btn:active { background: rgba(255, 255, 255, 0.08); }

.tt-main { padding: 0 16px 24px; }

.tt-profile-head {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.tt-avatar-col { flex-shrink: 0; }

.tt-story-ring {
    background: linear-gradient(135deg, var(--tt-cyan), var(--tt-accent));
    border: none;
    border-radius: 50%;
    padding: 3px;
    cursor: pointer;
    display: block;
    line-height: 0;
}

.tt-story-ring-inner {
    display: block;
    background: var(--tt-bg);
    border-radius: 50%;
    padding: 3px;
}

.tt-story-ring img,
.tt-avatar-plain img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.tt-avatar-plain img { border: 2px solid var(--tt-border); }

.tt-avatar-ph {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tt-surface);
    font-size: 32px;
    font-weight: 700;
    color: var(--tt-text);
}

.tt-stats {
    list-style: none;
    display: flex;
    flex: 1;
    justify-content: space-around;
    text-align: center;
}

.tt-stats strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.tt-stats span {
    font-size: 13px;
    color: var(--tt-text-muted);
}

.tt-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 2px;
}

.tt-handle {
    font-size: 14px;
    color: var(--tt-text-muted);
    margin-bottom: 8px;
}

.tt-bio {
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.tt-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--tt-cyan);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 12px;
}

.tt-actions {
    display: flex;
    gap: 8px;
    margin: 12px 0 16px;
}

.tt-btn {
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-family: inherit;
}

.tt-btn-primary {
    flex: 1;
    height: 44px;
    background: var(--tt-accent);
    color: var(--tt-btn-text);
    border-radius: var(--tt-radius);
}

.tt-btn-primary.following {
    background: var(--tt-surface);
    color: var(--tt-text);
    border: 1px solid var(--tt-border);
}

.tt-btn-secondary {
    flex: 1;
    height: 44px;
    background: var(--tt-surface);
    color: var(--tt-text);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
}

.tt-btn-icon {
    width: 44px;
    height: 44px;
    background: var(--tt-surface);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    color: var(--tt-text);
    flex-shrink: 0;
}

.tt-folders {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: none;
}

.tt-folders::-webkit-scrollbar { display: none; }

.tt-folder-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--tt-border);
    background: transparent;
    color: var(--tt-text-muted);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.tt-folder-pill.active {
    border-color: var(--tt-text);
    color: var(--tt-text);
    background: rgba(255, 255, 255, 0.06);
}

.tt-folder-img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.tt-tabs {
    display: flex;
    border-bottom: 1px solid var(--tt-border);
    margin-bottom: 1px;
}

.tt-tab {
    flex: 1;
    height: 44px;
    border: none;
    background: none;
    color: var(--tt-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.tt-tab.active { color: var(--tt-text); }

.tt-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--tt-text);
    border-radius: 1px;
}

.tt-video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.tt-video-grid[hidden] { display: none !important; }

.tt-video-item {
    position: relative;
    aspect-ratio: 9 / 16;
    border: none;
    padding: 0;
    background: var(--tt-surface);
    cursor: pointer;
    overflow: hidden;
    display: block;
    width: 100%;
}

.tt-video-item.hidden { display: none !important; }

.tt-video-item img,
.tt-video-item video,
.tt-video-item .profile-grid-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tt-post-placeholder,
.tt-reel-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.5);
}

.tt-reel-badge {
    inset: auto 6px 6px auto;
    width: auto;
    height: auto;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.55);
    padding: 2px 6px;
    border-radius: 4px;
}

.tt-views {
    position: absolute;
    left: 6px;
    bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.tt-empty {
    grid-column: 1 / -1;
    padding: 48px 16px;
    text-align: center;
    color: var(--tt-text-muted);
    font-size: 14px;
}

.tt-brand {
    text-align: center;
    padding: 20px;
    font-size: 12px;
}

.tt-brand a { color: var(--tt-text-muted); text-decoration: none; }

/* Story viewer */
.tt-story-viewer[hidden] { display: none !important; }

.tt-story-viewer {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #000;
    display: flex;
    flex-direction: column;
}

.tt-story-header { padding: 12px 12px 0; }

.tt-story-progress {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.tt-story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.tt-story-progress-fill {
    height: 100%;
    width: 0;
    background: #fff;
}

.tt-story-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.tt-story-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.tt-story-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.tt-story-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 16px;
}

.tt-story-content img,
.tt-story-content video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tt-story-caption {
    position: absolute;
    bottom: 24px;
    left: 16px;
    right: 16px;
    color: #fff;
    font-size: 15px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.tt-story-link-btn {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tt-accent);
    color: #fff;
    padding: 10px 24px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.tt-story-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40%;
    height: 60%;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 2;
}

.tt-story-prev { left: 0; }
.tt-story-next { right: 0; }

/* Modal */
.tt-modal[hidden] { display: none !important; }

.tt-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.tt-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.tt-modal-sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--tt-surface);
    border-radius: 16px 16px 0 0;
    overflow: auto;
    z-index: 1;
}

.tt-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.tt-modal-media-wrap {
    background: #000;
    aspect-ratio: 9 / 16;
    max-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tt-modal-media-wrap img,
.tt-modal-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tt-modal-body { padding: 20px; }

.tt-modal-body h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

.tt-modal-body p {
    font-size: 14px;
    color: var(--tt-text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.tt-modal-cta {
    width: 100%;
    height: 44px;
    border-radius: var(--tt-radius);
}
