/**
 * AZ Story Engine — Dashboard, gallery & reader styles.
 */

.az-slide-nsfw .az-slide-text-wrapper:not(.az-nsfw-revealed) .az-slide-text,
.az-slide-nsfw #az-staged-seed-text:not(.az-nsfw-revealed) {
    filter: blur(14px);
    user-select: none;
    pointer-events: none;
}
.az-nsfw-reveal-btn {
    position: absolute; z-index: 20; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(255,51,102,0.15); border: 1px solid #ff3366; color: #ff3366;
    padding: 10px 20px; border-radius: 20px; font-size: 12px; font-weight: 700; cursor: pointer;
}
		.az-archived-seeds-btn { border-color: rgba(138,148,166,0.4) !important; color: #8a94a6 !important; background: rgba(138,148,166,0.08) !important; }
#az-staged-seed-wrap blockquote.az-slide-text { font-size: 20px; opacity: 0.96; }
		.az-crowned-badge { position:absolute; top:8px; right:8px; background:rgba(255,215,0,0.92); color:#0b0e14; font-size:10px; font-weight:800; padding:3px 8px; border-radius:10px; z-index:5; letter-spacing:0.3px; }
        .az-v6-container { max-width: 1100px; margin: 30px auto; padding: 25px; background: #0b0e14; border: 1px solid #1f2430; border-radius: 16px; color: #e1e4ea; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
        .az-v6-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #1f2430; padding-bottom: 20px; margin-bottom: 25px; }
        .az-v6-section-title { font-size: 18px; color: #fff; margin-bottom: 15px; }
        .az-v6-story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
        .az-v6-card { background: #121620; border: 1px solid #1f2430; border-radius: 12px; padding: 18px; position: relative; display: flex; flex-direction: column; }
        .az-v6-card-badge { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 10px; font-weight: bold; margin-bottom: 8px; align-self: flex-start; }
        .badge-genesis { background: rgba(0, 255, 136, 0.15); color: #00ff88; }
        .badge-branch { background: rgba(0, 170, 255, 0.15); color: #00aaff; }
        .az-v6-card-title { margin: 0 0 10px 0; color: #fff; font-size: 16px; }
        .az-v6-progress-bar-bg { background: #1f2430; height: 6px; border-radius: 3px; margin-bottom: 10px; overflow: hidden; }
        .az-v6-progress-bar-fill { height: 100%; background: #00ff88; border-radius: 3px; }
        .az-v6-card-meta { display: flex; justify-content: space-between; font-size: 11px; color: #8a94a6; }
        
        .az-carousel-viewport { overflow: hidden; position: relative; width: 100%; height: 420px; border-radius: 12px; background: #121620; border: 1px solid #1f2430; }
        .az-carousel-track { display: flex; width: 100%; height: 100%; transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); }
        .az-slide { flex: 0 0 100%; width: 100%; height: 100%; box-sizing: border-box; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
        
        /* THEME-PROOF TEXT CENTERING */
        .az-slide-text-wrapper { padding: 20px 40px !important; text-align: center !important; max-width: 850px; width: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; overflow-y: auto; margin: 0 auto !important; }
        blockquote.az-slide-text { border: none !important; padding: 0 !important; margin: 0 auto !important; background: transparent !important; box-shadow: none !important; font-size: 24px; font-weight: 500; line-height: 1.6; color: #ffebc5; font-style: italic; word-wrap: break-word; overflow-wrap: break-word; user-select: text; white-space: pre-wrap; width: 100%; text-align: center !important; display: block !important; }
        .az-slide-text:before, .az-slide-text:after { content: none !important; display: none !important; } /* Strips theme quotation marks */
        
        .az-slide-credit { position: absolute; bottom: 20px; right: 20px; background: rgba(11, 14, 20, 0.85); backdrop-filter: blur(8px); padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; color: #00ff88; border: 1px solid rgba(255,255,255,0.08); z-index: 10; display: flex; align-items: center; gap: 8px; }
        .az-competing-seeds-btn {
            position: absolute; bottom: 20px; left: 20px; z-index: 12;
            background: rgba(0, 255, 136, 0.12); border: 1px solid rgba(0,255,136,0.45);
            color: #00ff88; font-size: 12px; font-weight: 600; padding: 7px 14px;
            border-radius: 20px; cursor: pointer; backdrop-filter: blur(8px);
            transition: all 0.2s;
        }
        .az-competing-seeds-btn:hover { background: rgba(0,255,136,0.25); transform: translateY(-1px); }
        .az-seed-submit-slide .az-slide-text-wrapper { justify-content: flex-start; padding-top: 40px !important; }
        .az-admin-controls { position: absolute; top: 10px; left: 10px; z-index: 99; display: flex; gap: 4px; align-items: center; }
        .az-admin-btn { background: #ff5c5c; color: #fff !important; border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; }
        .az-admin-edit-btn { background: #00ff88; color: #0b0e14 !important; }
        .az-admin-nsfw-btn { background: #2a3140; color: #8a94a6 !important; font-size: 8px; font-weight: 800; border-radius: 12px !important; width: auto !important; height: 24px !important; padding: 0 8px !important; transition: all 0.2s; }
        .az-admin-nsfw-btn.active { background: #ff3366 !important; color: #fff !important; }
        .az-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: rgba(18, 22, 32, 0.8); border: 1px solid #1f2430; color: #fff; border-radius: 50%; cursor: pointer; z-index: 10; font-size: 20px; }
        .az-prev { left: 15px; } .az-next { right: 15px; }
        .az-btn { background: #00ff88; color: #0b0e14 !important; font-weight: 700; border: none; padding: 10px 20px; border-radius: 25px; font-size: 13px; cursor: pointer; display: inline-block; }
        .az-btn-sm { background: #1f2430; color: #00ff88 !important; font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 15px; border: 1px solid #2a3140; cursor: pointer; }
        .az-tip-sparks-btn { background: rgba(255,215,0,0.2); border: 1px solid #ffd700; color: #ffd700; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 12px; cursor: pointer; }
        
        /* Highlights & Underlines */
        .az-interactive-text { text-decoration: underline; text-decoration-color: #00ff88; text-decoration-thickness: 2px; text-decoration-style: dashed; cursor: pointer; font-weight: 700; }
        .az-directive-text { text-decoration: underline; text-decoration-color: #ff7700; text-decoration-thickness: 3px; text-decoration-style: dashed; cursor: pointer; color: #ff9933; font-weight: 700; transition: all 0.2s; }
        .az-directive-text:hover { background: rgba(255,119,0,0.2); }
        
        /* Dropdown View Modes */
        .az-mode-prose .az-interactive-text,
        .az-mode-prose .az-directive-text { text-decoration: none !important; font-weight: normal !important; color: inherit !important; cursor: text !important; pointer-events: none !important; }
        .az-mode-interpretations .az-directive-text { text-decoration: none !important; font-weight: normal !important; color: inherit !important; cursor: text !important; pointer-events: none !important; }
        .az-mode-directives .az-interactive-text { text-decoration: none !important; font-weight: normal !important; color: inherit !important; cursor: text !important; pointer-events: none !important; }

        /* Showcase Grid */
        .az-showcase-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 30px; }
        .az-showcase-slot { height: 130px; background: #121620; border: 1px dashed #2a3140; border-radius: 10px; overflow: hidden; position: relative; transition: border-color 0.2s, background 0.2s, transform 0.2s; }
        .az-showcase-slot.empty:hover { border-color: #00ff88; background: #151a26; }
        .az-showcase-slot.occupied { border-style: solid; border-color: #00ff88; cursor: pointer; }
        .az-showcase-slot.occupied:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,255,136,0.15); }
        .az-slot-empty-trigger { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
        .az-slot-preview { width: 100%; height: 75px; background: #000; position: relative; }
        .az-slot-license-badge { position: absolute; top: 4px; left: 4px; font-size: 9px; font-weight: bold; padding: 2px 5px; border-radius: 4px; }
        .license-portfolio { background: #505a69; color: #fff; }
        .license-story { background: #00aaff; color: #0b0e14; }
        .license-commercial { background: #ffd700; color: #0b0e14; }
        .az-slot-meta { padding: 6px; font-size: 11px; }
        .az-slot-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
        .az-slot-tags { display: flex; gap: 4px; margin-top: 2px; }
        .az-tag-pill { font-size: 9px; color: #8a94a6; }
        .az-slot-del-btn { position: absolute; bottom: 4px; right: 4px; background: rgba(255,92,92,0.2); border: none; color: #ff5c5c; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 5; }
        .az-slot-del-btn:hover { background: #ff5c5c; color: #fff; }

        .az-jobboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
        .az-job-card { background: #121620; border: 1px solid #2a3140; border-left: 4px solid #ff7700; border-radius: 8px; padding: 14px; }
        .az-job-media-badge { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px; }
        .media-image { background: rgba(0,255,136,0.15); color: #00ff88; }
        .media-sound { background: rgba(0,170,255,0.15); color: #00aaff; }
        .media-video { background: rgba(255,92,92,0.15); color: #ff5c5c; }
        .media-text { background: rgba(255,215,0,0.15); color: #ffd700; }

        .az-gallery-scroll { display: flex; overflow-x: auto; gap: 15px; padding: 15px 0; scroll-snap-type: x mandatory; }
        .az-gallery-item { flex: 0 0 250px; scroll-snap-align: center; background: #0b0e14; border-radius: 12px; padding: 15px; text-align: center; border: 1px solid #1f2430; position: relative; }
        .az-gallery-img { width: 100%; height: 220px; object-fit: contain; background: #05070a; border-radius: 8px; margin-bottom: 10px; }
.az-gallery-video { width: 100%; height: 220px; object-fit: contain; border-radius: 8px; background: #000; display: block; }
        .az-gallery-audio-btn { width: 60px; height: 60px; border-radius: 50%; background: #00ff88; border: none; font-size: 24px; cursor: pointer; margin: 40px auto; display: flex; align-items: center; justify-content: center; }
        .az-gallery-author { font-size: 11px; color: #8a94a6; margin: 8px 0; }
        .az-like-btn { background: transparent; border: 1px solid #1f2430; color: #8a94a6; border-radius: 20px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
        .az-like-btn.liked { background: rgba(255, 92, 92, 0.1); border-color: #ff5c5c; color: #ff5c5c; }

        /* Floating Tooltip */
        #az-media-tooltip { display: none; position: fixed; background: #191e2b; padding: 6px 14px; border-radius: 30px; z-index: 10000; box-shadow: 0 8px 30px rgba(0,0,0,0.85); border: 1px solid #00ff88; gap: 8px; align-items: center; }
        .az-tooltip-btn { background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px; transition: transform 0.2s; }
        .az-tooltip-btn:hover { transform: scale(1.2); }

        .az-v6-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(7, 9, 13, 0.85); backdrop-filter: blur(10px); z-index: 99999; justify-content: center; align-items: center; }
        .az-v6-modal-overlay.active { display: flex !important; }
        .az-v6-modal-content { background: #121620; border: 1px solid #1f2430; border-radius: 16px; padding: 30px; width: 100%; max-width: 480px; position: relative; }
        .az-v6-modal-close { position: absolute; top: 15px; right: 15px; background: none; border: none; color: #8a94a6; font-size: 22px; cursor: pointer; }
        .az-v6-input-group { margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
        .az-v6-input-field { background: #0b0e14; border: 1px solid #1f2430; border-radius: 8px; padding: 10px 12px; color: #fff; font-size: 13px; width: 100%; box-sizing: border-box; }
        @media (max-width: 768px) { .az-showcase-grid { grid-template-columns: repeat(3, 1fr); } }

        /* =========================================================
           APPEARANCE MODES: Default / Full Transparency / Glass
           Controlled by body[data-az-theme]
           ========================================================= */
        :root {
            --az-bg: #0b0e14;
            --az-card: #121620;
            --az-border: #1f2430;
            --az-text: #e1e4ea;
            --az-muted: #8a94a6;
            --az-accent: #00ff88;
            --az-blur: 0px;
            --az-card-opacity: 1;
        }

        body[data-az-theme="transparent"] {
            --az-bg: transparent;
            --az-card: rgba(18, 22, 32, 0.35);
            --az-border: rgba(255,255,255,0.08);
            --az-card-opacity: 0.55;
            --az-blur: 0px;
        }

        body[data-az-theme="glass"] {
            --az-bg: transparent;
            --az-card: rgba(18, 22, 32, 0.45);
            --az-border: rgba(255,255,255,0.12);
            --az-card-opacity: 0.7;
            --az-blur: 16px;
        }

        body[data-az-theme="transparent"] .az-v6-container,
        body[data-az-theme="glass"] .az-v6-container {
            background: var(--az-card);
            border-color: var(--az-border);
            backdrop-filter: blur(var(--az-blur));
            -webkit-backdrop-filter: blur(var(--az-blur));
        }

        body[data-az-theme="transparent"] .az-v6-card,
        body[data-az-theme="glass"] .az-v6-card,
        body[data-az-theme="transparent"] .az-v6-modal-content,
        body[data-az-theme="glass"] .az-v6-modal-content {
            background: var(--az-card);
            border-color: var(--az-border);
            backdrop-filter: blur(var(--az-blur));
            -webkit-backdrop-filter: blur(var(--az-blur));
        }

        body[data-az-theme="transparent"] .az-carousel-viewport,
        body[data-az-theme="glass"] .az-carousel-viewport {
            background: var(--az-card);
            border-color: var(--az-border);
            backdrop-filter: blur(var(--az-blur));
        }

        /* =========================================================
           MERCH STUDIO — 6-slot grid, preview builder, creator modal
           ========================================================= */

        /* ── Slot grid ──────────────────────────────────────────── */
        .az-merch-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 12px;
            margin-bottom: 30px;
        }
        @media (max-width: 900px) { .az-merch-grid { grid-template-columns: repeat(3, 1fr); } }
        @media (max-width: 520px) { .az-merch-grid { grid-template-columns: repeat(2, 1fr); } }

        .az-merch-slot {
            min-height: 148px;
            background: #121620;
            border: 1px dashed #2a3140;
            border-radius: 12px;
            overflow: hidden;
            position: relative;
            display: flex;
            flex-direction: column;
            transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
        }
        .az-merch-slot.occupied {
            border-style: solid;
            border-color: rgba(0,255,136,0.35);
            cursor: default;
        }
        .az-merch-slot.occupied:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 18px rgba(0,255,136,0.12);
        }
        .az-merch-slot.empty:hover {
            border-color: rgba(0,255,136,0.5);
            background: #151a26;
        }

        .az-merch-slot-thumb {
            width: 100%;
            height: 90px;
            background: #0b0e14;
            overflow: hidden;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .az-merch-slot-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        .az-merch-slot-placeholder {
            font-size: 32px;
            opacity: 0.25;
        }

        .az-merch-slot-meta {
            padding: 7px 8px 8px;
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        .az-merch-slot-title {
            font-size: 11px;
            font-weight: 600;
            color: #fff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.3;
        }

        /* Empty slot add button */
        .az-merch-add-btn {
            width: 100%;
            height: 100%;
            background: none;
            border: none;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            padding: 12px 8px;
            transition: background 0.2s;
        }
        .az-merch-add-btn:hover { background: rgba(0,255,136,0.04); }
        .az-merch-add-btn:disabled { opacity: 0.35; cursor: not-allowed; }

        /* ── Creator modal sizing ───────────────────────────────── */
        .az-merch-modal-content {
            max-width: 860px;
            width: 96%;
            max-height: 92vh;
            overflow-y: auto;
            padding: 24px 28px;
        }
        .az-merch-modal-header {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid #1f2430;
        }

        /* ── Steps ──────────────────────────────────────────────── */
        .az-merch-step { animation: az-fadein 0.22s ease; }
        @keyframes az-fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

        /* ── Step 1: Drop zone ──────────────────────────────────── */
        .az-merch-drop-zone {
            border: 2px dashed #2a3140;
            border-radius: 12px;
            padding: 32px 20px;
            background: rgba(0,255,136,0.02);
            cursor: pointer;
            text-align: center;
            transition: border-color 0.2s, background 0.2s;
            min-height: 140px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .az-merch-drop-zone:hover,
        .az-merch-drop-zone.drag-over {
            border-color: #00ff88;
            background: rgba(0,255,136,0.06);
        }

        /* ── Step 2: Preview builder layout ────────────────────── */
        .az-merch-preview-layout {
            display: grid;
            grid-template-columns: 1fr 260px;
            gap: 20px;
            align-items: start;
        }
        @media (max-width: 640px) {
            .az-merch-preview-layout { grid-template-columns: 1fr; }
        }

        /* Garment canvas */
        .az-merch-canvas-wrap { display: flex; flex-direction: column; }
        .az-merch-canvas {
            width: 100%;
            max-width: 340px;
            margin: 0 auto;
            position: relative;
        }

        /* T-shirt silhouette — pure CSS, no image dependency */
        .az-merch-tee-bg {
            width: 100%;
            padding-top: 120%;          /* 5:6 aspect ratio */
            position: relative;
            background: #e8e8e8;
            border-radius: 8px 8px 4px 4px;
            /* Sleeve notches via clip-path */
            clip-path: polygon(
                18% 0%, 22% 0%,         /* left collar */
                28% 8%,                 /* left shoulder inner */
                50% 12%,                /* collar centre-top */
                72% 8%,                 /* right shoulder inner */
                78% 0%, 82% 0%,         /* right collar */
                100% 18%,               /* right sleeve tip */
                86% 26%,                /* right sleeve bottom */
                86% 100%,               /* right side */
                14% 100%,               /* left side */
                14% 26%,                /* left sleeve bottom */
                0% 18%                  /* left sleeve tip */
            );
            overflow: visible;
        }
        /* When admin/catalog blank photo is set — drop clip-path, show photo */
        .az-merch-tee-bg.has-blank-img {
            clip-path: none;
            background-color: transparent;
            background-size: contain;
            background-position: center top;
            background-repeat: no-repeat;
            border-radius: 8px;
        }

        /* Print zone — centred on the chest area */
        .az-merch-print-zone {
            position: absolute;
            top: 22%;
            left: 20%;
            width: 60%;
            height: 55%;
            border: 1px dashed rgba(0,180,255,0.5);
            border-radius: 4px;
            overflow: hidden;
            background: rgba(255,255,255,0.05);
        }

        /* Draggable design image */
        .az-merch-design-layer {
            position: absolute;
            cursor: grab;
            user-select: none;
            -webkit-user-drag: none;
            max-width: none;            /* allow JS to set exact px dimensions */
            touch-action: none;
            filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
            transition: width 0.08s ease;
        }
        .az-merch-design-layer:active { cursor: grabbing; }

        /* Controls panel (right column) */
        .az-merch-controls {
            background: #0d1219;
            border: 1px solid #1f2430;
            border-radius: 12px;
            padding: 16px;
        }

        /* ── Step 3: Result ─────────────────────────────────────── */
        #az-merch-result-icon { line-height: 1; display: block; }

        /* ── Responsive tweaks ──────────────────────────────────── */
        @media (max-width: 480px) {
            .az-merch-modal-content { padding: 18px 16px; }
            .az-merch-tee-bg { padding-top: 130%; }
        }

        /* Theme overrides — glass/transparent modes */
        body[data-az-theme="transparent"] .az-merch-slot,
        body[data-az-theme="glass"] .az-merch-slot,
        body[data-az-theme="transparent"] .az-merch-controls,
        body[data-az-theme="glass"] .az-merch-controls {
            background: var(--az-card);
            border-color: var(--az-border);
            backdrop-filter: blur(var(--az-blur));
            -webkit-backdrop-filter: blur(var(--az-blur));
        }

        /* =========================================================
           MERCH — PAYOUT PROFILE SECTION
           ========================================================= */

        .az-merch-payout-wrap {
            background: #0d1219;
            border: 1px solid #1f2430;
            border-radius: 12px;
            padding: 14px 18px;
            margin-bottom: 20px;
        }
        .az-merch-payout-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 12px;
            flex-wrap: wrap;
        }

        /* =========================================================
           MERCH — EARNINGS STRIP (profit tracker)
           ========================================================= */

        .az-merch-earnings-strip {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            background: #0d1219;
            border: 1px solid #1f2430;
            border-radius: 12px;
            overflow: hidden;
            margin-bottom: 8px;
        }
        @media (max-width: 700px) {
            .az-merch-earnings-strip { grid-template-columns: repeat(3, 1fr); }
        }
        @media (max-width: 440px) {
            .az-merch-earnings-strip { grid-template-columns: repeat(2, 1fr); }
        }
        .az-merch-earnings-cell {
            padding: 12px 10px;
            text-align: center;
            border-right: 1px solid #1f2430;
        }
        .az-merch-earnings-val {
            font-size: 18px;
            font-weight: 800;
            color: #fff;
            line-height: 1.2;
        }
        .az-merch-earnings-label {
            font-size: 9px;
            color: #505a69;
            letter-spacing: 0.6px;
            font-weight: 700;
            margin-top: 4px;
            text-transform: uppercase;
        }

        /* =========================================================
           MERCH — PER-SLOT EARNINGS BADGE
           ========================================================= */

        .az-merch-slot-earnings {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin-top: 4px;
            font-size: 10px;
            color: #8a94a6;
            align-items: center;
        }

        /* =========================================================
           MERCH — FINANCE PREVIEW TABLE  (Step 2 controls panel)
           ========================================================= */

        .az-merch-finance-preview {
            background: #0b0e14;
            border: 1px solid #1f2430;
            border-radius: 10px;
            padding: 12px;
            margin-top: 4px;
        }
        .az-merch-finance-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12px;
            color: #8a94a6;
            padding: 3px 0;
            border-bottom: 1px solid #13181f;
        }
        .az-merch-finance-row:last-child { border-bottom: none; }
        .az-merch-finance-total {
            font-weight: 700;
            color: #fff;
            padding-top: 6px;
            margin-top: 2px;
            border-top: 1px solid #2a3140 !important;
            border-bottom: none !important;
        }

        /* =========================================================
           MERCH — NOTICE BANNERS
           ========================================================= */

        .az-merch-notice {
            border-radius: 10px;
            padding: 12px 16px;
            font-size: 13px;
            margin-bottom: 16px;
        }
        .az-merch-notice-warn {
            background: rgba(255, 170, 0, 0.08);
            border: 1px solid rgba(255, 170, 0, 0.35);
            color: #ffaa00;
        }
        .az-merch-notice-error {
            background: rgba(255, 60, 60, 0.08);
            border: 1px solid rgba(255, 60, 60, 0.3);
            color: #ff5c5c;
        }

        /* =========================================================
           MERCH — STEP LABEL (above each step panel)
           ========================================================= */

        .az-merch-step-label {
            font-size: 11px;
            color: #00ff88;
            font-weight: 700;
            letter-spacing: 0.8px;
            margin-bottom: 12px;
        }

        /* =========================================================
           ESCROW ADMIN PAGE  (WP Admin — inline overrides)
           These supplement the WP admin styles only when the
           Merch Escrow admin page is active.
           ========================================================= */

        /* Escrow summary cards are inline-styled in PHP to avoid
           loading this stylesheet in WP admin. No additions needed. */

        /* =========================================================
           THEME OVERRIDES — earnings strip + payout wrap
           ========================================================= */

        body[data-az-theme="transparent"] .az-merch-earnings-strip,
        body[data-az-theme="glass"] .az-merch-earnings-strip,
        body[data-az-theme="transparent"] .az-merch-payout-wrap,
        body[data-az-theme="glass"] .az-merch-payout-wrap,
        body[data-az-theme="transparent"] .az-merch-finance-preview,
        body[data-az-theme="glass"] .az-merch-finance-preview {
            background: var(--az-card);
            border-color: var(--az-border);
            backdrop-filter: blur(var(--az-blur));
            -webkit-backdrop-filter: blur(var(--az-blur));
        }

        /* =========================================================
           VISION CALL INLINE DRAWER
           ========================================================= */

        @keyframes az-drawer-up {
            from { transform: translateY(100%); opacity: 0; }
            to   { transform: translateY(0);    opacity: 1; }
        }

        #az-directive-drawer {
            /* Base styles are inline in the PHP for specificity;
               this handles focus-ring and input overrides */
        }
        #az-directive-drawer textarea.az-v6-input-field {
            /* Override the full-width default so it stays flex-sized */
            width: auto;
        }
        #az-dir-prompt:focus {
            border-color: #ff7700;
            outline: none;
            box-shadow: 0 0 0 2px rgba(255,119,0,0.18);
        }
        .az-dir-type-btn:focus-visible {
            outline: 2px solid #ff7700;
            outline-offset: 2px;
        }
        @media (max-width: 600px) {
            #az-directive-drawer { padding: 12px 12px 16px; }
            #az-directive-drawer form { flex-direction: column; }
        }

        /* =========================================================
           BRICK GALLERY  (writer profile showcase)
           CSS-columns masonry: images fill their natural height,
           no empty placeholder cells, compositor-friendly hover.
           ========================================================= */

        .az-brick-gallery {
            column-count: 3;
            column-gap: 10px;
        }
        @media (max-width: 900px) { .az-brick-gallery { column-count: 2; } }
        @media (max-width: 480px) { .az-brick-gallery { column-count: 1; } }

        .az-brick-tile {
            break-inside: avoid;          /* keep each tile in one column   */
            display: block;
            margin-bottom: 10px;
            border-radius: 10px;
            overflow: hidden;
            position: relative;
            background: #0b0e14;
            border: 1px solid #1f2430;
            cursor: pointer;
            /* hardware-accelerated hover lift — no layout triggers */
            transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
                        box-shadow 0.22s ease;
            will-change: transform;
        }
        .az-brick-tile:hover,
        .az-brick-tile:focus-visible {
            transform: translateY(-3px) scale(1.012);
            box-shadow: 0 8px 28px rgba(0, 255, 136, 0.14);
            outline: none;
        }
        .az-brick-tile:focus-visible {
            box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.55);
        }

        /* Overlay slides up on hover — opacity + transform only (GPU) */
        .az-brick-overlay {
            position: absolute;
            bottom: 0; left: 0; right: 0;
            background: linear-gradient(to top, rgba(7,9,13,0.92) 0%, rgba(7,9,13,0) 100%);
            padding: 28px 10px 10px;
            display: flex;
            flex-direction: column;
            gap: 4px;
            /* hidden by default, revealed on hover */
            opacity: 0;
            transform: translateY(6px);
            transition: opacity 0.2s ease, transform 0.2s ease;
            pointer-events: none;
        }
        .az-brick-tile:hover .az-brick-overlay,
        .az-brick-tile:focus-visible .az-brick-overlay {
            opacity: 1;
            transform: translateY(0);
        }

        .az-brick-title {
            font-size: 12px;
            font-weight: 700;
            color: #fff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .az-brick-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 3px;
        }

        /* Video wrapper keeps the play icon centred */
        .az-brick-video-wrap {
            position: relative;
            line-height: 0;
        }
        .az-brick-play-icon {
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            font-size: 22px;
            color: #fff;
            text-shadow: 0 2px 10px rgba(0,0,0,0.9);
            pointer-events: none;
        }

        /* Audio placeholder — fixed height so column doesn't collapse */
        .az-brick-audio-placeholder {
            height: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #121620;
        }

        /* Theme overrides — brick gallery */
        body[data-az-theme="transparent"] .az-brick-tile,
        body[data-az-theme="glass"] .az-brick-tile {
            background: var(--az-card);
            border-color: var(--az-border);
            backdrop-filter: blur(var(--az-blur));
            -webkit-backdrop-filter: blur(var(--az-blur));
        }

        /* =========================================================
           MERCH STOREFRONT  (writer profile — published products)
           Row of product cards, each is a full <a> tag for SEO.
           ========================================================= */

        .az-merch-storefront {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
            gap: 14px;
        }
        @media (max-width: 480px) {
            .az-merch-storefront { grid-template-columns: repeat(2, 1fr); gap: 10px; }
        }

        .az-merch-product-card {
            display: flex;
            flex-direction: column;
            background: #121620;
            border: 1px solid #1f2430;
            border-radius: 12px;
            overflow: hidden;
            text-decoration: none;
            color: inherit;
            /* compositor-only hover */
            transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
                        box-shadow 0.22s ease,
                        border-color 0.2s ease;
            will-change: transform;
        }
        .az-merch-product-card:hover,
        .az-merch-product-card:focus-visible {
            transform: translateY(-4px) scale(1.015);
            box-shadow: 0 10px 30px rgba(0, 255, 136, 0.13);
            border-color: rgba(0, 255, 136, 0.4);
            outline: none;
        }
        .az-merch-product-card:focus-visible {
            box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.55);
        }

        .az-merch-product-img-wrap {
            width: 100%;
            aspect-ratio: 1 / 1;     /* square thumbnail, no layout shift */
            overflow: hidden;
            position: relative;
            background: #0b0e14;
            flex-shrink: 0;
        }
        .az-merch-product-img-wrap img {
            transition: transform 0.3s ease;
        }
        .az-merch-product-card:hover .az-merch-product-img-wrap img {
            transform: scale(1.04);
        }

        /* "Shop →" badge in the top-right corner of the image */
        .az-merch-product-badge {
            position: absolute;
            top: 7px; right: 7px;
            background: rgba(0, 255, 136, 0.9);
            color: #0b0e14;
            font-size: 10px;
            font-weight: 800;
            padding: 2px 8px;
            border-radius: 20px;
            letter-spacing: 0.4px;
            /* hidden until hover for a clean look */
            opacity: 0;
            transform: translateY(-4px);
            transition: opacity 0.2s ease, transform 0.2s ease;
            pointer-events: none;
        }
        .az-merch-product-card:hover .az-merch-product-badge,
        .az-merch-product-card:focus-visible .az-merch-product-badge {
            opacity: 1;
            transform: translateY(0);
        }

        .az-merch-product-meta {
            padding: 9px 10px 10px;
            display: flex;
            flex-direction: column;
            gap: 3px;
            flex: 1;
        }
        .az-merch-product-title {
            font-size: 12px;
            font-weight: 700;
            color: #e1e4ea;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.3;
        }
        .az-merch-product-price {
            font-size: 11px;
            color: #00ff88;
            font-weight: 700;
        }

        /* Theme overrides — merch storefront */
        body[data-az-theme="transparent"] .az-merch-product-card,
        body[data-az-theme="glass"] .az-merch-product-card {
            background: var(--az-card);
            border-color: var(--az-border);
            backdrop-filter: blur(var(--az-blur));
            -webkit-backdrop-filter: blur(var(--az-blur));
        }

    </style>
