/*
	preciocripto.com/assets/app.css
 */
:root {
    color-scheme: dark;

    --bg: #0b0d12;
    --panel: #11151d;
    --panel2: #171c26;
    --text: #eef2f7;
    --muted: #8c96a8;
    --border: #252c38;
    --accent: #7c8cff;
    --good: #089981;
    --bad: #F23645;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;

    background: var(--bg);
    color: var(--text);

    font:
        15px/1.45
        Inter,
        system-ui,
        -apple-system,
        Segoe UI,
        sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    height: 60px;

    display: flex;
    align-items: center;

    gap: 24px;

    padding:
        0
        22px;

    background: #0e1118;

    border-bottom:
        1px solid
        var(--border);
}

.brand {
    font-size: 21px;
    font-weight: 700;
}

.quiet,
.muted {
    color: var(--muted);
}

.topbar .quiet {
    margin-left: auto;
}

.page {
    max-width: 1050px;

    margin:
        0
        auto;

    padding:
        42px
        24px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 24px;
}

.page h1 {
    margin: 0;

    font-size: 32px;
}

.page p {
    margin:
        5px
        0;
}

.market-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(
                260px,
                1fr
            )
        );

    gap: 14px;
}

.market-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px;

    background: var(--panel);

    border:
        1px solid
        var(--border);

    border-radius: 14px;
}

.market-card:hover {
    background: var(--panel2);

    border-color: #3a4558;
}

.market-card strong {
    display: block;

    font-size: 18px;
}

.market-card span {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 13px;
}

.market-card .open {
    color: var(--text);
}

button {
    padding:
        10px
        14px;

    background: var(--accent);
    color: white;

    border: 0;
    border-radius: 9px;

    font-weight: 700;

    cursor: pointer;
}

button:disabled {
    opacity: 0.45;

    cursor: not-allowed;
}

.auth {
    min-height: 100vh;

    display: grid;

    place-items: center;

    padding: 20px;
}

.auth-card {
    width:
        min(
            420px,
            100%
        );

    padding: 30px;

    background: var(--panel);

    border:
        1px solid
        var(--border);

    border-radius: 18px;
}

.auth-card h1 {
    margin:
        18px
        0
        6px;

    font-size: 26px;
}

.auth-card form {
    display: grid;

    gap: 15px;

    margin-top: 22px;
}

label {
    display: grid;

    gap: 7px;

    color: #bec6d2;

    font-size: 13px;
}

input,
textarea {
    width: 100%;

    padding: 12px;

    background: #0b0e14;
    color: var(--text);

    border:
        1px solid
        var(--border);

    border-radius: 9px;

    font: inherit;
}

input:focus,
textarea:focus {
    outline:
        2px solid
        #4d5bcc;

    outline-offset: 1px;
}

.center {
    text-align: center;
}

.error {
    margin-top: 15px;

    padding: 10px;

    background: #35171b;
    color: #ffb3bd;

    border:
        1px solid
        #6b2d36;

    border-radius: 9px;
}

.chart-top {
    gap: 18px;
}

.symbol {
    display: flex;

    flex-direction: column;
}

.save-status {
    margin-left: auto;

    color: var(--muted);

    font-size: 13px;
}

.chart-layout {
    min-height:
        calc(
            100vh -
            60px
        );

    display: grid;

    grid-template-columns:
        72px
        minmax(
            0,
            1fr
        )
        230px;
}

.toolbox {
    display: flex;

    flex-direction: column;

    gap: 8px;

    padding:
        12px
        8px;

    background: #0e1118;

    border-right:
        1px solid
        var(--border);
}

.toolbox button {
    padding:
        8px
        3px;

    background: transparent;
    color: var(--muted);

    border:
        1px solid
        transparent;

    font-size: 18px;
}

.toolbox button span {
    display: block;

    margin-top: 2px;

    font-size: 10px;
    font-weight: 600;
}

