:root {
    --bg-color: #f1f5f9; --panel-bg: #ffffff; --border: #e2e8f0;
    --text-main: #475569; --text-light: #0f172a; --accent: #2563eb;
    --danger: #ef4444; --success: #10b981;
}

body { 
    font-family: 'Segoe UI', sans-serif; margin: 0; background: var(--bg-color); 
    height: 100vh; display: flex; flex-direction: column; overflow: hidden; 
    -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
}

.navbar { background: #1e293b; border-bottom: 3px solid var(--accent); padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; color: white; }
.logo { font-weight: 800; letter-spacing: 1px; }
.highlight { color: #60a5fa; }
.modern-select { padding: 6px; border-radius: 4px; outline: none; }
.main-container { display: flex; flex: 1; overflow: hidden; }
.controls { width: 320px; background: var(--panel-bg); border-right: 1px solid var(--border); padding: 20px; overflow-y: auto; flex-shrink: 0; }
.btn-action-main { width: 100%; padding: 14px; background: var(--accent); color: white; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.separator { border-top: 1px solid var(--border); margin: 15px 0; }
.section-title { font-size: 1rem; color: var(--text-light); text-transform: uppercase; font-weight: 700; margin-bottom: 15px; }
.input-grid { display: flex; flex-direction: column; gap: 10px; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }
.input-group input { width: 100%; padding: 8px; border: 1px solid #cbd5e1; border-radius: 4px; box-sizing: border-box; -webkit-user-select: auto; user-select: auto;}
.input-group input.has-error { border-color: var(--danger); background: #fef2f2; }
.error-msg { color: var(--danger); font-size: 0.75rem; margin-top: 2px; }

input[type=number].no-spin::-webkit-inner-spin-button, input[type=number].no-spin::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number].no-spin { -moz-appearance: textfield; }

.display-area { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--panel-bg); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
#viewer-container { position: relative; height: 400px; background: #cbd5e1; border-radius: 6px; overflow: hidden; width: 100%; }
#viewer-3d { width: 100%; height: 100%; }

.centered-action { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: 20px; }
.btn-primary-large { background: #334155; color: white; padding: 16px 40px; font-size: 1.2rem; font-weight: bold; border: none; border-radius: 8px; cursor: pointer; min-width: 300px; }
.btn-primary-large:disabled { background: #cbd5e1; cursor: not-allowed; }
.download-controls { display: flex; gap: 10px; background: #f1f5f9; padding: 10px; border-radius: 8px; border: 1px dashed #cbd5e1; }
.btn-success-large { background: var(--success); color: white; padding: 12px 30px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; }

.info-card { background: #f8fafc; border-left: 4px solid var(--accent); padding: 12px 20px !important; margin-bottom: 0px; }
.info-row { display: flex; justify-content: space-between; align-items: center; width: 100%; flex-wrap: wrap; gap: 8px; }
.iso-badge { background: var(--accent); color: white; padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; font-weight: 800; }
.footer-line { border-top: 1px solid #e2e8f0; padding-top: 8px; margin-top: 8px; }
.disclaimer-mini { font-size: 0.7rem; color: #94a3b8; font-style: italic; }

#results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.res-item { background: #f8fafc; padding: 12px; border-radius: 6px; border: 1px solid var(--border); }
.highlight-text { color: var(--accent); font-weight: bold; float: right; font-size: 1.05rem; text-align: right; line-height: 1.2; }
.highlight-error { color: var(--danger) !important; font-size: 0.95rem; font-weight: normal; }

.stats-bar {
    background: #1e293b; color: #cbd5e1; display: flex; justify-content: center;
    gap: 30px; padding: 12px; font-size: 0.9rem; border-top: 3px solid var(--accent);
    flex-wrap: wrap; z-index: 100;
}
.stat-box { display: flex; align-items: center; gap: 8px; }
.stat-box strong { color: white; font-size: 1.1rem; }

.hidden { display: none !important; }
#ad-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15,23,42,0.9); z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; color: white; }
.spinner { width: 50px; height: 50px; border: 4px solid rgba(255,255,255,0.1); border-left-color: #60a5fa; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 850px) {
    body { height: auto; overflow-y: auto; }
    .main-container { flex-direction: column; height: auto; overflow: visible; }
    .controls { width: 100%; border-right: none; border-bottom: 2px solid var(--border); height: auto; overflow: visible; padding-bottom: 30px; }
    .display-area { padding: 15px; height: auto; }
    #results-grid { grid-template-columns: 1fr; }
}