* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow: hidden;
    height: 100%;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    html, body {
        overflow: auto;
        overflow-x: hidden;
    }
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0a0a14;
}

::-webkit-scrollbar-thumb {
    background: #1e1e35;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00b4d8;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 180, 216, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 180, 216, 0.6); }
}

@keyframes spin-gantry {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes scan-progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes slide-line {
    0% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

.gantry-spin {
    animation: spin-gantry 1s linear infinite;
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.pulse-dot {
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.panel-card {
    background: #12121f;
    border: 1px solid #1e1e35;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #00b4d8, #0077b6);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.scan-btn-ready {
    background: radial-gradient(circle, #4ade80, #16a34a);
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.4);
    animation: pulse-glow 2s ease-in-out infinite;
}

.scan-btn-scanning {
    background: radial-gradient(circle, #f59e0b, #d97706);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

.slider-ct {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #1e1e35;
    border-radius: 3px;
    outline: none;
    width: 100%;
}

.slider-ct::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #00b4d8;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 180, 216, 0.5);
}

.slider-ct::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #00b4d8;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(0, 180, 216, 0.5);
}

@media (min-width: 769px) {
    .slider-ct {
        height: 4px;
    }
    .slider-ct::-webkit-slider-thumb {
        width: 14px;
        height: 14px;
    }
    .slider-ct::-moz-range-thumb {
        width: 14px;
        height: 14px;
    }
}

.tooltip-wrap {
    position: relative;
}

.tooltip-wrap:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

.tooltip-text {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    border: 1px solid #00b4d8;
    color: #e2e8f0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 1000;
    pointer-events: none;
}

select, input[type="number"] {
    background: #0a0a14;
    border: 1px solid #1e1e35;
    color: #e2e8f0;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    min-height: 36px;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 769px) {
    select, input[type="number"] {
        padding: 4px 8px;
        font-size: 12px;
        min-height: unset;
        border-radius: 4px;
    }
}

select:focus, input:focus {
    outline: none;
    border-color: #00b4d8;
    box-shadow: 0 0 6px rgba(0, 180, 216, 0.2);
}

.ct-image-canvas {
    image-rendering: auto;
}

.ct-real-image-badge {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 180, 216, 0.8);
    color: white;
    font-size: 8px;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    pointer-events: none;
    z-index: 10;
}

@keyframes ct-loading-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.ct-loading-indicator {
    animation: ct-loading-pulse 1.5s ease-in-out infinite;
}

.ct-image-info-banner {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.1), rgba(74, 222, 128, 0.05));
    border: 1px solid rgba(0, 180, 216, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 10px;
    color: #64748b;
}

.ct-image-info-banner strong {
    color: #00b4d8;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Case study panel specific */
.case-annotation-marker {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.5);
    pointer-events: none;
    animation: pulse-dot 2s ease-in-out infinite;
}

.case-annotation-marker.abnormal {
    background: #ef4444;
    border-color: rgba(239, 68, 68, 0.5);
}

.case-detail-panel {
    scrollbar-width: thin;
    scrollbar-color: #1e1e35 #0a0a14;
}

@keyframes reveal-structure {
    from { opacity: 0; transform: translateX(-5px); }
    to { opacity: 1; transform: translateX(0); }
}

.structure-revealed {
    animation: reveal-structure 0.3s ease-out forwards;
}

.tab-active {
    border-bottom: 2px solid #00b4d8;
    color: #00b4d8;
}

.achievement-badge {
    background: linear-gradient(135deg, #1e1e35, #0a0a14);
    border: 1px solid #f59e0b;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dose-bar {
    height: 8px;
    border-radius: 4px;
    background: #1e1e35;
    overflow: hidden;
}

.dose-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Mobile navigation */
.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    border-radius: 8px;
    font-size: 10px;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s;
    min-width: 56px;
}

.mobile-nav-btn.active {
    color: #00b4d8;
    background: rgba(0, 180, 216, 0.1);
}

.mobile-nav-btn .nav-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

/* Touch-friendly checkbox */
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #4ade80;
}

@media (min-width: 769px) {
    input[type="checkbox"] {
        width: 14px;
        height: 14px;
    }
}

/* Prevent zoom on input focus on iOS */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}