.toolbox button.active,
.toolbox button:hover {
    background: var(--panel2);
    color: var(--text);

    border-color: var(--border);
}

.chart-main {
    min-width: 0;
}

.chart-toolbar {
    height: 48px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding:
        0
        14px;

    border-bottom:
        1px solid
        var(--border);
}

.timeframes {
    display: flex;

    gap: 5px;
}

.timeframes button {
    padding:
        6px
        9px;

    background: transparent;
    color: var(--muted);
}

.timeframes button.active {
    background: var(--panel2);
    color: var(--text);
}

.demo-badge {
    margin-left: auto;

    color: #dbb15f;

    font-size: 11px;
}

#chart {
    height:
        calc(
            100vh -
            156px
        );

    min-height: 430px;

    background: #131722;
}

.summary {
    height: 48px;

    display: flex;
    align-items: center;

    gap: 24px;

    padding:
        0
        16px;

    color: var(--muted);

    border-top:
        1px solid
        var(--border);

    font-size: 12px;
}

.summary b {
    margin-left: 4px;

    color: var(--text);
}

dialog {
    width:
        min(
            420px,
            calc(
                100% -
                32px
            )
        );

    padding: 22px;

    background: var(--panel);
    color: var(--text);

    border:
        1px solid
        var(--border);

    border-radius: 14px;
}

dialog::backdrop {
    background:
        rgba(
            0,
            0,
            0,
            0.64
        );
}

dialog form {
    display: grid;

    gap: 14px;
}

dialog h2 {
    margin: 0;
}

.price-line {
    margin: 0;

    color: var(--muted);
}

.dialog-actions {
    display: flex;

    justify-content: flex-end;

    gap: 8px;
}

.secondary {
    background: var(--panel2);
    color: var(--text);

    border:
        1px solid
        var(--border);
}

.indicator-controls {
    display: flex;
    align-items: center;

    gap: 4px;

    flex-wrap: wrap;
}

.indicator-controls button {
    padding:
        6px
        8px;

    background: transparent;
    color: var(--muted);

    border:
        1px solid
        transparent;

    font-size: 11px;
}

.indicator-controls button:hover {
    color: var(--text);

    border-color: var(--border);
}

.indicator-controls button.active {
    background: var(--panel2);
    color: var(--text);

    border-color: #343b49;
}

.ema-dot {
    width: 7px;
    height: 7px;

    display: inline-block;

    margin-right: 5px;

    vertical-align: 1px;

    border-radius: 50%;
}

.ema20-dot {
    background: #2962FF;
}

.ema50-dot {
    background: #F2C94C;
}

.ema100-dot {
    background: #F2994A;
}

.ema200-dot {
    background: #9B7E46;
}

.indicator-controls button[data-indicator="dmi"] {
    border-left-color: #2962FF;
}

.indicator-controls button[data-indicator="squeeze"] {
    border-left-color: #808080;
}

/*
    v0.5:
    pane layout controls + draggable volume
 */

.chart-stage {
    position: relative;

    min-width: 0;
}

.layout-controls {
    display: flex;
    align-items: center;

    gap: 4px;

    margin-left: 2px;
}

.layout-controls button {
    padding:
        6px
        8px;

    background: #171c26;
    color: #b2b5be;

    border:
        1px solid
        #343b49;

    font-size: 11px;

    white-space: nowrap;
}

.layout-controls button:hover,
.layout-controls button.active {
    color: #ffffff;

    border-color: #596579;
}

#volumeIndicatorBtn[draggable="true"] {
    cursor: grab;
}

#volumeIndicatorBtn.dragging {
    opacity: 0.65;

    cursor: grabbing;
}

.volume-drop-overlay {
    position: absolute;

    inset: 0;

    z-index: 20;

    display: grid;

    grid-template-rows:
        2fr
        1fr;

    gap: 10px;

    padding: 14px;

    background:
        rgba(
            11,
            13,
            18,
            0.48
        );

    pointer-events: none;
}

