/* ============================================================
   Shared Layout CSS — FB Tools (UID Lookup / Video Downloader / Story Download)
   v1.0.0
   ============================================================ */

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
    --bg:          #0a0c10;
    --surface:     #111318;
    --surface2:    #181c24;
    --border:      rgba(255,255,255,0.07);
    --accent:      #1877f2;
    --accent-h:    #2d8cf0;
    --accent2:     #0cc;
    --success:     #23d18b;
    --error:       #ff5a5f;
    --warn:        #f59e0b;
    --text:        #eef0f4;
    --muted:       #6b7280;
    --font-head:   'Syne', sans-serif;
    --font-mono:   'DM Mono', monospace;
    --radius-lg:   20px;
    --radius-md:   12px;
    --radius-sm:   7px;
    --shadow-card: 0 8px 48px rgba(0,0,0,0.5);
}

/* ── Base ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-head);
    background: var(--bg);
    color: var(--text);
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 5rem;
    overflow-x: hidden;
}

/* Ambient background glow */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(ellipse 60% 40% at 20% 10%,  rgba(24,119,242,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 30% at 80% 85%,  rgba(0,200,200,0.08)  0%, transparent 55%);
    pointer-events: none;
}

/* ── Accessibility ──────────────────────────────────────────── */
.skip-link {
    position: absolute; top: -100%; left: 1rem;
    background: var(--accent); color: #fff;
    padding: .5rem 1rem; border-radius: var(--radius-sm);
    font-size: .85rem; font-weight: 700; z-index: 9999;
    transition: top .15s;
}
.skip-link:focus { top: 1rem; }

/* ── Navigation ─────────────────────────────────────────────── */
.site-nav {
    width: 100%; max-width: 720px;
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 1.4rem; margin-bottom: 2rem;
    background: rgba(17,19,24,0.7); border: 1px solid var(--border);
    border-radius: var(--radius-lg); backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeDown 0.5s ease both;
    position: relative; z-index: 100;
}

.site-nav .nav-brand {
    display: flex; align-items: center; gap: .5rem;
    text-decoration: none;
    font-family: var(--font-head); font-size: .85rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase;
    color: var(--text); transition: color .2s;
}
.site-nav .nav-brand:hover { color: var(--accent); }
.site-nav .nav-brand .fb-icon-sm {
    width: 28px; height: 28px; background: var(--accent); border-radius: 7px;
    display: grid; place-items: center; font-size: .95rem; font-weight: 800;
    color: #fff; flex-shrink: 0;
}

.site-nav .nav-links {
    display: flex; align-items: center; gap: .2rem; list-style: none;
}
.site-nav .nav-links > li { position: relative; }
.site-nav .nav-links a {
    font-family: var(--font-head); font-size: .8rem; font-weight: 600;
    letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
    text-decoration: none; padding: .4rem .8rem;
    border-radius: var(--radius-sm); transition: color .2s, background .2s;
    display: flex; align-items: center; gap: .3rem;
}
.site-nav .nav-links a:hover { color: var(--text); background: var(--surface2); }
.site-nav .nav-links a.active {
    color: var(--accent2); background: rgba(0,204,204,0.08);
    border: 1px solid rgba(0,204,204,0.15);
}

/* Tools dropdown button */
.nav-dropdown-btn {
    font-family: var(--font-head); font-size: .8rem; font-weight: 600;
    letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
    background: none; border: none; cursor: pointer; padding: .4rem .8rem;
    border-radius: var(--radius-sm); transition: color .2s, background .2s;
    display: flex; align-items: center; gap: .35rem;
}
.nav-dropdown-btn:hover { color: var(--text); background: var(--surface2); }
.nav-dropdown-btn[aria-expanded="true"] {
    color: var(--accent2); background: rgba(0,204,204,0.08);
}
.nav-dropdown-btn .chevron {
    width: 10px; height: 10px; transition: transform .2s;
    fill: none; stroke: currentColor; stroke-width: 2.5;
    stroke-linecap: round; stroke-linejoin: round;
}
.nav-dropdown-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }

