* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    /* Dark theme */
    --bg: #1B1B1F;
    --bg-card: #2A2A2E;
    --bg-elevated: #35353A;
    --bg-input: #2A2A2E;

    /* Brand */
    --primary: #ff3b30;
    --primary-soft: rgba(255, 59, 48, 0.12);
    --blue: #0057B8;
    --blue-soft: rgba(0, 87, 184, 0.12);
    --green: #34C759;
    --green-soft: rgba(52, 199, 89, 0.12);
    --yellow: #FECE00;
    --yellow-soft: rgba(254, 206, 0, 0.12);

    --text: #FAFAFA;
    --text-2: rgba(255,255,255,0.7);
    --text-3: rgba(255,255,255,0.4);
    --border: rgba(255,255,255,0.08);

    --r: 16px;
    --r-lg: 20px;
    --r-sm: 12px;
    --tab-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

html { height: 100%; overflow-x: hidden; background: #1B1B1F; }
body { min-height: 100%; overflow-x: hidden; padding-top: env(safe-area-inset-top, 0px); }

body {
    font-family: -apple-system, 'SF Pro Display', 'Inter', BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    padding-bottom: calc(var(--tab-h) + var(--safe-b) + 28px);
    -webkit-font-smoothing: antialiased;
    font-size: 15px; line-height: 1.47;
}

/* === HEADER === */
.header {
    padding: 16px 20px 10px;
    display: flex; align-items: center; gap: 12px;
}
.header-logo { width: 40px; height: 40px; flex-shrink: 0; }
.header-text { }
.header-title { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.header-subtitle { font-size: 12px; color: var(--text-3); }

/* === PAGES === */
.page { display: none; padding: 8px 16px 16px; min-height: calc(100vh - 120px - var(--tab-h)); }
.page.active { display: block; }

/* === STATS (Дія — clean cards, big numbers) === */
.stats-row { display: flex; gap: 8px; margin: 14px 0; }
.stat-card {
    flex: 1; border-radius: var(--r); padding: 18px 10px;
    text-align: center; background: var(--bg-card);
}
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -1px; }
.stat-label { font-size: 10px; color: var(--text-3); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

.grad-danger .stat-value { color: var(--primary); }
.grad-success .stat-value { color: var(--green); }
.grad-info .stat-value { color: var(--blue); }

/* === BUTTONS (Дія — large radius, bold) === */
.btn-primary {
    width: 100%; padding: 16px; border: none; border-radius: var(--r);
    background: var(--primary); color: white;
    font-size: 16px; font-weight: 600; cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}
.btn-primary:active { opacity: 0.75; transform: scale(0.98); }

.btn-primary-sm {
    padding: 10px 18px; border: none; border-radius: var(--r-sm);
    background: var(--primary); color: white;
    font-size: 14px; font-weight: 600; cursor: pointer;
}

.btn-accent {
    padding: 10px 14px; border: none; border-radius: var(--r-sm);
    background: var(--green); color: #000;
    font-size: 13px; font-weight: 600; cursor: pointer;
}

.btn-outline {
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    background: transparent; color: var(--text-2);
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all 0.15s;
}
.btn-outline:active { border-color: var(--primary); color: var(--text); background: var(--primary-soft); }

/* === SECTIONS === */
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; margin: 22px 0 10px; }
.section-subtitle { font-size: 13px; color: var(--text-3); margin: -6px 0 14px; }

/* === CARD LIST === */
.card-list { display: flex; flex-direction: column; gap: 8px; }

.calc-card {
    background: var(--bg-card); border-radius: var(--r); padding: 16px;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; transition: background 0.15s;
}
.calc-card:active { background: var(--bg-elevated); }

.calc-card-info { flex: 1; min-width: 0; }
.calc-card-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-card-date { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.calc-card-icon { font-size: 20px; margin-left: 10px; flex-shrink: 0; }

.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-left: 8px; }
.st-done { background: var(--green); box-shadow: 0 0 10px rgba(52,199,89,0.4); }
.st-draft { background: var(--text-3); }
.st-running { background: var(--yellow); box-shadow: 0 0 10px rgba(254,206,0,0.4); animation: pulse 1.2s infinite; }
.st-error { background: var(--primary); box-shadow: 0 0 10px rgba(255,59,48,0.4); }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

.btn-del {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--primary-soft); border: none;
    color: var(--primary); font-size: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* === INPUT === */
.input-field {
    width: 100%; padding: 14px 16px;
    background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--r);
    color: var(--text); font-size: 16px; outline: none;
}
.input-field:focus { border-color: var(--primary); }