.volume-drop-overlay[hidden] {
    display: none;
}

.volume-drop-zone {
    min-height: 70px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-direction: column;

    background:
        rgba(
            19,
            23,
            34,
            0.78
        );

    color: #eef2f7;

    border:
        2px dashed
        #596579;

    border-radius: 10px;

    text-align: center;

    pointer-events: auto;
}

.volume-drop-zone span {
    margin-top: 3px;

    color: #aeb6c3;

    font-size: 11px;
}

.volume-drop-zone.drag-over {
    background:
        rgba(
            42,
            46,
            57,
            0.92
        );

    border-color: #7c8cff;
}

/*
    v0.6:
    pane manager dinámico
 */

.layout-controls,
.volume-drop-overlay {
    display: none !important;
}

.indicator-controls .draggable-indicator {
    cursor: grab;

    user-select: none;

    touch-action: none;
}

.indicator-controls .draggable-indicator.dragging {
    opacity: 0.55;

    cursor: grabbing;
}

.indicator-controls .draggable-indicator.drag-target {
    background: #222938;

    outline:
        2px solid
        #7c8cff;

    outline-offset: 2px;
}

.pane-drop-overlay {
    position: absolute;

    inset: 0;

    z-index: 30;

    display: flex;

    flex-direction: column;

    gap: 12px;

    padding: 18px;

    background:
        rgba(
            11,
            13,
            18,
            0.58
        );

    pointer-events: none;
}

.pane-drop-overlay[hidden] {
    display: none;
}

.pane-drop-head {
    align-self: center;

    padding:
        9px
        13px;

    background:
        rgba(
            19,
            23,
            34,
            0.94
        );

    color: #eef2f7;

    border:
        1px solid
        #343b49;

    border-radius: 10px;

    text-align: center;

    pointer-events: none;
}

.pane-drop-head span {
    display: block;

    margin-top: 2px;

    color: #aeb6c3;

    font-size: 11px;
}

.pane-drop-zones {
    flex: 1;

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                180px,
                1fr
            )
        );

    gap: 10px;

    align-items: stretch;

    pointer-events: none;
}

.pane-drop-zone {
    min-height: 92px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-direction: column;

    padding: 12px;

    background:
        rgba(
            19,
            23,
            34,
            0.82
        );

    color: #eef2f7;

    border:
        2px dashed
        #596579;

    border-radius: 12px;

    text-align: center;

    pointer-events: auto;
}

.pane-drop-zone span {
    margin-top: 4px;

    color: #aeb6c3;

    font-size: 11px;
}

.pane-drop-zone.drag-over {
    background:
        rgba(
            42,
            46,
            57,
            0.96
        );

    border-color: #7c8cff;

    box-shadow:
        inset
        0
        0
        0
        1px
        #7c8cff;
}

/*
    v0.7:
    edición / eliminación de operaciones
 */

.dialog-actions .dialog-spacer {
    flex: 1;
}

.danger {
    background: #35171b;
    color: #ffb3bd;

    border:
        1px solid
        #6b2d36;
}

.danger:hover {
    background: #4b1f25;
}

/*
    Selector premium de mercado
 */

.chart-top .symbol {
    display: flex;
    align-items: center;
}

.market-dropdown {
    position: relative;
}

.market-dropdown-trigger {
    position: relative;

    min-width: 205px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding:
        8px
        11px
        8px
        14px;

    background:
        linear-gradient(
            180deg,
            #1d2431 0%,
            #141923 100%
        );

    color: #f5f7fc;

    border:
        1px solid
        #343d50;

    border-radius: 10px;

    box-shadow:
        inset
        0
        1px
        0
        rgba(
            255,
            255,
            255,
            0.05
        ),
        0
        5px
        16px
        rgba(
            0,
            0,
            0,
            0.24
        );

    cursor: pointer;

    transition:
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}

.market-dropdown-trigger:hover {
    background:
        linear-gradient(
            180deg,
            #222a39 0%,
            #171d28 100%
        );

    border-color: #586782;
}

