/* Alex Theme – Dark, mobile-first
   ================================ */

/* 1. Variables & Reset */
:root {
    --bg: #000;
    --text: #fff;
    --text-secondary: rgba(255,255,255,0.65);
    --accent: #facc15;
    --card-bg: rgba(255,255,255,0.06);
    --border: rgba(255,255,255,0.12);
    --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --container: 720px;
    --gap: clamp(16px, 4vw, 32px);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { font-size: 62.5%; }
body {
    font-family: var(--font);
    font-size: 1.7rem;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* 2. Site Header (hidden on home/story page) */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header-inner {
    max-width: var(--container); margin: 0 auto;
    padding: 14px var(--gap);
    display: flex; align-items: center; justify-content: space-between;
}
.site-logo { font-size: 1.8rem; font-weight: 700; }
.site-logo img { height: 28px; }
.site-nav { display: flex; gap: 20px; }
.site-nav a { font-size: 1.4rem; opacity: 0.8; transition: opacity 0.2s; }
.site-nav a:hover { opacity: 1; }

/* 3. Site Footer (hidden on home/story page) */
.site-footer { border-top: 1px solid var(--border); padding: 32px var(--gap); margin-top: 64px; }
.site-footer-inner {
    max-width: var(--container); margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 1.3rem; color: var(--text-secondary);
}
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--text); }

/* 4. Story Viewer (Full-screen) */
.story-viewer {
    width: 100vw; height: 100svh; overflow: hidden;
    position: relative; background: #000; color: #fff;
    touch-action: none; user-select: none;
    -webkit-touch-callout: none; -webkit-user-select: none;
}
.story-slides { position: absolute; inset: 0; }
.story-slide-media {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: #000; opacity: 0; transition: opacity 0.15s;
}
.story-slide-media.active { opacity: 1; z-index: 1; }
.story-slide-media img, .story-slide-media video {
    width: 100%; height: 100%; object-fit: contain; pointer-events: none;
}
.story-slide-media canvas.kb-live-canvas {
    width: 100%; height: 100%; display: block;
}

.story-top-gradient {
    position: absolute; top: 0; left: 0; right: 0; z-index: 2;
    padding: 40px 16px 48px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.42) 38%, transparent 100%);
    pointer-events: none;
}
.story-progress {
    position: absolute; top: 16px; left: 16px; right: 16px; z-index: 3;
    display: flex; gap: 4px;
}
.story-progress-bar {
    height: 4px; flex: 1; background: rgba(255,255,255,0.28);
    border-radius: 999px; overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,0.35);
}
.story-progress-fill {
    height: 100%; width: 0; background: #fff;
    border-radius: 999px; box-shadow: 0 0 10px rgba(255,255,255,0.55);
}
.story-bottom {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.76) 38%, rgba(0,0,0,0.42) 64%, transparent 100%);
    padding: 96px 16px 20px;
}
.story-bottom-inner {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
}

/* Story meta (title in top-left) */
.story-meta { font-size: 1.4rem; color: rgba(255,255,255,0.85); padding: 0; pointer-events: none; }
.story-title { font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }

/* Story caption */
.story-caption {
    flex: 1; min-width: 0;
}
.story-caption-text {
    font-size: 1.6rem; line-height: 1.45; max-width: 80vw;
    padding: 10px 14px; border-radius: 14px;
    background: rgba(0,0,0,0.44); backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-shadow: 0 1px 6px rgba(0,0,0,0.45);
}
.story-caption-toggle {
    display: block; margin-top: 4px; font-size: 1.3rem; opacity: 0.8; cursor: pointer;
}

