.trade-ticket-strip {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.trade-ticket-strip article,
.trade-ticket-strip label {
    min-height: 92px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent),
        var(--panel);
}

.trade-ticket-strip span,
.calc-cell span,
.input-grid span,
.risk-stack span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.trade-ticket-strip strong,
.trade-ticket-strip input {
    display: block;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 30px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.calc-output-panel {
    margin-top: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent),
        rgba(18, 21, 27, 0.82);
    overflow: hidden;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.calc-cell {
    min-height: 124px;
    padding: 18px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.calc-cell:nth-child(4),
.calc-cell:nth-child(8) {
    border-right: none;
}

.calc-cell strong {
    display: block;
    margin-top: 20px;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.calc-cell.positive strong {
    color: var(--green);
}

.calc-cell.danger strong {
    color: var(--red);
}

.calc-cell.blue strong {
    color: var(--blue);
}

.long-short-layout {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr;
    gap: 18px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.input-grid label {
    min-height: 104px;
    padding: 18px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.input-grid label:nth-child(3n) {
    border-right: none;
}

.input-grid input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.input-grid input:focus,
.trade-ticket-strip input:focus {
    color: var(--green);
}

.risk-panel {
    align-self: stretch;
}

.risk-stack {
    display: grid;
}

.risk-stack article {
    min-height: 94px;
    padding: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.risk-stack article:last-child {
    border-bottom: none;
}

.risk-stack strong {
    display: block;
    margin-top: 10px;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.05em;
}

.risk-warning {
    margin: 18px;
    padding: 14px;
    border: 1px solid rgba(255, 69, 69, 0.4);
    border-radius: 14px;
    background: rgba(255, 69, 69, 0.08);
    color: var(--red);
    font-size: 13px;
    font-weight: 900;
}

.hidden {
    display: none;
}

.trade-actions-panel {
    margin-top: 18px;
    min-height: 94px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent),
        rgba(18, 21, 27, 0.82);
}

.trade-actions-panel h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.04em;
}

.trade-actions-panel p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.trade-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reset-pill {
    border: 1px solid rgba(255, 69, 69, 0.35);
    border-radius: 999px;
    padding: 14px 20px;
    background: rgba(255, 69, 69, 0.1);
    color: var(--red);
    font-weight: 900;
}

.methodology-pill {
    border: 1px solid rgba(54, 163, 255, 0.35);
    border-radius: 999px;
    padding: 14px 20px;
    background: rgba(54, 163, 255, 0.1);
    color: var(--blue);
    font-weight: 900;
}

.methodology-pill:hover {
    background: rgba(54, 163, 255, 0.16);
}

.methodology-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 28px;
}

.methodology-modal.hidden {
    display: none;
}

.methodology-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(14px);
}

.methodology-dialog {
    position: relative;
    width: min(1180px, 100%);
    max-height: calc(100vh - 56px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(43, 220, 101, 0.08), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent),
        rgba(18, 21, 27, 0.98);
    box-shadow: 0 32px 120px rgba(0, 0, 0, 0.5);
}

.methodology-header {
    min-height: 110px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.methodology-header span,
.methodology-grid article span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.methodology-header h2 {
    margin: 0;
    font-size: 42px;
    line-height: 0.95;
    letter-spacing: -0.07em;
}

.methodology-header p {
    margin: 10px 0 0;
    color: var(--muted);
    font-weight: 750;
}

.modal-close-button {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
}

.methodology-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.methodology-grid article {
    min-height: 170px;
    padding: 22px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.methodology-grid article:nth-child(3n) {
    border-right: none;
}

.methodology-grid article strong {
    display: block;
    margin-bottom: 10px;
    font-size: 22px;
    letter-spacing: -0.05em;
}

.methodology-grid article p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
    font-size: 14px;
    font-weight: 750;
}

@media (max-width: 980px) {
    .methodology-grid {
        grid-template-columns: 1fr;
    }

    .methodology-grid article {
        border-right: none;
    }

    .methodology-header h2 {
        font-size: 34px;
    }
}

@media (max-width: 1180px) {

    .trade-ticket-strip,
    .long-short-layout {
        grid-template-columns: 1fr;
    }

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

    .calc-cell:nth-child(2),
    .calc-cell:nth-child(4),
    .calc-cell:nth-child(6),
    .calc-cell:nth-child(8) {
        border-right: none;
    }

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

    .input-grid label:nth-child(3n) {
        border-right: 1px solid var(--border);
    }

    .input-grid label:nth-child(2n) {
        border-right: none;
    }
}

@media (max-width: 720px) {

    .calc-grid,
    .input-grid {
        grid-template-columns: 1fr;
    }

    .calc-cell,
    .input-grid label {
        border-right: none;
    }

    .trade-actions-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .trade-actions {
        flex-direction: column;
        align-items: stretch;
    }
}