.market-dropdown.open .market-dropdown-trigger {
    border-color: #7c8cff;

    box-shadow:
        inset
        0
        1px
        0
        rgba(
            255,
            255,
            255,
            0.06
        ),
        0
        0
        0
        3px
        rgba(
            124,
            140,
            255,
            0.10
        ),
        0
        10px
        26px
        rgba(
            0,
            0,
            0,
            0.34
        );
}

.market-dropdown-main {
    display: flex;

    flex-direction: column;

    align-items: flex-start;

    gap: 3px;
}

.market-dropdown-pair {
    color: #ffffff;

    font-size: 18px;
    font-weight: 700;

    line-height: 1.05;

    letter-spacing: 0.015em;

    text-shadow:
        0
        1px
        0
        rgba(
            0,
            0,
            0,
            0.28
        );
}

.market-dropdown-meta {
    color:
        rgba(
            145,
            157,
            179,
            0.72
        );

    font-size: 10px;
    font-weight: 500;

    line-height: 1.15;

    letter-spacing: 0.01em;
}

.market-dropdown-chevron {
    width: 16px;
    height: 16px;

    margin-left: 18px;

    color: #8793a8;

    transition:
        transform 0.18s ease,
        color 0.18s ease;
}

.market-dropdown-chevron svg {
    display: block;

    width: 100%;
    height: 100%;
}

.market-dropdown-trigger:hover
.market-dropdown-chevron {
    color: #d5dbea;
}

.market-dropdown.open
.market-dropdown-chevron {
    color: #ffffff;

    transform:
        rotate(
            180deg
        );
}

.market-dropdown-menu {
    position: absolute;

    top:
        calc(
            100% +
            6px
        );

    left: 0;

    z-index: 1000;

    width: max-content;

    min-width: 200px;

    padding: 6px;

    background:
        linear-gradient(
            180deg,
            rgba(
                25,
                31,
                43,
                0.99
            ) 0%,
            rgba(
                14,
                18,
                26,
                0.99
            ) 100%
        );

    border:
        1px solid
        #303949;

    border-radius: 11px;

    box-shadow:
        0
        22px
        55px
        rgba(
            0,
            0,
            0,
            0.55
        ),
        inset
        0
        1px
        0
        rgba(
            255,
            255,
            255,
            0.035
        );

    overflow: hidden;
}

.market-dropdown-menu[hidden] {
    display: none;
}

.market-dropdown-option {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 22px;

    padding:
        10px
        11px;

    background: transparent;

    color: #edf1f8;

    border: 0;
    border-radius: 7px;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.14s ease,
        color 0.14s ease;
}

.market-dropdown-option:hover {
    background: #222a39;
}

.market-dropdown-option.active {
    background:
        linear-gradient(
            90deg,
            rgba(
                124,
                140,
                255,
                0.18
            ) 0%,
            rgba(
                124,
                140,
                255,
                0.07
            ) 100%
        );
}

.market-dropdown-option-main {
    display: flex;

    flex-direction: column;

    gap: 3px;
}

.market-dropdown-option-pair {
    color: #ffffff;

    font-size: 16px;
    font-weight: 700;

    line-height: 1.08;

    letter-spacing: 0.01em;
}

.market-dropdown-option-meta {
    color:
        rgba(
            139,
            151,
            173,
            0.72
        );

    font-size: .9em;
    font-weight: 500;

    line-height: 1.15;

    letter-spacing: 0.01em;
}

.market-dropdown-check {
    width: 20px;
    height: 20px;

    flex:
        0
        0
        20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background:
        rgba(
            124,
            140,
            255,
            0.14
        );

    color: #a7b1ff;

    border-radius: 50%;

    font-size: 11px;
    font-weight: 800;
}

/*
    Lista lateral de mercados
 */

.market-watchlist {
    min-width: 0;

    background: #0e1118;

    border-left:
        1px solid
        var(--border);

    overflow: hidden;

    transition:
        width 0.18s ease,
        min-width 0.18s ease;
}