/* Tools dropdown menu */
.nav-dropdown-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 210px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: .4rem;
    box-shadow: 0 12px 36px rgba(0,0,0,0.6);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .18s, transform .18s, visibility .18s;
}
.nav-dropdown-menu.open {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown-menu a {
    display: flex; align-items: center; gap: .65rem;
    padding: .6rem .85rem; border-radius: var(--radius-sm);
    text-decoration: none; color: var(--muted);
    font-family: var(--font-head); font-size: .8rem; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase;
    transition: background .15s, color .15s;
}
.nav-dropdown-menu a:hover { background: var(--surface2); color: var(--text); }
.nav-dropdown-menu .tool-icon {
    width: 28px; height: 28px; border-radius: 7px;
    display: grid; place-items: center; flex-shrink: 0; font-size: .9rem;
}
.nav-dropdown-menu .tool-icon.uid   { background: rgba(24,119,242,0.18); }
.nav-dropdown-menu .tool-icon.vid   { background: rgba(0,204,204,0.14); }
.nav-dropdown-menu .tool-icon.story { background: rgba(35,209,139,0.14); }
.nav-dropdown-menu .divider-line {
    height: 1px; background: var(--border); margin: .3rem .4rem;
}

/* ── Header ─────────────────────────────────────────────────── */
header {
    width: 100%; max-width: 720px;
    text-align: center; margin-bottom: 2.8rem;
    animation: fadeDown 0.7s ease both;
}

.logo-wrap {
    display: inline-flex; align-items: center; gap: .6rem;
    margin-bottom: 1.2rem;
}
.fb-icon {
    width: 40px; height: 40px; background: var(--accent); border-radius: 10px;
    display: grid; place-items: center; font-size: 1.4rem; font-weight: 800;
    color: #fff; box-shadow: 0 0 24px rgba(24,119,242,0.4); user-select: none;
}
.logo-text {
    font-size: 1rem; font-weight: 700; letter-spacing: .06em;
    color: var(--muted); text-transform: uppercase;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 800;
    line-height: 1.1; letter-spacing: -.02em;
    background: linear-gradient(135deg, #fff 40%, var(--accent) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; margin-bottom: .75rem;
}

.tagline {
    color: var(--muted); font-size: .9rem; font-weight: 400; line-height: 1.65;
    font-family: var(--font-mono); max-width: 520px; margin-inline: auto;
}

/* ── Main Card ──────────────────────────────────────────────── */
.card {
    width: 100%; max-width: 720px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 2rem 2.2rem; animation: fadeUp 0.6s ease both 0.15s;
    box-shadow: var(--shadow-card);
}

/* ── Form Elements ──────────────────────────────────────────── */
.form-group { margin-bottom: 1.3rem; }

label {
    display: block; font-size: .75rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); margin-bottom: .5rem;
}
label .required { color: var(--accent); margin-left: 2px; }

.input-wrap { position: relative; }
.input-icon {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--muted); pointer-events: none; font-size: .9rem; line-height: 1;
}

input[type="text"],
input[type="url"] {
    width: 100%; background: var(--surface2); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text); font-family: var(--font-mono);
    font-size: .9rem; padding: .88rem 1rem .88rem 2.9rem;
    transition: border-color .2s, box-shadow .2s; outline: none;
    -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="url"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(24,119,242,0.15);
}
input::placeholder { color: #3a3f4a; }

.hint {
    font-family: var(--font-mono); font-size: .73rem;
    color: var(--muted); margin-top: .45rem; line-height: 1.6;
}
.hint code {
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 4px; padding: 1px 5px; font-size: .72rem;
}

/* Story type pills */
.story-type-pills {
    display: flex; gap: .5rem; margin-top: .7rem; flex-wrap: wrap;
}
.story-type-pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem .75rem; border-radius: 20px;
    font-family: var(--font-mono); font-size: .7rem; font-weight: 500;
    border: 1px solid var(--border); background: var(--surface2); color: var(--muted);
}
.story-type-pill .pill-dot { width: 6px; height: 6px; border-radius: 50%; }
.pill-dot.blue  { background: var(--accent);  box-shadow: 0 0 5px var(--accent); }
.pill-dot.teal  { background: var(--accent2); box-shadow: 0 0 5px var(--accent2); }

