  :root {
            --primary: #4a6fa5;
            --secondary: #166088;
            --accent: #4cb5ae;
            --light: #f8f9fa;
            --dark: #343a40;
            --success: #28a745;
            --danger: #dc3545;
            --warning: #ffc107;
            --info: #17a2b8;
            --blue-50: #eff6ff;
            --blue-100: #dbeafe;
            --blue-600: #2563eb;
            --blue-700: #1d4ed8;
            --gray-50: #f9fafb;
            --gray-100: #f3f4f6;
            --gray-200: #e5e7eb;
            --gray-300: #d1d5db;
            --gray-600: #4b5563;
            --gray-700: #374151;
            --gray-800: #1f2937;
            --teal-400: #2dd4bf;
            --teal-500: #14b8a6;
            --teal-600: #0d9488;
            --teal-700: #0f766e;
            --green-100: #dcfce7;
            --green-800: #166534;
            --yellow-50: #fefce8;
            --yellow-200: #fef08a;
            --yellow-800: #854d0e;
            --red-100: #fee2e2;
            --red-500: #ef4444;
            --red-800: #991b1b;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
            color: var(--dark);
            line-height: 1.6;
            min-height: 100vh;
            padding: 10px;
            touch-action: manipulation;
        }
        
        .container {
            max-width: 1400px;
            margin: 0 auto;
            background: white;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            overflow: hidden;
        }
        
        header {
            background: linear-gradient(to right, var(--primary), var(--secondary));
            color: white;
            padding: 20px 15px;
            text-align: center;
            position: relative;
        }
        
        header h1 {
            font-size: 2.2rem;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
        }
        
        header p {
            font-size: 1.1rem;
            opacity: 0.9;
            margin-bottom: 15px;
        }
        
        .patient-info {
            margin: 15px 0;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
        }
        
        .patient-info input {
            padding: 12px 15px;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            width: 100%;
            max-width: 300px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }
        
        .how-to-use-btn {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 8px;
            padding: 10px 15px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 600;
            margin-top: 10px;
            display: inline-block;
        }
        
        .how-to-use-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }
        
        .main-content {
            display: flex;
            flex-wrap: wrap;
            padding: 15px;
            gap: 15px;
        }
        
        .section {
            background: var(--gray-50);
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            width: 100%;
        }
        
        .image-section {
            order: 1;
        }
        
        .analysis-section {
            order: 3;
        }
        
        .tools-section {
            order: 2;
        }
        
        .section-title {
            font-size: 1.5rem;
            color: var(--secondary);
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 2px solid var(--accent);
            font-weight: 700;
        }
        
        .eye-container {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-bottom: 20px;
        }
        
        .eye-box {
            flex: 1;
            min-width: 280px;
            text-align: center;
            padding: 15px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        }
        
        .eye-title {
            font-weight: bold;
            margin-bottom: 12px;
            color: var(--secondary);
            font-size: 1.1rem;
        }
        
  
.image-preview-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Isso cria um contêiner quadrado */
    margin: 0 auto 15px;
    overflow: hidden;
    border-radius: 50%;
    border: 2px dashed var(--accent);
    background: var(--gray-50);
    touch-action: none;
}