.market-watchlist-head {
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding:
        0
        10px
        0
        14px;

    border-bottom:
        1px solid
        var(--border);
}

.market-watchlist-head strong {
    color: #eef2f7;

    font-size: 13px;
    font-weight: 700;
}

.market-watchlist-toggle {
    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background: transparent;
    color: var(--muted);

    border:
        1px solid
        transparent;

    border-radius: 7px;

    font-size: 20px;
    font-weight: 400;
}

.market-watchlist-toggle:hover {
    background: var(--panel2);
    color: var(--text);

    border-color: var(--border);
}

.market-watchlist-body {
    height:
        calc(
            100vh -
            108px
        );

    display: flex;
    flex-direction: column;

    min-height: 0;
}

.market-watchlist-search {
    padding: 10px;

    border-bottom:
        1px solid
        var(--border);
}

.market-watchlist-search input {
    width: 100%;

    padding:
        8px
        10px;

    background: #111722;
    color: #eef2f7;

    border:
        1px solid
        #2b3443;

    border-radius: 7px;

    font-size: 12px;
}

.market-watchlist-search input:focus {
    outline:
        1px solid
        #596579;

    outline-offset: 0;
}

.market-watchlist-list {
    flex: 1;

    min-height: 0;

    overflow-y: auto;
}

.market-watchlist-item {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 3px;

    padding:
        10px
        13px;

    background: transparent;

    color: #eef2f7;

    border: 0;
    border-bottom:
        1px solid
        rgba(
            37,
            44,
            56,
            0.65
        );

    border-radius: 0;

    text-align: left;
}

.market-watchlist-item:hover {
    background: #171c26;
}

.market-watchlist-item.active {
    background:
        linear-gradient(
            90deg,
            rgba(
                124,
                140,
                255,
                0.16
            ) 0%,
            rgba(
                124,
                140,
                255,
                0.04
            ) 100%
        );

    box-shadow:
        inset
        3px
        0
        0
        #7c8cff;
}

.market-watchlist-pair {
    color: #ffffff;

    font-size: 13px;
    font-weight: 700;

    line-height: 1.15;
}

.market-watchlist-meta {
    color: #7f8a9d;

    font-size: 10px;
    font-weight: 500;
}

.chart-layout.market-watchlist-collapsed {
    grid-template-columns:
        72px
        minmax(
            0,
            1fr
        )
        36px;
}

.chart-layout.market-watchlist-collapsed
.market-watchlist-head {
    justify-content: center;

    padding:
        0;
}

.chart-layout.market-watchlist-collapsed
.market-watchlist-head strong,
.chart-layout.market-watchlist-collapsed
.market-watchlist-body {
    display: none;
}

.chart-layout.market-watchlist-collapsed
.market-watchlist-toggle {
    transform:
        rotate(
            180deg
        );
}


/*
    Responsive
 */

@media (
    max-width: 1150px
) {
    .layout-controls {
        width: 100%;

        order: 3;
    }

    .chart-toolbar {
        height: auto;

        min-height: 48px;

        flex-wrap: wrap;

        padding:
            7px
            10px;
    }

    .demo-badge {
        margin-left: auto;
    }
}

@media (
    max-width: 980px
) {
    .indicator-controls {
        max-width: 55vw;

        flex-wrap: nowrap;

        overflow-x: auto;
    }

    .indicator-controls button {
        white-space: nowrap;
    }
	
    .chart-layout {
        grid-template-columns:
            72px
            minmax(
                0,
                1fr
            )
            190px;
    }
	
}

@media (
    max-width: 700px
) {
    .pane-drop-zones {
        grid-template-columns:
            1fr
            1fr;
    }

    .pane-drop-zone {
        min-height: 74px;
    }
}

