@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700&family=Space+Grotesk:wght@400;600&display=swap");

:root {
    color-scheme: dark;
    --panel: rgba(22, 25, 36, 0.86);
    --panel-strong: #10141f;
    --glow: rgba(124, 58, 237, 0.45);
    --accent: #f59f0b;
    --accent-blue: #4f8cff;
    --text-soft: rgba(226, 232, 240, 0.82);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    background: radial-gradient(circle at top, rgba(79, 70, 229, 0.25), transparent 55%),
        radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.18), transparent 60%),
        #07090f;
    color: #f5f7ff;
}

.font-display {
    font-family: "Outfit", sans-serif;
}

.app-bg::before,
.app-bg::after {
    content: "";
    position: fixed;
    width: 360px;
    height: 360px;
    border-radius: 999px;
    filter: blur(40px);
    z-index: -1;
    opacity: 0.6;
    animation: float 12s ease-in-out infinite;
}

.app-bg::before {
    background: rgba(124, 58, 237, 0.45);
    top: -80px;
    left: -60px;
}

.app-bg::after {
    background: rgba(14, 165, 233, 0.4);
    bottom: -80px;
    right: -40px;
    animation-delay: -6s;
}

.panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(8, 10, 20, 0.6);
    animation: panelIn 0.6s ease;
}

.panel-compact {
    padding: 12px 16px;
}

.view-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.view-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.view-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(30, 41, 59, 0.6);
    color: #d6ddf5;
    font-size: 14px;
    transition: all 0.2s ease;
}

.view-btn.is-active {
    background: rgba(79, 70, 229, 0.35);
    border-color: rgba(99, 102, 241, 0.7);
    color: #eef2ff;
}

