/* ==========================================================================
   Stay Viral — mobile app stylesheet
   One file, no build step. The app runs inside a mobile webview, so every
   choice here favours touch targets, safe areas and cheap paints over
   desktop-style hover polish.
   ========================================================================== */

:root {
    /* Surfaces, darkest to lightest */
    --bg: #08080a;
    --surface: #131316;
    --surface-2: #1b1b20;
    --surface-3: #232329;
    --hairline: rgba(255, 255, 255, .08);
    --hairline-strong: rgba(255, 255, 255, .14);

    /* Text */
    --text: #f5f5f7;
    --text-dim: #a0a0ab;
    --text-faint: #6c6c78;

    /* Accent + semantics */
    --accent: #4c82fb;
    --accent-press: #3a6ce6;
    --accent-soft: rgba(76, 130, 251, .14);
    --accent-line: rgba(76, 130, 251, .32);
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, .13);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .13);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .12);
    --violet: #a78bfa;
    --violet-soft: rgba(167, 139, 250, .14);

    /* Shape */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;
    --r-pill: 999px;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;

    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);

    --appbar-h: 52px;
    --page-w: 540px;
}

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

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    overscroll-behavior-y: none;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
    overflow-x: hidden;
}

h1,
h2,
h3,
p {
    margin: 0;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    touch-action: manipulation;
}

a {
    color: var(--accent);
    text-decoration: none;
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.app {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--safe-b);
}

.appbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(8, 8, 10, .92);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--hairline);
    padding-top: var(--safe-t);
}

.appbar-row {
    max-width: var(--page-w);
    margin: 0 auto;
    min-height: var(--appbar-h);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
}

.appbar-titles {
    flex: 1;
    min-width: 0;
}

.appbar-title {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.appbar-sub {
    font-size: 12.5px;
    color: var(--text-dim);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appbar-extra {
    max-width: var(--page-w);
    margin: 0 auto;
    padding: 0 14px 10px;
}

.icon-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    position: relative;
    transition: background .15s, color .15s;
}

.icon-btn:active {
    background: var(--surface-2);
}

.icon-btn.is-on {
    color: var(--accent);
    background: var(--accent-soft);
}

.icon-btn-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: var(--r-pill);
    background: var(--accent);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    border: 2px solid var(--bg);
}

.page {
    flex: 1;
    width: 100%;
    max-width: var(--page-w);
    margin: 0 auto;
    padding: 14px 14px 28px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    background: var(--surface-2);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, opacity .15s, transform .1s;
}

.btn:active {
    transform: scale(.985);
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:active {
    background: var(--accent-press);
}

.btn-secondary {
    background: var(--surface-2);
    border-color: var(--hairline);
    color: var(--text);
}

.btn-danger {
    background: var(--danger-soft);
    border-color: rgba(248, 113, 113, .2);
    color: var(--danger);
}

.btn-sm {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: var(--r-sm);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: .5;
    pointer-events: none;
}

.btn[data-busy="true"] {
    opacity: .75;
    pointer-events: none;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    flex: 0 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --------------------------------------------------------------------------
   Form fields
   -------------------------------------------------------------------------- */

.field + .field {
    margin-top: 14px;
}

.label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 7px;
}

.input {
    width: 100%;
    /* 16px keeps iOS from zooming the viewport on focus. */
    font-size: 16px;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--hairline);
    background: var(--surface);
    color: var(--text);
    outline: none;
    appearance: none;
    transition: border-color .15s, background .15s;
}

.input::placeholder {
    color: var(--text-faint);
}

.input:focus {
    border-color: var(--accent-line);
    background: var(--surface-2);
}

/* Native picker: the OS handles scrolling hundreds of categories. */
select.input {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
}

.input-otp {
    text-align: center;
    letter-spacing: .4em;
    font-size: 22px;
    font-weight: 600;
    padding-left: .4em;
}

/* Search */
.search {
    position: relative;
    display: flex;
    align-items: center;
}

.search svg.search-icon {
    position: absolute;
    left: 12px;
    width: 17px;
    height: 17px;
    color: var(--text-faint);
    pointer-events: none;
}

.search .input {
    min-height: 42px;
    padding: 9px 40px 9px 37px;
    border-radius: var(--r-pill);
    font-size: 16px;
}

.search-clear {
    position: absolute;
    right: 6px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-faint);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.search.has-value .search-clear {
    display: flex;
}

/* --------------------------------------------------------------------------
   Chips
   -------------------------------------------------------------------------- */

.chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip-row.is-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    /* Bleed to the screen edges so the row reads as scrollable. */
    margin: 0 -14px 12px;
    padding: 0 14px 2px;
}

.chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 13px;
    border-radius: var(--r-pill);
    border: 1px solid var(--hairline);
    background: var(--surface);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.chip:active {
    transform: scale(.97);
}

