.app-header .header-content { display: flex; align-items: center; justify-content: space-between; }
.app-header .header-content h1 { font-size: 1.1rem; display: flex; align-items: center; gap: 0.75rem; margin: 0; color: white; }
.app-header .header-content h1 i { cursor: pointer; font-size: 1.2rem; }
.theme-switcher { display: flex; align-items: center; }
.switch { position: relative; display: inline-block; width: 48px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.25); transition: .3s; border-radius: 24px; }
.slider::before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background: #fbbf24; }
input:checked + .slider::before { transform: translateX(24px); }

.fullscreen-menu { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--surface); z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: .3s; transform: translateY(-10px); }
.fullscreen-menu.active { opacity: 1; pointer-events: auto; transform: translateY(0); }
.fullscreen-menu .close-btn { position: absolute; top: 1.5rem; right: 1.5rem; font-size: 2.5rem; color: var(--text); background: none; border: none; cursor: pointer; z-index: 1; }
.overlay-nav { display: flex; flex-direction: column; gap: 0.6rem; width: 92%; max-width: 480px; max-height: 80vh; overflow-y: auto; padding: 1rem 0; }
.overlay-nav .nav-link { font-size: 0.95rem; font-weight: 600; color: var(--text); text-decoration: none; padding: 0.7rem 0.85rem; border-radius: var(--radius-sm); transition: .2s; display: flex; align-items: center; gap: 0.75rem; border: 2px solid var(--border); background: var(--bg); }
.overlay-nav .nav-link i { width: 1.2rem; text-align: center; flex-shrink: 0; }
.overlay-nav .nav-link:hover, .overlay-nav .nav-link.active { background: var(--accent); color: white; border-color: var(--accent); }
.nav-group-label { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; padding: 0.5rem 0.85rem 0.2rem; }

.main-content { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; flex: 1; overflow-y: auto; }

.mode-tabs { display: flex; gap: 0; background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; border: 2px solid var(--border); }
.mode-tab { flex: 1; padding: 0.7rem; text-align: center; font-size: 0.85rem; font-weight: 700; cursor: pointer; border: none; background: transparent; color: var(--text-secondary); transition: .2s; font-family: var(--font); }
.mode-tab.active { background: var(--accent); color: white; }
.mode-tab:not(.active):hover { background: var(--border); }

.calc-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 4px; -webkit-overflow-scrolling: touch; margin-bottom: 4px; }
.calc-tabs::-webkit-scrollbar { height: 3px; }
.calc-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.calc-tab { flex-shrink: 0; padding: 8px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: .15s; font-family: var(--font); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.calc-tab.active { background: var(--accent); color: white; border-color: var(--accent); }
.calc-tab:not(.active):hover { border-color: var(--accent); color: var(--text); }

.shape-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }
.shape-btn { padding: 6px 12px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-secondary); font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: .15s; font-family: var(--font); }
.shape-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.shape-btn:not(.active):hover { border-color: var(--accent); color: var(--text); }

.input-unit { display: flex; align-items: center; gap: 0.5rem; }
.input-unit input { flex: 1; }
.input-unit span { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }

.result-box { background: var(--bg); border-radius: var(--radius-sm); padding: 1rem; font-size: 0.9rem; line-height: 1.7; }
.result-box p { margin: 0; }
.result-box strong { color: var(--primary); }

.section-title { font-size: 1.1rem; font-weight: 700; margin: 0.5rem 0 0.75rem; color: var(--text); }
.formula-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.formula-card { background: var(--bg); border-radius: var(--radius-sm); padding: 1rem; border: 1px solid var(--border); }
.formula-card h4 { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.formula-card .formula { font-size: 1rem; font-weight: 700; font-family: 'Times New Roman', serif; color: var(--text); line-height: 1.6; }
.example-box { background: var(--bg); border-radius: var(--radius-sm); padding: 1rem; border: 1px solid var(--border); font-size: 0.85rem; line-height: 1.7; }
.example-box .example-label { font-weight: 700; color: var(--accent); margin-bottom: 0.5rem; font-size: 0.9rem; }
.example-box .example-data { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-bottom: 0.75rem; font-size: 0.82rem; color: var(--text-secondary); }
.example-box .example-step { margin-bottom: 0.4rem; }

.material-picker { display: flex; gap: 8px; align-items: end; margin-bottom: 1rem; }
.material-picker select { flex: 1; padding: 0.7rem; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; background: var(--surface); color: var(--text); font-family: var(--font); outline: none; }
.material-picker select:focus { border-color: var(--accent); }
.material-picker .dens-field { width: 110px; }
.material-picker .dens-field input { width: 100%; padding: 0.7rem; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; background: var(--surface); color: var(--text); font-family: var(--font); outline: none; }
.material-picker .dens-field input:focus { border-color: var(--accent); }

body.dark-theme { --bg: #0f172a; --surface: #1e293b; --text: #f1f5f9; --text-secondary: #94a3b8; --border: #334155; --accent: #60a5fa; }

@media (max-width: 480px) {
  .app-header { padding: 0.8rem 1rem; }
  .app-header .header-content h1 { font-size: 1rem; }
  .main-content { padding: 0.75rem; gap: 0.75rem; }
  .formula-grid { grid-template-columns: 1fr; }
  .overlay-nav .nav-link { font-size: 0.88rem; padding: 0.6rem 0.7rem; }
}
@media (min-width: 992px) {
  .app-container { max-width: 100%; }
  .main-content { padding: 1.5rem 2rem; gap: 1.5rem; }
  .formula-grid { grid-template-columns: 1fr 1fr; }
  .material-picker { flex-direction: row; }
}
