/* ============================================
   Screen 2 — Unified Styles
   Generated from: styles.css + screen2.html <style>
   ============================================ */

/* === Base: Screen 4 Section Layout === */
.screen4-section {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--nav-height, 72px) 20px 40px;
    box-sizing: border-box;
}

.screen4 {
    width: 100%;
    max-width: 1000px;
}

.screen4-title {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 24px;
    text-align: center;
}

/* === Variant 5: Section Number + Divider + Title === */
.screen4-title-v5 {
    display: flex;
    align-items: center;
    gap: 28px;
    margin: 0 0 24px;
}

.screen4-title-v5 .v5-number {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #57F357 0%, #14AA14 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    opacity: 0.25;
    flex-shrink: 0;
}

.screen4-title-v5 .v5-divider {
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, #57F357, transparent);
    flex-shrink: 0;
    border-radius: 1px;
}

.screen4-title-v5 .v5-text h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.screen4-title-v5 .v5-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

@media (max-width: 768px) {
    .screen4-title-v5 {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .screen4-title-v5 .v5-number {
        font-size: 3rem;
    }

    .screen4-title-v5 .v5-divider {
        width: 48px;
        height: 2px;
        background: linear-gradient(to right, #57F357, transparent);
    }
}

/* === Scene (background image layer) === */
.screen4-scene {
    position: relative;
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    margin-top: -50px;
    margin-bottom: -20px;
    clip-path: inset(50px 0 20px 0);
    -webkit-mask-image: radial-gradient(ellipse 90% 85% at center, #000 60%, transparent 100%);
    mask-image: radial-gradient(ellipse 90% 85% at center, #000 60%, transparent 100%);
}

.screen4-bg {
    width: 100%;
    display: block;
}

/* === Receipt Fixed (overlay on scene) === */
.s4-receipt-fixed {
    position: absolute;
    left: 29%;
    top: 39%;
    z-index: 6;
    max-width: 18%;
    max-height: 32%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 1% 1.2%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    font-size: clamp(10px, 1vw, 12px);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.s4-receipt-fixed.s4-receipt-show {
    opacity: 1;
    transform: translateY(0);
}

.s4-receipt-highlight {
    background: rgba(87, 243, 87, 0.15) !important;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.s4-check {
    color: #57f357;
    font-weight: 900;
    font-size: 14px;
    margin-left: 6px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.s4-check.s4-check-show {
    opacity: 1;
}

.s4-upsell-label {
    color: #57f357;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    padding: 4px 8px;
    margin-top: 4px;
    background: rgba(87, 243, 87, 0.12);
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.s4-upsell-label.s4-upsell-show {
    opacity: 1;
}

.screen4-fade-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #0a0a0f);
    z-index: 3;
    pointer-events: none;
}

/* === Bubbles (scene overlay) === */
.s4-bubble {
    display: none;
    align-items: center;
    gap: 0.5em;
    padding: 0.6em 0.9em;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    font-size: clamp(11px, 1.1vw, 14px);
    color: #fff;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    max-width: 22%;
}

.s4-bubble.s4-active {
    display: flex;
    animation: s4BubbleIn 0.4s ease-out;
}

@keyframes s4BubbleIn {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.s4-pos-customer {
    position: absolute;
    left: 26%;
    top: 14.6%;
}

.s4-pos-cashier {
    position: absolute;
    left: 44.3%;
    top: 14.6%;
    max-width: 22%;
}

.s4-pos-system {
    position: absolute;
    left: 42.3%;
    top: 38%;
    max-width: 24%;
}

/* Spinner for POS check */
.s4-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(87, 243, 87, 0.3);
    border-top-color: #57f357;
    border-radius: 50%;
    animation: s4Spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

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

/* Receipt style (old scene receipt) */
.s4-receipt {
    background: rgba(255, 255, 255, 0.92) !important;
    color: #222 !important;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 12px 16px !important;
    border-radius: 4px !important;
    border: 1px dashed #999 !important;
    backdrop-filter: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    max-width: 260px;
}

.s4-receipt .s4-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.5;
}

.s4-receipt-line {
    display: flex;
    justify-content: space-between;
}

.s4-receipt-total {
    border-top: 1px dashed #999;
    padding-top: 4px;
    margin-top: 4px;
    font-weight: bold;
}

.s4-bubble.s4-hidden {
    display: none !important;
}

.s4-bubble.s4-4sell {
    background: rgba(20, 80, 20, 0.9);
    border: 1px solid rgba(87, 243, 87, 0.4);
    box-shadow: 0 0 20px rgba(87, 243, 87, 0.2);
}

/* === Agent 4sell Panel (scene overlay) === */
.s4-agent-panel {
    position: absolute;
    left: 42.3%;
    top: 39%;
    z-index: 6;
    width: 22%;
    background: rgba(10, 20, 10, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(87, 243, 87, 0.25);
    border-radius: 14px;
    padding: 0.8em 1em;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(87, 243, 87, 0.1);
    font-size: clamp(10px, 1vw, 13px);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.s4-agent-panel.s4-agent-show {
    opacity: 1;
    transform: translateY(0);
}

.s4-agent-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(87, 243, 87, 0.15);
}

.s4-agent-header img {
    height: 20px;
}

.s4-agent-header span {
    font-size: 1em;
    font-weight: 800;
    color: #57f357;
}

.s4-agent-dot {
    width: 6px;
    height: 6px;
    background: #57f357;
    border-radius: 50%;
    box-shadow: 0 0 6px #57f357;
    animation: s4DotPulse 1.5s ease infinite;
}

@keyframes s4DotPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.s4-agent-msg {
    display: none;
    align-items: flex-start;
    gap: 0.5em;
    padding: 0.4em 0;
    font-size: 1em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.s4-agent-msg.s4-agent-msg-show {
    display: flex;
    animation: s4BubbleIn 0.4s ease-out;
}

.s4-agent-msg.s4-agent-msg-done {
    display: flex;
    opacity: 0.5;
}

.s4-agent-check {
    color: #57f357;
    font-size: 14px;
    font-weight: 900;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.s4-agent-msg-show .s4-agent-check,
.s4-agent-msg-done .s4-agent-check {
    opacity: 1;
}

.s4-num {
    font-size: 16px;
    font-weight: 800;
    color: #ff0;
    min-width: 20px;
}

.s4-avatar {
    font-size: 18px;
}

.s4-logo {
    height: 18px;
    width: auto;
}

.s4-text {
    flex: 1;
    line-height: 1.3;
}

/* === Background switch === */
.screen4-bg2 {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.screen4-bg2.s4-bg-active {
    opacity: 1;
}

/* === Customer walk-in animation === */
.screen4-customer {
    position: absolute;
    bottom: -20px;
    height: calc(85% + 20px);
    z-index: 2;
    animation: screen4Walk 2.5s ease-out forwards;
}

@keyframes screen4Walk {
    0% {
        left: -15%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        left: var(--customer-stop, 8%);
    }
}

/* === Bubbles container === */
.s4-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    pointer-events: none;
}

/* === Dev mode grid canvas === */
.screen4-grid-canvas {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

body.dev-mode .screen4-grid-canvas {
    display: block;
    pointer-events: auto;
    cursor: crosshair;
}


/* ============================================
   Sandbox Grid Layout & Overrides
   (from screen2.html — preferred source)
   ============================================ */

:root {
    --nav-height: 56px;
}

/* V7 title — sandbox overrides */
.screen4-title-v7 {
    text-align: center;
    position: relative;
    margin: 0 0 6px;
    padding: 10px 0 4px;
}

.screen4-title-v7 .v7-glow {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(87, 243, 87, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.screen4-title-v7 h2 {
    font-size: 2.4rem !important;
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    margin-bottom: 0 !important;
}

.screen4-title-v7 .v7-sub {
    font-size: 0.88rem !important;
    color: var(--text-secondary);
    margin-top: 10px !important;
    margin-bottom: 4px !important;
    position: relative;
    z-index: 1;
    line-height: 1.3;
}

.screen4-title-v7 .s4-steps {
    position: static;
    transform: none;
    justify-content: center;
    margin-top: 14px;
    flex-wrap: wrap;
    gap: 6px;
}

/* Steps — sandbox base */
.s4-steps {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
    white-space: nowrap;
    justify-content: flex-start !important;
}

.s4-steps::-webkit-scrollbar { display: none; }

.s4-step {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.5s ease;
    white-space: nowrap;
}

.s4-step.s4-step-active {
    color: #fff;
    background: rgba(87, 243, 87, 0.25);
    border-color: rgba(87, 243, 87, 0.5);
    box-shadow: 0 0 12px rgba(87, 243, 87, 0.3);
    text-shadow: 0 0 6px rgba(87, 243, 87, 0.5);
}

.s4-step.s4-step-done {
    color: rgba(87, 243, 87, 0.7);
    background: rgba(87, 243, 87, 0.08);
    border-color: rgba(87, 243, 87, 0.2);
}

/* === Sandbox Grid === */
.sandbox-grid {
    display: grid;
    grid-template-columns: 1fr 1.35fr 1fr;
    grid-template-rows: minmax(0, 0.92fr) minmax(0, 1.08fr);
    grid-template-areas:
        "client sell cashier"
        "clientImage order cashierImage";
    gap: 8px;
    margin-top: 4px;
    height: calc(100svh - 240px);
    min-height: 220px;
    max-height: 640px;
}

.sandbox-block--client { grid-area: client; }
.sandbox-block--client-image { grid-area: clientImage; }
.sandbox-block--order { grid-area: order; }
.sandbox-block--sell { grid-area: sell; }
.sandbox-block--cashier { grid-area: cashier; }
.sandbox-block--cashier-image { grid-area: cashierImage; }

/* Emoji fallback for small screens */
.person-emoji-fallback {
    display: none;
    font-size: 36px;
    text-align: center;
    padding: 4px;
    line-height: 1;
}

/* === Sandbox Block base === */
.sandbox-block {
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 9px;
    position: relative;
    min-height: 0;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 6px;
}

.sandbox-block:active {
    border-color: rgba(87, 243, 87, 0.5);
}

.sandbox-grid-wrapper {
    overflow: hidden;
    width: 100%;
}

.sandbox-block__label {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    background: #0a0a0f;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* Block subtitles as pinned headers */
.sandbox-block__subtitle {
    position: sticky;
    top: 0;
    z-index: 2;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    margin: 0 0 2px;
    padding: 2px 8px;
    background: inherit;
    line-height: 1.25;
}

/* Copy toast */
.copy-toast {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    background: #14cc14;
    color: #000;
    font-size: 13px;
    font-weight: 700;
    font-family: monospace;
    border-radius: 8px;
    z-index: 999999;
    pointer-events: none;
    animation: toastFade 1.2s ease forwards;
}

@keyframes toastFade {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px);
    }
}

/* === Sandbox bubble overrides === */
.sandbox-block .s4-bubble {
    position: relative !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    display: block !important;
    margin: 0 !important;
    font-size: 11px !important;
    padding: 6px 9px !important;
    line-height: 1.3 !important;
    max-width: 100% !important;
    width: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
}

.sandbox-block .s4-bubble .s4-text {
    font-size: 11px !important;
}

.sandbox-block .s4-bubble.s4-hidden {
    display: none !important;
}

.sandbox-block .s4-bubble.s4-active {
    outline: 2px solid rgba(0, 200, 255, 0.5);
    outline-offset: 2px;
    border-radius: 10px;
}

/* === Client / Cashier blocks === */
.sandbox-block--client,
.sandbox-block--cashier {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 4px;
    overflow: hidden;
    padding-top: 16px;
}

.sandbox-block--client .person-bubbles,
.sandbox-block--cashier .person-bubbles {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sandbox-block--client-image,
.sandbox-block--cashier-image {
    padding-top: 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
}

.sandbox-block--client .s4-bubble,
.sandbox-block--cashier .s4-bubble {
    display: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 7px 9px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(52, 214, 154, 0.35);
    background: linear-gradient(135deg, #0e7b5d 0%, #0a6f56 55%, #0a664f 100%) !important;
    color: #f3fff9 !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(8px);
}

.sandbox-block--client .s4-bubble.s4-stack-visible,
.sandbox-block--cashier .s4-bubble.s4-stack-visible {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
    animation: s4StackIn 0.46s cubic-bezier(0.16, 1, 0.3, 1);
}

.sandbox-block--client .s4-bubble.s4-active,
.sandbox-block--cashier .s4-bubble.s4-active {
    outline: none !important;
}

.sandbox-block--client .s4-bubble::before,
.sandbox-block--cashier .s4-bubble::before {
    position: relative;
    top: -1px;
    margin-right: 7px;
    font-size: 13px;
}

.sandbox-block--client .s4-bubble::before { content: "🧑"; }
.sandbox-block--cashier .s4-bubble::before { content: "🧑‍🍳"; }

.sandbox-block--client .s4-bubble .s4-text,
.sandbox-block--cashier .s4-bubble .s4-text {
    font-size: 11px !important;
}

@keyframes s4StackIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Agent panel (sandbox compact) === */
.sandbox-block--sell {
    justify-content: flex-start;
    align-items: stretch;
    padding-top: 18px;
    padding-bottom: 8px;
}

.sandbox-block--sell .s4-agent-panel {
    flex: 1;
    min-height: 0;
}

.sandbox-block .s4-agent-panel {
    position: relative !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    display: flex !important;
    flex-direction: column;
    font-size: 11px !important;
    padding: 8px !important;
    max-width: 100% !important;
    width: auto !important;
    left: auto !important;
    top: auto !important;
    margin-top: 0 !important;
    height: 100%;
    box-sizing: border-box;
}

.sandbox-block .s4-agent-panel .s4-agent-header {
    font-size: 11px !important;
    margin-bottom: 6px !important;
}

.sandbox-block .s4-agent-messages {
    height: 96px;
    min-height: 96px;
    max-height: 96px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sandbox-block .s4-agent-panel .s4-agent-msg {
    font-size: 11px !important;
    padding: 3px 0 !important;
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    overflow: hidden;
    line-height: 1.25 !important;
    display: none;
    align-items: center;
    gap: 6px;
}

.sandbox-block .s4-agent-panel .s4-agent-msg.s4-agent-msg-stack {
    display: flex !important;
    opacity: 0.8;
}

.sandbox-block .s4-agent-panel .s4-agent-msg.s4-agent-msg-show {
    opacity: 1;
}

.sandbox-block .s4-agent-panel .s4-agent-check {
    display: inline-block !important;
    color: #57f357;
    font-size: 12px;
    font-weight: 900;
    opacity: 1 !important;
    flex-shrink: 0;
}

/* === Receipt (sandbox — реальный чек) === */
.sandbox-block .s4-receipt-fixed {
    all: unset !important;
    display: block !important;
    position: relative !important;
    overflow: hidden !important;
    background: #f2f2f2 !important;
    color: #121212 !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    border-radius: 2px !important;
    padding: 8px 8px 7px !important;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    height: 100%;
}

.sandbox-block .s4-receipt-fixed::before,
.sandbox-block .s4-receipt-fixed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background: repeating-linear-gradient(90deg,
            #111 0 2px,
            transparent 2px 8px);
    opacity: 0.32;
}

.sandbox-block .s4-receipt-fixed::before {
    top: -8px;
}

.sandbox-block .s4-receipt-fixed::after {
    bottom: -8px;
}

.sandbox-block .cafe-receipt {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between;
    gap: 2px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 11px !important;
    font-variant-numeric: tabular-nums;
    color: #121212 !important;
    letter-spacing: 0;
    height: 100%;
    overflow: hidden;
}

.sandbox-block .cafe-receipt-head {
    text-align: center;
    font-size: 16px;
    line-height: 1;
    font-weight: 900;
    color: #111;
    margin-bottom: 1px;
    letter-spacing: -0.01em;
}

.sandbox-block .cafe-receipt-sub {
    text-align: center;
    font-size: 11px;
    color: #2a2a2a;
    margin-bottom: 1px;
}

.sandbox-block .cafe-receipt-stars {
    text-align: center;
    font-size: 12px;
    color: #464646;
    letter-spacing: 0.22em;
    margin: 1px 0;
    white-space: nowrap;
    overflow: hidden;
}

.sandbox-block .cafe-receipt-doc {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #111;
    margin: 1px 0;
}

.sandbox-block .cafe-receipt-row {
    display: flex !important;
    align-items: baseline !important;
    gap: 3px !important;
    font-size: 11px !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    color: #111;
}

.sandbox-block .cafe-receipt-head-row {
    font-weight: 800;
    margin-top: 2px;
    margin-bottom: 1px;
}

.sandbox-block .cafe-receipt-item {
    color: #111 !important;
    font-size: 11px !important;
    font-weight: 600;
}

.sandbox-block .cafe-receipt-price {
    color: #111 !important;
    font-size: 11px !important;
    font-weight: 700;
    white-space: nowrap;
}

.sandbox-block .cafe-receipt-dots {
    flex: 1 !important;
    border-bottom: 1px dotted rgba(0, 0, 0, 0.5) !important;
    min-width: 10px !important;
}

.sandbox-block .cafe-receipt-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.25);
    margin: 2px 0;
}

.sandbox-block .cafe-receipt-total .cafe-receipt-item {
    color: #111 !important;
    font-weight: 900;
    font-size: 13px !important;
}

.sandbox-block .cafe-receipt-total .cafe-receipt-price {
    color: #111 !important;
    font-size: 18px !important;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sandbox-block .cafe-receipt-meta {
    font-size: 11px !important;
    color: #2e2e2e;
}

/* Receipt items hidden by default, shown via JS */
.sandbox-block .s4-receipt-item {
    display: none !important;
}
.sandbox-block .s4-receipt-item.s4-receipt-item-show {
    display: flex !important;
}

/* Paid badge */
.s4-receipt-paid {
    display: none;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 900;
    color: #0a7c42;
    background: rgba(10, 124, 66, 0.12);
    border: 2px solid #0a7c42;
    border-radius: 4px;
    padding: 4px 12px;
    margin-top: 4px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.s4-receipt-paid.s4-receipt-paid-show {
    display: block;
}

/* Receipt typewriter cursor */
.s4-receipt-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #111;
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: s4CursorBlink 0.6s step-end infinite;
}
@keyframes s4CursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Croissant highlight override */
.sandbox-block #s4ReceiptCroissant.s4-receipt-highlight {
    background: rgba(217, 33, 33, 0.14) !important;
    border-radius: 2px;
    padding: 1px 2px;
}

/* Upsell label in sandbox */
.sandbox-block .s4-upsell-label {
    margin-top: 1px;
    align-self: flex-start;
    border: none;
    background: #c72020;
    color: #fff;
    border-radius: 2px;
    font-size: 12px;
    line-height: 1;
    padding: 2px 4px;
    font-weight: 700;
    text-transform: lowercase;
}

/* Hide check in receipt */
.sandbox-block #s4Check {
    display: none !important;
}

/* Person visuals */
.sandbox-block--client-image .person-visual,
.sandbox-block--cashier-image .person-visual {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin: 0;
    overflow: hidden;
}

.person-visual img,
.person-visual .person-visual__img--client {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

/* Main content overrides */
.main-content > section {
    padding-bottom: 0 !important;
}

.main-content .container {
    padding-left: 14px;
    padding-right: 14px;
}


/* ============================================
   Responsive: Tablet (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .screen4-title-v7 {
        padding: 2px 0 0;
        margin-bottom: 2px;
    }
    .screen4-title-v7 h2 {
        font-size: 1.25rem !important;
    }
    .screen4-title-v7 .v7-sub {
        font-size: 0.68rem !important;
        margin-bottom: 2px !important;
        line-height: 1.15;
    }
    .screen4-title-v7 .s4-steps {
        margin-top: 2px;
        gap: 3px;
    }
    .s4-step {
        font-size: 10px;
        padding: 2px 7px;
    }

    .sandbox-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(0, 0.8fr) minmax(0, 1.2fr);
        grid-template-areas:
            "client cashier"
            "sell order";
        height: calc(100svh - 200px);
        max-height: none;
        gap: 5px;
        margin-top: 2px;
    }
    .sandbox-block--client-image,
    .sandbox-block--cashier-image {
        display: none !important;
    }
    .person-emoji-fallback {
        display: block;
        font-size: 24px;
        padding: 2px;
        margin: 0;
    }
    .sandbox-block {
        min-height: 0;
        padding: 8px;
        padding-top: 0;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    .sandbox-block__label {
        position: sticky !important;
        top: 0 !important;
        left: auto !important;
        transform: none !important;
        z-index: 2;
        background: rgba(18, 18, 26, 0.95) !important;
        border-bottom: 1px solid rgba(87, 243, 87, 0.2);
        padding: 6px 10px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        flex-shrink: 0;
        color: var(--text-primary, #f0f0f5);
        white-space: nowrap;
    }
    .sandbox-block__label img {
        height: 14px;
        vertical-align: middle;
        display: inline-block;
    }
    .sandbox-block__subtitle {
        position: relative;
        top: auto;
        z-index: 1;
        margin-top: 4px;
        padding: 2px 4px;
        font-size: 11px;
    }
    .sandbox-grid-wrapper {
        overflow: visible;
    }

    .sandbox-block--client,
    .sandbox-block--cashier {
        overflow-y: auto;
        overflow-x: hidden;
        padding-top: 0;
    }

    .sandbox-block--sell {
        padding-top: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .sandbox-block--client .s4-bubble,
    .sandbox-block--cashier .s4-bubble {
        font-size: 10px !important;
        padding: 6px 8px !important;
        line-height: 1.25 !important;
    }
    .sandbox-block .cafe-receipt {
        font-size: 11px !important;
        gap: 2px !important;
    }
    .sandbox-block .cafe-receipt-head {
        font-size: 14px;
    }
    .sandbox-block .cafe-receipt-total .cafe-receipt-price {
        font-size: 16px !important;
    }
    .sandbox-block .cafe-receipt-total .cafe-receipt-item {
        font-size: 12px !important;
    }
    .sandbox-block .cafe-receipt-row,
    .sandbox-block .cafe-receipt-item,
    .sandbox-block .cafe-receipt-price,
    .sandbox-block .cafe-receipt-meta {
        font-size: 11px !important;
    }
    .sandbox-block .s4-agent-header {
        padding: 4px 6px !important;
    }
    .sandbox-block .s4-agent-header span {
        font-size: 10px !important;
    }
    .sandbox-block .s4-agent-msg {
        font-size: 10px !important;
        padding: 2px 6px !important;
    }
    .sandbox-block .s4-agent-messages {
        max-height: 72px;
    }
    .sandbox-block--client,
    .sandbox-block--cashier {
        padding-top: 14px;
        gap: 3px;
    }
}


/* ============================================
   Responsive: Mobile (max-width: 560px)
   ============================================ */
@media (max-width: 560px) {
    .screen4-title-v7 {
        padding: 2px 0 0;
        margin-bottom: 2px;
    }
    .screen4-title-v7 h2 {
        font-size: 0.92rem !important;
        letter-spacing: 0;
    }
    .screen4-title-v7 .v7-sub {
        display: none;
    }

    .sandbox-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(0, 0.7fr) minmax(0, 1.3fr);
        grid-template-areas:
            "client cashier"
            "sell order";
        height: calc(100svh - 180px);
        gap: 4px;
        margin-top: 2px;
    }
    .sandbox-block {
        min-height: 0;
        padding: 6px;
        padding-top: 0;
        border-radius: 8px;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .sandbox-block__label {
        padding: 5px 8px;
        font-size: 10px;
    }
    .sandbox-block__subtitle {
        font-size: 10px;
        padding: 0 4px;
        margin-bottom: 2px;
    }
    .person-emoji-fallback {
        font-size: 20px;
        padding: 0;
    }
    .main-content .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .s4-steps {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        margin-top: 2px !important;
        gap: 2px !important;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .s4-steps::-webkit-scrollbar {
        display: none;
    }
    .s4-steps .s4-step {
        font-size: 8px !important;
        padding: 2px 5px !important;
        white-space: nowrap;
        flex: 0 0 auto;
        flex-shrink: 0;
    }

    .sandbox-block--client .s4-bubble,
    .sandbox-block--cashier .s4-bubble {
        font-size: 10px !important;
        padding: 5px 7px !important;
    }
    .sandbox-block .s4-agent-messages {
        max-height: 60px;
    }
    .sandbox-block .s4-agent-header span,
    .sandbox-block .s4-agent-msg {
        font-size: 10px !important;
    }
    .sandbox-block .cafe-receipt,
    .sandbox-block .cafe-receipt-row,
    .sandbox-block .cafe-receipt-item,
    .sandbox-block .cafe-receipt-price {
        font-size: 9px !important;
        line-height: 1.05 !important;
    }
    .sandbox-block .cafe-receipt-meta {
        font-size: 8px !important;
        line-height: 1.05 !important;
    }
    .sandbox-block .cafe-receipt {
        gap: 1px !important;
    }
    .sandbox-block .s4-receipt-fixed {
        padding: 6px !important;
    }
    .sandbox-block .cafe-receipt-head {
        font-size: 12px !important;
    }
    .sandbox-block .cafe-receipt-total .cafe-receipt-item {
        font-size: 11px !important;
    }
    .sandbox-block .cafe-receipt-total .cafe-receipt-price {
        font-size: 14px !important;
    }
    .sandbox-block .s4-upsell-label {
        font-size: 8px !important;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}


/* ============================================
   Responsive: Very small screens (max-height: 700px)
   ============================================ */
@media (max-height: 700px) {
    .sandbox-grid {
        margin-top: 4px;
        gap: 4px;
    }
    .screen4-title-v7 h2 {
        font-size: 1.25rem !important;
    }
    .v7-sub {
        font-size: 0.74rem !important;
    }
    .screen4-title-v7 .s4-steps {
        margin-top: 6px;
    }
}
