:root {
    --bg-base: #1e1f24;
    --bg-elevated: #2b2d31;
    --bg-card: #313338;
    --bg-input: #40444b;
    --border: #3f4147;
    --text: #dbdee1;
    --text-muted: #949ba4;
    --text-dim: #6d7178;
    --accent: #5865f2;
    --accent-hover: #4752c4;
    --twitch: #9146ff;
    --twitch-hover: #7c3aed;
    --success: #43b581;
    --warning: #faa61a;
    --danger: #f04747;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    --header-h: 64px;
    --container: 720px;
    --container-narrow: 520px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(88, 101, 242, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(145, 70, 255, 0.08), transparent),
        url("/video/bg.gif") center/cover no-repeat;
    opacity: 0.18;
    z-index: -1;
    pointer-events: none;
}

a {
    color: inherit;
}

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(30, 31, 36, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(16px, env(safe-area-inset-left, 16px)) 0 max(16px, env(safe-area-inset-right, 16px));
    gap: 12px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    flex-shrink: 0;
}

.site-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.site-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.site-nav a.active {
    color: #fff;
    background: rgba(88, 101, 242, 0.2);
}

.site-nav a.nav-cta {
    background: var(--accent);
    color: #fff;
}

.site-nav a.nav-cta:hover {
    background: var(--accent-hover);
}

.site-nav a.nav-twitch {
    color: #bf9bff;
}

.site-nav a.nav-twitch:hover {
    background: rgba(145, 70, 255, 0.15);
    color: #d4b8ff;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* ── Layout ── */
.page-main {
    padding: 32px 20px 48px;
    min-height: calc(100vh - var(--header-h) - 80px);
}

.page-container {
    max-width: var(--container);
    margin: 0 auto;
    width: 100%;
}

.page-container--narrow {
    max-width: var(--container-narrow);
}

.page-container--center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-h) - 160px);
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

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

.card-title {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    text-align: center;
    margin-bottom: 20px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-block {
    display: flex;
    width: 100%;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.35);
}

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

.btn-twitch:hover {
    background: var(--twitch-hover);
    box-shadow: 0 4px 16px rgba(145, 70, 255, 0.35);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: rgba(88, 101, 242, 0.1);
}

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

.btn-success:hover {
    background: #3ca374;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Forms ── */
.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid #202225;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    margin: 6px 0;
    transition: border-color 0.15s;
}

.form-input:focus {
    border-color: var(--accent);
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-form .form-input {
    margin: 4px 0 0;
}

.form-alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.45;
}

.form-alert--error {
    background: rgba(255, 80, 80, 0.12);
    border: 1px solid rgba(255, 100, 100, 0.35);
    color: #ffb4b4;
}

.password-field {
    position: relative;
}

.password-field .form-input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 2px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0.65;
    padding: 4px 6px;
}

.password-toggle:hover {
    opacity: 1;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
    cursor: pointer;
}

.form-check input {
    margin-top: 3px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.form-check a {
    color: var(--accent);
}

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

.link-accent:hover {
    text-decoration: underline;
}

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 24px 20px 32px;
    border-top: 1px solid var(--border);
    background: rgba(30, 31, 36, 0.6);
}

.site-footer a {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    margin: 0 12px;
    transition: color 0.15s;
}

.site-footer a:hover {
    color: #7289ff;
}

.site-footer-copy {
    display: block;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 12px;
}

.legal-content h2 {
    font-size: 18px;
    margin: 24px 0 8px;
    color: #fff;
}

.legal-content p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
}

.legal-content a {
    color: var(--accent);
}

/* ── Landing ── */
.hero {
    text-align: center;
    padding: 20px 0 40px;
}

.hero-logo-img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    margin: 0 auto 20px;
    box-shadow: 0 8px 32px rgba(88, 101, 242, 0.35);
    animation: float 3s ease-in-out infinite;
}