/* ── Thumbnail trigger button ── */
.lb-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    position: relative;
}
.lb-trigger:focus-visible { outline: 2px solid #4f8ef7; outline-offset: 2px; }
 
.lb-play-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.35);
    opacity: 0;
    transition: opacity .18s ease;
    border-radius: inherit;
    pointer-events: none;
}
.lb-trigger:hover .lb-play-hint,
.lb-trigger:focus-visible .lb-play-hint { opacity: 1; }
 
/* ── Backdrop ── */
.mm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.60);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: mmFadeIn .18s ease;
}
@keyframes mmFadeIn { from { opacity:0 } to { opacity:1 } }
 
/* ── Modal box ── */
.mm-box {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0,0,0,.7);
    width: min(92vw, 880px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: mmSlideUp .22s cubic-bezier(.22,1,.36,1);
}
@keyframes mmSlideUp { from { transform: translateY(24px) scale(.97); opacity:0 } to { transform:none; opacity:1 } }
 
/* ── Header ── */
.mm-header {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .75rem 1rem .75rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    flex-shrink: 0;
}
.mm-icon  { font-size: 1rem; }
.mm-title {
    flex: 1;
    font-size: .88rem;
    font-weight: 600;
    color: #e8e8e8;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mm-close {
    flex-shrink: 0;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.07);
    color: #ccc;
    font-size: .9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .14s, color .14s;
    line-height: 1;
}
.mm-close:hover { background: rgba(255,80,80,.25); color: #ff6b6b; border-color: rgba(255,80,80,.35); }
 
/* ── Body ── */
.mm-body {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    min-height: 120px;
    padding: .5rem;
}
.mm-media {
    max-width: 100%;
    max-height: calc(92vh - 180px);
    object-fit: contain;
    border-radius: 4px;
    display: block;
}
 
/* ── Footer ── */
.mm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .65rem 1rem;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    flex-shrink: 0;
}
.mm-meta {
    font-size: .75rem;
    color: #888;
    font-family: monospace;
    letter-spacing: .02em;
}
.mm-dl-group {
    display: flex;
    gap: .45rem;
    flex-wrap: wrap;
}
/* Reuse existing dl-btn styles; these reinforce them inside the modal */
.mm-dl-group .dl-btn {
    padding: .38rem .75rem;
    font-size: .76rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    text-decoration: none;
    font-weight: 600;
    transition: opacity .14s, transform .12s;
}
.mm-dl-group .dl-btn:hover { opacity: .85; transform: translateY(-1px); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-row { display: flex; gap: .7rem; margin-top: .4rem; flex-wrap: wrap; }

.btn {
    flex: 1; min-width: 140px;
    display: flex; align-items: center; justify-content: center; gap: .55rem;
    padding: .95rem; border: none; cursor: pointer; border-radius: 10px;
    font-family: var(--font-head); font-size: .95rem; font-weight: 700;
    letter-spacing: .03em; background: var(--accent); color: #fff;
    transition: transform .15s, box-shadow .2s, background .2s;
    box-shadow: 0 4px 20px rgba(24,119,242,0.3);
}
.btn:hover {
    background: var(--accent-h); transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(24,119,242,0.45);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }

/* ── Divider ────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.8rem 0; }

/* ── Result Section ─────────────────────────────────────────── */
.result { animation: fadeUp .4s ease both; }

.result-badge {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .72rem; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; margin-bottom: .9rem;
    padding: .3rem .7rem; border-radius: 20px;
}
.result-badge.success {
    color: var(--success); background: rgba(35,209,139,0.1);
    border: 1px solid rgba(35,209,139,0.25);
}
.result-badge.error {
    color: var(--error); background: rgba(255,90,95,0.08);
    border: 1px solid rgba(255,90,95,0.25);
}

/* ── Owner Card ─────────────────────────────────────────────── */
.owner-card {
    display: flex; align-items: center; gap: 1rem;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 1rem 1.2rem; margin-bottom: 1.2rem;
}
.owner-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1); object-fit: cover; flex-shrink: 0;
}
.owner-info { flex: 1; min-width: 0; }
.owner-name {
    font-size: 1rem; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.owner-meta {
    display: flex; align-items: center; gap: .6rem;
    margin-top: .2rem; flex-wrap: wrap;
}
.owner-uid { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }

.story-type-tag {
    font-family: var(--font-mono); font-size: .68rem; font-weight: 600;
    letter-spacing: .07em; text-transform: uppercase;
    padding: 2px 7px; border-radius: 20px;
}
.story-type-tag.s24h {
    background: rgba(24,119,242,0.15); color: #6ab3f8;
    border: 1px solid rgba(24,119,242,0.25);
}
.story-type-tag.highlight {
    background: rgba(0,204,204,0.12); color: var(--accent2);
    border: 1px solid rgba(0,204,204,0.2);
}
.media-count-tag { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); }