/* === EDITOR === */
.editor-header { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.toolbar-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.code-editor { width: 100%; height: calc(100vh - 300px); min-height: 200px; border-radius: var(--r); overflow: hidden; }

.status-bar { padding: 10px 14px; border-radius: var(--r-sm); font-size: 13px; margin-top: 6px; display: none; font-weight: 500; }
.status-ok { display: block; background: var(--green-soft); color: var(--green); }
.status-err { display: block; background: var(--primary-soft); color: var(--primary); }

/* === FORM EDITOR === */
.form-editor { overflow-y: visible; }

.form-table { margin-bottom: 10px; }
.form-table-header {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 16px; background: var(--bg-card); border-radius: var(--r);
    cursor: pointer; user-select: none;
}
.form-table-name { font-size: 15px; font-weight: 600; }
.form-table-badge {
    background: var(--blue-soft); color: var(--blue);
    font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 10px;
}
.form-table-arrow { color: var(--text-3); font-size: 10px; transition: transform 0.2s; }
.form-table.collapsed .form-table-arrow { transform: rotate(-90deg); }
.form-table.collapsed .form-table-body { display: none; }

.form-table-body { padding: 2px 0; }
.form-row {
    background: var(--bg-card); padding: 12px 16px; margin-top: 2px;
    border-radius: 4px;
}
.form-row:last-child { border-radius: 0 0 var(--r) var(--r); }

.form-row-header { margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.form-row-code {
    font-family: 'SF Mono', 'Menlo', monospace; font-size: 11px; color: var(--blue);
    background: var(--blue-soft); padding: 2px 8px; border-radius: 6px; font-weight: 600;
}
.form-row-help { font-size: 13px; color: var(--text-2); line-height: 1.3; }

/* Field tooltip */
.field-tip {
    position: fixed; z-index: 500; max-width: min(300px, calc(100vw - 24px));
    background: var(--bg-elevated); color: var(--text-2);
    font-size: 12px; line-height: 1.4; padding: 8px 12px;
    border-radius: var(--r-sm); box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.field-tip.show { opacity: 1; pointer-events: auto; }

.form-table-desc { font-size: 11px; color: var(--text-3); flex: 1; text-align: right; margin-left: 4px; }

/* New form layout: vertical fields list */
.form-row-fields { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.form-field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 4px; }
.form-field-label { font-size: 12px; color: var(--blue); font-weight: 500; }
.form-field-inline {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.form-field-inline:last-child { border-bottom: none; }
.form-field-num {
    font-size: 10px; color: var(--text-3); font-weight: 700;
    min-width: 20px; text-align: center;
    background: var(--bg-elevated); border-radius: 4px; padding: 2px 0;
    flex-shrink: 0;
}
.form-field-desc {
    font-size: 11px; color: var(--text-3); line-height: 1.3;
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap;
}
.form-field-inline:focus-within .form-field-desc {
    color: var(--text-2); white-space: normal;
}
.form-row-single { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.form-row-opts {
    font-size: 11px; color: var(--blue); line-height: 1.3;
    background: var(--blue-soft); padding: 4px 10px; border-radius: 8px;
    flex: 1; min-width: 0;
}

/* Mobile optimizations */
@media (max-width: 420px) {
    .form-input-num { width: 72px; font-size: 13px; padding: 8px; }
    .form-input-text { font-size: 13px; }
    .form-row { padding: 10px 12px; }
    .form-field-desc { font-size: 10px; }
    .res-kpi { padding: 14px 6px; }
    .kpi-val { font-size: 22px; }
    .tract-val { font-size: 20px; }
    .guide-content { padding: 12px; font-size: 13px; }
    .guide-content table { font-size: 11px; }
    .toolbar-row { gap: 4px; }
    .btn-outline { padding: 7px 10px; font-size: 12px; }
}

.form-input {
    padding: 9px 10px; border-radius: var(--r-sm);
    border: 1.5px solid var(--border);
    background: var(--bg); color: var(--text); font-size: 14px; outline: none;
    font-family: 'SF Mono', monospace;
    transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.form-input-text { width: 100%; min-width: 140px; }
.form-input-num { width: 84px; text-align: right; }

/* === QUICK ACTIONS === */
.quick-actions { display: flex; gap: 8px; margin: 14px 0; }
.quick-btn {
    flex: 1; padding: 14px 12px; background: var(--bg-card); border-radius: var(--r);
    text-align: center; text-decoration: none; color: var(--text-2);
    font-size: 13px; font-weight: 500; transition: background 0.15s;
    display: flex; flex-direction: column; gap: 4px; align-items: center;
    line-height: 1.4;
}
.quick-btn:active { background: var(--bg-elevated); }

/* === RESULT === */
.result-header { margin-bottom: 12px; }
.result-header h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.result-header:not(.has-result) h3 { display: none; }
.result-header .toolbar-row { display: none; }
.result-header.has-result .toolbar-row { display: flex; }
.result-view {
    background: var(--bg-card); border-radius: var(--r); padding: 14px;
    font-family: 'SF Mono', 'Menlo', monospace; font-size: 11px; line-height: 1.4;
    white-space: pre; overflow: auto; max-height: calc(100vh - 240px);
    -webkit-overflow-scrolling: touch; color: var(--text-2);
}

/* === RESULT CARDS (Дія document-card style) === */
.res-section { margin-bottom: 18px; }
.res-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.3px; }
.res-subtitle { font-size: 14px; color: var(--text-3); margin-bottom: 14px; }

.res-cards { display: flex; gap: 8px; margin-bottom: 18px; }
.res-kpi {
    flex: 1; border-radius: var(--r); padding: 18px 8px;
    text-align: center; background: var(--bg-card);
}
.kpi-val { font-size: 26px; font-weight: 700; letter-spacing: -1px; }
.kpi-green .kpi-val { color: var(--green); }
.kpi-red .kpi-val { color: var(--primary); }
.kpi-blue .kpi-val { color: var(--blue); }
.kpi-label { font-size: 9px; color: var(--text-3); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

.res-table { background: var(--bg-card); border-radius: var(--r); overflow: hidden; }
.res-row { display: flex; justify-content: space-between; padding: 13px 16px; font-size: 14px; }
.res-row + .res-row { border-top: 1px solid var(--border); }
.res-row span:first-child { color: var(--text-2); }
.res-row span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }

.res-tract {
    background: var(--bg-card); border-radius: var(--r); padding: 16px;
    margin-bottom: 8px;
}
.tract-name { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.tract-grid { display: flex; align-items: center; justify-content: space-between; }
.tract-col { text-align: center; flex: 1; }
.tract-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.tract-val { font-size: 24px; font-weight: 700; margin: 4px 0; letter-spacing: -0.5px; }
.tract-sub { font-size: 12px; color: var(--text-3); }
.tract-arrow { font-size: 20px; color: var(--text-3); padding: 0 8px; }

#result-content { overflow-y: visible; }

/* === INFO CARD === */
.info-card {
    background: var(--bg-card); border-radius: var(--r); padding: 4px 18px;
    font-size: 14px; line-height: 1.5;
}

/* === MODAL (Дія bottom sheet) === */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 200; display: flex; align-items: flex-end;
}
.modal-sheet {
    background: var(--bg-card); border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding: 8px 16px calc(var(--safe-b) + 28px); width: 100%;
    max-height: 70vh; overflow-y: auto;
}
.modal-handle { width: 36px; height: 5px; background: var(--text-3); border-radius: 3px; margin: 4px auto 18px; }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 14px; }

/* === BOTTOM TABS === */
.bottom-tabs {
    position: fixed;
    bottom: calc(var(--safe-b) + 6px);
    left: 8px;
    right: 8px;
    height: 56px;
    background: rgba(42, 42, 46, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 18px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-around;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    z-index: 100;
    padding: 0 4px;
}

.tab-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    flex-shrink: 0;
}

.tab {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 9px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 8px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 0;
    flex: 1;
}
.tab.active { color: var(--primary); }
.tab svg { width: 22px; height: 22px; flex-shrink: 0; display: block; }
.tab span { letter-spacing: 0.2px; white-space: nowrap; display: block; }

/* === TOAST === */
.toast {
    position: fixed; top: 14px; left: 14px; right: 14px;
    background: var(--bg-elevated);
    border-radius: var(--r);
    padding: 16px 18px; z-index: 300;
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    transform: translateY(-130%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px; font-weight: 500;
}
.toast.show { transform: translateY(0); }
.toast-icon { font-size: 22px; flex-shrink: 0; }
.toast-text { flex: 1; }
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--primary); }
.toast-info { border-left: 3px solid var(--blue); }

/* === EMPTY === */
.empty { text-align: center; color: var(--text-3); padding: 40px 20px; font-size: 14px; line-height: 1.6; }

/* === EDITOR EMPTY STATE === */
.editor-empty-state {
    display: flex; align-items: center; justify-content: center;
    min-height: calc(100vh - 220px);
    padding: 20px 0;
}
.empty-state-card {
    text-align: center; padding: 36px 28px;
    background: var(--bg-card); border-radius: var(--r-lg);
    max-width: 340px; width: 100%;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.empty-state-icon { margin-bottom: 20px; }
.empty-state-icon svg { opacity: 0.85; }
.empty-state-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; line-height: 1.3; }
.empty-state-subtitle { font-size: 13px; color: var(--text-3); margin-bottom: 28px; line-height: 1.5; }
.empty-state-buttons { display: flex; flex-direction: column; gap: 10px; }
.btn-empty-state {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 16px; border: none; border-radius: var(--r);
    background: var(--primary); color: white;
    font-size: 16px; font-weight: 600; cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}
.btn-empty-state:active { opacity: 0.75; transform: scale(0.98); }
.btn-empty-state.btn-empty-secondary {
    background: var(--bg-elevated); color: var(--text-2);
    border: 1.5px solid var(--border);
}
.btn-empty-icon { font-size: 20px; }

/* === RUN CALC BUTTON === */
.btn-run-calc {
    width: 100%; padding: 18px; border: none; border-radius: var(--r);
    background: var(--green); color: #000;
    font-size: 17px; font-weight: 700; cursor: pointer;
    margin-top: 14px;
    transition: opacity 0.15s, transform 0.1s;
    letter-spacing: -0.3px;
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.25);
}
.btn-run-calc:active { opacity: 0.75; transform: scale(0.98); }
.btn-run-calc[disabled] { opacity: 0.5; pointer-events: none; }

/* === RESULT EMPTY STATE === */
.result-empty {
    text-align: center; padding: 80px 20px 40px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.result-empty-icon { margin-bottom: 20px; opacity: 0.6; }
.result-empty-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.result-empty-subtitle { font-size: 14px; color: var(--text-3); line-height: 1.5; }

/* === LIBRARY CATEGORIES === */
.lib-category { margin-bottom: 20px; }
.lib-category-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px; padding: 0 2px;
}
.lib-category-icon { font-size: 18px; }
.lib-category-title { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.lib-category-count {
    font-size: 11px; font-weight: 600; color: var(--text-3);
    background: var(--bg-elevated); padding: 2px 8px; border-radius: 8px;
}

.lib-card {
    background: var(--bg-card); border-radius: var(--r); padding: 14px 16px;
    display: flex; align-items: center; gap: 12px;
    cursor: pointer; transition: background 0.15s;
    margin-bottom: 6px;
}
.lib-card:active { background: var(--bg-elevated); }
.lib-card-icon {
    width: 46px; height: 46px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.lib-card-icon.fuel-gas { background: rgba(0, 87, 184, 0.15); }
.lib-card-icon.fuel-bio { background: rgba(52, 199, 89, 0.15); }
.lib-card-icon.fuel-other { background: var(--bg-elevated); }
.lib-card-info { flex: 1; min-width: 0; }
.lib-card-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.lib-card-desc { font-size: 12px; color: var(--text-3); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-card-badge {
    font-size: 11px; font-weight: 700; color: var(--blue);
    background: var(--blue-soft); padding: 5px 10px; border-radius: 10px;
    white-space: nowrap; flex-shrink: 0;
}

.library-guides {
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 10px;
}

/* === PROFILE === */
.profile-hero {
    text-align: center; padding: 30px 16px 24px;
    background: var(--bg-card); border-radius: var(--r-lg);
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}
.profile-hero::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 80px;
    background: linear-gradient(135deg, var(--primary-soft), var(--blue-soft));
    opacity: 0.5;
}
.profile-avatar {
    width: 68px; height: 68px; border-radius: 50%;
    background: var(--bg-elevated); font-size: 32px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    border: 3px solid var(--primary);
    position: relative;
    z-index: 1;
}
.profile-name {
    font-size: 22px; font-weight: 700; margin-bottom: 8px;
    position: relative; z-index: 1;
}
.profile-role-badge {
    display: inline-block; font-size: 12px; font-weight: 600;
    color: var(--text-2); background: var(--bg-elevated);
    padding: 5px 16px; border-radius: 20px;
    position: relative; z-index: 1;
}

/* Profile info rows */
.info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; font-size: 14px;
}
.info-row + .info-row { border-top: 1px solid var(--border); }
.info-row-label { color: var(--text-3); }
.info-row-value { font-weight: 600; text-align: right; }
.info-row-value .perm-on { color: var(--green); }
.info-row-value .perm-off { color: var(--primary); }

/* Admin user cards */
.admin-user-card {
    background: var(--bg-card); border-radius: var(--r); padding: 14px 16px;
}
.admin-user-top {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.admin-user-emoji {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-elevated);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.admin-user-name { font-size: 15px; font-weight: 600; flex: 1; }
.admin-user-username { font-size: 12px; color: var(--text-3); }
.admin-user-perms { display: flex; gap: 6px; flex-wrap: wrap; }
.perm-badge {
    font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 8px;
    cursor: pointer; transition: all 0.15s; user-select: none;
}
.perm-badge.on { background: var(--green-soft); color: var(--green); }
.perm-badge.off { background: var(--bg-elevated); color: var(--text-3); }
.perm-badge:active { transform: scale(0.95); }

/* Server info compact */
.server-row {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 0; font-size: 14px;
}
.server-row + .server-row { border-top: 1px solid var(--border); }
.server-row-icon { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }
.server-row-label { color: var(--text-3); flex: 1; }
.server-row-value { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }

/* === GUIDE PAGE === */
.guide-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px; flex-wrap: wrap;
}
.guide-tabs { display: flex; gap: 4px; flex: 1; }
.guide-tab {
    padding: 8px 14px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
    background: transparent; color: var(--text-3); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; flex: 1; text-align: center;
}
.guide-tab.active { border-color: var(--primary); color: var(--text); background: var(--primary-soft); }
.guide-content {
    overflow-y: visible;
    background: var(--bg-card); border-radius: var(--r); padding: 16px;
    font-size: 14px; line-height: 1.6;
}
.guide-content h1 { font-size: 22px; font-weight: 700; margin: 0 0 8px; color: var(--text); -webkit-text-fill-color: var(--text); background: none; }
.guide-content h2 { font-size: 18px; font-weight: 700; margin: 24px 0 8px; color: var(--primary); }
.guide-content h3 { font-size: 15px; font-weight: 600; margin: 16px 0 6px; color: var(--yellow); }
.guide-content p { margin-bottom: 10px; color: var(--text-2); }
.guide-content ul, .guide-content ol { margin: 6px 0 12px 18px; color: var(--text-2); }
.guide-content li { margin-bottom: 4px; }
.guide-content table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12px; }
.guide-content th { background: var(--bg-elevated); padding: 6px 8px; text-align: left; font-weight: 600; color: var(--text-3); }
.guide-content td { padding: 5px 8px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.guide-content .code, .guide-content pre { background: var(--bg); border-radius: var(--r-sm); padding: 10px 12px; font-family: 'SF Mono', monospace; font-size: 12px; color: var(--green); overflow-x: auto; white-space: pre; margin: 8px 0; line-height: 1.5; }
.guide-content .warn { background: var(--yellow-soft); border-left: 3px solid var(--yellow); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 10px 12px; margin: 10px 0; font-size: 13px; color: var(--yellow); }
.guide-content .tip { background: var(--green-soft); border-left: 3px solid var(--green); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 10px 12px; margin: 10px 0; font-size: 13px; color: var(--green); }
.guide-content .info { background: var(--blue-soft); border-left: 3px solid var(--blue); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 10px 12px; margin: 10px 0; font-size: 13px; color: var(--blue); }
.guide-content .card { background: var(--bg-elevated); border-radius: var(--r-sm); padding: 12px; margin: 10px 0; }
.guide-content .card-title { font-size: 14px; font-weight: 600; color: var(--blue); margin-bottom: 6px; }
.guide-content .back-link, .guide-content .container > .subtitle:first-of-type { display: none; }
.guide-content .container { max-width: 100%; padding: 0; }
.guide-content .inline-code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-family: 'SF Mono', monospace; font-size: 11px; color: var(--green); }

/* === ELEMENT TABLE (per-element results) === */
.elem-table { font-size: 13px; }
.elem-header { font-weight: 600; color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.elem-header span { flex: 1; }
.elem-row span { flex: 1; }
.elem-name { font-weight: 500; font-family: 'SF Mono', monospace; font-size: 12px; }
.elem-temp { font-variant-numeric: tabular-nums; }
.elem-heat { font-variant-numeric: tabular-nums; font-size: 12px; }
.heat-neg { color: var(--primary); }
.heat-pos { color: var(--green); }

/* === FORM SELECT (dropdown for coded fields) === */
.form-select {
    padding: 9px 12px; border-radius: var(--r-sm);
    border: 1.5px solid var(--border);
    background: var(--bg); color: var(--text); font-size: 14px;
    font-family: -apple-system, sans-serif;
    outline: none; cursor: pointer; min-width: 160px; max-width: 100%;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    padding-right: 28px;
}
.form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.form-select option { background: var(--bg-card); color: var(--text); }

/* === SKELETON LOADING === */
.skeleton-card {
    background: var(--bg-card); border-radius: var(--r); height: 60px;
    margin-bottom: 8px; position: relative; overflow: hidden;
}
.skeleton-card::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* === SPINNER === */
.spinner {
    width: 28px; height: 28px; margin: 30px auto;
    border: 2.5px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