/* Story actions (right column) */
.story-actions {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    pointer-events: auto;
}
.story-like-btn {
    background: none; border: none; padding: 0; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: #fff;
}
.like-icon { font-size: 2.6rem; filter: grayscale(1) brightness(1.8); }
.like-icon.liked { filter: none; }
.like-count { font-size: 1.2rem; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.story-blog-link {
    color: #fff; white-space: nowrap; font-size: 1.4rem;
    text-shadow: 0 1px 6px rgba(0,0,0,0.45); position: relative;
}
.blog-badge {
    position: absolute; top: -8px; right: -14px;
    background: var(--accent); color: #000;
    font-size: 1rem; font-weight: 700; line-height: 1;
    width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* Story empty state */
.story-empty {
    min-height: 100svh; display: grid; place-items: center;
    background: #000; color: #fff; font-size: 1.8rem;
}

/* Animations */
@keyframes likePop { 0% { transform: scale(1); } 30% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes badgePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(250,204,21,0.7); } 50% { box-shadow: 0 0 0 6px rgba(250,204,21,0); } }
.blog-badge.pulse { animation: badgePulse 0.6s ease 3; }
.story-like-btn.pop { animation: likePop 0.4s ease; }

/* 5. Blog / Post list pages */
.tag-main, .post-main, .page-main, .author-main, .blog-main {
    max-width: var(--container); margin: 0 auto; padding: 32px var(--gap);
}
.tag-header, .author-header, .blog-header {
    margin-bottom: 40px; text-align: center;
}

/* Blog archive page */
.blog-title { font-size: 3.2rem; font-weight: 800; }
.blog-subtitle { margin-top: 8px; color: var(--text-secondary); font-size: 1.6rem; }
.blog-grid {
    display: grid; grid-template-columns: 1fr; gap: 20px;
}
@media (min-width: 480px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }
.blog-card {
    display: flex; flex-direction: column;
    background: var(--card-bg); border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border); transition: border-color 0.2s, transform 0.2s;
    text-decoration: none; color: inherit;
}
.blog-card:hover { border-color: rgba(255,255,255,0.3); transform: translateY(-2px); }
.blog-card-img img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
}
.blog-card-placeholder {
    aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
    background: var(--border); font-size: 3rem;
}
.blog-card-body { padding: 14px; }
.blog-card-title { font-size: 1.6rem; font-weight: 700; margin: 0 0 6px; }
.blog-card-date { font-size: 1.2rem; color: var(--text-secondary); }
.blog-empty { text-align: center; color: var(--text-secondary); font-size: 1.6rem; padding: 60px 0; }
.tag-title, .author-name { font-size: 3.2rem; font-weight: 800; }
.tag-description, .author-bio {
    margin-top: 8px; color: var(--text-secondary); font-size: 1.6rem;
}
.author-avatar {
    width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 16px; object-fit: cover;
}