/* ── Media Grid ─────────────────────────────────────────────── */
.media-section-label {
    font-size: .72rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted); margin-bottom: .75rem;
    display: flex; align-items: center; gap: .5rem;
}
.media-section-label::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem; margin-bottom: 1.5rem;
}

.media-card {
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.media-card:hover {
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.media-thumb-wrap {
    position: relative; aspect-ratio: 9/16;
    background: #0d0f14; overflow: hidden;
}
.media-thumb {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: opacity .3s;
}
.media-thumb-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: var(--muted); background: var(--surface2);
}

.media-type-badge {
    position: absolute; top: .5rem; left: .5rem;
    display: flex; align-items: center; gap: .3rem;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 20px;
    padding: 3px 8px; font-family: var(--font-mono); font-size: .65rem;
    font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #fff;
}
.media-type-badge.video { color: var(--accent2); }
.media-type-badge.photo { color: #ffd966; }

.media-duration {
    position: absolute; bottom: .5rem; right: .5rem;
    background: rgba(0,0,0,0.7); border-radius: 4px;
    font-family: var(--font-mono); font-size: .68rem; color: #fff;
    padding: 2px 6px;
}
.media-dims {
    position: absolute; bottom: .5rem; left: .5rem;
    background: rgba(0,0,0,0.7); border-radius: 4px;
    font-family: var(--font-mono); font-size: .65rem; color: var(--muted);
    padding: 2px 6px;
}

.media-actions {
    padding: .7rem .75rem .75rem;
    display: flex; flex-direction: column; gap: .4rem;
}

/* Download buttons — story page (anchor tags) */
a.dl-btn {
    display: flex; align-items: center; justify-content: center; gap: .4rem;
    width: 100%; padding: .5rem; border-radius: var(--radius-sm);
    font-family: var(--font-head); font-size: .75rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
    text-decoration: none; transition: background .2s, transform .15s;
    cursor: pointer; border: 1px solid transparent;
}
a.dl-btn:hover { transform: translateY(-1px); }

a.dl-btn.hd {
    background: rgba(35,209,139,0.12); color: var(--success);
    border-color: rgba(35,209,139,0.3);
}
a.dl-btn.hd:hover { background: rgba(35,209,139,0.22); }

a.dl-btn.sd {
    background: rgba(24,119,242,0.1); color: #6ab3f8;
    border-color: rgba(24,119,242,0.25);
}
a.dl-btn.sd:hover { background: rgba(24,119,242,0.2); }

a.dl-btn.photo {
    background: rgba(255,217,102,0.1); color: #ffd966;
    border-color: rgba(255,217,102,0.25);
}
a.dl-btn.photo:hover { background: rgba(255,217,102,0.2); }

/* ── Error Box ──────────────────────────────────────────────── */
.error-box {
    background: rgba(255,90,95,0.07); border: 1px solid rgba(255,90,95,0.25);
    border-radius: var(--radius-md); padding: 1.1rem 1.3rem;
    font-family: var(--font-mono); font-size: .85rem;
    color: var(--error); line-height: 1.6;
}

/* ── FAQ ────────────────────────────────────────────────────── */
.faq {
    width: 100%; max-width: 720px; margin-top: 2.8rem;
    animation: fadeUp .6s ease both .3s;
}
.faq h2 {
    font-size: .78rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 1rem;
}

details {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); margin-bottom: .6rem; overflow: hidden;
}
summary {
    padding: .95rem 1.2rem; font-size: .88rem; font-weight: 600;
    cursor: pointer; list-style: none;
    display: flex; align-items: center; justify-content: space-between;
    gap: .5rem; transition: color .2s;
}
summary:hover { color: var(--accent2); }
summary::after {
    content: '+'; font-size: 1.1rem; font-weight: 400;
    color: var(--muted); flex-shrink: 0; transition: transform .2s;
}
details[open] summary::after { transform: rotate(45deg); }
details > p {
    padding: 0 1.2rem 1rem;
    font-family: var(--font-mono); font-size: .82rem;
    color: var(--muted); line-height: 1.7;
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
    margin-top: 3rem; font-size: .73rem; font-family: var(--font-mono);
    color: var(--muted); text-align: center;
    animation: fadeUp .6s ease both .45s; line-height: 1.8;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 520px) {
    .card { padding: 1.5rem 1.2rem; border-radius: 16px; }
    h1 { font-size: 1.9rem; }
    .btn-row { flex-direction: column; }
    .site-nav { padding: .65rem 1rem; }
    .nav-dropdown-btn span { display: none; }
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}


/* ============================================================
   VIDEO DOWNLOADER — page-specific classes
   ============================================================ */

/* ── Video Preview ── */
.video-preview {
    display: flex; gap: 1.1rem; margin-bottom: 1.4rem;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden; padding: 1rem;
    align-items: flex-start;
}

.thumb-wrap {
    position: relative; flex-shrink: 0;
    width: 130px; height: 80px; border-radius: var(--radius-sm);
    background: #0d0f14; overflow: hidden;
}
.thumb-wrap img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.thumb-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; color: var(--muted); background: var(--surface2);
}