.chip.is-active {
    background: var(--accent-soft);
    border-color: var(--accent-line);
    color: #cddcff;
}

.chip .count {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-faint);
}

.chip.is-active .count {
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   Cards & panels
   -------------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.card + .card {
    margin-top: 12px;
}

.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--hairline);
}

.card-head h2 {
    flex: 1;
    min-width: 0;
    font-size: 15.5px;
    font-weight: 700;
}

.card-body {
    padding: 16px;
}

.section-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 10px;
}

.note {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--r-lg);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    font-size: 13.5px;
    color: #d5e2ff;
    margin-bottom: 14px;
}

.note p {
    flex: 1;
    min-width: 0;
}

/* Status pills */
.pill {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 3px 9px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .01em;
    background: var(--surface-3);
    color: var(--text-dim);
    white-space: nowrap;
}

.pill-accent {
    background: var(--accent-soft);
    color: #a8c3ff;
}

.pill-success {
    background: var(--success-soft);
    color: var(--success);
}

.pill-warn {
    background: var(--warn-soft);
    color: var(--warn);
}

.pill-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.pill-violet {
    background: var(--violet-soft);
    color: var(--violet);
}

/* Stats grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stat {
    text-align: center;
    padding: 11px 4px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1px solid var(--hairline);
}

.stat-value {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.stat-label {
    font-size: 10.5px;
    color: var(--text-dim);
    margin-top: 3px;
}

.stat.is-success .stat-value {
    color: var(--success);
}

.stat.is-accent .stat-value {
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   States: loading / empty / error
   -------------------------------------------------------------------------- */

.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
    border-radius: var(--r-sm);
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent);
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    to {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton::after {
        animation: none;
    }
}

.empty {
    text-align: center;
    padding: 52px 24px;
    color: var(--text-dim);
}

.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    color: var(--text-faint);
}

.empty-icon.is-success {
    color: var(--success);
    border-color: rgba(52, 211, 153, .3);
}

.empty h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.empty p {
    font-size: 13.5px;
    line-height: 1.5;
    max-width: 32ch;
    margin: 0 auto;
}

.empty .btn {
    margin-top: 18px;
}

.error-panel {
    padding: 16px;
    border-radius: var(--r-lg);
    background: var(--danger-soft);
    border: 1px solid rgba(248, 113, 113, .22);
    color: #fecaca;
    font-size: 13.5px;
    text-align: center;
}

.error-panel .btn {
    margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Pull to refresh
   -------------------------------------------------------------------------- */

.ptr {
    position: fixed;
    top: calc(var(--safe-t) + 8px);
    left: 50%;
    z-index: 50;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--hairline-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-60px);
}

.ptr svg {
    width: 18px;
    height: 18px;
}

.ptr.is-armed {
    border-color: var(--accent-line);
}

.ptr.is-busy svg {
    animation: spin .7s linear infinite;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast-host {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--safe-b) + 16px);
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    max-width: var(--page-w);
    width: 100%;
    padding: 12px 15px;
    border-radius: var(--r-md);
    background: var(--surface-3);
    border: 1px solid var(--hairline-strong);
    box-shadow: var(--shadow);
    font-size: 13.5px;
    animation: toast-in .22s cubic-bezier(.2, .8, .3, 1);
}

.toast.is-error {
    background: #2b1416;
    border-color: rgba(248, 113, 113, .3);
    color: #fecaca;
}

.toast.is-out {
    animation: toast-out .2s forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* --------------------------------------------------------------------------
   Bottom sheet (filters)
   -------------------------------------------------------------------------- */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.sheet-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 71;
    max-height: 82dvh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-top: 1px solid var(--hairline-strong);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(101%);
    transition: transform .26s cubic-bezier(.2, .8, .3, 1);
    padding-bottom: var(--safe-b);
}

.sheet.is-open {
    transform: translateY(0);
}

.sheet-grip {
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: var(--surface-3);
    margin: 10px auto 4px;
    flex: 0 0 auto;
}

.sheet-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 12px;
    flex: 0 0 auto;
}

.sheet-titles {
    flex: 1;
    min-width: 0;
}

.sheet-head h2 {
    flex: 1;
    font-size: 17px;
    font-weight: 700;
}

.sheet-sub {
    font-size: 12.5px;
    color: var(--text-dim);
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sheet-body {
    overflow-y: auto;
    padding: 0 16px 16px;
}

.sheet-body > * + * {
    margin-top: 20px;
}

.sheet-note {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-dim);
}

.sheet-body .videos {
    margin-bottom: 8px;
}

/* Shorter than the full-page grid so more than two fit in the sheet. */
.sheet-body .video-media {
    aspect-ratio: 3 / 4;
}

.sheet-foot {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--hairline);
    flex: 0 0 auto;
}

.sheet-foot .btn {
    flex: 1;
}

