:root {
    --vine-teal: #00bf8f;
    --vine-teal-dark: #00916d;
    --bg: #f5f8fb;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --border-subtle: #dde3eb;
    --text: #15202b;
    --text-soft: #5b7083;
    --accent: #00bf8f;
    --danger: #ff4d4f;
    --shadow-soft: 0 2px 8px rgba(15, 20, 25, 0.12);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-pill: 999px;
    --spacing: 16px;
    --sidebar-width: 240px;
}

/* Reset */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    color: var(--text);
    background: var(--bg);
}

/* Topbar – light like Vine web */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 1px 2px rgba(15, 20, 25, 0.04);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-image {
    height: 32px;
    width: auto;
    display: block;
}

.logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--vine-teal), #14ffb9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: #041014;
    box-shadow: var(--shadow-soft);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 700;
    letter-spacing: 0.03em;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-soft);
}

.topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

#search-form {
    display: flex;
    width: min(600px, 100%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

#search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    padding: 8px 12px 8px 16px;
    font-size: 14px;
}

#search-input::placeholder {
    color: var(--text-soft);
}

#search-input:focus {
    outline: none;
}

#search-form button {
    border: none;
    background: var(--vine-teal);
    color: #021012;
    font-weight: 600;
    padding: 0 18px;
    cursor: pointer;
    font-size: 14px;
}

#search-form button:hover {
    background: var(--vine-teal-dark);
}

.topbar-right {
    display: flex;
    align-items: center;
}

.stat-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: rgba(0, 191, 143, 0.08);
    border: 1px solid rgba(0, 191, 143, 0.35);
    font-size: 12px;
}

.stat-label {
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Layout – classic Vine center column with sidebar */

.page {
    display: flex;
    min-height: calc(100vh - 56px);
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 20px 32px;
    gap: 24px;
}

.sidebar {
    width: var(--sidebar-width);
    padding: 8px 0 16px;
    border-right: 1px solid var(--border-subtle);
    background: transparent;
}

.main {
    flex: 1;
    padding: 4px 0;
}

/* Sidebar */

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
}

.nav-item {
    border: none;
    text-align: left;
    padding: 8px 14px;
    border-radius: 999px;
    background: transparent;
    color: var(--text-soft);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-item:hover {
    background: rgba(15, 20, 25, 0.04);
    color: var(--text);
}

.nav-item.active {
    background: var(--vine-teal);
    color: #021012;
    font-weight: 600;
}

.sidebar-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-soft);
    margin: 0 0 8px;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Saved profiles */

.saved-profile-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 999px;
    cursor: pointer;
}

.saved-profile-item:hover {
    background: rgba(15, 20, 25, 0.04);
}

.saved-profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #e5ecf3;
    border: 1px solid var(--border-subtle);
    object-fit: cover;
}

.saved-profile-meta {
    display: flex;
    flex-direction: column;
}

.saved-profile-name {
    font-size: 13px;
}

.saved-profile-sub {
    font-size: 11px;
    color: var(--text-soft);
}

.empty-saved {
    font-size: 13px;
    color: var(--text-soft);
}

/* Avatars */

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #e5ecf3;
    border: 1px solid var(--border-subtle);
    object-fit: cover;
}

.avatar-lg {
    width: 40px;
    height: 40px;
}

/* Views */

.view {
    display: none;
}

.view.active {
    display: block;
}

.view-title {
    margin: 0 0 16px;
    font-size: 20px;
}

/* Home feed sort tabs */

.feed-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
}

.feed-tab {
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    color: var(--text-soft);
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.feed-tab:hover {
    background: rgba(15, 20, 25, 0.04);
    color: var(--text);
}

.feed-tab.active {
    background: var(--vine-teal);
    color: #021012;
    border-color: var(--vine-teal);
    font-weight: 600;
}

/* Cards (feed/history) – Vine-style grid, square thumbs */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 20, 25, 0.15);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform 0.08s ease-out, box-shadow 0.08s ease-out,
        border-color 0.08s ease-out;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 20, 25, 0.18);
    border-color: rgba(0, 191, 143, 0.35);
}

.card-thumb {
    position: relative;
    background: #000;
}

.card-thumb img {
    width: 100%;
    display: block;
    aspect-ratio: 1 / 1;
    /* square like Vine */
    object-fit: cover;
}