.image-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.1s;
    will-change: transform;
}

        
        .image-controls {
            margin: 12px 0;
            display: none;
        }
        
        .image-controls.active {
            display: block;
        }
        
        .control-buttons {
            display: flex;
            gap: 8px;
            justify-content: center;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }
        
        .control-btn {
            padding: 8px 12px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 14px;
            min-width: 44px;
            min-height: 44px;
        }
        
        .control-btn:hover {
            background: var(--secondary);
            transform: translateY(-2px);
        }
        
        .slider-group {
            margin: 8px 0;
            text-align: left;
        }
        
        .slider-label {
            display: block;
            color: var(--gray-600);
            font-size: 14px;
            margin-bottom: 5px;
        }
        
        .slider {
            width: 100%;
            height: 8px;
            background: var(--gray-200);
            border-radius: 5px;
            outline: none;
            -webkit-appearance: none;
        }
        
        .slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--primary);
            cursor: pointer;
        }
        
        .map-toggle {
            margin: 12px 0;
        }
        
        .map-btn {
            padding: 10px 20px;
            background: var(--gray-200);
            color: var(--gray-700);
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 600;
            min-width: 44px;
            min-height: 44px;
        }
        
        .map-btn.active {
            background: var(--teal-500);
            color: white;
        }
        
        .btn-group {
            display: flex;
            gap: 8px;
            justify-content: center;
            flex-wrap: wrap;
        }
        
        .btn {
            padding: 12px 18px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            text-decoration: none;
            font-size: 14px;
            min-width: 44px;
            min-height: 44px;
        }
        
        .btn-primary {
            background: var(--primary);
            color: white;
        }
        
        .btn-primary:hover {
            background: var(--secondary);
            transform: translateY(-2px);
        }
        
        .btn-success {
            background: var(--success);
            color: white;
        }
        
        .btn-success:hover {
            background: #218838;
            transform: translateY(-2px);
        }
        
        .btn-warning {
            background: var(--warning);
            color: var(--dark);
        }
        
        .btn-warning:hover {
            background: #e0a800;
            transform: translateY(-2px);
        }
        
        .btn-info {
            background: var(--info);
            color: white;
        }
        
        .btn-info:hover {
            background: #138496;
            transform: translateY(-2px);
        }
        
        .analysis-options {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 15px;
            margin: 15px 0;
        }
        
        .analysis-option {
            background: white;
            padding: 15px;
            border-radius: 10px;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
            position: relative;
        }
        
        .analysis-option h3 {
            color: var(--secondary);
            margin-bottom: 12px;
            font-size: 1rem;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .info-icon {
            font-size: 16px;
            color: var(--accent);
            cursor: pointer;
            transition: all 0.3s ease;
            min-width: 24px;
            min-height: 24px;
        }
        
        .info-icon:hover {
            color: var(--primary);
            transform: scale(1.2);
        }
        
        .analysis-option select {
            width: 100%;
            padding: 10px;
            border: 2px solid var(--gray-200);
            border-radius: 8px;
            margin-bottom: 12px;
            font-size: 14px;
        }
        
        .analysis-option select:focus {
            border-color: var(--primary);
            outline: none;
        }
        
        .diagnosis-result {
            background: white;
            border-radius: 12px;
            padding: 20px;
            margin-top: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        
        .diagnosis-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .diagnosis-title {
            font-size: 1.2rem;
            color: var(--secondary);
            font-weight: 700;
        }
        
        .health-status {
            padding: 6px 12px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 12px;
        }
        
        .status-good {
            background: var(--green-100);
            color: var(--green-800);
        }
        
        .status-warning {
            background: var(--yellow-50);
            color: var(--yellow-800);
        }
        
        .status-bad {
            background: var(--red-100);
            color: var(--red-800);
        }
        
        .diagnosis-content {
            line-height: 1.6;
            color: var(--gray-700);
            font-size: 14px;
        }
        
        .diagnosis-content h4 {
            color: var(--primary);
            margin: 12px 0 6px 0;
            font-weight: 600;
            font-size: 15px;
        }
        
        .diagnosis-content p {
            margin-bottom: 8px;
        }
        
        .tools-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
            margin: 15px 0;
        }
        
        .tool-item {
            background: white;
            padding: 15px;
            border-radius: 10px;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            min-height: 80px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        
        .tool-item:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }
        
        .tool-item.active {
            background: var(--primary);
            color: white;
        }
        
        .tool-icon {
            font-size: 1.5rem;
            margin-bottom: 8px;
            color: var(--primary);
        }
        
        .tool-item.active .tool-icon {
            color: white;
        }
        
        .tool-name {
            font-weight: 600;
            font-size: 13px;
        }
        
        .tool-status {
            background: var(--blue-50);
            border: 2px solid var(--blue-100);
            border-radius: 10px;
            padding: 15px;
            margin: 15px 0;
            display: none;
        }
        
        .tool-status.active {
            display: block;
        }
        
        .tool-status h3 {
            color: var(--blue-700);
            margin-bottom: 8px;
            font-size: 1.1rem;
        }
        
        .tool-status p {
            color: var(--blue-600);
            font-size: 13px;
        }
        
        .iris-reference {
            background: white;
            border-radius: 10px;
            padding: 15px;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
            margin-top: 15px;
        }
        
        .iris-reference h3 {
            color: var(--secondary);
            margin-bottom: 12px;
            font-size: 1.1rem;
            text-align: center;
        }
        
        .iris-reference ul {
            list-style: none;
            padding: 0;
        }
        
        .iris-reference li {
            padding: 4px 0;
            font-size: 13px;
            color: var(--gray-600);
        }
        
        .iris-reference li strong {
            color: var(--primary);
        }
        
        .note-box {
            background: var(--yellow-50);
            border: 2px solid var(--yellow-200);
            border-radius: 8px;
            padding: 12px;
            margin-top: 12px;
        }
        
        .note-box p {
            font-size: 12px;
            color: var(--yellow-800);
            margin: 0;
        }
        
        footer {
            text-align: center;
            padding: 20px;
            background: var(--gray-800);
            color: white;
        }
        
        footer p {
            margin-bottom: 6px;
            font-size: 14px;
        }
        
        footer p:last-child {
            font-size: 12px;
            opacity: 0.8;
        }
        
        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 15px;
        }
        
        .modal.active {
            display: flex;
        }
        
        .modal-content {
            background: white;
            padding: 25px;
            border-radius: 12px;
            width: 100%;
            max-width: 500px;
            text-align: center;
            max-height: 90vh;
            overflow-y: auto;
        }
        
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            position: relative;
        }
        
        .modal-title {
            font-size: 1.3rem;
            color: var(--gray-800);
            font-weight: 700;
            text-align: center;
            width: 100%;
        }
        
        .close-btn {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--gray-600);
            padding: 5px;
            border-radius: 5px;
            transition: all 0.3s ease;
            position: absolute;
            top: -10px;
            right: -10px;
            min-width: 44px;
            min-height: 44px;
        }
        
        .close-btn:hover {
            background: var(--gray-200);
        }
        
        #camera-video {
            width: 100%;
            max-width: 400px;
            background: #333;
            border-radius: 8px;
            margin: 15px 0;
        }
        
        .error-message {
            color: var(--danger);
            margin: 15px 0;
            font-weight: 600;
        }
        
        /* Iris Map Styles */
        .iris-map {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 5;
        }
        
        .iris-map.active {
            pointer-events: auto;
        }
        
        .iris-zone {
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .iris-zone:hover {
            fill: rgba(20, 184, 166, 0.6) !important;
        }
        
        .zone-tooltip {
            position: absolute;
            background: white;
            border: 2px solid var(--gray-300);
            border-radius: 8px;
            padding: 10px;
            max-width: 200px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            z-index: 100;
            pointer-events: none;
            transform: translate(-50%, -100%);
            margin-top: -8px;
            font-size: 12px;
        }
        
        .zone-tooltip h4 {
            color: var(--blue-700);
            margin-bottom: 4px;
            font-weight: 600;
            font-size: 13px;
        }
        
        .zone-tooltip p {
            font-size: 11px;
            color: var(--gray-600);
            margin: 0;
        }
        
        .zone-modal {
            background: white;
            border-radius: 12px;
            max-width: 400px;
            width: 90%;
            padding: 20px;
            position: relative;
        }
        
        .zone-modal h3 {
            color: var(--blue-700);
            margin-bottom: 15px;
            font-size: 1.2rem;
            text-align: center;
        }
        
        .zone-detail {
            margin-bottom: 12px;
        }
        
        .zone-detail h4 {
            color: var(--gray-700);
            margin-bottom: 4px;
            font-weight: 600;
            font-size: 14px;
        }
        
        .zone-detail p {
            color: var(--gray-600);
            font-size: 13px;
        }
        
        .zone-detail ul {
            color: var(--gray-600);
            font-size: 13px;
            margin-left: 18px;
        }
        
        .zone-detail li {
            margin-bottom: 3px;
        }
        
        .annotation {
            position: absolute;
            width: 12px;
            height: 12px;
            background: var(--red-500);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            cursor: pointer;
            z-index: 10;
        }
        
        .annotation:hover {
            background: #dc2626;
            transform: translate(-50%, -50%) scale(1.2);
        }
        
        /* Responsive Design */
        @media (max-width: 768px) {
            .main-content {
                flex-direction: column;
            }
            
            .section {
                padding: 15px;
            }
            
            .eye-container {
                flex-direction: column;
            }
            
            .eye-box {
                min-width: auto;
                width: 100%;
            }
            
            .image-preview-container {
                height: 220px;
            }
            
            .btn-group {
                flex-direction: column;
                width: 100%;
            }
            
            .btn {
                width: 100%;
                justify-content: center;
            }
            
            .tools-grid {
                grid-template-columns: 1fr;
            }
            
            header h1 {
                font-size: 1.8rem;
            }
            
            .analysis-options {
                grid-template-columns: 1fr;
            }
            
            .patient-info input {
                width: 100%;
            }
        }
        
        @media (max-width: 480px) {
            .container {
                border-radius: 10px;
            }
            
            header {
                padding: 15px 10px;
            }
            
            header h1 {
                font-size: 1.6rem;
            }
            
            header p {
                font-size: 1rem;
            }
            
            .section-title {
                font-size: 1.3rem;
            }
            
            .image-preview-container {
                height: 200px;
            }
            
            .modal-content {
                padding: 20px 15px;
            }
            
            .modal-title {
                font-size: 1.2rem;
            }
        }
        
        .hidden {
            display: none !important;
        }
        
        input[type="file"] {
            display: none;
        }
        
        /* Novos estilos para as melhorias */
        .analyze-btn-container {
            text-align: center;
            margin: 15px 0;
        }
        
        .measure-line {
            position: absolute;
            background: var(--red-500);
            height: 2px;
            transform-origin: 0 0;
            z-index: 10;
        }
        
        .measure-point {
            position: absolute;
            width: 8px;
            height: 8px;
            background: var(--red-500);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            z-index: 11;
        }
        
        .measure-label {
            position: absolute;
            background: white;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 11px;
            color: var(--red-800);
            border: 1px solid var(--red-300);
            transform: translate(-50%, -100%);
            z-index: 12;
        }
        
        .annotation-marker {
            position: absolute;
            width: 16px;
            height: 16px;
            background: var(--red-500);
            border-radius: 50%;
            cursor: pointer;
            transform: translate(-50%, -50%);
            z-index: 15;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 10px;
        }
        
        .annotation-marker:hover {
            transform: translate(-50%, -50%) scale(1.2);
        }
        
        .annotation-note {
            position: absolute;
            background: white;
            border: 1px solid var(--gray-300);
            border-radius: 8px;
            padding: 8px;
            max-width: 180px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            z-index: 20;
            display: none;
            font-size: 12px;
        }
        
        .annotation-note.active {
            display: block;
        }
        
        .annotation-note textarea {
            width: 100%;
            min-height: 50px;
            border: 1px solid var(--gray-300);
            border-radius: 4px;
            padding: 6px;
            font-size: 11px;
            resize: vertical;
            margin-bottom: 6px;
        }
        
        .annotation-actions {
            display: flex;
            justify-content: space-between;
        }
        
        .annotation-actions button {
            padding: 4px 8px;
            font-size: 11px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            min-width: 44px;
            min-height: 30px;
        }
        
        .annotation-actions .save-btn {
            background: var(--success);
            color: white;
        }
        
        .annotation-actions .delete-btn {
            background: var(--danger);
            color: white;
        }
        
        .instruction-item {
            margin-bottom: 12px;
            padding: 12px;
            background: var(--gray-50);
            border-radius: 8px;
            border-left: 4px solid var(--primary);
        }
        
        .instruction-item h4 {
            color: var(--primary);
            margin-bottom: 6px;
            font-size: 14px;
        }
        
        .instruction-item p {
            color: var(--gray-700);
            font-size: 13px;
        }
        
        .instruction-item ul {
            margin-left: 18px;
            color: var(--gray-700);
            font-size: 13px;
        }
        
        .instruction-item li {
            margin-bottom: 4px;
        }
        
        .draggable {
            cursor: grab;
            touch-action: none;
        }
        
        .draggable:active {
            cursor: grabbing;
        }
        
        /* Novos estilos para gestos em mobile */
        .touch-actions {
            display: flex;
            justify-content: space-around;
            margin: 10px 0;
            padding: 10px;
            background: var(--gray-100);
            border-radius: 8px;
        }
        
        .touch-action-item {
            text-align: center;
            font-size: 12px;
            color: var(--gray-700);
        }
        
        .touch-action-icon {
            font-size: 20px;
            margin-bottom: 5px;
            color: var(--primary);
        }
        
        /* Indicador de toque para medições */
        .measure-instruction {
            position: absolute;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 12px;
            z-index: 30;
            pointer-events: none;
            animation: fadeOut 2s forwards;
            animation-delay: 3s;
        }
        
        @keyframes fadeOut {
            from { opacity: 1; }
            to { opacity: 0; }
        }