/* ── Quantoshi Web App — custom styles ─────────────────────────────────────── */

/* Force light rendering — prevents browser dark-mode (and Dark Reader etc.)
   from inverting or recoloring charts and UI. Plotly SVG backgrounds are
   already explicitly white; this stops extensions overriding them. */
:root {
    color-scheme: only light;
    --btc-orange: #f7931a;
    --nav-dark: #2c3e50;
    --nav-darker: #1a252f;
    --nav-lighter: #34495e;
}

/* Light theme base */
body {
    font-size: 13px;
    background-color: #f0f2f5 !important;
    color: #212529 !important;
}

/* ── #1: Navbar gradient ──────────────────────────────────────────────────── */
.navbar {
    background: linear-gradient(135deg, var(--nav-darker) 0%, var(--nav-dark) 50%, var(--nav-lighter) 100%) !important;
    overflow: visible !important;
    z-index: 1040;
    position: relative;
    border-radius: 10px;
}

/* Tab bar */
.nav-tabs {
    background-color: var(--nav-dark) !important;
    border-bottom: none !important;
    padding: 4px 8px 0;
    border-radius: 10px;
    margin-top: 4px;
}
.nav-tabs .nav-link {
    color: rgba(255,255,255,0.75) !important;
    border: none !important;
    border-radius: 4px 4px 0 0;
    padding: 4px 10px;
    font-size: 13px;
    transition: color 0.2s, background-color 0.2s;
}
.nav-tabs .nav-link:hover {
    color: #fff !important;
    background-color: rgba(255,255,255,0.15) !important;
}

/* ── #2: Active tab orange accent ─────────────────────────────────────────── */
.nav-tabs .nav-link.active {
    color: var(--nav-dark) !important;
    background-color: #f0f2f5 !important;
    font-weight: 600;
    border-top: 3px solid var(--btc-orange) !important;
    animation: accentBreath 3s ease-in-out infinite;
}

/* Export row */
.export-row {
    background-color: var(--nav-dark) !important;
    border-top: none !important;
    padding: 6px 12px !important;
}
.export-row .btn { color: #fff !important; border-color: rgba(255,255,255,0.4) !important; }

/* ── #3: Card elevation on hover ──────────────────────────────────────────── */
.ctrl-card {
    border: 1px solid #dee2e6 !important;
    background: #f8f9fa !important;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    border-radius: 8px !important;
}
.ctrl-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #c8ccd0 !important;
}
.ctrl-card .card-body { padding: 8px !important; }

/* ── #4: Bitcoin-orange accent for primary actions ────────────────────────── */
.btn-share-accent {
    background-color: var(--btc-orange) !important;
    border-color: var(--btc-orange) !important;
    color: #fff !important;
    font-weight: 600;
    transition: filter 0.15s;
}
.btn-share-accent:hover {
    filter: brightness(1.1);
    color: #fff !important;
}
.btn-generate-accent {
    background-color: var(--btc-orange) !important;
    border-color: var(--btc-orange) !important;
    color: #fff !important;
}
.btn-generate-accent:hover {
    filter: brightness(1.1);
    color: #fff !important;
}

/* ── Splash quote modal ───────────────────────────────────────────────────── */
.splash-modal .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    background: linear-gradient(160deg, #fff 0%, #f8f6f0 100%);
}
.splash-modal .modal-body {
    border-radius: 16px;
}