.play-badge {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.45);
}
.play-badge svg {
    width: 22px; height: 22px; fill: rgba(255,255,255,0.85);
}

.video-meta { flex: 1; min-width: 0; }
.video-title {
    font-size: .88rem; font-weight: 700; color: var(--text);
    line-height: 1.4; margin-bottom: .55rem;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.video-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.vtag {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: 2px 9px; border-radius: 20px;
    font-family: var(--font-mono); font-size: .67rem; font-weight: 600;
    letter-spacing: .05em; text-transform: uppercase;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--muted);
}
.vtag.hd { color: var(--success); background: rgba(35,209,139,0.08); border-color: rgba(35,209,139,0.25); }
.vtag.aud { color: var(--accent2); background: rgba(0,204,204,0.08); border-color: rgba(0,204,204,0.2); }

/* ── Notice boxes ── */
.notice {
    display: flex; align-items: flex-start; gap: .7rem;
    padding: .85rem 1rem; border-radius: var(--radius-sm);
    font-family: var(--font-mono); font-size: .8rem; line-height: 1.6;
    margin-bottom: 1rem; border: 1px solid transparent;
}
.notice.info  { background: rgba(24,119,242,0.08); border-color: rgba(24,119,242,0.2); color: #6ab3f8; }
.notice.warn  { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.25); color: var(--warn); }
.notice.error { background: rgba(255,90,95,0.07);  border-color: rgba(255,90,95,0.2);  color: var(--error); }

/* ── Download section ── */
.dl-section-label {
    font-size: .72rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted);
    margin-bottom: .65rem;
}
.dl-grid { display: flex; flex-direction: column; gap: .55rem; }