@media (
    max-width: 650px
) {
    .chart-layout {
        grid-template-columns:
            1fr;
    }

    .market-watchlist {
        display: none;
    }

    .toolbox {
        flex-direction: row;

        overflow: auto;

        border-right: 0;

        border-bottom:
            1px solid
            var(--border);
    }

    .toolbox button {
        min-width: 72px;
    }

    .chart-top .brand {
        display: none;
    }

    #chart {
        height: 520px;
    }

    .summary {
        height: auto;

        padding:
            10px
            14px;

        flex-wrap: wrap;
    }

    .indicator-controls {
        width: 100%;

        max-width: none;

        order: 2;
    }

    .chart-toolbar {
        height: auto;

        min-height: 48px;

        flex-wrap: wrap;

        padding:
            8px
            10px;
    }

    .demo-badge {
        display: none;
    }

    .market-dropdown-trigger {
        min-width: 180px;
    }


}

[hidden] {
    display: none !important;
}

#entryId {
    width: 100%;

    padding:
        12px;

    background: #0b0e14;
    color: var(--text);

    border:
        1px solid
        var(--border);

    border-radius: 9px;

    font: inherit;

    appearance: none;
    -webkit-appearance: none;
}

#entryId:focus {
    outline:
        2px solid
        #4d5bcc;

    outline-offset: 1px;
}

#entryId option {
    background: #11151d;
    color: var(--text);
}

.entry-row {
    display: grid;

    gap: 7px;

    color: #bec6d2;

    font-size: 13px;
}

.entry-dropdown {
    position: relative;

    width: 100%;
}

.entry-dropdown-trigger {
    width: 100%;
    min-height: 45px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding:
        11px
        13px;

    background: #0b0e14;
    color: var(--text);

    border:
        1px solid
        var(--border);

    border-radius: 9px;

    font: inherit;
    font-weight: 400;

    text-align: left;

    cursor: pointer;
}

.entry-dropdown-trigger:hover {
    border-color: #3a4558;
}

.entry-dropdown.open
.entry-dropdown-trigger {
    border-color: #7c8cff;

    outline:
        2px solid
        rgba(
            124,
            140,
            255,
            0.35
        );

    outline-offset: 1px;
}

.entry-dropdown-chevron {
    flex:
        0
        0
        auto;

    color: var(--muted);

    transition:
        transform
        0.16s ease;
}

.entry-dropdown.open
.entry-dropdown-chevron {
    transform:
        rotate(
            180deg
        );
}

.entry-dropdown-menu {
    position: absolute;

    top:
        calc(
            100% +
            6px
        );

    left: 0;
    right: 0;

    z-index: 2000;

    max-height: 280px;

    padding: 6px;

    overflow-y: auto;

    background: #11151d;

    border:
        1px solid
        #343d50;

    border-radius: 10px;

    box-shadow:
        0
        16px
        40px
        rgba(
            0,
            0,
            0,
            0.48
        );
}

.entry-dropdown-menu[hidden] {
    display: none !important;
}

.entry-dropdown-option {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 3px;

    padding:
        10px
        11px;

    background: transparent;

    border: 0;
    border-radius: 7px;

    color: var(--text);

    text-align: left;

    cursor: pointer;
}

.entry-dropdown-option:hover {
    background: #1d2431;
}

.entry-dropdown-option-primary {
    color: #ffffff;

    font-size: 13px;
    font-weight: 700;
}

.entry-dropdown-option-secondary {
    max-width: 100%;

    overflow: hidden;

    color: #8c96a8;

    font-size: 11px;
    font-weight: 400;

    white-space: nowrap;
    text-overflow: ellipsis;
}


.entry-dropdown-option.partial
.entry-dropdown-option-primary {
    color: #c9a84a;
}

.entry-dropdown-option.partial:hover {
    background:
        rgba(
            201,
            168,
            74,
            0.09
        );
}

.entry-dropdown-option.closed {
    opacity: 0.65;
}

.entry-dropdown-option.closed
.entry-dropdown-option-primary {
    color: #8c96a8;
}