body.bodylogin #ksi-calculator-root,
body.loginpage #ksi-calculator-root {
    display: none !important;
}

#ksi-calculator-root,
#ksi-calculator-root * {
    box-sizing: border-box;
}

.ksi-calculator-launcher {
    position: fixed;
    right: 26px;
    bottom: 90px;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    cursor: grab;
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 48%, #06b6d4 100%);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.30), 0 6px 14px rgba(15, 23, 42, 0.22);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.ksi-calculator-launcher:hover,
.ksi-calculator-launcher:focus {
    transform: translateY(-2px) scale(1.03);
    filter: saturate(1.08);
    box-shadow: 0 20px 42px rgba(37, 99, 235, 0.38), 0 8px 18px rgba(15, 23, 42, 0.24);
}

.ksi-calculator-launcher:active,
.ksi-calculator-launcher.ksi-calculator-dragging {
    cursor: grabbing;
    transform: scale(0.98);
}

.ksi-calculator-launcher-symbol {
    width: 30px;
    height: 34px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 10px repeat(3, 1fr);
    gap: 3px;
    padding: 3px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
}

.ksi-calculator-launcher-symbol span {
    display: block;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.95);
}

.ksi-calculator-launcher-symbol span:first-child {
    grid-column: 1 / 4;
    background: rgba(255, 255, 255, 0.82);
}

.ksi-calculator-panel {
    position: fixed;
    width: 340px;
    max-width: calc(100vw - 24px);
    min-height: 456px;
    border-radius: 24px;
    overflow: hidden;
    z-index: 99998;
    background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 42%, #312e81 100%);
    color: #ffffff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.45), 0 10px 22px rgba(15, 23, 42, 0.30);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.ksi-calculator-panel.ksi-calculator-open {
    display: block;
    animation: ksiCalculatorPop 0.16s ease-out;
}

@keyframes ksiCalculatorPop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ksi-calculator-panel-inner {
    padding: 18px;
}

.ksi-calculator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.ksi-calculator-title {
    min-width: 0;
}

.ksi-calculator-title strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.ksi-calculator-title span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
}

.ksi-calculator-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: background 0.16s ease, transform 0.16s ease;
}

.ksi-calculator-close:hover,
.ksi-calculator-close:focus {
    background: rgba(255, 255, 255, 0.22);
    transform: rotate(90deg);
    outline: none;
}

.ksi-calculator-display-wrap {
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 14px;
}

.ksi-calculator-operation {
    min-height: 18px;
    text-align: right;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.58);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ksi-calculator-display {
    width: 100%;
    min-height: 50px;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    color: #ffffff;
    font-size: 38px;
    line-height: 1.2;
    text-align: right;
    font-weight: 700;
    outline: none;
    font-variant-numeric: tabular-nums;
}

.ksi-calculator-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ksi-calculator-key {
    min-height: 54px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    color: #ffffff;
    font-size: 19px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.08s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.ksi-calculator-key:hover,
.ksi-calculator-key:focus {
    background: rgba(255, 255, 255, 0.20);
    outline: none;
}

.ksi-calculator-key:active {
    transform: scale(0.96);
}

.ksi-calculator-key-muted {
    background: rgba(148, 163, 184, 0.22);
    color: rgba(255, 255, 255, 0.88);
}

.ksi-calculator-key-operator {
    background: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
}

.ksi-calculator-key-operator:hover,
.ksi-calculator-key-operator:focus {
    background: linear-gradient(135deg, #fb923c 0%, #f472b6 100%);
}

.ksi-calculator-key-equals {
    grid-row: span 2;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
}

.ksi-calculator-key-equals:hover,
.ksi-calculator-key-equals:focus {
    background: linear-gradient(135deg, #34d399 0%, #22d3ee 100%);
}

.ksi-calculator-key-zero {
    grid-column: span 2;
}

.ksi-calculator-footer {
    margin-top: 14px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.62);
}

.ksi-calculator-footer a {
    color: #67e8f9;
    text-decoration: none;
    font-weight: 700;
}

.ksi-calculator-footer a:hover,
.ksi-calculator-footer a:focus {
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 420px) {
    .ksi-calculator-launcher {
        width: 54px;
        height: 54px;
        right: 16px;
        bottom: 72px;
    }

    .ksi-calculator-panel {
        width: calc(100vw - 20px);
        min-height: 430px;
    }

    .ksi-calculator-panel-inner {
        padding: 14px;
    }

    .ksi-calculator-display {
        font-size: 32px;
    }

    .ksi-calculator-key {
        min-height: 50px;
        border-radius: 14px;
    }
}