﻿
        body { margin: 0; font-family: Arial, sans-serif; background-color: black; }
        #container {
            /* These properties ensure the container fills the entire screen */
            width: 100vw; 
            height: 100vh;
            position: relative;
            overflow: hidden;
        }

        /* --- FIX FOR CAMERA ALIGNMENT AND SCALING --- */
        #container > video,
        #container > canvas {
            position: absolute !important;
            top: 0 !important;
            left: 0 !important;
            width: 100% !important;
            height: 100% !important;
            object-fit: cover !important; 
        }
        /* --- END FIX --- */

        /* UPDATED: Control panel styling for multiple buttons */
        #control {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            transform: none;
            z-index: 10;
            display: flex;
            align-items: center;
            /* Allow buttons to wrap on smaller screens */
            flex-wrap: wrap; 
            justify-content: center;
            gap: 0.5rem;
            width: 100%;
            padding: 1rem;
        }
        #control-container {
            background: rgba(10, 12, 16, 0.9);
            padding: 1rem;
            border-radius: 0.5rem;
            border: 1px solid #111827;
            box-shadow: 0 4px 14px rgba(0,0,0,0.35);
            display: flex;
            gap: 0.5rem;
            /* margin: 0.5rem; */
            flex-wrap: wrap;
        }
        #control-container {
            width: 100%;
        }

        .control-button {
            padding: 0.45rem 0.8rem;
            border-radius: 0.375rem;
            font-weight: 700;
            font-size: 0.9rem;
            font-family: Arial, sans-serif;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            transition: border-color 0.15s, background-color 0.15s, transform 0.05s ease-in-out;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
            white-space: nowrap; /* Prevent button text from wrapping */
            background-color: #0b0f14;
            color: #e5e7eb;
            border: 1px solid #1f2937;
        }

        .control-button:disabled {
            opacity: 0.35;
            cursor: not-allowed;
            box-shadow: none;
        }

        /* AR Buttons */
        .control-button.colored-start {
            background-color: #0b3b2f; /* deep emerald tint */
            color: #d1fae5;
            border: 1px solid #10b981;
        }
        .control-button.colored-start:hover {
            background-color: #115e49;
            box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35);
        }
        .control-button.colored-selected {
            background-color: #7c2d12; /* deep orange tint */
            color: #ffedd5;
            border: 1px solid #fb923c;
        }
        .control-button.colored-selected:hover {
            background-color: #9a3412;
            box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35);
        }
        .control-button.colored-stop {
            background-color: #4a1111; /* deep red tint */
            color: #fee2e2;
            border: 1px solid #ef4444;
        }
        .control-button.colored-stop:hover {
            background-color: #7f1d1d;
            box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35);
        }
        .control-button.colored-screenshot {
            background-color: #0c1f3f; /* deep blue tint */
            color: #dbeafe;
            border: 1px solid #3b82f6;
        }
        .control-button.colored-screenshot:hover {
            background-color: #1d4ed8;
            box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35);
        }

        .control-button.colored-place {
            background-color: #433144;
            color: #f5d0fe;
            border: 1px solid #d946ef;
        }
        .control-button.colored-place:hover {
            background-color: #581c87;
            box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35);
        }
        

        /* Model Selection Buttons */
        .model-select-button {
            padding: 0.4rem 0.7rem;
            border-radius: 0.375rem;
            font-weight: 700;
            font-size: 0.85rem;
            font-family: Arial, sans-serif;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            transition: border-color 0.15s, background-color 0.15s, transform 0.05s ease-in-out;
            background-color: #0b0f14; /* HUD dark */
            color: #e5e7eb;
            border: 1px solid #1f2937; /* Gray 800 */
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
        }

        .arrow-row {
            justify-content: space-between !important;
        }
        .arrow-button {
            position: static;
            transform: none;
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 50%;
            border: 1px solid rgba(255,255,255,0.2);
            background: rgba(12, 18, 28, 0.9);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.15s ease, border-color 0.15s ease;
            z-index: 12;
        }
        .arrow-button:active {
            transform: scale(0.95);
        }
        .arrow-button:disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }
        .arrow-button.hidden {
            display: none !important;
        }
        .lottie-arrow {
            width: 100%;
            height: 100%;
            pointer-events: none;
        }
        .start-hint {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            padding: 0.8rem 1.2rem;
            width: 100%;
            border-radius: 0.6rem;
            color: #e5e7eb;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-align: center;
            z-index: 14;
            pointer-events: none;
        }
        .start-hint.hidden { display: none !important; }
        .moisture-row {
            position: fixed;
            bottom: 15rem;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.6rem 0.95rem;
            border-radius: 999px;
            background: rgba(6, 8, 12, 0.85);
            border: 1px solid rgba(59, 130, 246, 0.45);
            color: #e0f2fe;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            z-index: 14;
            pointer-events: none;
        }
        .collapse-controls-button {
            position: relative;
            margin-left: auto;
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 2rem;
            font-weight: 700;
            font-size: 0.75rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            background: rgba(12, 18, 28, 0.9);
            color: #e5e7eb;
            border: 1px solid rgba(255,255,255,0.2);
            box-shadow: 0 6px 12px rgba(0,0,0,0.35);
            z-index: 15;
        }
        #control-container.hidden {
            display: none !important;
        }
        .moisture-value {
            font-family: Arial, sans-serif;
        }
        .moisture-icon svg {
            width: 1.1rem;
            height: 1.1rem;
            fill: #60a5fa;
            display: block;
        }
        .model-select-button:hover {
            background-color: #121923; /* slight lift */
            border-color: #374151;
        }
        .model-select-button.selected {
            background-color: #111827; 
            color: #fcd34d; /* warm amber text */
            border-color: #f59e0b;
            box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25) inset, 0 3px 8px rgba(0,0,0,0.35);
        }

        /* Compact row layout with tighter gaps and aligned edges */
        #control .row {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: flex-start; /* tighter grouping, no auto spacing */
            gap: 0.5rem;
        }

        /* Header row with tiny spacing and headline */
        #control .header-row { gap: 0.35rem; }
        #modelHeadline.hud-headline {
            color: #9ca3af; /* gray-400 */
            font-family: Arial, sans-serif;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            font-size: 0.75rem;
            padding: 0.25rem 0.35rem;
            border: 1px solid #111827; /* slate-900 */
            background: rgba(6, 8, 12, 0.95);
            border-radius: 0.25rem;
            user-select: none;
        }

        /* Darker background container for model buttons */
        .model-row {
            overflow: hidden;
        }
        .model-scroll {
            flex: 1;
            overflow-x: auto;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            padding-bottom: 0.15rem;
        }
        .model-scroll::-webkit-scrollbar {
            height: 6px;
        }
        .model-scroll::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.4);
            border-radius: 999px;
        }
        .model-group {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            background: rgba(5, 7, 10, 0.95);
            border: 1px solid #0f172a; /* slate-950 */
            border-radius: 0.4rem;
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 3px 10px rgba(0,0,0,0.35);
            width: max-content;
        }
        .header-row {
            overflow: hidden;
        }
        .header-scroll {
            flex: 1;
            overflow-x: auto;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            padding-bottom: 0.15rem;
        }
        .header-scroll::-webkit-scrollbar {
            height: 6px;
        }
        .header-scroll::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.4);
            border-radius: 999px;
        }
        .header-group {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            width: max-content;
        }

        /* Mobile sizing: slightly smaller but readable */
        @media (max-width: 480px) {
            #control { gap: 0.5rem; }
            .control-button { font-size: 0.82rem; padding: 0.38rem 0.65rem; }
            .model-select-button { font-size: 0.78rem; padding: 0.34rem 0.58rem; white-space: nowrap;}
        }

        /* Row layout to align edges across rows */
        #control .row {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .loading-message {
            position: absolute; 
            top: 50%; 
            left: 50%; 
            transform: translate(-50%, -50%); 
            color: white; 
            background: rgba(0,0,0,0.7); 
            padding: 1rem 2rem; 
            border-radius: 0.75rem; 
            z-index: 99;
            font-size: 1.125rem;
            box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
            pointer-events: none;
        }
        .loading-subtext {
            position: absolute;
            top: calc(50% + 3rem);
            left: 50%;
            transform: translate(-50%, -50%);
            color: #e5e7eb;
            font-size: 0.95rem;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            text-align: center;
            background: rgba(0,0,0,0.6);
            padding: 0.5rem 0.75rem;
            border-radius: 0.5rem;
            border: 1px solid rgba(255,255,255,0.15);
            box-shadow: 0 6px 12px rgba(0,0,0,0.35);
            z-index: 99;
            pointer-events: none;
        }
        .unlock-message {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #fefce8;
            background: rgba(22, 24, 29, 0.95);
            padding: 0.65rem 1rem;
            border-radius: 0.6rem;
            font-size: 0.85rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            text-align: center;
            border: 1px solid rgba(250, 204, 21, 0.45);
            box-shadow: 0 8px 18px rgba(0,0,0,0.4);
            z-index: 15;
            pointer-events: none;
        }
        .locked-plant {
            opacity: 0.8;
        }
        .hidden {
            display: none !important;
        }

        .mindar-ui-scanning .scanning .scanning-text {
            position: absolute;
            top: calc(100% + 0.8rem);
            left: 50%;
            transform: translateX(-50%);
            font-family: Arial, sans-serif;
            font-weight: 600;
            font-size: 0.85rem;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: #f9fafb;
            text-shadow: 0 2px 6px rgba(0,0,0,0.5);
            white-space: nowrap;
            pointer-events: none;
        }
    
