:root {
    --ink: #0f1d1a;
    --muted: #51605b;
    --accent: #0f766e;
    --accent-strong: #0f5f55;
    --accent-soft: #ccf3e6;
    --sand: #f7f1e7;
    --panel: #ffffff;
    --border: #dde5e2;
    --sun: #f6c585;
    --sky: #cfe9f2;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
    background: linear-gradient(180deg, #f7f1e7 0%, #f6f5ef 48%, #e6f3f1 100%);
    color: var(--ink);
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

.screen {
    animation: fade-up 0.6s ease both;
}

.message {
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 600;
    text-align: center;
    margin-top: 8px;
}

.message.success {
    background: #dcfce7;
    color: #166534;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--muted);
}

.detail-row strong {
    color: var(--ink);
    font-weight: 600;
}

#scanner-viewport {
    position: relative;
}

#scanner-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-region {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 28%;
    border: 3px solid rgba(204, 243, 230, 0.9);
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(8, 15, 13, 0.45);
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes drift {
    0% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(-10px, 12px, 0);
    }
    100% {
        transform: translate3d(0, 0, 0);
    }
}

.drift-slow {
    animation: drift 14s ease-in-out infinite;
}

.drift-slower {
    animation: drift 18s ease-in-out infinite;
}

.drift-slowest {
    animation: drift 22s ease-in-out infinite;
}

@media (min-width: 1024px) {
    .screen {
        animation-delay: 0.05s;
    }
}

/* Collapsible welcome section */
#welcome-section.collapsed .welcome-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

#welcome-section .welcome-content {
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

#welcome-section.collapsed #welcome-toggle {
    display: flex;
}

#welcome-section #welcome-toggle {
    display: none;
}

#welcome-section.collapsed .welcome-chevron {
    transform: rotate(0deg);
}

#welcome-section:not(.collapsed) .welcome-chevron {
    transform: rotate(180deg);
}

/* Notes section toggle */
#order-notes-section.expanded .notes-chevron {
    transform: rotate(180deg);
}

#order-notes-section .notes-chevron {
    transform: rotate(0deg);
    transition: transform 0.2s ease;
}

/* Note item styling */
.note-item {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
}

.note-item .note-content {
    font-size: 0.875rem;
    color: var(--ink);
    white-space: pre-wrap;
    word-break: break-word;
}

.note-item .note-meta {
    margin-top: 4px;
    font-size: 0.7rem;
    color: var(--muted);
}