/* Range slider */
.range-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.range-row output {
    flex: 0 0 auto;
    min-width: 46px;
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dim);
}

.range-row output.is-set {
    color: var(--accent);
}

input[type="range"] {
    flex: 1;
    height: 28px;
    appearance: none;
    background: transparent;
    accent-color: var(--accent);
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: var(--surface-3);
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    margin-top: -9px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg);
}

input[type="range"]::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: var(--surface-3);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg);
}

/* --------------------------------------------------------------------------
   Brand deals
   -------------------------------------------------------------------------- */

.result-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.result-bar strong {
    color: var(--text);
    font-weight: 700;
}

.result-bar .link-btn {
    margin-left: auto;
}

.link-btn {
    border: 0;
    background: none;
    padding: 4px 2px;
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.deals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

@media (min-width: 700px) {
    .deals {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.deal {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    overflow: hidden;
    text-align: left;
    padding: 0;
    color: inherit;
    cursor: pointer;
    transition: border-color .15s, transform .1s;
}

.deal:active {
    transform: scale(.985);
    border-color: var(--hairline-strong);
}

/* The image is positioned rather than laid out, so the box height comes from
   aspect-ratio alone. Left in flow with flex: 0 0 auto the column flex parent
   sized the box to the image's intrinsic height instead, and cards in a row
   ended up with images of different heights. */
.deal-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--surface-2);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    overflow: hidden;
}

.deal-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deal-flag {
    position: absolute;
    top: 7px;
    right: 7px;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    background: rgba(167, 139, 250, .92);
    color: #14061f;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .01em;
}

.deal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px 11px 11px;
    min-width: 0;
}

.deal-name {
    font-size: 13.5px;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.deal-cat {
    font-size: 11.5px;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deal-rate {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    font-weight: 700;
    color: var(--success);
    font-size: 15px;
    letter-spacing: -.02em;
}

.deal-rate .was {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-faint);
    text-decoration: line-through;
}

.deal-rate .unit {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-faint);
    letter-spacing: 0;
}

.deal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.deal-tags .pill {
    font-size: 10px;
    padding: 2px 7px;
}

.deal .btn {
    margin-top: auto;
}

/* Video ideas sit on the image so the primary action keeps the full width. */
.deal-ideas {
    position: absolute;
    top: 7px;
    left: 7px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    cursor: pointer;
}

.deal-ideas:active {
    background: rgba(0, 0, 0, .75);
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 11px;
}

.row-actions .btn {
    flex: 1 1 auto;
}

/* List view */
.deals.is-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
}

.deals.is-list .deal {
    flex-direction: row;
    align-items: stretch;
}

.deals.is-list .deal-media {
    width: 108px;
    flex: 0 0 108px;
    aspect-ratio: auto;
    align-self: stretch;
}

.deals.is-list .deal-body {
    padding: 10px 12px;
    gap: 5px;
}

.deals.is-list .deal-name {
    -webkit-line-clamp: 1;
    line-clamp: 1;
    font-size: 14.5px;
}

.deals.is-list .deal .btn {
    margin-top: 8px;
    align-self: flex-start;
    width: auto;
}

.deal-skeleton {
    border-radius: var(--r-lg);
    height: 216px;
}

/* Invisible target the infinite-scroll observer watches for. */
.scroll-sentinel {
    height: 1px;
}

.row-skeleton {
    border-radius: var(--r-lg);
    height: 96px;
}

.deals.is-list .deal-skeleton {
    height: 106px;
}

/* --------------------------------------------------------------------------
   Showcase
   -------------------------------------------------------------------------- */

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

.row-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: 13px;
}

.row-card.is-upgrade {
    border-color: rgba(52, 211, 153, .28);
}

.row-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.thumb {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
}

.thumb.is-tall {
    width: 62px;
    flex-basis: 62px;
    height: 82px;
}

.row-main {
    flex: 1;
    min-width: 0;
}

.row-brand {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.row-title {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.row-sub {
    font-size: 12.5px;
    color: var(--text-dim);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-dim);
}

.row-card > .btn {
    margin-top: 11px;
}

/* The rate story is the whole point of the card, so it is one line rather than
   a two-column panel: current rate, arrow, our rate, and the gain. */
.rate-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.rate-line .from {
    color: var(--text-dim);
}

.rate-line .arrow {
    color: var(--text-faint);
    font-weight: 400;
}

.rate-line .to {
    color: var(--success);
}

.rate-line .only {
    color: var(--text);
}

.rate-line .caption {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-faint);
}

.delta-badge {
    flex: 0 0 auto;
    align-self: flex-start;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    background: var(--success-soft);
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
}

/* Named alternative product, kept as a caption instead of its own boxed panel. */
.swap-note {
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text-dim);
}

.swap-note strong {
    color: var(--text);
    font-weight: 600;
}

