:root {
    color-scheme: dark light;
    --primary-dark: #0D1B2A;
    --slate-dark: #1B263B;
    --slate-blue: #415A77;
    --accent-cyan: #00C6FF;
    --accent-blue: #00A8E8;
    --accent-green: #32CD32;
    --accent-amber: #FFB300;
    --text-white: #FFFFFF;
    --text-muted: #A3A3A3;
    --bg-soft: #F1F1F1;
    --ui-deep: #0F3057;
    --ui-teal: #008080;
    --shadow: rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg-soft);
    color: var(--slate-dark);
    min-height: 100vh;
}

[hidden] {
    display: none !important;
}

.layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-soft);
}

.sidebar {
    width: 280px;
    background: var(--primary-dark);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 24px;
    transition: width 0.3s ease, transform 0.3s ease;
    box-shadow: 4px 0 12px var(--shadow);
}

.sidebar--collapsed {
    width: 80px;
}

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

.sidebar__logo {
    width: 52px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.sidebar__title {
    font-weight: 700;
    letter-spacing: 0.08em;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar__toggle {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--text-white);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: border 0.2s ease, color 0.2s ease;
}

.sidebar__toggle:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.sidebar__link {
    text-decoration: none;
    color: var(--text-white);
    padding: 12px 14px;
    border-radius: 10px;
    transition: background 0.2s ease, color 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar__link--active,
.sidebar__link:hover {
    background: rgba(0, 198, 255, 0.2);
    color: var(--accent-cyan);
}

.sidebar__icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar--collapsed .sidebar__link {
    justify-content: center;
}

.sidebar--collapsed .sidebar__link-text,
.sidebar--collapsed .sidebar__title {
    display: none;
}

.sidebar--collapsed .sidebar__toggle {
    align-self: center;
}

.sidebar__footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.sidebar__user {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar__label {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar__value {
    font-weight: 600;
}


.sidebar__user-icon {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    cursor: default;
}

.sidebar--collapsed .sidebar__user {
    align-items: center;
}

.sidebar--collapsed .sidebar__label,
.sidebar--collapsed .sidebar__value {
    display: none;
}

.sidebar--collapsed .sidebar__user-icon {
    display: inline-flex;
}

.content {
    flex: 1;
    padding: 32px 40px;
}

.content__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 13px;
}

.language-switcher__label {
    color: var(--text-muted);
}

.language-switcher__link {
    text-decoration: none;
    color: var(--slate-dark);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
}

.language-switcher__link.is-active,
.language-switcher__link:hover {
    background: var(--accent-cyan);
    color: #fff;
}

.content__header h1 {
    color: var(--slate-dark);
    font-size: 28px;
}

.content__header p {
    color: var(--text-muted);
    margin-top: 8px;
}

.header__logo img {
    width: 160px;
    height: auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.panel {
    background: var(--bg-soft);
}

.panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid--two {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid--max-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alert {
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(13, 27, 42, 0.08);
}

.alert--success {
    background: rgba(50, 205, 50, 0.12);
    border: 1px solid rgba(50, 205, 50, 0.3);
    color: #1b5e20;
}

.alert--error {
    background: rgba(214, 69, 69, 0.12);
    border: 1px solid rgba(214, 69, 69, 0.35);
    color: #7f1d1d;
}

.alert__message {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.alert__message--critical {
    background: rgba(214, 69, 69, 0.18);
    border-radius: 10px;
    padding: 10px 12px;
    border: 2px solid rgba(214, 69, 69, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.alert__icon {
    font-size: 18px;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 12px 24px rgba(13, 27, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calculator-panel {
    padding: 0;
}

.calculator-panel__summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    cursor: pointer;
}

.calculator-panel__summary-content {
    flex: 1;
    min-width: 0;
}

.calculator-panel__title-row {
    align-items: center;
    display: flex;
    gap: 10px;
}

.calculator-panel__title-row h3 {
    margin: 0;
}

.calculator-panel__copy {
    flex: 0 0 auto;
}

.calculator-panel__copy-hint {
    margin-top: 6px;
}

.calculator-panel__toggle-label {
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.calculator-panel__summary::-webkit-details-marker {
    display: none;
}

.calculator-panel__toggle-icon {
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.calculator-panel[open] .calculator-panel__toggle-icon {
    transform: rotate(180deg);
}

.calculator-panel__body {
    border-top: 1px solid rgba(13, 27, 42, 0.08);
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calculator-panel__search {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calculator-panel__search input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(13, 27, 42, 0.2);
}

.formula-status {
    font-size: 12px;
    margin-top: 6px;
}

.formula-status--ok {
    color: var(--accent-green);
}

.formula-status--error {
    color: #d64545;
}

.formula-status--muted {
    color: var(--text-muted);
}

.card__hint {
    color: var(--text-muted);
}

.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.password-input {
    position: relative;
}

.password-input input[type="password"],
.password-input input[type="text"] {
    width: 100%;
    padding-right: 42px;
}

.password-input__toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0.7;
}

.password-input__toggle:hover {
    opacity: 1;
}

.form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.form__actions--spread {
    justify-content: space-between;
    align-items: center;
}

.form__actions-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.plan-symbols__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.plan-symbols__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.plan-type {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-type__option {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(65, 90, 119, 0.2);
    background: #f9fafc;
}

.plan-type__option input {
    margin-top: 4px;
}

.plan-type__option input:disabled ~ div {
    opacity: 0.6;
}

.plan-type__reason {
    color: #d64545;
    font-size: 12px;
    margin-top: 4px;
}

.plan-backtest__label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-backtest__range {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.plan-backtest__error {
    color: #d64545;
}

.plan-amount {
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-amount__row {
    align-items: start;
}

.plan-amount__currency {
    font-weight: 600;
    color: var(--text-muted);
}

.plan-executing {
    font-weight: 600;
}

.plan-executing-summary {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 176, 0, 0.35);
    background: rgba(255, 176, 0, 0.1);
}

.plan-executing-summary[data-state="paused"] {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(96, 165, 250, 0.12);
}

.plan-pause-editable {
    padding: 12px;
    border-radius: 10px;
    border: 1px dashed rgba(96, 165, 250, 0.45);
    background: rgba(96, 165, 250, 0.06);
    margin-bottom: 12px;
}

.plan-executing-summary h4 {
    margin-bottom: 8px;
}

.plan-executing-summary__grid {
    display: grid;
    gap: 6px;
}

.plan-executing-summary__item {
    font-size: 13px;
}

.form__hint {
    color: var(--text-muted);
    font-size: 13px;
}

.formula-helper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f6f8fb;
    border: 1px solid rgba(65, 90, 119, 0.15);
}

.formula-helper__section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.formula-helper__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.formula-helper__note {
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    margin-left: 6px;
    color: var(--text-muted);
}

.formula-helper__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.formula-helper__filters {
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
    gap: 8px;
}

.formula-helper__filters select,
.formula-helper__filters input {
    font-size: 12px;
    padding: 6px 8px;
}

.formula-helper__category {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.formula-helper__category-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.formula-helper__empty {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}


.formula-token {
    border: 1px solid rgba(65, 90, 119, 0.2);
    border-radius: 999px;
    padding: 4px 10px;
    background: #fff;
    color: var(--slate-dark);
    font-size: 12px;
    cursor: pointer;
}

.formula-token:hover,
.formula-token:focus-visible {
    background: var(--slate-dark);
    color: var(--text-white);
}

.formula-calculator {
    position: relative;
}

.formula-token--calculator {
    font-weight: 600;
}

.formula-calculator__panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 12;
    min-width: 220px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(65, 90, 119, 0.2);
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(17, 17, 17, 0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.formula-calculator__options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.formula-token--interval {
    border-radius: 8px;
}

.formula-calculator__hint {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-muted);
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(65, 90, 119, 0.08);
    border: 1px dashed rgba(65, 90, 119, 0.2);
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.formula-calculator__hint strong {
    color: var(--text-default);
}

.formula-calculator__hint-icon {
    font-style: normal;
    font-size: 12px;
    line-height: 1.2;
}

.formula-calculator__hint--description {
    justify-content: space-between;
}

.formula-calculator__catalog-link {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    color: var(--text-muted);
    margin-left: 6px;
}

.formula-calculator__catalog-link:hover {
    color: var(--primary);
}

.formula-calculator__dots {
    font-size: 16px;
    line-height: 1;
}

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

@media (max-width: 768px) {
    .formula-calculator__panel {
        position: static;
        margin-top: 6px;
        width: 100%;
        box-shadow: none;
    }
}

.formula-test {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.formula-test__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.formula-test__controls input {
    flex: 1 1 160px;
}

.formula-test__result {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    background: rgba(214, 69, 69, 0.1);
    border: 1px solid rgba(214, 69, 69, 0.25);
    color: #8f2f2f;
}

.formula-test__result--ok {
    background: rgba(39, 174, 96, 0.12);
    border-color: rgba(39, 174, 96, 0.35);
    color: #1e7a4f;
}

.formula-test__status {
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.formula-test__resolved {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-word;
}

.strategy-block {
    border-radius: 12px;
    border: 1px solid rgba(65, 90, 119, 0.2);
    background: #f6f8fb;
    overflow: hidden;
}

.strategy-block__summary {
    cursor: pointer;
    padding: 14px 16px;
    background: rgba(65, 90, 119, 0.08);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.strategy-block__summary::-webkit-details-marker {
    display: none;
}

.strategy-block__summary h4 {
    margin: 0;
}

.strategy-block__summary .card__hint {
    margin-top: 4px;
}

.strategy-block__summary-content {
    display: flex;
    flex-direction: column;
}

.strategy-block__indicator {
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(65, 90, 119, 0.7);
    border-bottom: 2px solid rgba(65, 90, 119, 0.7);
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    flex: 0 0 auto;
}

.strategy-block[open] .strategy-block__summary {
    border-bottom: 1px solid rgba(65, 90, 119, 0.15);
}

.strategy-block[open] .strategy-block__indicator {
    transform: rotate(45deg);
}

.strategy-block__body {
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.plan-risk-inline {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(140px, 180px);
    gap: 10px;
    align-items: end;
}

.plan-risk-inline__limit {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-risk-inline__limit label {
    font-size: 13px;
}

label {
    font-weight: 600;
    color: var(--slate-dark);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(65, 90, 119, 0.3);
    background: #fff;
    color: var(--slate-dark);
    caret-color: var(--slate-dark);
    font-size: 14px;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder,
input[type="number"]::placeholder,
input[type="date"]::placeholder {
    color: rgba(27, 38, 59, 0.58);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus {
    border-color: var(--accent-cyan);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.2);
}

textarea {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(65, 90, 119, 0.3);
    font-size: 14px;
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

textarea:focus {
    border-color: var(--accent-cyan);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.2);
}

.button {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.button--primary {
    background: var(--accent-cyan);
    color: var(--primary-dark);
}

.button--secondary {
    background: var(--slate-blue);
    color: var(--text-white);
}

.button--ghost {
    background: transparent;
    border: 1px solid rgba(65, 90, 119, 0.3);
    color: var(--slate-dark);
}
.button--danger-soft {
    background: #d7263d;
    color: #fff;
}
.button--warning-soft {
    background: #c75b12;
    color: #fff;
}
.button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.manual-execute-bulk-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.plan-bulk-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.button--danger-solid {
    background: #c91f37;
    border-color: #c91f37;
    color: #fff;
}

.button--danger-solid:hover {
    background: #a8182d;
    border-color: #a8182d;
    color: #fff;
}

.bulk-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.45);
}

.bulk-loading-overlay__card {
    max-width: 520px;
    width: min(520px, 100%);
    padding: 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    text-align: center;
}

.bulk-loading-overlay__spinner {
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 14px;
    border: 4px solid #f1b6bf;
    border-right-color: #c91f37;
    border-radius: 50%;
    animation: button-spin 0.75s linear infinite;
}

.bulk-loading-overlay__message {
    margin: 0;
    color: #1f2937;
    font-weight: 700;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}


.button--loading {
    pointer-events: none;
    opacity: 0.85;
}

.button__spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -0.15em;
    animation: button-spin 0.75s linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

.notice {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.notice--success {
    background: rgba(50, 205, 50, 0.15);
    border: 1px solid rgba(50, 205, 50, 0.4);
}

.notice--error {
    background: rgba(255, 179, 0, 0.15);
    border: 1px solid rgba(255, 179, 0, 0.4);
}

.notice ul {
    list-style: none;
    display: grid;
    gap: 8px;
}

.select-table {
    position: relative;
}

.select-table__toggle {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(65, 90, 119, 0.3);
    background: #fff;
    cursor: pointer;
}

.select-table__panel {
    display: none;
    position: absolute;
    z-index: 10;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
    padding: 12px;
}

.select-table__panel.is-open {
    display: block;
}

.select-table__search {
    width: 100%;
    margin-bottom: 12px;
}

.select-table__table {
    max-height: 240px;
    overflow: auto;
}

.select-table__table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.select-table__table th,
.select-table__table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid rgba(65, 90, 119, 0.1);
}

.select-table__table tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

.select-table__table tr:hover {
    background: rgba(0, 198, 255, 0.1);
}

.select-table__table tr.is-selected {
    background: rgba(0, 198, 255, 0.2);
}

.select-table__title {
    font-weight: 600;
    margin-bottom: 8px;
}

.interface-details {
    background: var(--bg-soft);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(65, 90, 119, 0.15);
}

.interface-details__title {
    font-weight: 600;
    margin-bottom: 8px;
}

.interface-details__content p {
    color: var(--text-muted);
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-grid__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(65, 90, 119, 0.08);
    font-size: 13px;
}

.connector-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-search-row {
    margin: 10px 0 14px;
}

.list-search-row__input {
    width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid rgba(65, 90, 119, 0.24);
}

.connector-list__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(65, 90, 119, 0.18);
    background: linear-gradient(150deg, rgba(13, 27, 42, 0.035), rgba(255, 255, 255, 0.72));
    box-shadow: 0 8px 22px rgba(13, 27, 42, 0.08);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.connector-list__item:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(13, 27, 42, 0.12);
}

.connector-list__item.is-active {
    border-color: rgba(0, 198, 255, 0.85);
    box-shadow: 0 0 0 2px rgba(0, 198, 255, 0.22), 0 12px 24px rgba(13, 27, 42, 0.12);
}

.connector-list__item--executing {
    background: rgba(255, 176, 0, 0.14);
}

.connector-list__item--paused {
    background: rgba(96, 165, 250, 0.14);
}

.plan-executing-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 176, 0, 0.2);
    color: #6a3f00;
    font-size: 12px;
    font-weight: 600;
}

.plan-kpis {
    margin-top: 10px;
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
}

.plan-kpi {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    padding: 8px 10px;
    background: rgba(13, 27, 42, 0.06);
    color: var(--slate-dark);
    font-weight: 600;
}

.plan-kpi__icon {
    opacity: 0.9;
}

.plan-kpi__icon.is-profit {
    color: #1f9d55;
}

.plan-kpi__icon.is-loss {
    color: #b73333;
}

.plan-kpi--profit {
    min-width: 124px;
    font-size: 18px;
    padding: 10px 12px;
}

.plan-kpi--profit.is-profit {
    background: rgba(46, 204, 113, 0.18);
    color: #1f9d55;
}

.plan-kpi--profit.is-loss {
    background: rgba(214, 69, 69, 0.16);
    color: #b73333;
}

.plan-kpi--minor {
    font-size: 13px;
    color: var(--text-muted);
}

.connector-list__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.strategy-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.strategy-list__section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-top: 8px;
}

.strategy-list__divider {
    width: 100%;
    border: none;
    border-top: 1px solid rgba(65, 90, 119, 0.2);
    margin: 4px 0;
}

.strategy-list__item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(65, 90, 119, 0.18);
    background: linear-gradient(150deg, rgba(13, 27, 42, 0.035), rgba(255, 255, 255, 0.72));
    box-shadow: 0 8px 22px rgba(13, 27, 42, 0.08);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.strategy-list__item:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(13, 27, 42, 0.12);
}

.strategy-list__item.is-active {
    border-color: rgba(0, 198, 255, 0.85);
    box-shadow: 0 0 0 2px rgba(0, 198, 255, 0.22), 0 12px 24px rgba(13, 27, 42, 0.12);
}

.strategy-list__item--system {
    background: rgba(0, 198, 255, 0.12);
    border: 1px solid rgba(0, 198, 255, 0.4);
}

.strategy-list__item--lineage-latest {
    border-color: rgba(46, 204, 113, 0.35);
    background: linear-gradient(150deg, rgba(46, 204, 113, 0.08), rgba(255, 255, 255, 0.72));
}

.strategy-list__item--lineage-older {
    opacity: 0.88;
}

.strategy-lineage-details summary {
    cursor: pointer;
    user-select: none;
}

.strategy-list__meta {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.strategy-list__details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.strategy-list__actions {
    align-items: flex-start;
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    white-space: nowrap;
}

.strategy-list__actions form {
    display: flex;
}

.strategy-list__actions .button {
    flex: 0 0 auto;
}


.strategy-version-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 8px;
}

.strategy-version-banner--new {
    background: rgba(65, 90, 119, 0.1);
    color: var(--text-muted);
}

.strategy-version-banner--latest {
    background: rgba(42, 157, 143, 0.15);
    color: #1b6f65;
}

.strategy-version-banner--older {
    background: rgba(244, 162, 97, 0.2);
    color: #8a4a0d;
}

.strategy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.calculator-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.calculator-table th,
.calculator-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(65, 90, 119, 0.12);
    vertical-align: top;
}

.calculator-table th {
    color: var(--slate-dark);
    font-weight: 600;
    background: rgba(65, 90, 119, 0.08);
}

.calculator-table--compact {
    font-size: 13px;
}

.calculator-table--compact th,
.calculator-table--compact td {
    padding: 8px 9px;
}

.calculator-table__row--danger td {
    background: rgba(220, 53, 69, 0.12);
    color: #8b1f2d;
    font-weight: 600;
}

.balance-diff--positive {
    color: #1f7a1f;
    font-weight: 600;
}

.balance-diff--negative {
    color: #b42318;
    font-weight: 600;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}


.plan-trades {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.plan-trades__section {
    padding: 14px;
    border-radius: 12px;
    background: rgba(13, 27, 42, 0.03);
}

.plan-trades__plan-title {
    margin-bottom: 10px;
}

.plan-trades__run {
    border: 1px solid rgba(65, 90, 119, 0.2);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
    margin-bottom: 10px;
}

.plan-trades__run--active {
    border-color: rgba(255, 176, 0, 0.7);
    background: rgba(255, 176, 0, 0.12);
}

.plan-trades__run summary {
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
}

.plan-trades__run summary::-webkit-details-marker,
.plan-trades__positions summary::-webkit-details-marker {
    display: none;
}

.plan-trades__toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    color: var(--text-muted);
    font-size: 14px;
    transition: transform 0.2s ease;
}

.plan-trades__run[open] > summary .plan-trades__toggle-icon,
.plan-trades__positions[open] > summary .plan-trades__toggle-icon {
    transform: rotate(90deg);
}

.plan-trades__summary-title {
    font-weight: 700;
}

.plan-trades__summary-meta {
    color: var(--text-muted);
    font-size: 13px;
}


.plan-kpis--compact {
    margin-top: 0;
    margin-left: auto;
}

.plan-kpi--compact {
    padding: 5px 8px;
    border-radius: 10px;
    gap: 6px;
    font-size: 12px;
}

.plan-kpi--compact.plan-kpi--profit {
    min-width: 0;
    font-size: 13px;
    padding: 6px 9px;
}

.plan-kpi__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    opacity: 0.8;
}

.plan-trades__details {
    width: 100%;
}

.plan-trades__details > summary {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 6px;
}

.plan-trades__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px 0 8px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 176, 0, 0.12);
}


.plan-trades__delete-form {
    margin-top: 8px;
}

.plan-trades__delete-form .button {
    color: #b91c1c;
}

.plan-trades__positions {
    width: 100%;
}

.plan-trades__positions summary {
    cursor: pointer;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-trades__controls {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.plan-trades__controls input,
.plan-trades__controls select {
    padding: 6px 8px;
}

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

.plan-trades__pagination button {
    padding: 2px 8px;
}

.plan-trades__position-change {
    font-weight: 700;
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.plan-trades__position-change.is-profit {
    color: #1f9d55;
}

.plan-trades__position-change.is-loss {
    color: #d64545;
}

.password-strength {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.password-strength__value[data-strength="weak"] {
    color: #c0392b;
    font-weight: 600;
}

.password-strength__value[data-strength="medium"] {
    color: #f39c12;
    font-weight: 600;
}

.password-strength__value[data-strength="strong"] {
    color: #2ecc71;
    font-weight: 600;
}

.referral-card {
    margin-top: 24px;
}

.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 16px;
    background: linear-gradient(135deg, rgba(13, 27, 42, 0.9), rgba(65, 90, 119, 0.9));
}

.auth-card {
    width: min(480px, 100%);
    background: #fff;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-card__header h1 {
    font-size: 26px;
    color: var(--primary-dark);
}

.auth-card__header p {
    color: var(--text-muted);
    margin-top: 6px;
}

.auth-card__header .auth-card__referral {
    color: rgba(65, 90, 119, 0.68);
    font-size: 13px;
    margin-top: 4px;
}

.auth-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 4px;
    padding: 8px;
    border: 1px solid rgba(0, 198, 255, 0.12);
    border-radius: 12px;
    background: rgba(241, 241, 241, 0.52);
    font-size: 12px;
}

.auth-footer a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 9px;
    overflow: hidden;
    border: 1px solid rgba(65, 90, 119, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    color: var(--ui-deep);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.auth-footer a::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 198, 255, 0.1), rgba(0, 128, 128, 0.08));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.auth-footer a:hover,
.auth-footer a:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(0, 198, 255, 0.55);
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-dark);
    box-shadow: 0 6px 14px rgba(13, 27, 42, 0.1);
}

.auth-footer a:hover::before,
.auth-footer a:focus-visible::before {
    opacity: 1;
}

.chip {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 198, 255, 0.12);
    color: var(--slate-dark);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chip input {
    margin-right: 4px;
}

.auth-fields {
    display: grid;
    gap: 10px;
}

.accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion__item {
    border-radius: 12px;
    border: 1px solid rgba(65, 90, 119, 0.2);
    background: #fff;
    padding: 12px 16px;
}

.accordion__summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.accordion__summary::-webkit-details-marker {
    display: none;
}

.accordion__body {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.accordion__actions {
    display: flex;
    gap: 10px;
}

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

.connector-meta .label {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
}

.status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status--ok {
    background: rgba(50, 205, 50, 0.2);
    color: var(--accent-green);
}

.status--error {
    background: rgba(255, 179, 0, 0.2);
    color: var(--accent-amber);
}

.status--idle {
    background: rgba(65, 90, 119, 0.1);
    color: var(--slate-blue);
}

.muted {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 6px;
}

.empty {
    color: var(--text-muted);
    font-style: italic;
}

.dashboard__list {
    list-style: none;
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.dashboard__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.dashboard__item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dashboard__item-title {
    font-weight: 600;
}

.button--small {
    padding: 6px 12px;
    font-size: 12px;
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        z-index: 20;
        height: 100vh;
        transform: translateX(0);
    }

    .sidebar--collapsed {
        transform: translateX(0);
    }

    .content {
        padding: 24px;
        margin-left: 280px;
    }

    .sidebar--collapsed ~ .content {
        margin-left: 80px;
    }
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.dashboard-kpi-tile {
    background: rgba(29, 78, 216, 0.08);
    border: 1px solid rgba(29, 78, 216, 0.18);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dashboard-kpi-tile > span:not(.muted) {
    color: var(--slate-dark);
    font-size: 13px;
    font-weight: 600;
}

.dashboard-kpi-tile strong {
    font-size: 20px;
}

.dashboard-kpi-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dashboard-kpi-value.is-profit {
    color: #1f9d55;
}

.dashboard-kpi-value.is-loss {
    color: #b73333;
}

.dashboard-kpi-value.is-profit .plan-kpi__icon {
    color: #1f9d55;
}

.dashboard-kpi-value.is-loss .plan-kpi__icon {
    color: #b73333;
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.dashboard-trade-search {
    min-width: 260px;
    border-radius: 10px;
    border: 1px solid rgba(13, 27, 42, 0.2);
    padding: 8px 10px;
}

.trades-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 1rem;
}

.trades-filter-field {
    display: flex;
    flex: 0 1 200px;
    flex-direction: column;
    gap: 6px;
    width: min(100%, 200px);
}

.trades-filter-field select {
    width: 100%;
}

.dashboard-trade-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.dashboard-trade-pagination button {
    border: 1px solid rgba(13, 27, 42, 0.15);
    border-radius: 8px;
    padding: 2px 10px;
    background: #fff;
}

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

.dashboard-multiselect {
    position: relative;
    width: 100%;
}

.dashboard-multiselect__trigger {
    width: 100%;
    border: 1px solid rgba(13, 27, 42, 0.22);
    border-radius: 10px;
    background: linear-gradient(180deg, #fff 0%, #f5f8ff 100%);
    color: #18263a;
    padding: 9px 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(13, 27, 42, 0.05);
}

.dashboard-multiselect__trigger:hover {
    border-color: rgba(29, 78, 216, 0.4);
}

.dashboard-multiselect__panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 8;
    background: #fff;
    border: 1px solid rgba(13, 27, 42, 0.14);
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(13, 27, 42, 0.16);
    padding: 8px;
    display: none;
    max-height: 240px;
    overflow-y: auto;
}

.dashboard-multiselect.is-open .dashboard-multiselect__panel {
    display: grid;
    gap: 4px;
}

.dashboard-multiselect__option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 7px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.dashboard-multiselect__option:hover {
    background: rgba(29, 78, 216, 0.08);
}

.dashboard-multiselect__option input {
    width: 16px;
    height: 16px;
    accent-color: #1d4ed8;
}

.dashboard__item--compact {
    opacity: 0.8;
    font-size: 12px;
}


.dashboard-inline-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.dashboard-inline-kpis .dashboard-kpi-tile {
    padding: 10px;
}

.dashboard-inline-kpis .dashboard-kpi-tile strong {
    font-size: 18px;
}

.dashboard-kpi-debug {
    margin-bottom: 20px;
}

.dashboard-kpi-debug-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.dashboard-kpi-debug-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
}

.dashboard-kpi-connector-breakdown {
    margin-top: 8px;
    display: grid;
    gap: 4px;
}

.dashboard-kpi-connector-row {
    font-size: 14px;
    color: #314155;
    font-weight: 600;
}

.dashboard-kpi-connector-name {
    color: var(--slate-dark);
    font-weight: 700;
}

.dashboard-kpi-connector-row strong {
    color: var(--slate-dark);
    font-weight: 700;
    font-size: 15px;
}

.dashboard-kpi-connector-row .dashboard-kpi-value {
    font-weight: 700;
}

.dashboard-kpi-connector-meta {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.dashboard-kpi-connector-meta-value {
    font-size: 12px;
    font-weight: 700;
}

.dashboard-kpi-connector-row .plan-kpi__icon {
    font-size: 12px;
    opacity: 1;
}

.dashboard-inline-kpis--compact {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    margin-top: 4px;
}

.dashboard-inline-kpis--compact .dashboard-kpi-tile {
    padding: 6px;
}

.dashboard-inline-kpis--compact .dashboard-kpi-tile strong {
    font-size: 13px;
}

.dashboard-inline-kpis--running-plans {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.dashboard-inline-kpis--running-plans .dashboard-kpi-tile {
    padding: 5px 6px;
    border-radius: 10px;
    width: 100%;
    max-width: none;
}

.dashboard-inline-kpis--running-plans .dashboard-kpi-tile--balance {
    min-width: 0;
}

.dashboard-inline-kpis--running-plans .dashboard-kpi-tile > span:not(.muted) {
    font-size: 11px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.dashboard-inline-kpis--running-plans .dashboard-kpi-tile strong {
    font-size: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.dashboard-inline-kpis--running-plans .dashboard-kpi-tile strong .dashboard-kpi-subvalue {
    font-size: 11px;
}

.dashboard-inline-kpis--auto-content {
    grid-template-columns: repeat(2, minmax(0, 45%));
    justify-content: space-between;
}

.dashboard-inline-kpis--auto-content .dashboard-kpi-tile {
    width: 100%;
    max-width: none;
}

.dashboard-inline-kpis--auto-content .dashboard-kpi-tile > span:not(.muted),
.dashboard-inline-kpis--auto-content .dashboard-kpi-tile strong {
    white-space: normal;
    overflow-wrap: anywhere;
}

.dashboard-collapsible {
    border-radius: 12px;
    border: 1px solid rgba(65, 90, 119, 0.2);
    background: #fff;
    margin-bottom: 16px;
    padding: 12px 16px;
}

.dashboard-collapsible > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--slate-dark);
}

.dashboard-collapsible > summary::-webkit-details-marker {
    display: none;
}

.dashboard-collapsible__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(13, 27, 42, 0.08);
    color: var(--slate-dark);
    font-size: 14px;
}

.dashboard-collapsible__icon::before {
    content: '▸';
}

.dashboard-collapsible[open] .dashboard-collapsible__icon::before {
    content: '▾';
}

.dashboard-collapsible__body {
    margin-top: 12px;
}

.dashboard-inline-kpis--running-plans .plan-kpi--profit {
    min-width: 0;
    font-size: inherit;
    padding: 5px 6px;
}

.connector-list__actions .button[title] {
    min-width: 34px;
    text-align: center;
    padding: 4px 8px;
}

.stack--narrow {
    max-width: 780px;
    margin: 0 auto;
}

.formula-helper__empty[hidden] {
    display: none;
}

.button--icon-eye {
    font-size: 1em;
    line-height: 1;
}

.dashboard-collapsible--card {
    padding: 12px 16px;
}

.dashboard-collapsible--card > .dashboard-collapsible__body {
    margin-top: 10px;
}

.dashboard-kpi-tile--backtest {
    background: #f3f4f6;
}

.heatmap-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 12px;
}

.heatmap-toolbar__controls {
    flex-basis: 100%;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.heatmap-picker {
    position: relative;
}

.heatmap-picker details {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 6px;
    background: #fff;
    min-width: 280px;
}

.heatmap-picker details#hm-connector-select {
    min-width: 520px;
}

.heatmap-picker summary {
    cursor: pointer;
    font-weight: 600;
}

.heatmap-picker__table {
    max-height: 240px;
    overflow: auto;
    margin-top: 8px;
}

.heatmap-picker table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}

.heatmap-picker th,
.heatmap-picker td {
    padding: 4px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.heatmap-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.heatmap-wrap {
    overflow: auto;
    max-height: 70vh;
    max-width: 100%;
    border: 1px solid #ddd;
}

.heatmap {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 900px;
    width: max-content;
}

.heatmap th,
.heatmap td {
    border-right: 1px solid #e1e1e1;
    border-bottom: 1px solid #e1e1e1;
    padding: 8px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
}

.heatmap thead th {
    position: sticky;
    top: 0;
    background: #f8f8f8;
    z-index: 3;
}

.heatmap .first-col {
    position: sticky;
    left: 0;
    background: #fbfbfb;
    z-index: 2;
    text-align: left;
    font-weight: 600;
}

.heatmap thead .first-col {
    z-index: 4;
}

.cell-true {
    background: #c8f7c5;
}

.cell-false {
    background: #f7c5c5;
}

.cell-empty {
    background: #f2f2f2;
    color: #888;
}

.heatmap-input--search-all {
    width: 160px;
}

.heatmap-input--search-symbol {
    width: 140px;
}

.heatmap-input--refresh {
    width: 72px;
}

.heatmap-cell--pos-1 { background: rgba(16, 185, 129, 0.22); }
.heatmap-cell--pos-2 { background: rgba(16, 185, 129, 0.29); }
.heatmap-cell--pos-3 { background: rgba(16, 185, 129, 0.36); }
.heatmap-cell--pos-4 { background: rgba(16, 185, 129, 0.43); }
.heatmap-cell--pos-5 { background: rgba(16, 185, 129, 0.50); }
.heatmap-cell--pos-6 { background: rgba(16, 185, 129, 0.57); }
.heatmap-cell--pos-7 { background: rgba(16, 185, 129, 0.64); }
.heatmap-cell--pos-8 { background: rgba(16, 185, 129, 0.71); }
.heatmap-cell--pos-9 { background: rgba(16, 185, 129, 0.78); }
.heatmap-cell--pos-10 { background: rgba(16, 185, 129, 0.85); }

.heatmap-cell--neg-1 { background: rgba(239, 68, 68, 0.22); }
.heatmap-cell--neg-2 { background: rgba(239, 68, 68, 0.29); }
.heatmap-cell--neg-3 { background: rgba(239, 68, 68, 0.36); }
.heatmap-cell--neg-4 { background: rgba(239, 68, 68, 0.43); }
.heatmap-cell--neg-5 { background: rgba(239, 68, 68, 0.50); }
.heatmap-cell--neg-6 { background: rgba(239, 68, 68, 0.57); }
.heatmap-cell--neg-7 { background: rgba(239, 68, 68, 0.64); }
.heatmap-cell--neg-8 { background: rgba(239, 68, 68, 0.71); }
.heatmap-cell--neg-9 { background: rgba(239, 68, 68, 0.78); }
.heatmap-cell--neg-10 { background: rgba(239, 68, 68, 0.85); }

.is-highlight-col {
    outline: 2px solid #1d4ed8;
    outline-offset: -2px;
}

.is-highlight-row {
    outline: 2px solid #c2410c;
    outline-offset: -2px;
}













.notice-inline--error {
    color: #b73333;
}

@media (max-width: 900px) {

    .grid--max-two {
        grid-template-columns: 1fr;
    }

    .dashboard-inline-kpis--running-plans {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-inline-kpis--auto-content {
        grid-template-columns: 1fr;
    }
}

.referral-copy-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.referral-share-hint {
    margin: 14px 0 4px;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.referral-copy-row--link {
    margin-top: 4px;
}

.referral-copy-row--highlight {
    padding: 12px 14px;
    border: 1px solid rgba(0, 198, 255, 0.35);
    border-radius: 12px;
    background: rgba(0, 198, 255, 0.08);
}

.referral-copy-row__value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--primary-dark);
}

.referral-copy-row__link {
    overflow-wrap: anywhere;
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.copy-button {
    border: 1px solid rgba(13, 27, 42, 0.15);
    border-radius: 10px;
    background: #fff;
    color: var(--primary-dark);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    min-height: 36px;
    min-width: 36px;
    padding: 8px 10px;
    position: relative;
}

.copy-button:hover,
.copy-button:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 198, 255, 0.18);
    outline: none;
}

.copy-button[data-copy-feedback]::after {
    content: attr(data-copy-feedback);
    position: absolute;
    left: 50%;
    top: calc(100% + 6px);
    transform: translateX(-50%);
    white-space: nowrap;
    border-radius: 999px;
    background: var(--primary-dark);
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    z-index: 2;
}

.affiliate-network-table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.affiliate-network-table th {
    background: rgba(0, 198, 255, 0.08);
    color: var(--primary-dark);
}

.affiliate-network-table th,
.affiliate-network-table td {
    padding: 12px 14px;
    white-space: nowrap;
}

.affiliate-network-table tbody tr {
    background: rgba(0, 198, 255, 0.045);
}

.affiliate-network-table tbody tr:nth-child(even) {
    background: rgba(91, 192, 222, 0.08);
}

.affiliate-network-table tbody tr:hover {
    background: rgba(0, 198, 255, 0.12);
}

.affiliate-network-table tbody td {
    border-top: 1px solid rgba(0, 198, 255, 0.12);
    border-bottom: 1px solid rgba(0, 198, 255, 0.12);
}

.affiliate-network-table tbody td:first-child {
    border-left: 1px solid rgba(0, 198, 255, 0.12);
    border-radius: 10px 0 0 10px;
}

.affiliate-network-table tbody td:last-child {
    border-right: 1px solid rgba(0, 198, 255, 0.12);
    border-radius: 0 10px 10px 0;
}

.table-wrapper--spaced,
.manual-execute-bulk-actions--spaced {
    margin-top: 16px;
}

.manual-execute-pending-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.button--delete-unused {
    color: #bb5b5b;
    border-color: #e7c5c5;
}

.email-vault-contract {
    font-size: 16px;
}

.account-panel > .card,
.account-panel > .grid { margin-top: 24px; }
.docs-page { display: grid; gap: 22px; }
.docs-hero,
.docs-toc,
.docs-section {
    background: #fefefe;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 5px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
}
.docs-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; }
.docs-hero h2 { margin-top: 0; }
.docs-hero__meta { min-width: 260px; padding: 14px; border-radius: 6px; background: linear-gradient(135deg, rgba(30, 64, 175, 0.10), rgba(0, 198, 255, 0.08)); line-height: 1.7; }
.docs-toc { display: flex; flex-wrap: wrap; gap: 10px; }
.docs-toc a { text-decoration: none; padding: 8px 12px; border-radius: 999px; background: rgba(15, 23, 42, 0.06); color: inherit; }
.docs-section summary { cursor: pointer; font-size: 1.15rem; font-weight: 700; }
.docs-content { margin-top: 18px; line-height: 1.75; }
.docs-content p,
.docs-content ul,
.docs-content ol { margin-top: 0; margin-bottom: 14px; }
.docs-content li + li { margin-top: 6px; }
.docs-content h3 { margin-top: 28px; margin-bottom: 12px; }
.docs-content h4 { margin-top: 20px; margin-bottom: 8px; }
.docs-accept { margin-top: 28px; padding: 18px; border-radius: 16px; border: 2px solid rgba(37, 99, 235, 0.35); background: rgba(37, 99, 235, 0.06); }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.checkbox-row input { margin-top: 5px; }
.button--large { font-size: 1.05rem; padding: 14px 22px; margin-top: 16px; }
.auth-card--wide { max-width: 1120px; }
.docs-public .docs-hero { grid-template-columns: 1fr; }
.notice--warning { border-left: 4px solid #f59e0b; background: rgba(245, 158, 11, 0.10); }
@media (max-width: 760px) { .docs-hero { grid-template-columns: 1fr; } .docs-hero__meta { min-width: 0; } }

/* Mobile overflow hardening: keep controls and cards within the viewport. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.layout,
.content,
.panel,
.card,
.grid,
.form,
.form__group,
.dashboard__item-info,
.connector-list__item,
.strategy-list__item,
.strategy-list__meta,
.docs-page,
.docs-section,
.docs-content {
    min-width: 0;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea,
button,
.button,
.select-table,
.dashboard-multiselect {
    max-width: 100%;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    min-width: 0;
}

.card,
.panel,
.notice,
.alert,
.docs-content,
.card__hint,
.dashboard__item-title,
.dashboard__item-info,
.connector-list__item,
.strategy-list__item,
.strategy-list__meta,
.strategy-list__details,
.referral-copy-row__value,
.referral-copy-row__link,
.sidebar__value {
    overflow-wrap: anywhere;
}

.sidebar {
    width: 220px;
    padding: 14px 10px;
    gap: 14px;
}

.sidebar--collapsed {
    width: 58px;
    padding-left: 6px;
    padding-right: 6px;
}

.sidebar__brand {
    gap: 6px;
}

.sidebar__logo {
    width: 42px;
    border-radius: 8px;
}

.sidebar__nav {
    gap: 6px;
}

.sidebar__toggle,
.sidebar__link {
    padding: 8px 8px;
    border-radius: 8px;
}

.sidebar__link {
    gap: 6px;
}

.sidebar__icon {
    width: 22px;
    font-size: 17px;
}

.sidebar__footer {
    padding-top: 10px;
}

.table-wrapper,
.heatmap-wrap,
.select-table__table {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    max-width: 100%;
}

.calculator-table,
.affiliate-network-table {
    min-width: max-content;
}

@media (max-width: 900px) {
    .sidebar {
        width: 220px;
        padding-left: 10px;
        padding-right: 10px;
        overflow-x: hidden;
    }

    .sidebar.sidebar--collapsed {
        width: 58px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .sidebar.sidebar--collapsed .sidebar__title,
    .sidebar.sidebar--collapsed .sidebar__link-text,
    .sidebar.sidebar--collapsed .sidebar__label,
    .sidebar.sidebar--collapsed .sidebar__value {
        display: none;
    }

    .sidebar.sidebar--collapsed .sidebar__brand,
    .sidebar.sidebar--collapsed .sidebar__link,
    .sidebar.sidebar--collapsed .sidebar__toggle,
    .sidebar.sidebar--collapsed .sidebar__user {
        justify-content: center;
    }

    .sidebar.sidebar--collapsed .sidebar__user-icon {
        display: inline-flex;
    }

    .content {
        margin-left: 220px;
        width: calc(100% - 220px);
        min-width: 0;
        padding: 14px 10px;
    }

    .sidebar--collapsed ~ .content {
        margin-left: 58px;
        width: calc(100% - 58px);
    }

    .content__header,
    .panel__header,
    .dashboard-card-header,
    .manual-execute-pending-header,
    .strategy-version-banner,
    .connector-list__item,
    .strategy-list__item,
    .dashboard__item,
    .calculator-panel__summary,
    .plan-symbols__header,
    .form__actions--spread {
        align-items: stretch;
        flex-direction: column;
    }

    .header__actions,
    .form__actions,
    .form__actions-group,
    .connector-list__actions,
    .strategy-list__actions,
    .accordion__actions,
    .heatmap-actions,
    .heatmap-toolbar__controls,
    .plan-trades__controls,
    .plan-trades__pagination,
    .trades-filter-actions,
    .referral-copy-row {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .header__logo {
        display: none;
    }

    .language-switcher,
    .button,
    .form__actions a,
    .form__actions button,
    .connector-list__actions .button,
    .strategy-list__actions .button,
    .trades-filter-actions .button,
    .heatmap-actions .button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .grid--two,
    .grid--max-two,
    .dashboard-kpis,
    .dashboard-inline-kpis,
    .dashboard-inline-kpis--running-plans,
    .form__group--inline,
    .plan-risk-inline,
    .formula-helper__filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .card,
    .accordion__item,
    .dashboard-collapsible,
    .docs-accept {
        padding: 14px;
        border-radius: 12px;
    }

    .dashboard-trade-search,
    .trades-filter-field,
    .heatmap-picker,
    .heatmap-picker details,
    .heatmap-picker details#hm-connector-select,
    .heatmap-input--search-all,
    .heatmap-input--search-symbol,
    .heatmap-input--refresh,
    .plan-amount,
    .select-table__toggle,
    .select-table__panel,
    .formula-test__controls input {
        width: 100%;
        min-width: 0;
    }

    .plan-amount,
    .formula-test__controls,
    .plan-trades__stats,
    .plan-kpis,
    .plan-kpis--compact {
        align-items: stretch;
        flex-direction: column;
        margin-left: 0;
        width: 100%;
    }

    .plan-kpi,
    .plan-kpi--profit,
    .plan-kpi--compact.plan-kpi--profit {
        justify-content: space-between;
        width: 100%;
        min-width: 0;
    }

    .docs-page,
    .docs-content {
        width: 100%;
        max-width: 100%;
    }

    .docs-toc {
        flex-direction: column;
    }

    .docs-toc a {
        width: 100%;
        text-align: center;
    }

    .auth-layout {
        padding: 16px 8px;
    }

    .auth-card,
    .auth-card--wide {
        width: 100%;
        max-width: 100%;
        padding: 18px;
    }
}

@media (max-width: 480px) {
    .content,
    .sidebar--collapsed ~ .content {
        padding: 10px 8px;
    }

    .content__header h1 {
        font-size: 22px;
    }

    .content__header p,
    .card__hint,
    .muted {
        font-size: 12px;
    }

    .referral-copy-row__value {
        font-size: 20px;
        letter-spacing: 0.04em;
    }
}

.account-credits-card {
    display: grid;
    gap: 16px;
}

.credit-balance-row {
    align-items: center;
    justify-content: space-between;
}

.credit-balance-row__label {
    color: var(--muted);
    font-weight: 700;
}

.credit-balance-row__value {
    font-size: 1.4rem;
}

.credits-coupon-box {
    border: 1px solid rgba(251, 191, 36, 0.34);
    border-radius: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(224, 242, 254, 0.9));
    box-shadow: 0 14px 30px rgba(245, 158, 11, 0.12);
}

.credits-coupon-box h4,
.credits-coupon-box .card__hint,
.credits-coupon-box label {
    color: #0f172a;
}

.credits-usage-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.credits-usage-filter {
    min-width: min(320px, 100%);
}

.credits-usage-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
}

.credits-usage-table thead th {
    background: rgba(15, 23, 42, 0.78);
    color: #f8fafc;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.credits-usage-table tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.08);
}

.credits-usage-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.12);
}

.credits-usage-table th,
.credits-usage-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    vertical-align: middle;
    white-space: nowrap;
}

.credits-usage-table th:nth-child(4),
.credits-usage-table td:nth-child(4) {
    min-width: 240px;
    max-width: 420px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.credits-usage-table tbody tr:last-child td {
    border-bottom: 0;
}

.credits-amount {
    font-weight: 800;
    text-align: right;
}

.credits-amount--positive {
    color: #22c55e;
}

.credits-amount--negative {
    color: #ef4444;
}

.credits-usage-pagination {
    margin-top: 12px;
}

@media (max-width: 720px) {
    .calculator-panel__summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .calculator-panel__toggle-label {
        flex: 1 1 auto;
        text-align: left;
    }
}

.dex-arbitrum-address-info {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid rgba(59, 130, 246, 0.28);
    border-radius: 12px;
    background: rgba(219, 234, 254, 0.72);
    color: #1e3a5f;
}

.dex-arbitrum-address-info__icon,
.dex-arbitrum-address-info__help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.dex-arbitrum-address-info__icon {
    background: #2563eb;
    color: #fff;
    font-family: Georgia, serif;
    font-style: italic;
}

.dex-arbitrum-address-info__content {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.dex-arbitrum-address-info__row {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.dex-arbitrum-address-info__label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dex-arbitrum-address-info__help {
    border: 1px solid rgba(37, 99, 235, 0.35);
    background: #fff;
    color: #2563eb;
    cursor: help;
}

.dex-arbitrum-address-info code {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: #0f172a;
}

.form__group--referral {
    margin-top: 10px;
    margin-bottom: 2px;
}

.form__group--referral label {
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(65, 90, 119, 0.9);
}

.form__group--referral input[type="text"] {
    padding: 8px 10px;
    border-color: rgba(0, 198, 255, 0.35);
    background: #eaf8ff;
    font-size: 13px;
}