.card-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
}

.card-meta {
    display: flex;
    padding: 8px 10px 10px;
    gap: 8px;
}

.card-title {
    font-size: 14px;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-sub {
    font-size: 12px;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Watch layout – 2-column like Vine web 2016 */

.watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 640px) minmax(260px, 1fr);
    gap: 20px;
    align-items: flex-start;
}

.video-wrapper {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 2px 6px rgba(15, 20, 25, 0.2);
}

#watch-video {
    width: 100%;
    display: block;
    aspect-ratio: 1 / 1;
    /* Vine square */
    background: #000;
}

.watch-meta {
    margin-top: 12px;
}

.watch-title {
    margin: 0 0 6px;
    font-size: 20px;
}

.watch-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.pill {
    border-radius: 999px;
    padding: 4px 10px;
    background: #f0f3f7;
    border: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-soft);
}

.watch-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.watch-username {
    font-size: 15px;
    font-weight: 600;
}

.watch-date {
    font-size: 12px;
    color: var(--text-soft);
}

.watch-description {
    font-size: 13px;
    color: var(--text-soft);
    margin-top: 6px;
}

/* Profile header */

.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.profile-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-username {
    font-size: 16px;
    font-weight: 600;
}

.profile-meta {
    font-size: 12px;
    color: var(--text-soft);
}

/* Follow button + hint */

.watch-follow-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.follow-btn {
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: var(--vine-teal);
    color: #021012;
}

.follow-btn:hover {
    background: var(--vine-teal-dark);
}

.follow-btn.following {
    background: #ffffff;
    color: var(--vine-teal);
    border: 1px solid var(--vine-teal);
}

.follow-hint {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-soft);
    cursor: default;
    position: relative;
}

/* Tooltip */

.follow-hint::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 130%;
    width: 220px;
    padding: 6px 8px;
    font-size: 11px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    color: var(--text-soft);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease-out;
    z-index: 20;
}

.follow-hint:hover::after {
    opacity: 1;
}

/* Up next – light right column */

.watch-upnext {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid var(--border-subtle);
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}

.watch-upnext-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-soft);
}

.upnext-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upnext-item {
    display: flex;
    gap: 8px;
    cursor: pointer;
    border-radius: 6px;
    padding: 4px;
}

.upnext-item:hover {
    background: rgba(15, 20, 25, 0.04);
}

.upnext-thumb {
    width: 96px;
    height: 96px;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}

.upnext-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upnext-meta {
    flex: 1;
    min-width: 0;
}

.upnext-title {
    font-size: 13px;
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upnext-user {
    font-size: 11px;
    color: var(--text-soft);
}

.upnext-stats {
    font-size: 11px;
    color: var(--text-soft);
}

.hidden {
    display: none !important;
}

/* Modal */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 18px 20px 16px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-soft);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 8px;
}

.modal-content p {
    font-size: 13px;
    color: var(--text-soft);
}

.modal-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 12px;
    font-size: 12px;
}

.modal-content button {
    padding: 6px 14px;
    border-radius: 999px;
    border: none;
    background: var(--vine-teal);
    color: #021012;
    font-weight: 600;
    cursor: pointer;
}

/* History list */

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    padding: 8px 10px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
}

.history-item:hover {
    background: rgba(15, 20, 25, 0.04);
}

.history-caption {
    font-size: 14px;
    margin-bottom: 3px;
}

.history-meta {
    font-size: 12px;
    color: var(--text-soft);
}

.history-empty {
    font-size: 13px;
    color: var(--text-soft);
}

/* About */

.about-content {
    max-width: 780px;
    font-size: 14px;
    color: var(--text-soft);
}

.about-content p {
    line-height: 1.6;
}

.about-links {
    padding-left: 20px;
}

.about-links li {
    margin-bottom: 6px;
}

.about-links a {
    color: var(--vine-teal);
    text-decoration: none;
}

.about-links a:hover {
    text-decoration: underline;
}

.about-disclaimer {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 10px;
}

/* Responsive */

@media (max-width: 900px) {
    .page {
        flex-direction: column;
        padding: 12px 12px 24px;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        padding-bottom: 12px;
    }

    .watch-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .watch-upnext {
        max-height: none;
    }
}