/* ── #6: Smooth tab content fade-in ───────────────────────────────────────── */
.tab-content > .tab-pane {
    animation: fadeInTab 0.2s ease-in;
}
@keyframes fadeInTab {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── #7: Price ticker pulse + green/red flash on update ───────────────────── */
.price-pulse {
    animation: pricePulse 0.6s ease-out;
}
@keyframes pricePulse {
    0%   { text-shadow: 0 0 8px rgba(247,147,26,0.8); }
    100% { text-shadow: none; }
}
.price-flash-green {
    animation: priceFlashGreen 1.2s ease-out !important;
}
.price-flash-red {
    animation: priceFlashRed 1.2s ease-out !important;
}
@keyframes priceFlashGreen {
    0%   { text-shadow: 0 0 12px rgba(0,200,80,0.9); color: #4cff88; }
    40%  { text-shadow: 0 0 6px rgba(0,200,80,0.4); }
    100% { text-shadow: none; color: rgba(255,255,255,0.9); }
}
@keyframes priceFlashRed {
    0%   { text-shadow: 0 0 12px rgba(255,60,60,0.9); color: #ff6b6b; }
    40%  { text-shadow: 0 0 6px rgba(255,60,60,0.4); }
    100% { text-shadow: none; color: rgba(255,255,255,0.9); }
}

/* ── #8: Better typography hierarchy — section headers ────────────────────── */
.form-label { font-size: 11px; color: #555; margin-bottom: 2px !important; }
.ctrl-section-header {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    padding-bottom: 2px;
    border-bottom: 1px solid #e0e0e0;
}

/* ── #9: Export row polish ─────────────────────────────────────────────────── */
.export-row-polished {
    background: #ebeef1;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 6px 10px;
    margin-top: 4px;
}
.export-row-polished .btn {
    background-color: var(--nav-dark) !important;
    border-color: var(--nav-dark) !important;
    color: #fff !important;
    font-weight: 500;
}
.export-row-polished .btn:hover {
    filter: brightness(1.15);
}

/* Compact sliders */
.rc-slider { margin-top: 4px; }

/* Compact checklists */
.form-check-label { font-size: 12px; }

/* Graph container — no excess padding, rounded corners */
.js-plotly-plot { width: 100%; border-radius: 8px; overflow: hidden; }

/* ── #10: Controls column — visible drawer frame ─────────────────────────── */
.controls-col {
    position: relative;
    padding: 6px 6px 6px 4px !important;
    scrollbar-width: thin;
    scrollbar-color: var(--nav-dark) #f0f2f5;
    background: linear-gradient(180deg, #e8eaed 0%, #f0f2f5 8%, #f0f2f5 92%, #e8eaed 100%);
    border-right: 2px solid #ccc;
    box-shadow: 2px 0 6px rgba(0,0,0,0.08);
    border-radius: 0 6px 6px 0;
}
.controls-col::-webkit-scrollbar { width: 6px; }
.controls-col::-webkit-scrollbar-track { background: #f0f2f5; }
.controls-col::-webkit-scrollbar-thumb { background: var(--nav-dark); border-radius: 3px; }
.controls-col::-webkit-scrollbar-thumb:hover { background: var(--nav-lighter); }

/* DataTable tweaks — already styled inline but reinforce */
.dash-table-container .dash-spreadsheet-container { font-size: 12px; }

/* FAQ links — slightly muted vs default bright blue */
.accordion a { color: #1a6fa8 !important; }
.accordion a:hover { color: #154e78 !important; }

/* ── #11: Loading skeleton shimmer ────────────────────────────────────────── */
.chart-loading-skeleton {
    background: linear-gradient(90deg, #e8eaed 25%, #f0f2f5 50%, #e8eaed 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    min-height: 400px;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Mobile nav drawer — auto-collapse row 2 after 3s ─────────────────── */
.mobile-nav-drawer {
    overflow: hidden;
    max-height: 40px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}
.mobile-nav-drawer.collapsed {
    max-height: 0;
    opacity: 0;
}
.mobile-nav-toggle {
    transition: opacity 0.3s ease;
}
.mobile-nav-toggle-hidden {
    opacity: 0;
    pointer-events: none;
}
.mobile-nav-toggle.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Desktop nav drawer — auto-collapse after 4s ─────────────────────── */
.desktop-nav-drawer {
    overflow: hidden;
    max-height: 50px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    position: relative;
    z-index: 1050;
}
.desktop-nav-drawer.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}
.desktop-nav-toggle {
    transition: opacity 0.3s ease;
}
.desktop-nav-toggle-hidden {
    opacity: 0;
    pointer-events: none;
}
.desktop-nav-toggle.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── #12: Logo glow + pulsing orange accents ─────────────────────────── */
.logo-glow {
    filter: drop-shadow(0 0 6px rgba(247,147,26,0.5));
    transition: filter 0.4s ease;
}
.logo-glow:hover {
    filter: drop-shadow(0 0 12px rgba(247,147,26,0.8))
            drop-shadow(0 0 24px rgba(247,147,26,0.3));
}

@keyframes accentBreath {
    0%, 100% { border-top-color: var(--btc-orange); }
    50%      { border-top-color: #fbb034; }
}

/* ── Streak reward: orange Q in Quantoshi after 7-day streak ─────────── */
.brand-q {
    transition: color 0.6s ease, text-shadow 0.6s ease;
}
/* Orange color (applied first during ceremony) */
.brand-q.streak-orange,
.brand-q.streak-unlocked {
    color: var(--btc-orange) !important;
    text-shadow: none;
    position: relative;
}
/* Hat (applied after color during ceremony) */
.brand-q.streak-hat::before,
.brand-q.streak-unlocked::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(12deg);
    width: 20px;
    height: 17px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 18'%3E%3Cpolygon points='10,0 3,12 17,12' fill='%233a2d7c' stroke='%23fff' stroke-width='0.7'/%3E%3Crect x='1' y='11' width='18' height='3' rx='1' fill='%232d2266' stroke='%23fff' stroke-width='0.5'/%3E%3Ctext x='9' y='8' font-size='4' fill='%23ffd700' text-anchor='middle'%3E%E2%98%85%3C/text%3E%3C/svg%3E") no-repeat center/contain;
    pointer-events: none;
    animation: hatAppear 0.4s ease-out;
}
@keyframes hatAppear {
    0%   { opacity: 0; transform: translateX(-50%) rotate(12deg) scale(0.3); }
    60%  { transform: translateX(-50%) rotate(16deg) scale(1.15); }
    100% { opacity: 1; transform: translateX(-50%) rotate(12deg) scale(1); }
}

/* ── Streak reward: gold reflection on "Quantoshi" text ──────────────── */
.brand-uantoshi.streak-shimmer {
    background: linear-gradient(
        90deg,
        #fff 0%, #fff 35%,
        #ffd700 42%, #f7931a 50%, #ffd700 58%,
        #fff 65%, #fff 100%
    );
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: goldShimmer 20s ease-in-out infinite;
}
@keyframes goldShimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ── Knighting ceremony: Orange Q streak unlock ──────────────────────── */
.knight-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(0, 0, 0, 0);
    animation: knightDim 1.2s ease-out forwards;
    pointer-events: none;
}
@keyframes knightDim {
    to { background: rgba(0, 0, 0, 0.6); }
}
.knight-fade-out {
    animation: knightFadeOut 1s ease-in forwards !important;
}
@keyframes knightFadeOut {
    to { opacity: 0; }
}

.knight-staff {
    position: fixed;
    width: 40px;
    top: -320px;
    animation: staffDescend 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    z-index: 11001;
    filter: drop-shadow(0 0 12px rgba(247, 147, 26, 0.6));
}
.knight-staff svg {
    width: 40px;
    height: 300px;
}
@keyframes staffDescend {
    0%   { top: -320px; }
    100% { top: 30px; }
}
.knight-staff-retract {
    animation: staffRetract 1s cubic-bezier(0.55, 0, 1, 0.45) forwards !important;
}
@keyframes staffRetract {
    to { top: -320px; }
}

.knight-flash {
    animation: knightQFlash 2s ease-out !important;
    color: var(--btc-orange) !important;
}
@keyframes knightQFlash {
    0%   { text-shadow: 0 0 30px #ffd700, 0 0 60px #f7931a, 0 0 90px #ffd700; }
    50%  { text-shadow: 0 0 20px #ffd700, 0 0 40px #f7931a; }
    100% { text-shadow: 0 0 8px rgba(247, 147, 26, 0.4); }
}

.knight-ring {
    position: fixed;
    width: 0;
    height: 0;
    border: 2px solid #ffd700;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: knightRing 1.5s ease-out forwards;
    pointer-events: none;
}
@keyframes knightRing {
    0%   { width: 0; height: 0; opacity: 1; border-width: 3px; }
    100% { width: 300px; height: 300px; opacity: 0; border-width: 1px; }
}

.knight-particle {
    position: fixed;
    font-size: 16px;
    color: #ffd700;
    pointer-events: none;
    animation: knightBurst 1.5s ease-out forwards;
    z-index: 11002;
}
@keyframes knightBurst {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; }
}

.knight-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffd700;
    font-family: "Palatino Linotype", Palatino, "Book Antiqua", serif;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    line-height: 1.5;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 2px 8px rgba(0,0,0,0.5);
    letter-spacing: 1px;
    animation: knightTextIn 1s ease-out;
    z-index: 11003;
}
@keyframes knightTextIn {
    0%   { opacity: 0; transform: translate(-50%, -40%) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.knight-confetti {
    position: fixed;
    top: -20px;
    font-size: 14px;
    color: #ffd700;
    pointer-events: none;
    animation: knightFall linear forwards;
    opacity: 0.8;
    z-index: 11002;
}
@keyframes knightFall {
    0%   { top: -20px; opacity: 0.9; transform: rotate(0deg); }
    100% { top: 110vh; opacity: 0.2; transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .knight-text {
        font-size: 20px;
    }
    .knight-ring {
        display: none;
    }
}

/* ── #10: Parallax depth — navbar responds to mouse ──────────────────── */
.navbar-parallax {
    transition: transform 0.15s ease-out;
    will-change: transform;
}

/* ── Mobile navbar touch targets — min 44px per Apple HIG ─────────────── */
.nav-touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Block Drop: new-block celebration animation ─────────────────────────── */

/* Screen shake */
.block-shake {
    animation: blockShake 0.4s ease-in-out;
}
@keyframes blockShake {
    0%, 100% { transform: translate(0, 0); }
    10%      { transform: translate(-3px, 2px); }
    20%      { transform: translate(4px, -2px); }
    30%      { transform: translate(-4px, -1px); }
    40%      { transform: translate(3px, 3px); }
    50%      { transform: translate(-2px, -3px); }
    60%      { transform: translate(3px, 1px); }
    70%      { transform: translate(-3px, 2px); }
    80%      { transform: translate(2px, -1px); }
    90%      { transform: translate(-1px, 2px); }
}

/* Full-screen click/tap overlay */
.blockdrop-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9999;
    pointer-events: auto;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* The falling block — jagged rock with SVG polygon mask */
.blockdrop-cube {
    position: absolute;
    left: 50%;
    width: 170px;
    height: 150px;
    margin-left: -85px;
    background:
        /* Mineral veins */
        radial-gradient(ellipse at 25% 15%, rgba(180,160,120,0.25) 0%, transparent 40%),
        radial-gradient(ellipse at 75% 85%, rgba(0,0,0,0.2) 0%, transparent 35%),
        radial-gradient(circle at 60% 40%, rgba(120,100,70,0.15) 0%, transparent 30%),
        radial-gradient(circle at 10% 70%, rgba(0,0,0,0.12) 0%, transparent 25%),
        radial-gradient(circle at 90% 20%, rgba(200,180,140,0.1) 0%, transparent 20%),
        /* Base stone */
        linear-gradient(170deg, #7a6a4f 0%, #665535 20%, #55472a 45%, #483c22 65%, #3a3018 85%, #2e2510 100%);
    /* Jagged polygon shape — irregular rock silhouette */
    clip-path: polygon(
        12% 2%, 28% 0%, 45% 4%, 60% 1%, 78% 3%, 92% 8%,
        98% 22%, 100% 40%, 97% 58%, 99% 75%, 95% 88%, 88% 97%,
        72% 100%, 55% 96%, 38% 100%, 22% 97%, 8% 92%,
        2% 78%, 0% 60%, 3% 42%, 1% 25%, 5% 12%
    );
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7),
                0 3px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
/* Rough surface: layered grain + chisel marks */
.blockdrop-cube::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        /* Grain */
        repeating-linear-gradient(52deg,
            transparent, transparent 6px,
            rgba(0,0,0,0.06) 6px, rgba(0,0,0,0.06) 7px),
        repeating-linear-gradient(-38deg,
            transparent, transparent 10px,
            rgba(255,255,255,0.04) 10px, rgba(255,255,255,0.04) 11px),
        /* Pitting */
        radial-gradient(circle 2px at 20% 30%, rgba(0,0,0,0.12) 0%, transparent 100%),
        radial-gradient(circle 3px at 65% 55%, rgba(0,0,0,0.1) 0%, transparent 100%),
        radial-gradient(circle 2px at 40% 80%, rgba(0,0,0,0.08) 0%, transparent 100%),
        radial-gradient(circle 1px at 80% 20%, rgba(0,0,0,0.1) 0%, transparent 100%);
    pointer-events: none;
}
/* Highlight edge — top-left light source */
.blockdrop-cube::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 40%,
                transparent 70%, rgba(0,0,0,0.15) 100%);
    pointer-events: none;
}
.blockdrop-label {
    color: #f7931a;
    font-size: 18px;
    font-weight: 700;
    font-family: monospace;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6), 0 0 12px rgba(247,147,26,0.3);
    z-index: 1;
}
.blockdrop-sublabel {
    color: rgba(255,220,160,0.8);
    font-size: 11px;
    font-family: monospace;
    margin-top: 3px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    z-index: 1;
}

/* Fall animation — heavy drop with acceleration */
.blockdrop-fall {
    top: -180px;
    animation: blockFall 1.1s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}
@keyframes blockFall {
    0%   { top: -180px; opacity: 0; }
    10%  { opacity: 1; }
    100% { top: calc(75vh - 70px); opacity: 1; }
}
.blockdrop-landed {
    top: calc(75vh - 70px);
}

/* Landing bounce — heavy impact squash */
.blockdrop-bounce {
    animation: blockBounce 0.5s ease-out;
}
@keyframes blockBounce {
    0%   { transform: scaleY(0.75) scaleX(1.2); }
    25%  { transform: scaleY(1.1) scaleX(0.92); }
    50%  { transform: scaleY(0.93) scaleX(1.05); }
    75%  { transform: scaleY(1.03) scaleX(0.98); }
    100% { transform: scaleY(1) scaleX(1); }
}

/* Tap hit micro-shake */
.blockdrop-hit {
    animation: blockHit 0.15s ease-out;
}
@keyframes blockHit {
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(-3deg) scale(0.96); }
    50%  { transform: rotate(2deg); }
    100% { transform: rotate(0deg) scale(1); }
}

/* Progressive crack overlays */
.blockdrop-crack {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    pointer-events: none;
}
/* Crack lines as pseudo-borders / gradients */
.blockdrop-crack-1 {
    background: linear-gradient(135deg,
        transparent 40%, rgba(0,0,0,0.3) 40%, rgba(0,0,0,0.3) 41%, transparent 41%);
}
.blockdrop-crack-2 {
    background: linear-gradient(45deg,
        transparent 30%, rgba(0,0,0,0.3) 30%, rgba(0,0,0,0.3) 31%, transparent 31%),
        linear-gradient(160deg,
        transparent 55%, rgba(0,0,0,0.25) 55%, rgba(0,0,0,0.25) 56%, transparent 56%);
}
.blockdrop-crack-3 {
    background: linear-gradient(100deg,
        transparent 20%, rgba(0,0,0,0.3) 20%, rgba(0,0,0,0.3) 21%, transparent 21%),
        linear-gradient(70deg,
        transparent 60%, rgba(0,0,0,0.25) 60%, rgba(0,0,0,0.25) 61%, transparent 61%);
}
.blockdrop-crack-4 {
    background: linear-gradient(30deg,
        transparent 45%, rgba(0,0,0,0.35) 45%, rgba(0,0,0,0.35) 46%, transparent 46%),
        linear-gradient(150deg,
        transparent 35%, rgba(0,0,0,0.3) 35%, rgba(0,0,0,0.3) 36%, transparent 36%);
}
/* Show cracks progressively based on data-cracks attribute */
[data-cracks="1"] .blockdrop-crack-1 { opacity: 1; }
[data-cracks="2"] .blockdrop-crack-1,
[data-cracks="2"] .blockdrop-crack-2 { opacity: 1; }
[data-cracks="3"] .blockdrop-crack-1,
[data-cracks="3"] .blockdrop-crack-2,
[data-cracks="3"] .blockdrop-crack-3 { opacity: 1; }
[data-cracks="4"] .blockdrop-crack-1,
[data-cracks="4"] .blockdrop-crack-2,
[data-cracks="4"] .blockdrop-crack-3,
[data-cracks="4"] .blockdrop-crack-4 { opacity: 1; }

/* Block fragments on shatter */
.blockdrop-fragment {
    position: fixed;
    width: 44px;
    height: 38px;
    background: linear-gradient(145deg, #7a6a4f 0%, #3a3018 100%);
    clip-path: polygon(10% 0%, 85% 5%, 100% 35%, 90% 100%, 15% 95%, 0% 50%);
    margin-left: -22px;
    margin-top: -19px;
    animation: fragScatter 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
@keyframes fragScatter {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* Transaction elements that fly away */
.blockdrop-tx {
    position: fixed;
    font-size: 9px;
    font-family: monospace;
    font-weight: 700;
    color: var(--btc-orange);
    background: rgba(247,147,26,0.12);
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid rgba(247,147,26,0.3);
    margin-left: -12px;
    margin-top: -8px;
    white-space: nowrap;
    pointer-events: none;
    animation: txScatter 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes txScatter {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    60%  { opacity: 0.8; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.5); opacity: 0; }
}

/* ── Mini block drop (non-intrusive, bottom-right) ───────────────────── */
.blockdrop-mini {
    position: fixed;
    right: 24px;
    top: -60px;
    z-index: 9998;
    width: 44px;
    height: 38px;
    background:
        radial-gradient(ellipse at 25% 15%, rgba(180,160,120,0.25) 0%, transparent 40%),
        radial-gradient(ellipse at 75% 85%, rgba(0,0,0,0.2) 0%, transparent 35%),
        linear-gradient(170deg, #7a6a4f 0%, #55472a 45%, #3a3018 85%, #2e2510 100%);
    clip-path: polygon(
        12% 2%, 28% 0%, 45% 4%, 60% 1%, 78% 3%, 92% 8%,
        98% 22%, 100% 40%, 97% 58%, 99% 75%, 95% 88%, 88% 97%,
        72% 100%, 55% 96%, 38% 100%, 22% 97%, 8% 92%,
        2% 78%, 0% 60%, 3% 42%, 1% 25%, 5% 12%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    pointer-events: auto;
    opacity: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}
.blockdrop-mini-in {
    animation: miniBlockFall 0.8s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}
@keyframes miniBlockFall {
    0%   { top: -60px; opacity: 0; }
    15%  { opacity: 0.85; }
    100% { top: calc(100vh - 60px); opacity: 0.85; }
}
.blockdrop-mini-out {
    opacity: 0;
    transition: opacity 0.35s ease;
}
.blockdrop-mini-label {
    color: #f7931a;
    font-size: 8px;
    font-weight: 700;
    font-family: monospace;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    line-height: 1;
}
.blockdrop-mini-sub {
    color: rgba(255,220,160,0.8);
    font-size: 6px;
    font-family: monospace;
    margin-top: 1px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
    line-height: 1;
}

/* ── Magic Internet Money Wizard ──────────────────────────────────────── */
.wizard-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10000;
    pointer-events: none;
    overflow: hidden;
}
.wizard-sprite {
    position: absolute;
    transition: none;
    white-space: nowrap;
    filter: drop-shadow(0 0 14px rgba(247,147,26,0.5))
            drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}
.wizard-sprite.wizard-flip {
    transform: scaleX(-1);
}
.wizard-svg {
    width: 110px;
    height: 160px;
    animation: wizardBob 0.6s ease-in-out infinite alternate;
}
@keyframes wizardBob {
    0%   { transform: rotate(-3deg); }
    100% { transform: rotate(3deg); }
}

/* Sparkle trail */
.wizard-sparkle {
    position: absolute;
    font-size: 16px;
    pointer-events: none;
    animation: sparkleFloat 1.4s ease-out forwards;
    opacity: 1;
}
@keyframes sparkleFloat {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--drift), 60px) scale(0.3); opacity: 0; }
}

/* Reason toast — floats below wizard path */
.wizard-toast {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(247,147,26,0.9);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: monospace;
    padding: 6px 18px;
    border-radius: 20px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    animation: toastFade 4s ease-out forwards;
    pointer-events: none;
}
@keyframes toastFade {
    0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
    15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}

/* ── Mobile: hide minor grid (crashes Plotly.js on Safari) ────────────── */
@media (max-width: 767px) {
    label:has(.minor-grid-opt) { display: none !important; }
}

/* ── Mobile: block drop sizing ────────────────────────────────────────── */
@media (max-width: 767px) {
    .blockdrop-cube {
        width: 130px;
        height: 115px;
        margin-left: -65px;
    }
    .blockdrop-label { font-size: 15px; }
    .blockdrop-sublabel { font-size: 10px; }
    .blockdrop-fragment { width: 34px; height: 30px; }
}

/* ── Desktop: controls drawer — auto-collapse after delay ────────────────── */
@media (min-width: 768px) {
    .controls-col {
        transition: flex 0.35s ease, max-width 0.35s ease, min-width 0.35s ease,
                    padding 0.35s ease, opacity 0.25s ease;
    }
    /* Graph column also transitions so the chart slides */
    .controls-col + [class*="col-"] {
        transition: flex 0.35s ease, max-width 0.35s ease;
    }
    .controls-col.drawer-collapsed {
        flex: 0 0 34px !important;
        max-width: 34px !important;
        min-width: 34px !important;
        padding: 0 !important;
        overflow: hidden;
        cursor: pointer;
        position: relative;
        background: transparent;
        border-right: none;
        box-shadow: none;
    }
    /* Hide inner content when collapsed */
    .controls-col.drawer-collapsed > * {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    /* Parchment scroll handle — SVG with dowel rolls */
    .controls-col.drawer-collapsed::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 34px;
        height: 140px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 140'%3E%3Cdefs%3E%3CclipPath id='pb'%3E%3Crect x='6' y='13' width='22' height='110'/%3E%3C/clipPath%3E%3C/defs%3E%3C!-- Top dowel --%3E%3Crect x='1' y='2' width='32' height='7' rx='3.5' fill='%235a3a18'/%3E%3Crect x='1' y='2' width='32' height='4' rx='2' fill='%23805020' opacity='0.7'/%3E%3Crect x='3' y='3' width='28' height='1.5' rx='0.8' fill='%23a07040' opacity='0.5'/%3E%3C!-- Dowel knob left --%3E%3Ccircle cx='3' cy='5.5' r='2.5' fill='%234a2e12'/%3E%3Ccircle cx='3' cy='4.5' r='1.5' fill='%23704820' opacity='0.5'/%3E%3C!-- Dowel knob right --%3E%3Ccircle cx='31' cy='5.5' r='2.5' fill='%234a2e12'/%3E%3Ccircle cx='31' cy='4.5' r='1.5' fill='%23704820' opacity='0.5'/%3E%3C!-- Top roll --%3E%3Cellipse cx='17' cy='13' rx='12' ry='5.5' fill='%23c49a3c'/%3E%3Cellipse cx='17' cy='11.5' rx='11' ry='3' fill='%23dbb864' opacity='0.7'/%3E%3Cellipse cx='17' cy='15' rx='10' ry='2' fill='%23a07828' opacity='0.4'/%3E%3C!-- Top roll spiral edges --%3E%3Cellipse cx='17' cy='13' rx='11.5' ry='5' fill='none' stroke='%23604018' stroke-width='0.7' opacity='0.35'/%3E%3Cellipse cx='17' cy='13.2' rx='10' ry='4' fill='none' stroke='%23604018' stroke-width='0.65' opacity='0.32'/%3E%3Cellipse cx='17' cy='13.3' rx='8.5' ry='3.2' fill='none' stroke='%23604018' stroke-width='0.6' opacity='0.28'/%3E%3Cellipse cx='17' cy='13.4' rx='7' ry='2.5' fill='none' stroke='%23604018' stroke-width='0.55' opacity='0.25'/%3E%3Cellipse cx='17' cy='13.5' rx='5.5' ry='1.8' fill='none' stroke='%23604018' stroke-width='0.5' opacity='0.22'/%3E%3Cellipse cx='17' cy='13.6' rx='4' ry='1.2' fill='none' stroke='%23604018' stroke-width='0.45' opacity='0.2'/%3E%3C!-- Parchment body base --%3E%3Crect x='6' y='13' width='22' height='110' fill='%23e8cc7a'/%3E%3C!-- Aged texture group (clipped to parchment) --%3E%3Cg clip-path='url(%23pb)'%3E%3C!-- Tea-stain wash — warm brown overlay --%3E%3Crect x='6' y='13' width='22' height='110' fill='%23a07040' opacity='0.08'/%3E%3C!-- Darkened edges (foxing) --%3E%3Crect x='6' y='13' width='4' height='110' fill='%23907030' opacity='0.18'/%3E%3Crect x='24' y='13' width='4' height='110' fill='%23906830' opacity='0.14'/%3E%3Crect x='6' y='13' width='22' height='8' fill='%23906830' opacity='0.1'/%3E%3Crect x='6' y='115' width='22' height='8' fill='%23906830' opacity='0.12'/%3E%3C!-- Age spots — scattered brown blotches --%3E%3Ccircle cx='12' cy='28' r='3' fill='%23997040' opacity='0.12'/%3E%3Ccircle cx='22' cy='42' r='2.5' fill='%23886030' opacity='0.14'/%3E%3Cellipse cx='10' cy='65' rx='3.5' ry='2' fill='%23907038' opacity='0.1'/%3E%3Ccircle cx='20' cy='78' r='2' fill='%23886030' opacity='0.13'/%3E%3Cellipse cx='14' cy='95' rx='2.5' ry='3' fill='%23907040' opacity='0.11'/%3E%3Ccircle cx='24' cy='108' r='2.5' fill='%23886838' opacity='0.1'/%3E%3Ccircle cx='9' cy='48' r='1.5' fill='%23806028' opacity='0.15'/%3E%3Ccircle cx='23' cy='60' r='1.8' fill='%23806028' opacity='0.12'/%3E%3Ccircle cx='16' cy='115' r='2' fill='%23907040' opacity='0.1'/%3E%3C!-- Fiber texture — thin angled lines --%3E%3Cline x1='7' y1='22' x2='27' y2='24' stroke='%23b09050' stroke-width='0.4' opacity='0.2'/%3E%3Cline x1='8' y1='38' x2='26' y2='36' stroke='%23a08040' stroke-width='0.5' opacity='0.22'/%3E%3Cline x1='7' y1='50' x2='27' y2='52' stroke='%23b09050' stroke-width='0.35' opacity='0.15'/%3E%3Cline x1='8' y1='68' x2='26' y2='66' stroke='%23a08040' stroke-width='0.3' opacity='0.2'/%3E%3Cline x1='7' y1='82' x2='27' y2='84' stroke='%23b09050' stroke-width='0.4' opacity='0.15'/%3E%3Cline x1='8' y1='96' x2='26' y2='94' stroke='%23a08040' stroke-width='0.5' opacity='0.22'/%3E%3Cline x1='7' y1='110' x2='27' y2='112' stroke='%23b09050' stroke-width='0.35' opacity='0.15'/%3E%3C!-- Cross-grain fibers (diagonal) --%3E%3Cline x1='8' y1='20' x2='12' y2='45' stroke='%23a08848' stroke-width='0.3' opacity='0.1'/%3E%3Cline x1='22' y1='35' x2='26' y2='70' stroke='%23a08848' stroke-width='0.25' opacity='0.08'/%3E%3Cline x1='10' y1='75' x2='14' y2='110' stroke='%23a08848' stroke-width='0.3' opacity='0.1'/%3E%3Cline x1='20' y1='85' x2='24' y2='120' stroke='%23a08848' stroke-width='0.25' opacity='0.08'/%3E%3C!-- Crinkle fold marks --%3E%3Cline x1='8' y1='45' x2='25' y2='43' stroke='%23b09858' stroke-width='0.5' opacity='0.1'/%3E%3Cline x1='9' y1='88' x2='24' y2='90' stroke='%23b09858' stroke-width='0.5' opacity='0.08'/%3E%3C!-- Tiny specks --%3E%3Ccircle cx='15' cy='35' r='0.6' fill='%23705020' opacity='0.2'/%3E%3Ccircle cx='21' cy='52' r='0.5' fill='%23705020' opacity='0.18'/%3E%3Ccircle cx='10' cy='72' r='0.7' fill='%23705020' opacity='0.15'/%3E%3Ccircle cx='24' cy='92' r='0.5' fill='%23705020' opacity='0.2'/%3E%3Ccircle cx='13' cy='105' r='0.6' fill='%23705020' opacity='0.16'/%3E%3Ccircle cx='18' cy='25' r='0.5' fill='%23705020' opacity='0.18'/%3E%3C/g%3E%3C!-- Bottom roll --%3E%3Cellipse cx='17' cy='123' rx='12' ry='5.5' fill='%23c49a3c'/%3E%3Cellipse cx='17' cy='121.5' rx='11' ry='3' fill='%23dbb864' opacity='0.7'/%3E%3Cellipse cx='17' cy='125' rx='10' ry='2' fill='%23a07828' opacity='0.4'/%3E%3C!-- Bottom roll spiral edges --%3E%3Cellipse cx='17' cy='123' rx='11.5' ry='5' fill='none' stroke='%23604018' stroke-width='0.7' opacity='0.35'/%3E%3Cellipse cx='17' cy='122.8' rx='10' ry='4' fill='none' stroke='%23604018' stroke-width='0.65' opacity='0.32'/%3E%3Cellipse cx='17' cy='122.7' rx='8.5' ry='3.2' fill='none' stroke='%23604018' stroke-width='0.6' opacity='0.28'/%3E%3Cellipse cx='17' cy='122.6' rx='7' ry='2.5' fill='none' stroke='%23604018' stroke-width='0.55' opacity='0.25'/%3E%3Cellipse cx='17' cy='122.5' rx='5.5' ry='1.8' fill='none' stroke='%23604018' stroke-width='0.5' opacity='0.22'/%3E%3Cellipse cx='17' cy='122.4' rx='4' ry='1.2' fill='none' stroke='%23604018' stroke-width='0.45' opacity='0.2'/%3E%3C!-- Bottom dowel --%3E%3Crect x='1' y='126' width='32' height='7' rx='3.5' fill='%235a3a18'/%3E%3Crect x='1' y='126' width='32' height='4' rx='2' fill='%23805020' opacity='0.7'/%3E%3Crect x='3' y='127' width='28' height='1.5' rx='0.8' fill='%23a07040' opacity='0.5'/%3E%3C!-- Bottom dowel knobs --%3E%3Ccircle cx='3' cy='129.5' r='2.5' fill='%234a2e12'/%3E%3Ccircle cx='3' cy='128.5' r='1.5' fill='%23704820' opacity='0.5'/%3E%3Ccircle cx='31' cy='129.5' r='2.5' fill='%234a2e12'/%3E%3Ccircle cx='31' cy='128.5' r='1.5' fill='%23704820' opacity='0.5'/%3E%3C/svg%3E") no-repeat center/contain;
        pointer-events: none;
        z-index: 1;
        filter: drop-shadow(1px 2px 3px rgba(0,0,0,0.3));
    }
    /* Scroll text — feather quill + CONFIG */
    .controls-col.drawer-collapsed::after {
        content: "\1FAB6\a C\a O\a N\a F\a I\a G";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 16px;
        font-weight: 700;
        font-family: "Palatino Linotype", Palatino, "Book Antiqua", serif;
        color: #3a2210;
        text-align: center;
        white-space: pre;
        line-height: 0.9;
        letter-spacing: 1px;
        text-shadow: 0 1px 0 rgba(212,168,85,0.5);
        pointer-events: none;
        z-index: 2;
    }
    /* Graph column expands when controls collapsed */
    .controls-col.drawer-collapsed + [class*="col-"] {
        flex: 1 1 auto !important;
        max-width: calc(100% - 34px) !important;
    }
    /* Sword-in-stone pin button — top-right of open panel */
    .drawer-pin {
        position: sticky;
        top: 2px;
        float: right;
        margin-left: -64px;
        z-index: 10;
        width: 64px;
        height: 64px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        opacity: 0.65;
        transition: opacity 0.25s;
        line-height: 1;
        text-align: center;
    }
    .drawer-pin:hover {
        opacity: 1;
    }
    .drawer-pin .pin-sword {
        display: block;
        font-size: 28px;
        transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        transform: translateY(-6px) rotate(-20deg);
        filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    }
    .drawer-pin .pin-stone {
        display: block;
        font-size: 22px;
        margin-top: -8px;
        filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
    }
    /* Pinned: sword thrust into stone */
    .drawer-pin.pinned {
        opacity: 1;
    }
    .drawer-pin.pinned .pin-sword {
        transform: translateY(2px) rotate(-45deg);
        animation: swordSparkle 1.5s ease-out;
    }
    @keyframes swordSparkle {
        0%   { filter: drop-shadow(0 0 4px #ffd700) drop-shadow(0 0 8px #f7931a); }
        40%  { filter: drop-shadow(0 0 10px #ffd700) drop-shadow(0 0 16px #f7931a); }
        100% { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); }
    }
    /* Label below */
    .drawer-pin .pin-label {
        display: block;
        font-size: 7px;
        font-family: "Palatino Linotype", Palatino, serif;
        font-style: italic;
        color: #8b6336;
        margin-top: 3px;
        letter-spacing: 0.3px;
        transition: opacity 0.3s;
        opacity: 0;
    }
    .drawer-pin.pinned .pin-label {
        opacity: 1;
    }

}
/* Hover-expand only on devices with a real pointer (not sticky touch :hover) */
@media (min-width: 768px) and (hover: hover) {
    .controls-col.drawer-collapsed:hover {
        flex: 0 0 25% !important;
        max-width: 25% !important;
        min-width: 25% !important;
        overflow-y: auto;
        padding-right: 6px !important;
    }
    .controls-col.drawer-collapsed:hover > * {
        opacity: 1;
        pointer-events: auto;
    }
    .controls-col.drawer-collapsed:hover::before,
    .controls-col.drawer-collapsed:hover::after {
        display: none;
    }
    .controls-col.drawer-collapsed:hover + [class*="col-"] {
        flex: 0 0 75% !important;
        max-width: 75% !important;
    }
}

/* MC "NEW" badge — defaults (desktop) */
.mc-new-badge {
    padding: 3px 10px 2px 8px;
    font-size: 10px;
    letter-spacing: 2px;
    border: 2px solid #8b0000;
}
/* MC "NEW" badge — landscape phones / narrow desktops */
@media (min-width: 768px) and (max-width: 1100px) {
    .controls-col { overflow: visible !important; max-height: none !important; }
    .controls-col.drawer-collapsed { max-height: 100vh !important; overflow: hidden !important; }
    /* Keep chart pinned while scrolling through tall control panels */
    .controls-col + [class*="col-"] {
        position: sticky;
        top: 0;
        align-self: flex-start;
    }
    .mc-new-badge {
        font-size: 12px;
        padding: 2px 4px 1px 3px;
        letter-spacing: 0.5px;
        border-width: 1px;
        top: 0px !important;
        right: -12px !important;
        transform: rotate(28deg) !important;
        z-index: 10 !important;
    }
}
/* ── Mobile: stack controls below chart ─────────────────────────────────── */
@media (max-width: 767px) {
    .drawer-pin { display: none; }
    .controls-col {
        order: 2;
        max-height: none !important;
        width: 100% !important;
        border-right: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        border-top: 2px solid #ccc;
    }
    .tab-content .row.g-0 {
        flex-direction: column;
    }
    .tab-content .row.g-0 > .col-9,
    .tab-content .row.g-0 > .col-3 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100%;
    }
    /* Constrain both the dcc.Graph wrapper and the inner Plotly div.
       Without this the wrapper stays at 78vh while the plot is only 55vw,
       leaving a large blank gap that makes controls appear unreachable. */
    [id$="-graph"] {
        height: 55vw !important;
        min-height: 280px !important;
    }
    .js-plotly-plot {
        height: 55vw !important;
        min-height: 280px !important;
    }
    /* ── Mobile dropdown: larger touch targets, cleaner option list ──── */
    .Select-control {
        min-height: 38px;
    }
    .Select-menu-outer {
        font-size: 14px;
    }
    .VirtualizedSelectOption {
        min-height: 38px !important;
        padding: 8px 12px !important;
    }
}

/* ── Site footer: block height + halving countdown ────────────────────────── */
.site-footer {
    opacity: 0.7;
    transition: opacity 0.3s;
}
.site-footer:hover {
    opacity: 1;
}

/* ── Ambient toast (birthday, night owl) ──────────────────────────────────── */
.ambient-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 62, 80, 0.92);
    color: #fff;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 13px;
    font-family: "Palatino Linotype", Palatino, serif;
    letter-spacing: 0.3px;
    z-index: 9999;
    pointer-events: none;
    animation: ambientToastIn 0.5s ease-out, ambientToastOut 0.5s ease-in 5.5s forwards;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    max-width: 90vw;
    text-align: center;
}
@keyframes ambientToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes ambientToastOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ── Heatmap swipe container (QR ↔ MC) ──────────────────────────────────── */
.hm-swipe-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #bbb transparent;
}
.hm-swipe-container::-webkit-scrollbar { height: 6px; }
.hm-swipe-container::-webkit-scrollbar-thumb { background: #bbb; border-radius: 3px; }
.hm-swipe-panel {
    position: relative;
    scroll-snap-align: start;
    min-width: 100%;
    flex-shrink: 0;
}
/* Allow browser-native pinch-to-zoom on heatmap charts (mobile readability).
   pointer-events:none on drag layer lets touches fall through to the browser;
   touch-action:manipulation enables pinch-to-zoom + pan without Plotly interference. */
#heatmap-graph,
#hm-mc-graph {
    touch-action: manipulation !important;
}
#heatmap-graph .draglayer .nsewdrag,
#heatmap-graph .draglayer .drag,
#hm-mc-graph .draglayer .nsewdrag,
#hm-mc-graph .draglayer .drag {
    pointer-events: none !important;
}

/* Quantile panel: static multi-column grid */
.q-panel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px 4px;
}
.q-panel-grid label {
    white-space: nowrap;
    font-size: 13px;
}
@media (max-width: 991px) {
    .q-panel-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* Mobile: larger quantile touch targets to reduce accidental taps */
@media (max-width: 767px) {
    .q-panel-grid label {
        min-height: 36px;
        padding: 6px 4px;
        display: flex;
        align-items: center;
    }
    .q-panel-grid input[type="checkbox"] {
        width: 18px;
        height: 18px;
        min-width: 18px;
    }
}

/* MC chart overlay — grays out chart when MC settings don't match */
.mc-chart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(64, 64, 64, 0.65);
    z-index: 10;
    pointer-events: all;
    cursor: not-allowed;
    border-radius: 4px;
}

/* ── MC premium chart styling (all 6 options active for preview) ──────────── */

/* Option 1: Gold border */
.mc-premium-chart {
    border: 2.5px solid #d4820a;
    border-radius: 6px;
}

/* Option 2: Gold top accent bar */
.mc-premium-chart::before {
    content: "";
    display: block;
    height: 3.5px;
    background: linear-gradient(90deg, #b8600a, #e8960e, #d4820a);
    border-radius: 6px 6px 0 0;
}

/* Option 5: Gold box-shadow glow */
.mc-premium-chart {
    box-shadow: 0 0 10px rgba(212, 130, 10, 0.35);
}

/* Option 4: Corner badge (favicon Q) */
.mc-premium-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 5;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    opacity: 0.7;
    pointer-events: none;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

/* ── Slider scroll guard ─────────────────────────────────────────────────────
   pan-y lets the browser handle vertical scrolling natively through slider
   areas.  Only deliberately horizontal movements activate the slider.
*/
.rc-slider {
    touch-action: pan-y;
}

/* ── Input accepted flash ───────────────────────────────────────────────────
   Brief green border flash when user presses Enter on a numeric input.
*/
@keyframes input-accepted {
    0%   { box-shadow: 0 0 0 2px rgba(26,143,60,0.6); }
    100% { box-shadow: none; }
}
.input-accepted {
    animation: input-accepted 0.6s ease-out;
}
