* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0d1117; color: #c9d1d9; }
a { color: #58a6ff; text-decoration: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; }

/* App layout */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 220px; background: #161b22; border-right: 1px solid #30363d; display: flex; flex-direction: column; transition: width 0.2s; flex-shrink: 0; overflow: hidden; }
.sidebar.collapsed { width: 48px; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #30363d; min-height: 48px; }
.logo { font-size: 16px; font-weight: 700; color: #f0f6fc; white-space: nowrap; }
.sidebar.collapsed .logo { display: none; }
.sidebar-toggle { background: none; border: none; color: #8b949e; font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.sidebar-toggle:hover { background: #30363d; color: #f0f6fc; }
.sidebar-nav { flex: 1; padding: 8px 0; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 8px 14px; color: #8b949e; font-size: 14px; border-radius: 6px; margin: 2px 6px; }
.sidebar-link:hover { background: #21262d; color: #c9d1d9; }
.sidebar-link.active { background: #1f6feb22; color: #58a6ff; }
.sidebar-sub { padding-left: 28px; font-size: 13px; }
.sidebar.collapsed .sidebar-sub { padding-left: 14px; }
.sidebar-icon { width: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-icon svg { display: block; }
.sidebar-text { white-space: nowrap; overflow: hidden; }
.sidebar.collapsed .sidebar-text { display: none; }
.sidebar-footer { padding: 8px 0; border-top: 1px solid #30363d; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
.sidebar.collapsed .sidebar-user .avatar { margin: 0 auto; }
.logout { color: #8b949e; }
.logout:hover { color: #f85149; }

/* Main content */
.main-content { flex: 1; padding: 24px; overflow-y: auto; }

.btn { padding: 8px 16px; border: 1px solid #30363d; border-radius: 6px; background: #21262d; color: #c9d1d9; cursor: pointer; font-size: 14px; }
.btn:hover { background: #30363d; }
.btn-primary { background: #238636; border-color: #238636; color: #fff; }
.btn-primary:hover { background: #2ea043; }
.btn-auto { background: #8957e5; border-color: #8957e5; color: #fff; }
.btn-auto:hover { background: #7048c2; }
.btn-success { background: #1f6feb; border-color: #1f6feb; color: #fff; font-size: 16px; padding: 12px 24px; }
.btn-sm { padding: 4px 12px; font-size: 12px; }

.page-header { margin-bottom: 24px; }
h1 { font-size: 24px; color: #f0f6fc; display: flex; align-items: center; gap: 16px; }
h1 .btn { font-size: 14px; }
h2 { font-size: 18px; color: #f0f6fc; margin: 24px 0 12px; }

.create-form { display: flex; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
.create-form .field-error { width: 100%; }
.input { padding: 8px 12px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: 14px; flex: 1; }

.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card { position: relative; padding: 16px; padding-right: 36px; background: #161b22; border: 1px solid #30363d; border-radius: 8px; }
.project-card:hover { border-color: #58a6ff; }
.project-link { display: block; color: inherit; }
.btn-delete { position: absolute; top: 10px; right: 10px; background: none; border: none; color: #484f58; font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 4px; line-height: 1; z-index: 2; }
.btn-delete:hover { background: #f8514922; color: #f85149; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(2px); }
.modal { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 24px; max-width: 400px; width: 90%; box-shadow: 0 16px 48px rgba(0,0,0,0.5); }
.modal h3 { color: #f0f6fc; margin-bottom: 8px; }
.modal-text { color: #8b949e; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }
.btn-danger { background: #da3633; border-color: #da3633; color: #fff; }
.confirm-params { margin: 16px 0; }
.confirm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.confirm-table td { padding: 6px 8px; border-bottom: 1px solid #21262d; }
.confirm-label { color: #8b949e; width: 45%; }
.confirm-value { color: #f0f6fc; font-weight: 500; }
.confirm-table .calc-row td { color: #58a6ff; font-style: italic; }
.confirm-computed h4 { color: #58a6ff; font-size: 13px; margin: 16px 0 8px; }
.btn-danger:hover { background: #f85149; }
.modal-wide { max-width: 600px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-header h3 { margin: 0; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-label { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #c9d1d9; padding: 4px 8px; background: #21262d; border-radius: 4px; cursor: pointer; }
.checkbox-label:hover { background: #30363d; }
.checkbox-label input { margin: 0; }
.auto-info { padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.auto-info.success { background: #23863622; border: 1px solid #238636; color: #3fb950; }
.auto-info.error { background: #f8514922; border: 1px solid #f85149; color: #f85149; }
.auto-params { margin: 12px 0; }
.auto-params-grid { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: #8b949e; }
.auto-params-grid strong { color: #f0f6fc; }

/* Search airfoiltools */
.search-row { display: flex; gap: 8px; align-items: center; }
.search-row .input { flex: 1; }
.search-status { font-size: 12px; color: #8b949e; white-space: nowrap; }
.search-results { max-height: 200px; overflow-y: auto; border: 1px solid #30363d; border-radius: 6px; margin-top: 8px; }
.search-results:empty { display: none; }
.search-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #21262d; font-size: 13px; }
.search-item:hover { background: #1f6feb22; }
.search-item strong { color: #f0f6fc; }
.search-code { color: #8b949e; font-size: 11px; margin-left: 8px; }
.search-empty { padding: 12px; text-align: center; color: #8b949e; font-size: 13px; }
.search-selected { padding: 8px 12px; background: #23863622; border: 1px solid #238636; border-radius: 6px; color: #3fb950; font-size: 13px; }
.form-divider { text-align: center; margin: 16px 0; color: #484f58; font-size: 13px; position: relative; }
.form-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid #30363d; }
.form-divider span { background: #161b22; padding: 0 12px; position: relative; }
.project-card h3 { color: #f0f6fc; margin-bottom: 8px; }
.project-meta { display: flex; gap: 12px; font-size: 13px; color: #8b949e; margin-bottom: 12px; }
.phase-badge { background: #1f6feb; color: #fff; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.scheme-badge { background: #8957e522; color: #d2a8ff; padding: 2px 8px; border-radius: 12px; font-size: 11px; border: 1px solid #8957e544; }
.phase-progress { display: flex; gap: 6px; }
.phase-dot { width: 20px; height: 6px; border-radius: 3px; background: #30363d; }
.phase-dot.done { background: #238636; }
.phase-dot.current { background: #1f6feb; }

.empty-state { color: #8b949e; font-style: italic; text-align: center; padding: 48px; }

/* Phase layout */
.phase-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; min-height: calc(100vh - 80px); }
.phase-sidebar { background: #161b22; border-radius: 8px; padding: 16px; height: fit-content; position: sticky; top: 80px; }
.phase-sidebar h3 { font-size: 14px; color: #f0f6fc; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #30363d; }
.phase-link { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px; color: #8b949e; font-size: 14px; margin-bottom: 4px; }
.phase-link:hover { background: #21262d; color: #c9d1d9; }
.phase-link.active { background: #1f6feb22; color: #58a6ff; border: 1px solid #1f6feb44; }
.phase-link.completed { color: #3fb950; }
.phase-link.locked { opacity: 0.4; pointer-events: none; }
.phase-num { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #30363d; font-size: 12px; font-weight: 700; }
.phase-link.active .phase-num { background: #1f6feb; color: #fff; }
.phase-link.completed .phase-num { background: #238636; color: #fff; }

.phase-content { max-width: 1100px; flex: 1; }
.phase-desc { color: #8b949e; margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #c9d1d9; margin-bottom: 4px; }
.tooltip-btn { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #30363d; color: #8b949e; font-size: 11px; font-weight: 700; cursor: help; position: relative; flex-shrink: 0; border: 1px solid #484f58; }
.tooltip-btn:hover { background: #484f58; color: #f0f6fc; }
.tooltip-popup { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); background: #1c2128; border: 1px solid #30363d; border-radius: 8px; padding: 10px 14px; font-size: 13px; font-weight: 400; color: #c9d1d9; width: 300px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,0.4); line-height: 1.5; pointer-events: none; }
.tooltip-popup::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #30363d; }
.required { color: #f85149; }
.form-group input, .form-group select { width: 100%; padding: 8px 12px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: 14px; }
.form-group input:focus, .form-group select:focus { border-color: #58a6ff; outline: none; }

/* Валидация в стиле темы */
input:invalid, select:invalid { border-color: #30363d; }
input:invalid:focus, select:invalid:focus { border-color: #f85149; }
input:required:invalid::placeholder { color: #484f58; }

.input-error { border-color: #f85149 !important; box-shadow: 0 0 0 1px #f85149; }
.field-error { color: #f85149; font-size: 12px; margin-top: 4px; display: block; }
.form-section { color: #58a6ff; font-size: 15px; margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 1px solid #30363d; }
.form-section:first-of-type { margin-top: 8px; }
/* Aero interactive panel */
.aero-interactive { margin-bottom: 24px; }
.aero-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.slider-group { background: #161b22; border: 1px solid #30363d; border-radius: 6px; padding: 10px 14px; }
.slider-group label { display: block; font-size: 13px; color: #8b949e; margin-bottom: 6px; }
.slider-group strong { color: #f0f6fc; font-size: 15px; }
.slider-group input[type="range"] { width: 100%; accent-color: #58a6ff; height: 6px; cursor: pointer; transition: opacity 0.2s; }
.slider-group input[type="range"].out-of-range { accent-color: #d29922; }
#expert-mode:checked ~ .aero-sliders .slider-group input[type="range"] { accent-color: #d29922; }
.aero-calc-table { width: 100%; border-collapse: collapse; background: #161b22; border: 1px solid #30363d; border-radius: 6px; overflow: hidden; }
.aero-calc-table td { padding: 8px 14px; border-bottom: 1px solid #21262d; font-size: 14px; }
.aero-calc-table td:first-child { color: #8b949e; width: 45%; }
.aero-calc-table td:last-child { color: #f0f6fc; font-weight: 500; text-align: right; }

.airfoil-preview { margin-top: 16px; padding: 12px; background: #0d1117; border: 1px solid #21262d; border-radius: 6px; }
.airfoil-svg { width: 100%; height: auto; display: block; }
.form-with-preview { display: flex; gap: 24px; }
.form-with-preview form { flex: 1; min-width: 0; }
.scheme-preview { width: 300px; flex-shrink: 0; position: sticky; top: 24px; height: fit-content; }
.preview-card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 16px; }
.preview-card h3 { color: #f0f6fc; font-size: 16px; margin-bottom: 8px; }
.preview-card h4 { color: #8b949e; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin: 16px 0 8px; }
.preview-desc { color: #8b949e; font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.preview-features { list-style: none; padding: 0; margin: 0 0 8px; }
.preview-features li { font-size: 13px; color: #c9d1d9; padding: 3px 0; border-bottom: 1px solid #21262d; }
.preview-params { margin-top: 12px; border-top: 1px solid #30363d; padding-top: 8px; }
.preview-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.preview-table td { padding: 4px 0; }
.preview-table td:first-child { color: #8b949e; padding-right: 8px; }
.preview-table td:last-child { color: #f0f6fc; text-align: right; font-weight: 500; }
.preview-table .calc-row td { color: #58a6ff; font-style: italic; }
.preview-table .calc-row td:first-child { color: #58a6ff; }
.preview-warnings { margin-top: 12px; border-top: 1px solid #30363d; padding-top: 8px; }
.preview-warnings h4 { color: #d29922; }
.preview-warning { font-size: 12px; color: #d29922; padding: 4px 0; border-bottom: 1px solid #21262d; line-height: 1.4; }
@media (max-width: 900px) {
    .form-with-preview { flex-direction: column; }
    .scheme-preview { width: 100%; position: static; }
}
.form-group input[type="checkbox"] { width: auto; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.alert-error { background: #f8514922; border: 1px solid #f85149; color: #f85149; }
.alert-error ul { margin-top: 8px; padding-left: 20px; }

.analysis-result { margin-top: 32px; padding: 24px; background: #161b22; border: 1px solid #30363d; border-radius: 8px; }
.analysis-result h2 { margin-top: 0; }
.markdown-content { line-height: 1.6; }
.markdown-content h1, .markdown-content h2, .markdown-content h3 { color: #f0f6fc; margin: 16px 0 8px; }
.markdown-content h1 { font-size: 20px; }
.markdown-content h2 { font-size: 17px; }
.markdown-content h3 { font-size: 15px; }
.markdown-content p { margin: 8px 0; }
.markdown-content ul, .markdown-content ol { margin: 8px 0; padding-left: 24px; }
.markdown-content li { margin: 4px 0; }
.markdown-content strong { color: #f0f6fc; }
.markdown-content code { background: #21262d; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.markdown-content pre { background: #0d1117; border: 1px solid #30363d; border-radius: 6px; padding: 12px; overflow-x: auto; margin: 12px 0; }
.markdown-content pre code { background: none; padding: 0; }
.markdown-content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.markdown-content th { text-align: left; color: #f0f6fc; font-weight: 600; padding: 8px; border-bottom: 2px solid #30363d; background: #161b22; }
.markdown-content td { padding: 6px 8px; border-bottom: 1px solid #21262d; }
.markdown-content tr:hover td { background: #161b2288; }
.markdown-content blockquote { border-left: 3px solid #58a6ff; padding: 4px 12px; margin: 12px 0; color: #8b949e; background: #161b2244; }
.action-buttons { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.btn-secondary { background: #30363d; border-color: #484f58; }
.btn-secondary:hover { background: #484f58; }
.btn-warning { background: #9e6a03; border-color: #9e6a03; color: #fff; }
.btn-warning:hover { background: #bb8009; }
.variant-buttons { display: flex; gap: 8px; align-items: center; }
.variant-label { color: #8b949e; font-size: 13px; }
.settings-card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 24px; margin-bottom: 16px; width: 100%; }
.settings-card h2 { margin-top: 0; }
.settings-card .desc { color: #8b949e; margin-bottom: 16px; }
.settings-form { display: flex; flex-direction: column; gap: 16px; }
.hint { font-size: 12px; color: #8b949e; margin-top: 4px; display: block; }
.account-info { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avatar-lg { width: 48px; height: 48px; border-radius: 50%; }
.email { color: #8b949e; }

/* Drive browser */
.drive-browser { background: #0d1117; border: 1px solid #30363d; border-radius: 8px; margin-bottom: 16px; }
.browser-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #30363d; }
.browser-path { flex: 1; font-size: 13px; color: #8b949e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-folder-row { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #30363d; align-items: center; }
.input-sm { padding: 4px 8px; font-size: 13px; }
.folder-list { max-height: 300px; overflow-y: auto; }
.folder-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #21262d; cursor: default; }
.folder-item:hover { background: #161b22; }
.folder-item.selected { background: #1f6feb22; border-left: 3px solid #1f6feb; }
.folder-icon { font-size: 18px; }
.folder-name { flex: 1; cursor: pointer; color: #58a6ff; }
.folder-name:hover { text-decoration: underline; }
.folder-empty, .folder-error { padding: 24px; text-align: center; color: #8b949e; }
.folder-error { color: #f85149; }
.loading { padding: 24px; text-align: center; color: #8b949e; }
.selected-folder { padding: 8px 12px; background: #161b22; border: 1px solid #30363d; border-radius: 6px; color: #58a6ff; font-size: 14px; }
.alert-success { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; background: #23863622; border: 1px solid #238636; color: #3fb950; }
.alert-info { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; background: #1f6feb22; border: 1px solid #1f6feb; color: #58a6ff; }

/* Polar table */
.polar-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.polar-table th { text-align: left; color: #8b949e; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #30363d; }
.polar-table td { padding: 6px 8px; border-bottom: 1px solid #21262d; }
.polar-table tr:hover td { background: #161b2288; }
.btn-delete-sm { background: none; border: none; color: #484f58; cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 4px; }
.btn-delete-sm:hover { background: #f8514922; color: #f85149; }
.btn-toggle { background: none; border: none; cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 4px; color: #3fb950; }
.btn-toggle:hover { background: #21262d; }
.action-cell { white-space: nowrap; }
.btn-icon { display: inline-block; padding: 2px 5px; border-radius: 4px; font-size: 11px; color: #8b949e; background: none; border: none; cursor: pointer; text-decoration: none; }
.btn-icon:hover { background: #21262d; color: #58a6ff; }

/* Sidebar divider */
.sidebar-divider { height: 1px; background: #30363d; margin: 8px 14px; }

/* About */
.about-version { color: #8b949e; font-size: 13px; margin-bottom: 16px; }
.about-section { margin-bottom: 20px; }
.about-section h3 { color: #f0f6fc; font-size: 15px; margin-bottom: 8px; }
.about-section p { color: #c9d1d9; line-height: 1.6; margin: 4px 0; }
.about-section ul { padding-left: 20px; }
.about-section li { margin: 4px 0; }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tech-item { background: #0d1117; border: 1px solid #21262d; border-radius: 6px; padding: 10px; }
.tech-item strong { display: block; color: #8b949e; font-size: 11px; text-transform: uppercase; margin-bottom: 2px; }
.tech-item span { color: #f0f6fc; font-size: 14px; }
.author-avatar { width: 80px; height: 80px; border-radius: 50%; border: 2px solid #30363d; }
.author-card { display: flex; align-items: center; gap: 16px; }
.author-info h3 { color: #f0f6fc; margin-bottom: 4px; }
.author-info p { color: #8b949e; margin-bottom: 8px; }
.author-links { display: flex; gap: 12px; }
.author-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: #21262d; border-radius: 6px; color: #f0f6fc; font-size: 14px; }
.author-link:hover { background: #30363d; }
.link-icon { color: #f85149; }

/* Empty state large */
.empty-state-large { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.empty-state-large h3 { color: #f0f6fc; margin-bottom: 8px; }
.empty-state-large p { color: #8b949e; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.add-airfoil-form { display: flex; flex-direction: column; gap: 12px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filter-input { flex: 1; min-width: 150px; }
.filter-count { font-size: 12px; color: #8b949e; white-space: nowrap; }
.scrollable-table { max-height: 500px; overflow-y: auto; border: 1px solid #21262d; border-radius: 6px; margin: 12px 0; }
.scrollable-table table { margin: 0; }
.scrollable-table thead th { position: sticky; top: 0; background: #0d1117; z-index: 1; }
.cat-badge { font-size: 11px; padding: 2px 6px; border-radius: 8px; }
.cat-general { background: #1f6feb33; color: #58a6ff; }
.cat-low_re { background: #23863633; color: #3fb950; }
.cat-high_lift { background: #9e6a0333; color: #d29922; }
.cat-symmetric { background: #484f5833; color: #8b949e; }
.cat-laminar { background: #a371f733; color: #bc8cff; }
.cat-reflex { background: #da363333; color: #f85149; }
.cat-acro { background: #f9731633; color: #f97316; }
.polar-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.import-form { display: inline; }
.btn.loading { opacity: 0.7; cursor: wait; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Aero 3D Viewer ─────────────────────────────────── */
.aero3d-wrapper { margin: 24px 0; border: 1px solid #30363d; border-radius: 8px; overflow: hidden; background: #0d1117; }
.aero3d-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid #21262d; background: #161b22; }
.aero3d-title { font-size: 13px; color: #8b949e; }
.aero3d-views { display: flex; gap: 4px; }
.aero3d-views .btn { padding: 4px 10px; font-size: 12px; }
.aero3d-container { display: flex; position: relative; }
.aero3d-canvas { flex: 1; height: 500px; min-height: 400px; cursor: grab; }
.aero3d-canvas:active { cursor: grabbing; }
.aero3d-info { width: 240px; padding: 12px; border-left: 1px solid #21262d; background: #161b22; overflow-y: auto; max-height: 500px; flex-shrink: 0; }
.aero3d-calc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.aero3d-calc-table td { padding: 4px 6px; }
.aero3d-calc-table td:first-child { color: #8b949e; }
.aero3d-calc-table .val { text-align: right; font-weight: 500; color: #f0f6fc; }
.aero3d-calc-table .val.ok { color: #3fb950; }
.aero3d-calc-table .val.warn { color: #d29922; }
.aero3d-calc-table .val.bad { color: #f85149; }
.aero3d-calc-table .section-header { color: #58a6ff; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 10px 6px 4px; border-bottom: 1px solid #21262d; font-weight: 600; }
.aero3d-hints { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.aero3d-hints span { font-size: 11px; padding: 4px 8px; border-radius: 4px; display: block; line-height: 1.4; }
.hint-ok { background: #23863622; color: #3fb950; border: 1px solid #23863644; }
.hint-warn { background: #9e6a0322; color: #d29922; border: 1px solid #9e6a0344; }
.hint-bad { background: #f8514922; color: #f85149; border: 1px solid #f8514944; }
.aero3d-legend { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid #21262d; background: #161b22; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #8b949e; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

@media (max-width: 900px) {
    .aero3d-container { flex-direction: column; }
    .aero3d-info { width: 100%; max-height: 200px; border-left: none; border-top: 1px solid #21262d; }
    .aero3d-canvas { height: 350px; min-height: 300px; }
}

/* ─── Designer (unified interactive) ──────────────── */
.designer-layout { display: flex; gap: 0; min-height: calc(100vh - 48px); }
.designer-left { width: 240px; background: #161b22; border-right: 1px solid #21262d; padding: 12px; overflow-y: auto; flex-shrink: 0; }
.designer-center { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.designer-right { width: 220px; background: #161b22; border-left: 1px solid #21262d; padding: 12px; overflow-y: auto; flex-shrink: 0; }
.panel-section { margin-bottom: 16px; }
.panel-section h3 { font-size: 12px; color: #58a6ff; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #21262d; }
.compact-field { margin-bottom: 6px; }
.compact-field label { display: block; font-size: 11px; color: #8b949e; margin-bottom: 2px; }
.compact-field input, .compact-field select { width: 100%; padding: 4px 8px; background: #0d1117; border: 1px solid #30363d; border-radius: 4px; color: #c9d1d9; font-size: 13px; box-sizing: border-box; }
.compact-field input:focus, .compact-field select:focus { border-color: #58a6ff; outline: none; }
.designer-sliders { display: flex; gap: 8px; padding: 8px 12px; background: #161b22; border-bottom: 1px solid #21262d; align-items: center; flex-wrap: wrap; }
.ds-group { flex: 1; min-width: 100px; }
.ds-group label { font-size: 11px; color: #8b949e; display: block; margin-bottom: 2px; }
.ds-group strong { color: #f0f6fc; }
.ds-group input[type="range"] { width: 100%; height: 4px; accent-color: #58a6ff; cursor: pointer; }
.designer-3d-wrap { flex: 1; position: relative; min-height: 350px; overflow: hidden; }
.designer-3d-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 4px 12px; background: #161b22; border-bottom: 1px solid #21262d; }
.designer-3d-canvas { width: 100%; height: 100%; overflow: hidden; }
.designer-calc-row { padding: 8px 12px; background: #161b22; border-top: 1px solid #21262d; }
.designer-calc-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.designer-calc-table td { padding: 2px 8px; }
.designer-calc-table td:nth-child(odd) { color: #8b949e; }
.designer-calc-table td:nth-child(even) { color: #f0f6fc; font-weight: 500; }
.designer-info-panel { font-size: 12px; }
.panel-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.panel-actions .btn { width: 100%; text-align: center; font-size: 13px; }
.validation-box { margin-top: 8px; }
.val-error { font-size: 11px; color: #f85149; padding: 3px 0; }
.val-warn { font-size: 11px; color: #d29922; padding: 3px 0; }
.val-ok { font-size: 11px; color: #3fb950; padding: 3px 0; }
.profile-mini-table { width: 100%; font-size: 11px; border-collapse: collapse; }
.profile-mini-table th { color: #8b949e; text-align: left; padding: 2px 4px; border-bottom: 1px solid #21262d; font-weight: 400; }
.profile-mini-table td { padding: 2px 4px; color: #c9d1d9; }

@media (max-width: 1100px) {
    .designer-layout { flex-direction: column; }
    .designer-left, .designer-right { width: 100%; flex-direction: row; flex-wrap: wrap; }
    .designer-3d-canvas { min-height: 300px; }
}

@media (max-width: 768px) {
    .phase-layout { grid-template-columns: 1fr; }
    .phase-sidebar { position: static; display: flex; overflow-x: auto; gap: 4px; }
    .phase-sidebar h3 { display: none; }
}

/* 3D legend */
.d3d-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 6px 10px; background: #0d1117cc; border-top: 1px solid #21262d; font-size: 11px; color: #8b949e; }
.d3d-legend span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.leg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.leg-circle { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.leg-diamond { display: inline-block; width: 8px; height: 8px; transform: rotate(45deg); border-radius: 1px; }
.leg-line { display: inline-block; width: 14px; height: 2px; border-radius: 1px; }

/* Scheme select (create modal) */
.scheme-select { display: flex; flex-direction: column; gap: 8px; }
.scheme-option { cursor: pointer; }
.scheme-option input { display: none; }
.scheme-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid #30363d; border-radius: 8px; transition: border-color 0.15s, background 0.15s; }
.scheme-option input:checked + .scheme-card { border-color: #58a6ff; background: #1f6feb15; }
.scheme-card:hover { border-color: #484f58; }
.scheme-card svg { flex-shrink: 0; color: #8b949e; }
.scheme-option input:checked + .scheme-card svg { color: #58a6ff; }
.scheme-card strong { font-size: 13px; color: #f0f6fc; white-space: nowrap; }
.scheme-card span { font-size: 11px; color: #8b949e; line-height: 1.3; }
.scheme-warning { font-size: 11px; color: #d29922; margin-top: 8px; padding: 6px 10px; background: #d2992211; border: 1px solid #d2992233; border-radius: 6px; }

/* Project detail */
.back-link { color: #8b949e; text-decoration: none; font-size: 20px; }
.back-link:hover { color: #f0f6fc; }
.project-info { background: #161b22; border: 1px solid #30363d; border-radius: 10px; padding: 20px 24px; margin-bottom: 28px; }
.info-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #21262d; }
.info-row:last-child { border-bottom: none; }
.info-label { color: #8b949e; font-size: 13px; }
.info-value { color: #c9d1d9; font-size: 13px; font-weight: 500; }
.info-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid #30363d; }
.info-section h3 { font-size: 14px; color: #8b949e; margin-bottom: 10px; font-weight: 500; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.info-cell { display: flex; flex-direction: column; gap: 2px; }

.action-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 32px; }
.action-card { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; background: #161b22; border: 1px solid #30363d; border-radius: 10px; color: inherit; text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.action-card:hover { border-color: #58a6ff; background: #1c2333; }
.action-primary { border-color: #238636; background: #23863611; grid-column: 1 / -1; }
.action-primary:hover { border-color: #3fb950; background: #23863622; }
.action-done { opacity: 0.7; }
.action-done:hover { opacity: 1; }
.action-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #58a6ff; }
.action-primary .action-icon { color: #3fb950; }
.action-phase-num { font-size: 16px; font-weight: 700; color: #484f58; }
.action-text { display: flex; flex-direction: column; gap: 4px; }
.action-text strong { font-size: 14px; color: #f0f6fc; }
.action-text span { font-size: 12px; color: #8b949e; line-height: 1.4; }
.project-danger-zone { padding-top: 24px; border-top: 1px solid #30363d; }

/* Login page */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 40px 36px; width: 100%; max-width: 400px; }
.login-logo { font-size: 28px; font-weight: 700; color: #f0f6fc; text-align: center; margin-bottom: 4px; }
.login-subtitle { text-align: center; color: #8b949e; font-size: 14px; margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .form-group { display: flex; flex-direction: column; gap: 6px; }
.login-form label { font-size: 13px; color: #8b949e; }
.login-form input { padding: 10px 12px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: 14px; outline: none; }
.login-form input:focus { border-color: #58a6ff; box-shadow: 0 0 0 2px rgba(88,166,255,0.15); }
.login-btn { width: 100%; padding: 10px; font-size: 14px; border-radius: 6px; cursor: pointer; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-google { background: #21262d; border: 1px solid #30363d; color: #c9d1d9; text-decoration: none; padding: 10px; }
.login-google:hover { background: #30363d; color: #f0f6fc; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #484f58; font-size: 13px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-top: 1px solid #30363d; }
.login-footer { text-align: center; margin-top: 20px; font-size: 13px; color: #8b949e; }
.login-error { background: #f8514922; border: 1px solid #f85149; color: #f85149; padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.login-success { background: #23863622; border: 1px solid #238636; color: #3fb950; padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