/* ---------- Auth pages ---------- */

.auth-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
}

.auth-link-btn {
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-soft);
}

.auth-link-btn:hover {
    background: rgba(15, 20, 25, 0.04);
    color: var(--text);
}

.auth-user-pill {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    background: rgba(0, 191, 143, 0.08);
    border: 1px solid rgba(0, 191, 143, 0.35);
    color: var(--text-soft);
}

.auth-card {
    max-width: 420px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    padding: 18px 20px 20px;
    box-shadow: var(--shadow-soft);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-field label {
    font-size: 13px;
    color: var(--text-soft);
}

.auth-field input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    font-size: 14px;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--vine-teal);
    box-shadow: 0 0 0 1px rgba(0, 191, 143, 0.3);
}

.auth-submit {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--vine-teal);
    color: #021012;
}

.auth-submit:hover {
    background: var(--vine-teal-dark);
}

.auth-switch {
    font-size: 13px;
    color: var(--text-soft);
}

.link-btn {
    border: none;
    background: transparent;
    color: var(--vine-teal);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.auth-error {
    min-height: 16px;
    font-size: 12px;
    color: var(--danger);
}

.auth-hint {
    min-height: 14px;
    font-size: 12px;
    color: var(--text-soft);
}

/* ---------- About Page (Shared Styling for viner.co + beta.viner.co) ---------- */

#view-about .view-title {
    display: none;
    /* We use our own hero title */
}

.about-page {
    max-width: 860px;
    margin: 0 auto;
    font-size: 14px;
    color: var(--text-soft);
    padding-bottom: 24px;
}

/* Hero Section */

.about-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 18px;
    text-align: center;
}

.about-logo-pill {
    position: relative;
    width: 100%;
    max-width: 520px;
    height: 110px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-logo-pill-bg {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.94),
            rgba(255, 255, 255, 0.62));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

.about-logo-image {
    position: relative;
    height: 54px;
    object-fit: contain;
}

.about-title {
    font-size: 22px;
    font-weight: 700;
    margin: 4px 0 4px;
    color: var(--vine-teal);
}

.about-subtitle {
    font-size: 13px;
    max-width: 430px;
    margin: 0 auto;
    color: var(--text-soft);
}

/* Sections Grid */

.about-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.about-card {
    display: flex;
    padding: 16px 18px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-soft);
}

.about-card-muted {
    background: #f8fafb;
}

.about-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    font-size: 22px;
}

/* Icon Color Variants */

.about-card-icon-blue {
    background: rgba(0, 160, 255, 0.14);
}

.about-card-icon-green {
    background: rgba(0, 191, 143, 0.14);
}

.about-card-icon-orange {
    background: rgba(255, 163, 26, 0.16);
}

.about-card-icon-pink {
    background: rgba(255, 105, 180, 0.18);
}

.about-card-icon-purple {
    background: rgba(138, 97, 255, 0.18);
}

.about-card-icon-gray {
    background: rgba(15, 20, 25, 0.08);
}

/* Card Body */

.about-card-body {
    flex: 1;
}

.about-card-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.about-card-body p {
    margin: 0 0 8px;
    line-height: 1.62;
    font-size: 14px;
}

/* Support Chips */

.about-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.about-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid rgba(0, 191, 143, 0.4);
    background: rgba(0, 191, 143, 0.12);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: var(--vine-teal-dark);
    white-space: nowrap;
}

.about-chip-outline {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.09);
}

.about-chip:hover {
    background: rgba(0, 191, 143, 0.17);
}

/* Lists (only used on archive site) */

.about-links {
    padding-left: 20px;
    margin-top: 8px;
}

.about-links li {
    margin-bottom: 6px;
}

.about-links a {
    color: var(--vine-teal);
    text-decoration: none;
}

.about-links a:hover {
    text-decoration: underline;
}

/* Disclaimer Text */

.about-disclaimer {
    font-size: 12px !important;
    margin-top: 6px;
    color: var(--text-soft);
}

/* Responsive Tweaks */

@media (max-width: 720px) {
    .about-page {
        padding: 0 4px;
    }

    .about-card {
        padding: 14px 14px;
        border-radius: 18px;
    }

    .about-card-icon {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }

    .about-chip {
        font-size: 12px;
    }
}