/* Download buttons — video downloader (button elements, row layout) */
button.dl-btn {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1rem; border-radius: var(--radius-md);
    background: var(--surface2); border: 1px solid var(--border);
    cursor: pointer; transition: border-color .2s, background .2s, transform .15s;
    color: var(--text); width: 100%; text-align: left;
    font-family: inherit;
}
button.dl-btn:hover {
    border-color: rgba(255,255,255,0.15);
    background: #1e2230;
    transform: translateY(-1px);
}
/* Colour tiers by data-tier attribute (0=best quality) */
button.dl-btn[data-tier="0"] { border-color: rgba(35,209,139,0.25); }
button.dl-btn[data-tier="0"]:hover { border-color: rgba(35,209,139,0.45); background: rgba(35,209,139,0.06); }
button.dl-btn[data-tier="1"] { border-color: rgba(24,119,242,0.25); }
button.dl-btn[data-tier="1"]:hover { border-color: rgba(24,119,242,0.45); background: rgba(24,119,242,0.06); }
button.dl-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.dl-left { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
.dl-icon {
    width: 36px; height: 36px; border-radius: 9px;
    background: rgba(24,119,242,0.15); border: 1px solid rgba(24,119,242,0.2);
    display: grid; place-items: center; flex-shrink: 0; color: var(--accent);
}
.dl-icon svg { width: 16px; height: 16px; }

.dl-label {
    font-size: .9rem; font-weight: 700; color: var(--text);
    letter-spacing: .01em;
}
.dl-sub {
    font-family: var(--font-mono); font-size: .72rem;
    color: var(--muted); margin-top: 1px;
}

.merge-progress { display: none; margin-top: .4rem; }
.merge-progress.active { display: block; }
.prog-bar-track {
    height: 4px; background: var(--border); border-radius: 99px;
    overflow: hidden; margin-bottom: .3rem;
}
.prog-bar-fill {
    height: 100%; width: 0%; background: var(--accent2);
    border-radius: 99px; transition: width .25s ease;
}
.prog-label {
    font-family: var(--font-mono); font-size: .68rem; color: var(--muted);
}

.dl-arrow { color: var(--muted); flex-shrink: 0; display: flex; align-items: center; }

/* ── How it works steps ── */
.steps {
    display: grid;
    grid-template-rows: repeat(auto-fit, minmax(180px, 1fr));
    gap: .9rem; width: 100%; max-width: 720px;
    margin-top: 2.2rem;
    animation: fadeUp .6s ease both .25s;
}
.step-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 1.2rem 1.1rem;
    transition: border-color .2s;
}
.step-card:hover { border-color: rgba(255,255,255,0.12); }
.step-num {
    font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
    color: var(--accent2); letter-spacing: .1em; margin-bottom: .5rem;
}
.step-title {
    font-size: .9rem; font-weight: 700; color: var(--text); margin-bottom: .3rem;
}
.step-desc {
    font-family: var(--font-mono); font-size: .75rem;
    color: var(--muted); line-height: 1.6;
}


/* ============================================================
   UID LOOKUP — page-specific classes
   ============================================================ */

/* ── Tutorial toggle button ── */
.tutorial-toggle {
    display: flex; align-items: center; gap: .4rem;
    background: none; border: none; cursor: pointer;
    font-family: var(--font-head); font-size: .75rem; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); padding: .35rem 0;
    transition: color .2s;
}
.tutorial-toggle:hover { color: var(--accent2); }
.tut-chevron {
    width: 11px; height: 11px;
    fill: none; stroke: currentColor; stroke-width: 2.5;
    stroke-linecap: round; stroke-linejoin: round;
    transition: transform .2s; flex-shrink: 0;
}
.tutorial-toggle[aria-expanded="true"] .tut-chevron { transform: rotate(180deg); }

/* ── Tutorial panel ── */
.tutorial-panel {
    display: none; margin-top: .9rem;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 1rem 1.1rem;
}
.tutorial-panel.open { display: block; }

.tut-header {
    font-size: .72rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted); margin-bottom: .75rem;
}
.tut-grid { display: flex; flex-direction: column; gap: .6rem; }
.tut-row {
    display: flex; align-items: flex-start; gap: .75rem;
    padding-bottom: .6rem; border-bottom: 1px solid var(--border);
}
.tut-row:last-child { border-bottom: none; padding-bottom: 0; }