/* Post grid */
.post-grid {
    display: grid; grid-template-columns: 1fr; gap: 24px;
}
@media (min-width: 640px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Post card */
.post-card-link {
    display: flex; flex-direction: column;
    background: var(--card-bg); border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border); transition: border-color 0.2s;
}
.post-card-link:hover { border-color: rgba(255,255,255,0.3); }
.post-card-image img { width: 100%; height: 200px; object-fit: cover; }
.post-card-content { padding: 16px; }
.post-card-tag {
    font-size: 1.2rem; font-weight: 600; text-transform: uppercase;
    color: var(--accent); letter-spacing: 0.05em;
}
.post-card-title { font-size: 1.8rem; font-weight: 700; margin: 6px 0; }
.post-card-excerpt {
    font-size: 1.4rem; color: var(--text-secondary); margin-top: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-meta {
    font-size: 1.2rem; color: var(--text-secondary); margin-top: 10px;
}

/* Pagination */
.pagination {
    display: flex; justify-content: center; align-items: center; gap: 16px;
    margin-top: 48px; font-size: 1.4rem;
}
.pagination a { color: var(--accent); }
.pagination-info { color: var(--text-secondary); }

/* 6. Single post */
.post-header { margin-bottom: 32px; }
.post-tag {
    display: inline-block; font-size: 1.2rem; font-weight: 600;
    text-transform: uppercase; color: var(--accent); letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.post-title { font-size: 3.2rem; font-weight: 800; line-height: 1.2; }
.post-excerpt { font-size: 1.8rem; color: var(--text-secondary); margin-top: 12px; }
.post-meta { font-size: 1.4rem; color: var(--text-secondary); margin-top: 12px; }
.post-feature-image { margin: 0 calc(var(--gap) * -1) 32px; }
.post-feature-image img { width: 100%; border-radius: 8px; }
.post-feature-image figcaption {
    text-align: center; font-size: 1.3rem; color: var(--text-secondary); margin-top: 8px;
}

/* Post content */
.post-content { font-size: 1.7rem; line-height: 1.7; }
.post-content h2 { font-size: 2.4rem; margin: 40px 0 16px; }
.post-content h3 { font-size: 2rem; margin: 32px 0 12px; }
.post-content p { margin-bottom: 20px; }
.post-content a { color: var(--accent); text-decoration: underline; }
.post-content img { border-radius: 8px; margin: 24px 0; }
.post-content blockquote {
    border-left: 3px solid var(--accent); padding-left: 20px;
    margin: 24px 0; color: var(--text-secondary); font-style: italic;
}
.post-content ul, .post-content ol { padding-left: 24px; margin-bottom: 20px; }
.post-content pre {
    background: rgba(255,255,255,0.08); border-radius: 8px;
    padding: 16px; overflow-x: auto; margin: 24px 0;
}
.post-content code { font-size: 1.5rem; }

/* Related posts */
.related-posts { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-title { font-size: 2rem; margin-bottom: 24px; }

/* 7. Page */
.page-header { margin-bottom: 32px; }
.page-title { font-size: 3.2rem; font-weight: 800; }
.page-feature-image { margin-bottom: 32px; }
.page-feature-image img { border-radius: 8px; }
.page-content { font-size: 1.7rem; line-height: 1.7; }

/* 8. Ghost content width classes (required by Ghost) */
.kg-width-wide {
    margin-left: calc(var(--gap) * -1);
    margin-right: calc(var(--gap) * -1);
}
.kg-width-full {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    position: relative;
}
.kg-width-wide img,
.kg-width-full img {
    width: 100%;
}

/* 9. Ghost content cards (galleries, bookmarks, etc.) */
.kg-gallery-container { display: flex; flex-direction: column; gap: 8px; margin: 24px 0; }
.kg-gallery-row { display: flex; gap: 8px; }
.kg-gallery-image img { border-radius: 4px; }
.kg-bookmark-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; }


/* 10. Story Studio */
.studio { min-height: 100svh; background: radial-gradient(circle at top, #1b1b1b 0%, #0a0a0a 38%, #000 100%); color: #fff; }

/* PIN Gate */
.studio-pin { min-height: 100svh; display: grid; place-items: center; }
.studio-pin-inner { text-align: center; padding: 24px; }
.studio-pin-inner h1 { font-size: 28px; margin: 0 0 8px; }
.studio-pin-inner p { color: rgba(255,255,255,0.6); margin: 0 0 20px; }
.studio-pin-inner input { display: block; width: 160px; margin: 0 auto 14px; padding: 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.08); color: #fff; font-size: 24px; text-align: center; letter-spacing: 8px; }
.studio-pin-inner input:focus { outline: none; border-color: rgba(255,255,255,0.4); }
.studio-pin-inner button { padding: 14px 28px; border-radius: 14px; border: none; background: #fff; color: #000; font-weight: 700; font-size: 16px; cursor: pointer; }
.studio-pin-error { margin-top: 12px; color: #f87171; font-size: 14px; }

/* Studio Main */
.studio-main { padding: 16px 16px 120px; max-width: 640px; margin: 0 auto; }

/* Top bar */
.studio-topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.studio-back { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 13px; }
.studio-title { font-weight: 700; font-size: 16px; }
.studio-step-label { font-size: 12px; color: rgba(255,255,255,0.5); }

/* Step indicators */
.studio-steps { display: flex; gap: 8px; margin-bottom: 20px; }
.studio-step { flex: 1; padding: 10px; border-radius: 12px; text-align: center; font-size: 13px; font-weight: 600; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.4); cursor: pointer; transition: all 0.2s; }
.studio-step.active { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: #fff; }
.studio-step.done { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); color: #22c55e; }

/* Panels */
.studio-panel { border-radius: 24px; padding: 20px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 16px 42px rgba(0,0,0,0.24); }
.studio-panel h2 { margin: 0 0 6px; font-size: 24px; }
.studio-hint { margin: 0 0 16px; color: rgba(255,255,255,0.6); font-size: 14px; line-height: 1.5; }

/* Buttons */
.studio-btn-primary { display: inline-block; padding: 14px 24px; border-radius: 14px; border: none; background: #fff; color: #000; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; text-align: center; }
.studio-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.studio-btn-secondary { padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); color: #fff; font-size: 14px; cursor: pointer; }
.studio-btn-accent { padding: 14px 18px; border-radius: 14px; border: none; background: #22c55e; color: #052e16; font-weight: 700; font-size: 14px; cursor: pointer; }
.studio-btn-accent:disabled { opacity: 0.4; cursor: not-allowed; }

/* Thumbs grid */
.studio-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 16px; position: relative; }
.studio-thumb { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 3/4; }
.studio-thumb img { width: 100%; height: 100%; object-fit: cover; }
.studio-thumb-num { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,0.7); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; }
.studio-thumb-remove { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.7); color: #f87171; border: none; font-size: 14px; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }

/* Slide editor (Step 2) — stacked layout: image on top, caption below */
.studio-slides-list { display: grid; gap: 16px; }
.studio-slide-edit { display: flex; flex-direction: column; gap: 10px; border-radius: 18px; padding: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); position: relative; }
.studio-slide-drag-handle { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); border-radius: 8px; color: rgba(255,255,255,0.6); font-size: 16px; cursor: grab; touch-action: none; z-index: 5; user-select: none; -webkit-user-select: none; }
.studio-slide-drag-handle:active { cursor: grabbing; color: #fff; background: rgba(99,102,241,0.6); }
.studio-slide-dragging { position: fixed !important; z-index: 999; opacity: 0.9; pointer-events: none; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.studio-slide-placeholder { border: 2px dashed rgba(99,102,241,0.5); border-radius: 18px; background: rgba(99,102,241,0.05); transition: height 0.15s ease; }
.studio-slide-preview { position: relative; border-radius: 12px; overflow: hidden; max-height: 320px; }
.studio-slide-preview img { width: 100%; height: auto; max-height: 320px; object-fit: contain; display: block; }
.studio-slide-number { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.7); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; }
.studio-slide-fields { display: flex; flex-direction: column; gap: 8px; }
.studio-caption-input { width: 100%; min-height: 44px; padding: 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: #fff; font-size: 14px; resize: none; overflow: hidden; font-family: inherit; box-sizing: border-box; line-height: 1.5; }
.studio-caption-input:focus { outline: none; border-color: rgba(255,255,255,0.3); }
.studio-slide-actions { display: flex; gap: 6px; }
.studio-remove-btn { padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(248,113,113,0.3); background: rgba(255,255,255,0.04); color: #fca5a5; font-size: 14px; cursor: pointer; }

/* Add more media button */
.studio-add-more-wrap { text-align: center; padding: 12px 0; }
.studio-btn-add-more { display: inline-flex; align-items: center; gap: 6px; padding: 14px 28px; border-radius: 14px; border: 2px dashed rgba(255,255,255,0.2); background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.7); font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; width: 100%; justify-content: center; }
.studio-btn-add-more:hover, .studio-btn-add-more:active { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.08); color: #fff; }

/* Drag-to-reorder styles */
.studio-thumb.dragging { opacity: 0.4; transform: scale(0.92); }
.studio-thumb.drag-over { outline: 2px solid #22c55e; outline-offset: 2px; }
.studio-thumb { transition: transform 0.15s ease, opacity 0.15s ease; user-select: none; -webkit-user-select: none; touch-action: none; }

/* Publish form */
.studio-publish-form { margin-bottom: 16px; }
.studio-publish-form label { display: block; font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 6px; }
.studio-publish-form input { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: #fff; font-size: 16px; box-sizing: border-box; }
.studio-publish-form input:focus { outline: none; border-color: rgba(255,255,255,0.3); }

/* Upload status */
.studio-upload-item { display: grid; grid-template-columns: auto 48px 1fr auto; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); margin-bottom: 8px; }
.studio-upload-num { font-weight: 700; color: rgba(255,255,255,0.5); font-size: 13px; }
.studio-upload-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.studio-upload-info { min-width: 0; }
.studio-upload-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-upload-caption { font-size: 12px; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-upload-state { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.5); }
.studio-upload-state.uploading { color: #facc15; }
.studio-upload-state.done { color: #22c55e; }

/* Publish actions & results */
.studio-publish-actions { margin-top: 16px; }
.studio-success { text-align: center; padding: 20px; border-radius: 18px; background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); margin-top: 16px; }
.studio-success h3 { margin: 0 0 8px; font-size: 22px; }
.studio-success p { margin: 0 0 16px; color: rgba(255,255,255,0.7); }
.studio-post-share-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.studio-post-share-btns button { flex: 1; min-width: 140px; }
.studio-btn-whatsapp { padding: 14px 18px; border-radius: 14px; border: none; background: #25d366; color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; width: 100%; transition: background 0.2s; }
.studio-btn-whatsapp:hover { background: #1ebe5d; }
.studio-btn-whatsapp:active { background: #17a34a; transform: scale(0.98); }
.studio-error { padding: 14px; border-radius: 14px; background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: #fca5a5; margin-top: 16px; }

/* Draft toggle */
.studio-draft-toggle { margin: 12px 0 8px; }
.studio-toggle-label { display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(255,255,255,0.8); cursor: pointer; user-select: none; }
.studio-toggle-label input { display: none; }
.studio-toggle-switch { width: 40px; height: 22px; border-radius: 11px; background: rgba(255,255,255,0.15); position: relative; transition: background 0.2s; flex-shrink: 0; }
.studio-toggle-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.studio-toggle-label input:checked + .studio-toggle-switch { background: #facc15; }
.studio-toggle-label input:checked + .studio-toggle-switch::after { transform: translateX(18px); }
.studio-toggle-hint { font-size: 12px; color: rgba(255,255,255,0.4); }

/* Draft story card */
.studio-story-card.draft-card { opacity: 0.55; border-color: rgba(250,204,21,0.25); }
.studio-story-card.draft-card:hover { opacity: 0.8; }
.studio-draft-badge { display: inline-block; background: rgba(250,204,21,0.2); color: #facc15; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.studio-btn-publish { border-color: rgba(34,197,94,0.4) !important; color: #4ade80 !important; }

/* Bottom bar */
.studio-bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(3,3,3,0.86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; }
.studio-spacer { flex: 1; }

/* Drag-to-reorder */
.studio-thumb.dragging { opacity: 0.4; transform: scale(0.92); transition: transform 0.15s; }
.studio-thumb.drag-over { outline: 2px solid #22c55e; outline-offset: 2px; border-radius: 14px; }
.studio-drop-indicator { position: absolute; width: 3px; background: #fff; border-radius: 2px; z-index: 10; pointer-events: none; box-shadow: 0 0 6px rgba(255,255,255,0.5); }

/* Video trimmer (WhatsApp-style) */
.vtrim-wrap { position: relative; }
.vtrim-video { width: 100%; max-height: 320px; object-fit: contain; display: block; background: #000; border-radius: 8px; }
.vtrim-timeline { position: relative; width: calc(100% - 32px); height: 44px; margin: 0 16px 24px; border-radius: 6px; overflow: visible; background: #111; }
.vtrim-thumbs { display: flex; height: 100%; overflow: hidden; border-radius: 6px; }
.vtrim-thumbs img { flex-shrink: 0; object-fit: cover; opacity: 0.5; }
.vtrim-bracket { position: absolute; inset: 0; pointer-events: none; }
.vtrim-selected { position: absolute; top: 0; height: 100%; border-top: 3px solid #fff; border-bottom: 3px solid #fff; pointer-events: none; }
.vtrim-handle { position: absolute; top: -2px; width: 16px; height: calc(100% + 4px); background: #fff; cursor: ew-resize; touch-action: none; pointer-events: auto; z-index: 3; border-radius: 4px; }
.vtrim-handle-l { transform: translateX(-100%); border-radius: 4px 0 0 4px; }
.vtrim-handle-r { border-radius: 0 4px 4px 0; }
.vtrim-label { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; }
.trim-label { font-weight: 600; color: #fff; font-size: 12px; }
.vtrim-play-btn { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(0,0,0,0.6); border: 2px solid #fff; color: #fff; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.vtrim-playhead { position: absolute; top: 0; width: 2px; height: 100%; background: #f00; z-index: 5; pointer-events: none; display: none; transform: translateX(-1px); }

/* Crop reset button */
.crop-btn-reset { background: none; border: 1px solid rgba(255,255,255,0.3); color: rgba(255,255,255,0.7); font-size: 14px; padding: 8px 16px; border-radius: 20px; cursor: pointer; }

/* Share overlay (step-by-step) */
.studio-share-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; padding: 16px; }
.studio-share-card { background: #1a1a1a; border-radius: 18px; padding: 20px; max-width: 400px; width: 100%; text-align: center; }
.studio-share-preview { margin-bottom: 12px; }
.studio-share-caption { color: rgba(255,255,255,0.7); font-size: 14px; margin-bottom: 8px; min-height: 20px; }
.studio-share-counter { color: rgba(255,255,255,0.4); font-size: 12px; margin-bottom: 16px; }
.studio-share-btns { display: flex; gap: 10px; justify-content: center; }

/* Mode tabs */
.studio-mode-tabs { display: flex; gap: 0; margin: 0 16px 16px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.studio-mode-tab { flex: 1; padding: 10px; text-align: center; font-size: 14px; font-weight: 600; background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.6); border: none; cursor: pointer; transition: all 0.2s; }
.studio-mode-tab.active { background: rgba(255,255,255,0.12); color: #fff; }

/* Story cards (Meine Stories) */
.studio-stories-list { display: grid; gap: 12px; padding: 0 16px 120px; }
.studio-story-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); touch-action: none; transition: transform 0.15s, opacity 0.15s, border-color 0.15s; }
.studio-story-card.dragging { opacity: 0.4; transform: scale(0.96); }
.studio-story-card.drag-over { border-color: rgba(250,204,21,0.6); background: rgba(250,204,21,0.08); }
.studio-story-thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.studio-story-thumb img { width: 100%; height: 100%; object-fit: cover; }
.studio-story-nothumb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.06); font-size: 24px; }
.studio-story-info { flex: 1; min-width: 0; }
.studio-story-title { font-weight: 600; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-story-meta { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.studio-story-actions { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.studio-btn-small { padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: #fff; font-size: 12px; cursor: pointer; white-space: nowrap; flex: 1; text-align: center; }
.studio-btn-danger { border-color: rgba(248,113,113,0.3); color: #fca5a5; }
.studio-loading { text-align: center; padding: 40px; color: rgba(255,255,255,0.5); }
.studio-crop-btn { padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: #fff; font-size: 14px; cursor: pointer; }

/* Fullscreen Cropper (WhatsApp-style) */
.crop-fullscreen { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; flex-direction: column; }
.crop-topbar { display: flex; align-items: center; padding: 8px 12px; gap: 6px; background: rgba(0,0,0,0.85); z-index: 2; }
.crop-topbar-btn { background: none; border: none; color: #fff; font-size: 22px; padding: 8px; cursor: pointer; flex-shrink: 0; }
.crop-ratios { display: flex; gap: 4px; overflow-x: auto; flex: 1; justify-content: center; }
.crop-ratio { padding: 5px 12px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.2); background: transparent; color: rgba(255,255,255,0.6); font-size: 12px; cursor: pointer; white-space: nowrap; transition: all 0.15s; }
.crop-ratio.active { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.4); }
.crop-canvas-area { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.crop-canvas-area canvas { display: block; }
.crop-selection { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,0.6); cursor: move; touch-action: none; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; }
.crop-grid::before, .crop-grid::after { content: ''; position: absolute; background: rgba(255,255,255,0.25); }
.crop-grid::before { left: 33.33%; width: 1px; top: 0; bottom: 0; box-shadow: calc(33.33% * 1) 0 0 rgba(255,255,255,0.25); }
.crop-grid::after { top: 33.33%; height: 1px; left: 0; right: 0; box-shadow: 0 calc(33.33% * 1) 0 rgba(255,255,255,0.25); }
/* Corner handles */
.crop-handle { position: absolute; width: 24px; height: 24px; z-index: 3; touch-action: none; }
.crop-h-tl { top: -3px; left: -3px; cursor: nwse-resize; border-top: 3px solid #fff; border-left: 3px solid #fff; }
.crop-h-tr { top: -3px; right: -3px; cursor: nesw-resize; border-top: 3px solid #fff; border-right: 3px solid #fff; }
.crop-h-bl { bottom: -3px; left: -3px; cursor: nesw-resize; border-bottom: 3px solid #fff; border-left: 3px solid #fff; }
.crop-h-br { bottom: -3px; right: -3px; cursor: nwse-resize; border-bottom: 3px solid #fff; border-right: 3px solid #fff; }
/* Edge handles */
.crop-edge { position: absolute; z-index: 3; touch-action: none; }
.crop-e-t { top: -8px; left: 24px; right: 24px; height: 16px; cursor: ns-resize; }
.crop-e-b { bottom: -8px; left: 24px; right: 24px; height: 16px; cursor: ns-resize; }
.crop-e-l { left: -8px; top: 24px; bottom: 24px; width: 16px; cursor: ew-resize; }
.crop-e-r { right: -8px; top: 24px; bottom: 24px; width: 16px; cursor: ew-resize; }
/* Bottom bar */
.crop-bottombar { display: flex; justify-content: space-between; padding: 12px 20px; background: rgba(0,0,0,0.85); z-index: 2; }
.crop-btn-cancel { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 16px; padding: 10px 20px; cursor: pointer; }
.crop-btn-done { background: #22c55e; border: none; color: #fff; font-size: 16px; font-weight: 600; padding: 10px 24px; border-radius: 24px; cursor: pointer; }

/* ═══ Ken Burns Effect Modal ═══ */
.studio-fx-btn { padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(168,85,247,0.4); background: rgba(168,85,247,0.12); color: #c084fc; font-size: 14px; cursor: pointer; transition: all 0.15s; }
.studio-fx-btn:hover { background: rgba(168,85,247,0.25); }
.kb-fullscreen { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; flex-direction: column; }
.kb-topbar { display: flex; align-items: center; padding: 8px 12px; gap: 8px; background: rgba(0,0,0,0.85); z-index: 2; }
.kb-topbar-btn { background: none; border: 1px solid rgba(255,255,255,0.2); color: #fff; font-size: 14px; padding: 6px 14px; border-radius: 16px; cursor: pointer; }
.kb-topbar-title { flex: 1; text-align: center; color: #c084fc; font-weight: 600; font-size: 15px; }
.kb-canvas-area { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.kb-canvas-inner { position: relative; display: inline-block; transform-origin: center center; }
.kb-canvas-inner canvas { display: block; }
/* Crop frame */
.kb-crop-frame { position: absolute; border: 2px solid #22c55e; z-index: 4; cursor: move; touch-action: none; }
.kb-frame-a { box-shadow: 0 0 0 9999px rgba(0,0,0,0.45); }
.kb-frame-b { border-color: #f97316; z-index: 3; box-shadow: none; border-style: dashed; }
.kb-frame-label { position: absolute; top: 4px; left: 4px; font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 4px; pointer-events: none; line-height: 1.2; }
.kb-frame-a .kb-frame-label { background: #22c55e; color: #000; }
.kb-frame-b .kb-frame-label { background: #f97316; color: #000; }
.kb-crop-grid { position: absolute; inset: 0; pointer-events: none; }
.kb-crop-grid::before, .kb-crop-grid::after { content: ''; position: absolute; }
.kb-frame-a .kb-crop-grid::before { left: 33.33%; width: 1px; top: 0; bottom: 0; background: rgba(34,197,94,0.3); box-shadow: calc(33.33%) 0 0 rgba(34,197,94,0.3); }
.kb-frame-a .kb-crop-grid::after { top: 33.33%; height: 1px; left: 0; right: 0; background: rgba(34,197,94,0.3); box-shadow: 0 calc(33.33%) 0 rgba(34,197,94,0.3); }
.kb-frame-b .kb-crop-grid::before { left: 33.33%; width: 1px; top: 0; bottom: 0; background: rgba(249,115,22,0.3); box-shadow: calc(33.33%) 0 0 rgba(249,115,22,0.3); }
.kb-frame-b .kb-crop-grid::after { top: 33.33%; height: 1px; left: 0; right: 0; background: rgba(249,115,22,0.3); box-shadow: 0 calc(33.33%) 0 rgba(249,115,22,0.3); }
/* Handle sizes scale with zoom via CSS custom properties set from JS */
.kb-canvas-inner { --kb-handle-size: 44px; --kb-handle-offset: -10px; --kb-handle-border: 3px; --kb-frame-border: 2px; }
.kb-crop-frame { border-width: var(--kb-frame-border); }
.kb-crop-handle { position: absolute; width: var(--kb-handle-size); height: var(--kb-handle-size); z-index: 5; touch-action: none; }
.kb-frame-a .kb-h-tl { top: var(--kb-handle-offset); left: var(--kb-handle-offset); cursor: nwse-resize; border-top: var(--kb-handle-border) solid #22c55e; border-left: var(--kb-handle-border) solid #22c55e; }
.kb-frame-a .kb-h-tr { top: var(--kb-handle-offset); right: var(--kb-handle-offset); cursor: nesw-resize; border-top: var(--kb-handle-border) solid #22c55e; border-right: var(--kb-handle-border) solid #22c55e; }
.kb-frame-a .kb-h-bl { bottom: var(--kb-handle-offset); left: var(--kb-handle-offset); cursor: nesw-resize; border-bottom: var(--kb-handle-border) solid #22c55e; border-left: var(--kb-handle-border) solid #22c55e; }
.kb-frame-a .kb-h-br { bottom: var(--kb-handle-offset); right: var(--kb-handle-offset); cursor: nwse-resize; border-bottom: var(--kb-handle-border) solid #22c55e; border-right: var(--kb-handle-border) solid #22c55e; }
.kb-frame-b .kb-h-tl { top: var(--kb-handle-offset); left: var(--kb-handle-offset); cursor: nwse-resize; border-top: var(--kb-handle-border) solid #f97316; border-left: var(--kb-handle-border) solid #f97316; }
.kb-frame-b .kb-h-tr { top: var(--kb-handle-offset); right: var(--kb-handle-offset); cursor: nesw-resize; border-top: var(--kb-handle-border) solid #f97316; border-right: var(--kb-handle-border) solid #f97316; }
.kb-frame-b .kb-h-bl { bottom: var(--kb-handle-offset); left: var(--kb-handle-offset); cursor: nesw-resize; border-bottom: var(--kb-handle-border) solid #f97316; border-left: var(--kb-handle-border) solid #f97316; }
.kb-frame-b .kb-h-br { bottom: var(--kb-handle-offset); right: var(--kb-handle-offset); cursor: nwse-resize; border-bottom: var(--kb-handle-border) solid #f97316; border-right: var(--kb-handle-border) solid #f97316; }
/* Aspect ratio bar */
.kb-aspect-bar { display: flex; gap: 4px; flex-wrap: wrap; }
.kb-aspect-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.kb-aspect-btn.active { background: #22c55e; color: #000; border-color: #22c55e; font-weight: 600; }
.kb-rotate-btn { font-size: 14px; padding: 3px 6px; }
.kb-reset-btn { font-size: 14px; padding: 3px 6px; }
.kb-img-info { color: rgba(255,255,255,0.4); font-size: 11px; white-space: nowrap; margin-left: 4px; }
/* Controls */
.kb-controls { padding: 12px 16px; background: rgba(0,0,0,0.85); display: flex; flex-direction: column; gap: 8px; }
.kb-control-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kb-label { color: rgba(255,255,255,0.7); font-size: 13px; min-width: 60px; }
.kb-slider { flex: 1; accent-color: #c084fc; }
.kb-val { color: #c084fc; font-weight: 600; font-size: 14px; min-width: 20px; }
.kb-hint { color: rgba(255,255,255,0.45); font-size: 12px; font-style: italic; }
.kb-hold-btns { display: flex; align-items: center; gap: 6px; }
.kb-hold-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; border-radius: 6px; padding: 4px 10px; font-size: 13px; cursor: pointer; min-width: 32px; text-align: center; }
.kb-hold-btn.active { background: #c084fc; color: #000; border-color: #c084fc; font-weight: 600; }
.kb-hold-input { width: 48px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.25); color: #c084fc; border-radius: 6px; padding: 4px 6px; font-size: 13px; text-align: center; font-weight: 600; }
.kb-hold-input::-webkit-inner-spin-button { opacity: 1; }
/* Direction toggle */
.kb-toggle-wrap { display: flex; gap: 2px; background: rgba(255,255,255,0.08); border-radius: 10px; padding: 2px; }
.kb-toggle-btn { padding: 5px 12px; border: none; border-radius: 8px; background: transparent; color: rgba(255,255,255,0.5); font-size: 12px; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.kb-toggle-btn.active { background: rgba(168,85,247,0.3); color: #c084fc; font-weight: 600; }
/* Bottom bar */
.kb-bottombar { display: flex; justify-content: space-between; padding: 12px 20px; background: rgba(0,0,0,0.85); z-index: 2; }
.kb-btn-cancel { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 16px; padding: 10px 20px; cursor: pointer; }
.kb-btn-done { background: linear-gradient(135deg, #a855f7, #22c55e); border: none; color: #fff; font-size: 16px; font-weight: 600; padding: 10px 24px; border-radius: 24px; cursor: pointer; }
/* A/B frame toggle (pan mode) */
.kb-ab-row { transition: opacity 0.2s; }
.kb-ab-toggle { display: flex; gap: 2px; background: rgba(255,255,255,0.08); border-radius: 10px; padding: 2px; }
.kb-ab-btn { padding: 5px 14px; border: none; border-radius: 8px; background: transparent; color: rgba(255,255,255,0.5); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 6px; }
.kb-ab-btn.active { background: rgba(255,255,255,0.15); color: #fff; }
.kb-ab-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
/* Joystick */
.kb-joystick-row { justify-content: flex-start; }
.kb-joystick { position: relative; width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); touch-action: none; flex-shrink: 0; }
.kb-joystick-knob { position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: rgba(168,85,247,0.6); border: 2px solid #c084fc; pointer-events: none; transition: transform 0.08s ease-out; }
/* Studio version label */
.studio-version { position: fixed; bottom: 6px; right: 10px; font-size: 10px; color: rgba(255,255,255,0.2); z-index: 999; pointer-events: none; }
/* KB badge on slide thumbnail */
.kb-badge { position: absolute; bottom: 8px; right: 8px; background: rgba(168,85,247,0.85); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 6px; pointer-events: none; }