.lang-picker {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-select {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(30, 41, 59, 0.6);
    color: #e2e8f0;
    padding: 6px 28px 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background-image: linear-gradient(45deg, transparent 50%, #a5b4fc 50%),
        linear-gradient(135deg, #a5b4fc 50%, transparent 50%);
    background-position: calc(100% - 14px) calc(50% - 3px), calc(100% - 9px) calc(50% - 3px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.view-panel {
    display: none;
}

.view-panel.is-active {
    display: block;
}

.calculator-panel {
    max-width: 380px;
    margin: 0 auto;
}

.chip {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(79, 70, 229, 0.2);
    border: 1px solid rgba(79, 70, 229, 0.5);
    color: #c7d2fe;
}

.display {
    width: 100%;
    height: 58px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--panel-strong);
    color: #f8fafc;
    font-size: 22px;
    padding: 0 14px;
    text-align: right;
    margin-bottom: 14px;
    box-shadow: 0 0 18px rgba(124, 58, 237, 0.22);
    transition: box-shadow 0.25s ease;
}

.display:focus {
    outline: none;
    box-shadow: 0 0 22px var(--glow);
}

.btn {
    height: 46px;
    border: none;
    border-radius: 12px;
    background: #2a2f3b;
    color: #f5f7ff;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.08s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.2);
}

.btn:active {
    transform: scale(0.97);
}

.btn-func {
    background: #3b4151;
    color: #e2e8f0;
}

.btn-op {
    background: var(--accent);
    color: #151515;
}

.btn-eq {
    grid-column: span 2;
    background: var(--accent-blue);
    font-weight: 600;
}

.btn-wide {
    grid-column: span 2;
}

.btn-sci {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.tab-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(30, 41, 59, 0.6);
    color: var(--text-soft);
    font-size: 14px;
    transition: all 0.2s ease;
}

.tab-btn.is-active {
    background: rgba(79, 70, 229, 0.3);
    color: #e0e7ff;
    border-color: rgba(99, 102, 241, 0.7);
}

.panel-stack {
    position: relative;
}

.tab-panel {
    display: none;
    animation: fadeUp 0.4s ease;
}

.tab-panel.is-active {
    display: block;
}

.panel-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.panel-grid.simple {
    grid-template-columns: 1fr;
}

.panel-block {
    background: rgba(15, 18, 30, 0.6);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Graph Section - Unified Layout */
.graph-unified-section {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    animation: fadeUp 0.4s ease;
}

.graph-controls-panel {
    background: rgba(15, 18, 30, 0.6);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: fit-content;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.graph-header {
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    padding-bottom: 10px;
    margin-bottom: 6px;
}

.graph-title {
    font-size: 15px;
    font-weight: 600;
    color: #e0e7ff;
    margin: 0;
    font-family: "Outfit", sans-serif;
}

.graph-input-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-hint {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
}

.graph-canvas-panel {
    background: linear-gradient(135deg, #0a0f1a 0%, #111827 50%, #0d1220 100%);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 450px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#graph-canvas {
    background: transparent;
    border: none;
    padding: 0;
    max-width: 100%;
    width: 100%;
    display: block;
    box-shadow: none;
}

.graph-legend {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 10px;
    font-size: 11px;
    color: #cbd5e1;
    max-height: 200px;
    overflow-y: auto;
}

.range-inputs {
    display: flex;
    gap: 8px;
}

.range-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.range-label {
    font-size: 11px;
    font-weight: 600;
    color: #cbd5e1;
}

.range-input-group .field {
    font-size: 13px;
    padding: 8px;
    background: rgba(13, 17, 28, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.range-input-group .field:focus {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(79, 70, 229, 0.1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.graph-input-item .field {
    background: rgba(13, 17, 28, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.2s ease;
}

.graph-input-item .field:focus {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(79, 70, 229, 0.1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

@media (max-width: 1024px) {
    .graph-unified-section {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .graph-controls-panel {
        height: auto;
    }

    .graph-canvas-panel {
        min-height: 350px;
    }
}

/* Math Section Styling */
.math-section {
    animation: fadeUp 0.4s ease;
}

.sum-section,
.integral-section,
.derivative-section {
    background: transparent;
}

.math-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(124, 58, 237, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.math-title {
    font-size: 18px;
    font-weight: 600;
    color: #e0e7ff;
    margin: 0;
    font-family: "Outfit", sans-serif;
}

.math-formula {
    font-size: 24px;
    color: #f59f0b;
    font-weight: 600;
    letter-spacing: 2px;
}

.math-input-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.panel-block {
    background: rgba(15, 18, 30, 0.6);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.input-with-example {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-with-formula {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 2px 2px 2px 8px;
}

.formula-prefix,
.formula-suffix {
    font-weight: 600;
    font-size: 18px;
    color: #a78bfa;
    white-space: nowrap;
}

.input-with-formula .field {
    border: none;
    background: transparent;
    flex: 1;
    padding: 10px;
}

.sum-range-block,
.integral-range-block {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 16px;
}

.range-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.range-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.range-item .field {
    border: 1px solid rgba(99, 102, 241, 0.3);
    background: rgba(13, 17, 28, 0.8);
}

.range-item .field:focus {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(79, 70, 229, 0.1);
}

.range-symbol {
    position: absolute;
    right: 12px;
    top: 35px;
    color: #5b6bff;
    font-weight: 600;
    font-size: 14px;
}

.integral-precision-block {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 16px;
}

.precision-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.precision-hint {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}

.result-section {
    margin-top: 8px;
}

.result-large {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(79, 70, 229, 0.1));
    border: 2px solid rgba(99, 102, 241, 0.3);
    min-height: 60px;
    font-size: 20px;
    font-weight: 600;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.result-info {
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.mt-3 {
    margin-top: 12px;
}

@media (max-width: 768px) {
    .graph-container {
        grid-template-columns: 1fr;
    }

    .math-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .range-grid {
        grid-template-columns: 1fr;
    }

    .graph-canvas-wrapper {
        padding: 16px 16px 32px 32px;
    }
}

.panel-label {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 6px;
    display: block;
}

.field {
    width: 100%;
    background: #0d111c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #e2e8f0;
    padding: 10px;
    font-size: 15px;
}

.field::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

.field.small {
    max-width: 88px;
}

.range-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.helper,
.hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-soft);
}

.status {
    margin-top: 10px;
    font-size: 13px;
    color: #fca5a5;
    min-height: 16px;
}

.result-box {
    min-height: 44px;
    padding: 12px;
    border-radius: 12px;
    background: #0d111c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 17px;
}

.result-box.compact {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 10px 14px;
    font-size: 15px;
    border-radius: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.matrix-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
}

/* Матриці */
.matrix-size-selector {
    margin-bottom: 16px;
}

.size-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.size-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.size-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.size-btn.is-active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #3b82f6;
    color: #fff;
    font-weight: 600;
}

.matrix-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding: 12px 20px;
    margin: 12px 0;
}

.matrix-container::before,
.matrix-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    border-color: rgba(255, 255, 255, 0.4);
    border-style: solid;
}

.matrix-container::before {
    left: 0;
    border-width: 2px 0 2px 2px;
    border-radius: 4px 0 0 4px;
}

.matrix-container::after {
    right: 0;
    border-width: 2px 2px 2px 0;
    border-radius: 0 4px 4px 0;
}

.matrix-grid-table {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(var(--matrix-cols), 1fr);
}

.matrix-cell {
    width: 50px;
    height: 40px;
    padding: 4px 8px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 15px;
    transition: all 0.2s;
}

.matrix-cell:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.matrix-cell:hover:not(:focus) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.matrix-cell:read-only {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    cursor: default;
}

.matrix-cell:read-only:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Стилізація для матриці результату */
.matrix-cell-result {
    width: 80px;
    height: 60px;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 500;
    background: rgba(34, 197, 94, 0.08);
    border: 2px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.1);
}

.matrix-cell-result:hover {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.15);
}

.matrix-result {
    padding: 16px;
    background: rgba(34, 197, 94, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.matrix-det-result {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(74, 222, 128, 0.05));
    border: 2px solid rgba(34, 197, 94, 0.4);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #86efac;
    text-align: center;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.15);
}

#matrix-result-container {
    margin-top: 12px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(100, 150, 200, 0.15);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.matrix-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .matrix-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .matrix-cell {
        width: 42px;
        height: 36px;
        font-size: 13px;
        padding: 2px 4px;
    }
    
    .matrix-container {
        padding: 8px 16px;
    }
    
    .size-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(20px);
    }
}

/* Формули фізики */
.formula-reference {
    margin-top: 24px;
    padding: 16px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.formula-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.formula-list li {
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-soft);
}

.formula-list strong {
    color: var(--accent);
    font-family: 'Courier New', monospace;
    margin-right: 8px;
}

/* Налаштування */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
}

.setting-header {
    margin-bottom: 16px;
}

.setting-title {
    font-size: 18px;
    font-weight: 600;
    color: #eef2ff;
    margin-bottom: 4px;
}

.setting-description {
    font-size: 13px;
    color: rgba(226, 232, 240, 0.6);
}

/* Вибір теми */
.theme-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-soft);
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.theme-option:hover {
    border-color: rgba(124, 58, 237, 0.5);
    transform: translateY(-2px);
}

.theme-option.is-active {
    border-color: rgba(124, 58, 237, 0.8);
    background: rgba(79, 70, 229, 0.2);
}

.theme-preview {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.theme-light {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.theme-purple {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
}

.theme-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
}

/* Вибір мови */
.lang-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.lang-option {
    cursor: pointer;
}

.lang-option input[type="radio"] {
    display: none;
}

.lang-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    transition: all 0.2s ease;
}

.lang-option:hover .lang-card {
    border-color: rgba(124, 58, 237, 0.5);
    transform: translateY(-2px);
}

.lang-option input[type="radio"]:checked + .lang-card {
    border-color: rgba(124, 58, 237, 0.8);
    background: rgba(79, 70, 229, 0.2);
}

.lang-flag {
    font-size: 28px;
}

.lang-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-soft);
}

/* Додаткові налаштування */
.misc-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle-setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-setting:hover {
    background: rgba(15, 23, 42, 0.6);
}

.toggle-setting input[type="checkbox"] {
    width: 44px;
    height: 24px;
    appearance: none;
    background: rgba(71, 85, 105, 0.6);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-setting input[type="checkbox"]::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    background: white;
    transition: transform 0.2s ease;
}

.toggle-setting input[type="checkbox"]:checked {
    background: rgba(124, 58, 237, 0.8);
}

.toggle-setting input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

/* Про додаток */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
}

.about-heading {
    font-size: 20px;
    font-weight: 600;
    color: #eef2ff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.about-text {
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.6;
}

.about-text p {
    margin-bottom: 12px;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-text strong {
    color: var(--accent);
    font-weight: 600;
}

/* Технології */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.tech-item:hover {
    background: rgba(15, 23, 42, 0.6);
    transform: translateY(-2px);
}

.tech-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.tech-item strong {
    display: block;
    color: #eef2ff;
    font-size: 14px;
    margin-bottom: 4px;
}

.tech-desc {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.6);
    margin: 0;
}

/* Можливості */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-list li {
    padding: 12px 12px 12px 40px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
    position: relative;
    color: var(--text-soft);
    font-size: 14px;
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 12px;
    color: var(--accent);
    font-weight: bold;
    font-size: 18px;
}

/* Контакти */
.contact-info {
    margin-top: 12px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
}

.link {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Футер про додаток */
.about-footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 8px;
    color: rgba(226, 232, 240, 0.6);
    font-size: 13px;
}

.version {
    margin-top: 8px;
    color: rgba(226, 232, 240, 0.4);
    font-size: 12px;
}

/* Теми */
body[data-theme="light"] {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #1e293b;
}

body[data-theme="light"] .panel {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .btn {
    background: rgba(241, 245, 249, 0.8);
    color: #1e293b;
}

body[data-theme="light"] .display,
body[data-theme="light"] .field {
    background: rgba(241, 245, 249, 0.6);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="purple"] {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), transparent 55%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.25), transparent 60%),
        #0a0118;
}

body[data-theme="purple"] .panel {
    background: rgba(88, 28, 135, 0.2);
    border-color: rgba(168, 85, 247, 0.3);
}

body[data-theme="blue"] {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), transparent 55%),
        radial-gradient(circle at 80% 20%, rgba(96, 165, 250, 0.25), transparent 60%),
        #030712;
}

body[data-theme="blue"] .panel {
    background: rgba(30, 58, 138, 0.2);
    border-color: rgba(96, 165, 250, 0.3);
}

@media (max-width: 640px) {
    .panel {
        padding: 16px;
    }

    .panel-compact {
        padding: 10px 12px;
    }

    .calculator-panel {
        max-width: 100%;
    }

    .btn {
        height: 44px;
        font-size: 14px;
    }

    .btn-sci {
        font-size: 12px;
        letter-spacing: 0.02em;
    }

    .display {
        height: 52px;
        font-size: 20px;
    }

    .panel-label {
        font-size: 12px;
    }

    .graph-unified-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .graph-controls-panel {
        height: auto;
    }

    .graph-canvas-panel {
        min-height: 300px;
    }

    .range-inputs {
        flex-direction: column;
        gap: 10px;
    }

    .tech-grid {
        grid-template-columns: 1fr;
    }

    .theme-picker {
        grid-template-columns: repeat(2, 1fr);
    }
}