.hero-logo {
    width: 72px;
    height: 72px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
    box-shadow: 0 8px 32px rgba(88, 101, 242, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.hero h1 {
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}

.hero .subtitle {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 420px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 40px;
}

.step {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    text-align: left;
    transition: transform 0.15s, border-color 0.15s;
}

.step:hover {
    transform: translateY(-2px);
    border-color: rgba(88, 101, 242, 0.3);
}

.step-icon {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.step-text {
    font-size: 14px;
    color: var(--text);
}

.step-text strong {
    color: #fff;
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

/* ── Profile ── */
.profile-header {
    text-align: center;
    padding: 12px 0 24px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 12px;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-actions .btn {
    padding: 14px 12px;
    font-size: 14px;
}

/* ── Twitch ── */
.twitch-input {
    margin-bottom: 12px;
}

.video-list {
    margin-top: 20px;
}

.video-item {
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin: 8px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: background 0.15s, border-color 0.15s;
}

.twitch-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.twitch-actions .btn { flex: 1; min-width: 160px; }
.period-select {
    flex: 0 0 140px;
    margin: 0;
    padding: 10px 12px;
}
.section-title {
    margin: 28px 0 12px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
}
.pick-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
.pick-hint {
    margin: -4px 0 14px;
    font-size: 0.9rem;
}
.pick-card {
    display: grid;
    grid-template-columns: 120px 1fr 28px;
    gap: 12px;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 8px;
    cursor: default;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}
.pick-card--video {
    grid-template-columns: 1fr 28px;
    grid-template-rows: auto auto;
    align-items: start;
}
.pick-card--video .pick-video {
    grid-column: 1 / 2;
    width: 100%;
    max-height: 220px;
    border-radius: 8px;
    background: #000;
    aspect-ratio: 16 / 9;
    object-fit: contain;
}
.pick-card--video .pick-body {
    grid-column: 1 / 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}
.pick-card--video .pick-check {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    cursor: pointer;
}
.pick-select-btn {
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
    margin: 0;
}
.pick-card.selected .pick-select-btn {
    background: var(--twitch);
    border-color: var(--twitch);
    color: #fff;
}
.pick-card:hover { border-color: #6b7280; }
.pick-card.selected {
    border-color: var(--twitch);
    background: #3a3f4a;
}
.pick-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    background: #222;
}
.pick-thumb--empty { background: #2a2e36; }
.pick-title {
    font-weight: 550;
    color: #fff;
    font-size: 0.92rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pick-meta {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.pick-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #6b7280;
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}
.pick-card.selected .pick-check {
    background: var(--twitch);
    border-color: var(--twitch);
    color: #fff;
}
.mt-12 { margin-top: 12px; }

.video-item:hover {
    background: #4a4f57;
    border-color: var(--twitch);
}

.video-title {
    flex: 1;
    font-weight: 500;
    color: #fff;
    word-break: break-word;
}

.video-duration {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.video-item--disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.video-item--disabled:hover {
    background: var(--bg-input);
    border-color: transparent;
}

.video-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.video-tag--ok { background: rgba(87, 242, 135, 0.15); color: #57f287; }
.video-tag--warn { background: rgba(254, 231, 92, 0.15); color: #fee75c; }
.video-tag--error { background: rgba(237, 66, 69, 0.15); color: #ed4245; }

/* ── Progress ── */
.progress-wrap {
    margin-top: 20px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.progress-bar {
    height: 8px;
    background: #202225;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--twitch);
    transition: width 0.3s;
}

.progress-msg {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
}

/* ── Clips library ── */
.page-container--clips {
    max-width: 880px;
    margin: 0 auto;
    padding: 8px 16px 40px;
}

.clips-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.clips-heading {
    font-size: 1.65rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}

.clips-sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.clips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.clip-tile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.clip-phone {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #0a0a0c;
    aspect-ratio: 9 / 16;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 18px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clip-tile.is-playing .clip-phone,
.clip-phone:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 0 1px rgba(88, 101, 242, 0.35),
        0 22px 48px rgba(0, 0, 0, 0.45);
}

.clip-phone .clip-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.clip-play {
    position: absolute;
    inset: 0;
    border: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.45) 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.clip-play:hover {
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.55) 100%);
}

.clip-play.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.clip-play-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    position: relative;
}

.clip-play-icon::after {
    content: "";
    position: absolute;
    left: 23px;
    top: 18px;
    border-style: solid;
    border-width: 11px 0 11px 16px;
    border-color: transparent transparent transparent #1e1f24;
}

.clip-meta {
    padding: 0 2px;
}

.clip-meta-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.clip-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clip-chip {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(88, 101, 242, 0.2);
    color: #aeb4ff;
    text-transform: lowercase;
}

.clip-meta-line {
    margin: 0 0 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.clip-dl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: #fff;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.clip-dl:hover {
    background: #4a4f57;
    border-color: var(--accent);
}

.empty-state--clips {
    padding: 56px 20px;
    background: rgba(49, 51, 56, 0.55);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.empty-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 6px;
}

.empty-text {
    margin: 0 0 20px;
    color: var(--text-muted);
}

/* legacy list layout */
.clip-item {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.clip-item:last-child {
    border-bottom: none;
}

.clip-item video {
    width: 80px;
    height: 142px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: #000;
    flex-shrink: 0;
}

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

.clip-time {
    font-weight: 600;
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.clip-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(145, 70, 255, 0.25);
    color: #c9a0ff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.clip-score {
    font-size: 12px;
    color: #00f593;
    font-weight: 500;
}

.clip-date {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 16px;
}

/* ── Upload ── */
.upload-zone {
    border: 2px dashed var(--accent);
    border-radius: var(--radius);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    margin: 16px 0;
    background: rgba(88, 101, 242, 0.05);
    transition: background 0.15s, border-color 0.15s;
}

.upload-zone:hover {
    background: rgba(88, 101, 242, 0.1);
    border-color: #7289ff;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

/* ── Shop ── */
.balance-card {
    text-align: center;
    margin-bottom: 16px;
}

.balance-amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--accent);
}

.balance-label {
    font-size: 14px;
    color: var(--text-muted);
}

.cuts-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.12);
    border: 1px solid rgba(88, 101, 242, 0.25);
    font-size: 13px;
    font-weight: 600;
    color: #c9d0ff;
}

.cuts-badge--unlimited {
    background: rgba(0, 245, 147, 0.1);
    border-color: rgba(0, 245, 147, 0.3);
    color: #7dffc4;
}

.cuts-badge--block {
    display: flex;
    justify-content: center;
    width: 100%;
}

.toast-root {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: min(92vw, 360px);
}

.toast {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.toast--success {
    background: #0d3d2a;
    color: #00f593;
    border: 1px solid rgba(0, 245, 147, 0.35);
}

.toast--error {
    background: #3d1515;
    color: #ff8a8a;
    border: 1px solid rgba(255, 100, 100, 0.35);
}

.toast--info {
    background: rgba(24, 24, 27, 0.95);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.shop-item {
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    transition: border-color 0.15s;
    position: relative;
}

.shop-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(145, 70, 255, 0.25);
    color: #c9a0ff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
}

.shop-item:hover {
    border-color: var(--accent);
}

.shop-item b {
    display: block;
    color: #fff;
    margin-bottom: 6px;
}

.shop-item .price {
    color: var(--accent);
    font-weight: 700;
    font-size: 18px;
}

.shop-item .clips-count {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

.shop-item button {
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
}

.shop-item button:hover {
    background: var(--accent-hover);
}

/* ── Pay ── */
.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.15s;
}

.tab-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(88, 101, 242, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.amount-btn {
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    font-family: inherit;
    transition: all 0.15s;
}

.amount-btn.active {
    border-color: var(--accent);
    background: rgba(88, 101, 242, 0.15);
    color: var(--accent);
}

.qr-code {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    border-radius: var(--radius);
}

/* ── How-to-use / content pages ── */
.content-page h1 {
    color: #fff;
    font-size: clamp(22px, 4vw, 28px);
    margin-bottom: 16px;
}

.content-page h2 {
    color: #fff;
    font-size: 20px;
    margin: 28px 0 12px;
}

.content-page h3 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 6px;
}

.content-page p {
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.65;
}

.content-step {
    display: flex;
    gap: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.content-step-num {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.faq-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
}

/* ── Utilities ── */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-error { color: var(--danger); }
.text-success { color: var(--success); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s;
}

.back-link a:hover {
    color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    :root {
        --header-h: 56px;
    }

    .nav-toggle {
        display: block;
        min-width: 44px;
        min-height: 44px;
    }

    .site-header {
        position: relative;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(30, 31, 36, 0.98);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        padding: 8px 12px 12px;
        gap: 4px;
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        width: 100%;
        text-align: center;
        padding: 14px 12px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .page-main {
        padding: 20px 12px 28px;
    }

    .card {
        padding: 18px 14px;
    }

    .card-title {
        font-size: 20px;
    }

    .btn {
        min-height: 44px;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
    }

    .profile-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-box {
        padding: 12px 6px;
    }

    .stat-value {
        font-size: clamp(13px, 3.5vw, 18px);
        word-break: break-word;
        line-height: 1.2;
    }

    .stat-label {
        font-size: 10px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .amount-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .step {
        flex-direction: column;
        text-align: center;
    }

    .content-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .video-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .video-duration {
        font-size: 12px;
        background: rgba(0, 0, 0, 0.2);
        padding: 4px 8px;
        border-radius: 6px;
    }

    .clips-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .clips-header {
        flex-direction: column;
        align-items: stretch;
    }

    .clips-header .btn {
        align-self: flex-start;
    }

    .clip-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .clip-item video:not(.clip-player) {
        width: 100%;
        height: auto;
        max-height: 220px;
        aspect-ratio: 9 / 16;
    }

    .clip-item .btn {
        width: 100%;
        justify-content: center;
    }

    .shop-grid {
        grid-template-columns: 1fr 1fr;
    }

    .site-footer {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0));
    }

    .site-footer a {
        margin: 0;
        padding: 6px 0;
    }

    .hero {
        padding: 8px 0 28px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero .subtitle {
        font-size: 15px;
        padding: 0 4px;
    }

    .upload-zone {
        padding: 28px 16px;
    }
}

@media (max-width: 560px) {
    .clips-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 0 auto;
    }

    .clip-phone {
        border-radius: 22px;
    }
}

@media (max-width: 360px) {
    .profile-stats {
        grid-template-columns: 1fr;
    }

    .shop-grid {
        grid-template-columns: 1fr;
    }

    .amount-grid {
        grid-template-columns: 1fr;
    }

    .site-logo-text {
        font-size: 15px;
    }
}