/* One-line page summary. Replaces a four-tile grid that mostly showed zeroes. */
.summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--hairline);
    font-size: 13.5px;
    color: var(--text-dim);
}

.summary.is-actionable {
    background: var(--success-soft);
    border-color: rgba(52, 211, 153, .25);
    color: #b9f3dc;
}

.summary strong {
    color: var(--text);
    font-weight: 700;
}

.summary.is-actionable strong {
    color: var(--success);
}

.summary svg {
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   Videos
   -------------------------------------------------------------------------- */

.videos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.video {
    display: block;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--hairline);
    color: inherit;
}

.video:active {
    transform: scale(.985);
}

.video-media {
    position: relative;
    aspect-ratio: 9 / 14;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
}

.video-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-stats {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 9px;
    padding: 26px 9px 8px;
    /* Thumbnails are often bright, so the scrim has to carry the text on its own. */
    background: linear-gradient(transparent, rgba(0, 0, 0, .45) 45%, rgba(0, 0, 0, .88));
    font-size: 10.5px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}

.video-stats span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-body {
    padding: 9px 10px 11px;
}

.video-brand {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.video-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-skeleton {
    border-radius: var(--r-lg);
    aspect-ratio: 9 / 18;
}

/* --------------------------------------------------------------------------
   Profile
   -------------------------------------------------------------------------- */

.brand-mark {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.brand-mark.tiktok {
    background: linear-gradient(135deg, #25f4ee 0%, #000 45%, #fe2c55 100%);
}

.brand-mark.shop {
    background: linear-gradient(135deg, #ff8a3d 0%, #ea580c 100%);
}

.account {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1px solid var(--hairline);
}

.avatar {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-3);
    border: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
}

.avatar > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-info {
    flex: 1;
    min-width: 0;
}

.account-name {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.account-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-name svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: #20d5ec;
}

.account-sub {
    font-size: 12.5px;
    color: var(--text-dim);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bio {
    margin-top: 12px;
    padding: 11px 13px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-dim);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-body > .stat-grid,
.card-body > .btn,
.card-body > .account + * {
    margin-top: 12px;
}

.connect-hint {
    text-align: center;
    color: var(--text-dim);
    font-size: 13.5px;
    line-height: 1.5;
    padding: 4px 0 14px;
}

/* Recovery advice that only matters if TikTok shows the wrong screen: present
   when needed, quiet enough that a first-time creator reads past it. */
.connect-note {
    text-align: center;
    color: var(--text-faint);
    font-size: 12.5px;
    line-height: 1.45;
    padding: 0 0 14px;
}

/* --------------------------------------------------------------------------
   Auth screen
   -------------------------------------------------------------------------- */

.auth {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 20px calc(32px + var(--safe-b));
}

.auth-inner {
    width: 100%;
    max-width: 380px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 26px;
}

.auth-brand img {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    margin: 0 auto 16px;
    object-fit: cover;
}

.auth-brand h1 {
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.auth-brand p {
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 5px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    padding: 22px 20px;
}

.auth-card .btn {
    margin-top: 18px;
}

.auth-echo {
    text-align: center;
    font-size: 13.5px;
    color: var(--text-dim);
    margin-bottom: 18px;
}

.auth-echo strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    margin-top: 3px;
}

.auth-alt {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 16px;
}

.auth-foot {
    text-align: center;
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 22px;
}

.form-error {
    margin-top: 14px;
    padding: 11px 13px;
    border-radius: var(--r-md);
    background: var(--danger-soft);
    border: 1px solid rgba(248, 113, 113, .2);
    color: #fecaca;
    font-size: 13px;
    text-align: center;
}

.form-note {
    margin-top: 14px;
    font-size: 13px;
    color: var(--success);
    text-align: center;
}

/* First paint is hidden until the session check resolves, so a signed-in user
   never sees the sign-in screen flash past. */
.boot {
    visibility: hidden;
}

.boot.is-ready {
    visibility: visible;
    animation: fade-in .18s ease;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
}

/* --------------------------------------------------------------------------
   TikTok hand-off page

   Written into the tab opened by the hand-off, which is a blank document on
   this origin. Its styling has to live here rather than in style attributes:
   `style-src 'self'` forbids inline styles, so an inline-styled hand-off
   renders as unstyled Times New Roman.
   -------------------------------------------------------------------------- */

.opening {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
}

.opening-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid rgba(255, 255, 255, .2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: opening-spin .7s linear infinite;
}

@keyframes opening-spin {
    to {
        transform: rotate(360deg);
    }
}

.opening-title {
    margin: 0;
    font-weight: 600;
}

.opening-note {
    margin: 0;
    max-width: 30ch;
    color: var(--text-dim);
    font-size: 13.5px;
}

.opening-link {
    color: var(--accent);
    font-weight: 600;
}