.tut-type {
    display: flex; align-items: center; gap: .4rem;
    font-size: .72rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted);
    min-width: 90px; flex-shrink: 0; padding-top: 2px;
}
.tut-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.dot-username { background: var(--accent2); box-shadow: 0 0 5px var(--accent2); }
.dot-url      { background: var(--accent);  box-shadow: 0 0 5px var(--accent); }
.dot-id       { background: var(--success); box-shadow: 0 0 5px var(--success); }
.dot-people   { background: var(--warn);    box-shadow: 0 0 5px var(--warn); }

.tut-examples { display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.tut-example  { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.tut-code {
    font-family: var(--font-mono); font-size: .75rem; color: var(--text);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 4px; padding: 1px 7px;
}
.tut-pill {
    font-family: var(--font-mono); font-size: .65rem; font-weight: 600;
    letter-spacing: .05em; text-transform: uppercase;
    padding: 1px 7px; border-radius: 20px;
    background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.tut-pill.works { color: var(--success); background: rgba(35,209,139,0.08); border-color: rgba(35,209,139,0.25); }
.tut-pill.also  { color: var(--muted);   background: var(--surface2); border-color: var(--border); }

.tut-tip {
    font-family: var(--font-mono); font-size: .75rem;
    color: var(--muted); line-height: 1.65; margin-top: .8rem;
    padding-top: .8rem; border-top: 1px solid var(--border);
}
.tut-tip strong { color: var(--text); }

/* ── UID result box ── */
.uid-box {
    display: flex; align-items: center; gap: .75rem;
    background: var(--surface2); border: 1px solid rgba(24,119,242,0.3);
    border-radius: var(--radius-md); padding: 1rem 1.2rem; margin-bottom: 1.1rem;
    box-shadow: 0 0 0 1px rgba(24,119,242,0.08);
}
.uid-value {
    font-family: var(--font-mono); font-size: 1.5rem; font-weight: 500;
    color: var(--accent2); letter-spacing: .04em; flex: 1;
    cursor: pointer; user-select: all;
}
.copy-btn {
    display: flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .5rem .9rem; border-radius: var(--radius-sm); flex-shrink: 0;
    font-family: var(--font-head); font-size: .75rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
    background: rgba(24,119,242,0.12); color: var(--accent);
    border: 1px solid rgba(24,119,242,0.25); cursor: pointer;
    transition: background .2s, transform .15s;
}
.copy-btn:hover { background: rgba(24,119,242,0.22); transform: translateY(-1px); }

/* ── Profile meta table ── */
.meta-table {
    width: 100%; border-collapse: collapse;
    font-family: var(--font-mono); font-size: .82rem;
}
.meta-table tr { border-bottom: 1px solid var(--border); }
.meta-table tr:last-child { border-bottom: none; }
.meta-table td { padding: .6rem .2rem; vertical-align: middle; }
.meta-table td:first-child {
    color: var(--muted); font-size: .72rem; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase;
    white-space: nowrap; padding-right: 1.2rem; width: 1%;
}
.meta-table td:last-child { color: var(--text); }

.profile-picture {
    width: 72px; height: 72px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1); object-fit: cover; display: block;
}

/* ── Cache status bar ── */
.cache-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .5rem .85rem; border-radius: var(--radius-sm);
    font-family: var(--font-mono); font-size: .72rem;
    margin-bottom: 1rem; gap: .5rem; flex-wrap: wrap;
}
.cache-bar.from-cache {
    background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.2);
    color: var(--warn);
}
.cache-bar.from-live {
    background: rgba(35,209,139,0.07); border: 1px solid rgba(35,209,139,0.2);
    color: var(--success);
}
.cache-label { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.cache-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.from-cache .cache-dot { background: var(--warn);    box-shadow: 0 0 5px var(--warn); }
.from-live  .cache-dot { background: var(--success); box-shadow: 0 0 5px var(--success); }