:root {
    --reverse-blue: #0878ec;
    --reverse-pink: #d119d7;
    --reverse-line: rgba(125, 170, 220, .3);
    --reverse-glass: rgba(3, 17, 39, .76);
}

html, body.reverse-tool { min-height: 100%; }
body.reverse-tool {
    min-height: 100vh;
    height: auto !important;
    margin: 0;
    padding: 18px clamp(12px, 3vw, 48px) 26px;
    color: #f4f8ff;
    background-color: #01012E !important;
    background-image: linear-gradient(rgba(1, 1, 46, .5), rgba(1, 1, 46, .5)), url('/assets/IMG_4786.PNG') !important;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    font-family: "Segoe UI", Arial, sans-serif;
}
.reverse-shell { max-width: 1760px; margin: 0 auto; }
.reverse-header { display: flex; align-items: center; justify-content: space-between; gap: 30px; max-width: 1540px; margin: 0 auto 24px; padding: 14px 0 26px; border-bottom: 1px solid rgb(125 170 220 / 22%); }
.reverse-header .reverse-brand-home { flex: 0 0 auto; }
.reverse-header .reverse-brand-logo { margin-bottom: 0; }
.reverse-header nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 28px; margin-left: auto; }
.reverse-header nav a { color: #d4deef; text-decoration: none; font-size: 14px; }
.reverse-header nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 6px; }
.reverse-header nav a:focus-visible { outline: 2px solid #38beff; outline-offset: 5px; }
.reverse-header app-crackslab-account { flex-shrink: 0; }
@media (max-width: 800px) {
    .reverse-header { gap: 20px; flex-wrap: wrap; padding-bottom: 18px; }
    .reverse-header nav { order: 3; flex-basis: 100%; justify-content: flex-start; gap: 25px; }
    .reverse-header app-crackslab-account { margin-left: auto; }
}
@media (max-width: 420px) { .reverse-header { gap: 12px; } }
.reverse-intro { margin: 0 auto 16px; max-width: 1540px; color: #fff; }
.reverse-brand-logo {
    display: block;
    width: clamp(65px, 7vw, 90px);
    max-width: 100%;
    height: auto;
    aspect-ratio: 6.7 / 1;
    object-fit: cover;
    object-position: center 51%;
    margin: 0 0 8px;
    /* Align the visible artwork with the text despite the source's left margin. */
    transform: translateX(-6.9%);
    /* Crop the source's empty margins visually and blend its black background. */
    mix-blend-mode: screen;
}
.reverse-intro h1 { margin: 3px 0 0; font-size: clamp(25px, 3vw, 38px); line-height: 1.15; }
.reverse-intro p { margin: 3px 0 0; color: #d8e6f9; font-size: 16px; }
.reverse-brand-home { display: block; width: fit-content; }
.reverse-brand-home:focus-visible { outline: 2px solid #38beff; outline-offset: 4px; border-radius: 3px; }
.crackslab-account { position: absolute; inset: 0 0 auto auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; width: 160px; }
.crackslab-account-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px; padding: 5px 16px; border-radius: 999px; border: 0; background: #414141; color: #fff; font: inherit; font-size: 13px; line-height: 22px; cursor: pointer; transition: background-color .18s, color .18s; }
.crackslab-account-button:hover:enabled { background: #c9a54c; color: #17140b; }
.crackslab-account-button:focus-visible { outline: 2px solid #c9a54c; outline-offset: 3px; }
.crackslab-account-button:disabled { opacity: .65; cursor: wait; }
.crackslab-account p { width: 100%; text-align: right; font-size: 13px; }
@media (pointer: coarse) {
    .crackslab-account-button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .crackslab-account-button { transition: none; }
}
@media (max-width: 640px) {
    .crackslab-account { position: static; width: 100%; justify-content: flex-start; margin-top: 12px; }
    .crackslab-account p { text-align: left; }
}
.reverse-workspace {
    overflow: hidden;
    border: 1px solid #237ee9;
    border-right-color: #bd25d4;
    border-bottom-color: #bd25d4;
    border-radius: 12px;
    background: var(--reverse-glass);
    box-shadow: 0 14px 52px rgba(0, 0, 0, .45), 0 0 30px rgba(0, 118, 255, .16);
    backdrop-filter: blur(12px);
}
.reverse-marketbar { min-height: 66px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 10px 16px; border-bottom: 1px solid var(--reverse-line); }
.reverse-asset { display: flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; }
.reverse-asset strong { font-size: 23px; }
.reverse-asset b { font-size: 23px; font-weight: 650; }
.reverse-asset-quote { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.reverse-trend-dot { width: 13px; height: 13px; flex: 0 0 auto; border-radius: 50%; background: #64748b; box-shadow: 0 0 12px currentColor; }
.reverse-trend-dot.is-up { color: #00d995; background: #00d995; }
.reverse-trend-dot.is-down { color: #fb4455; background: #fb4455; }
.reverse-trend-dot.is-flat { color: #fbbf24; background: #fbbf24; }
.reverse-market-controls { display: flex; align-items: end; gap: 12px; min-width: 0; }
.reverse-market-controls label { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin: 0; color: #e1eaf7; font-size: 14px; }
.reverse-market-controls label select { width: 100%; }
.reverse-market-controls label:first-child { flex: 0 1 212px; }
.reverse-market-controls label:nth-of-type(2) { flex: 0 1 246px; }
.reverse-market-controls label > span { line-height: 1; }
.reverse-market-controls label .sr-only { display: none; }
.reverse-market-controls .reverse-symbol-picker { align-self: end; }
.reverse-market-controls .reverse-replay-trigger { margin: 0 0 2px; }
.reverse-marketbar select { min-width: 145px; height: 40px; padding: 0 34px 0 12px; color: white; background-color: rgba(4, 12, 29, .9); border: 1px solid var(--reverse-line); border-radius: 6px; }
.reverse-mode { display: flex; gap: 22px; align-items: center; margin-left: auto; color: #d0d9e9; font-size: 12px; white-space: nowrap; }
.reverse-mode span, .reverse-mode-button { padding: 8px 4px; }
.reverse-mode-button { color: inherit; background: none; border: 0; font: inherit; cursor: pointer; }
.reverse-mode-button:disabled { cursor: default; }
.reverse-mode .is-selected { color: white; border-bottom: 3px solid var(--reverse-blue); }
.reverse-replay-trigger { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: 0 0 auto; color: #eaf3ff; background: rgba(8, 120, 236, .14); border: 1px solid var(--reverse-line); border-radius: 6px; cursor: pointer; transition: background .16s ease, border-color .16s ease; }
.reverse-replay-trigger:hover { background: rgba(8, 120, 236, .32); border-color: #4497f7; }
.reverse-replay-trigger:focus-visible { outline: 2px solid #65b4ff; outline-offset: 2px; }
.reverse-replay-trigger i { font-size: 17px; }
.reverse-chart-row { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 10px; padding: 10px; }
.reverse-tool #retroceso-chart { height: min(74vh, 900px); min-height: 480px; overflow: hidden; border: 1px solid var(--reverse-line); border-radius: 7px; }
.reverse-reading { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--reverse-line); border-radius: 7px; background: rgba(7, 19, 41, .8); }
.reverse-reading h2 { margin: 0; padding: 16px; font-size: 14px; border-bottom: 1px solid var(--reverse-line); }
.reverse-reading > div { display: flex; flex-direction: column; gap: 11px; padding: 18px 16px; border-bottom: 1px solid var(--reverse-line); }
.reverse-reading > div span, .reverse-statistics > div span { color: #cad7e9; font-size: 12px; letter-spacing: .04em; }
.reverse-reading > div strong { font-size: 23px; overflow-wrap: anywhere; }
.reverse-reading #reverse-trend.is-up { color: #00d995; }
.reverse-reading #reverse-trend.is-down { color: #fb4455; }
.reverse-reading #reverse-trend.is-flat { color: #fbbf24; }
.reverse-statistics { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 10px 10px; padding: 10px 0; border: 1px solid var(--reverse-line); border-radius: 7px; background: rgba(7, 19, 41, .83); }
.reverse-statistics > div { display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center; border-right: 1px solid var(--reverse-line); }
.reverse-statistics > div:nth-child(4) { border-right: 0; }
.reverse-statistics strong { font-size: 26px; color: #f4f8ff; }
.reverse-statistics strong.is-win { color: #00d995; }
.reverse-statistics strong.is-loss { color: #fb4455; }
.reverse-statistics small { grid-column: 1 / -1; padding: 7px 12px 0; color: #c7d4e8; text-align: center; }
.reverse-statistics small.is-error { color: #ff8991; }
.reverse-tool .dropdown-container { background: transparent; box-shadow: none; border: 0; }
.reverse-tool .replay-bars { bottom: 16px; width: min(1000px, calc(100vw - 24px)); }
.reverse-tool .replay-bars__toolbar { color: white; background: rgba(4, 15, 35, .96); border-color: rgba(68, 151, 247, .45); box-shadow: 0 10px 32px rgba(0,0,0,.48); backdrop-filter: blur(12px); }
.reverse-tool .replay-bars [hidden] { display: none !important; }
.reverse-tool .replay-bars__status [data-replay-time] { display: none !important; }
.reverse-tool .replay-bars__speed-control { display: inline-flex; align-items: center; gap: 7px; margin: 0 2px 0 0; padding-right: 12px; color: #fff; white-space: nowrap; border-right: 1px solid var(--reverse-line); font-size: 12px; font-weight: 600; }
.reverse-tool .replay-bars__speed { box-sizing: border-box; width: 112px; min-width: 112px; height: 34px; padding: 0 8px; color: #fff; background: #09172c; border: 1px solid var(--reverse-line); border-radius: 6px; }
.reverse-tool #retroceso-chart { position: relative; }
.reverse-tool .replay-bars__future-shade { position: absolute; z-index: 12; top: 0; right: 0; bottom: 0; background: rgba(2, 8, 23, .58); pointer-events: none; }
.reverse-tool .replay-bars button:not(:disabled), .reverse-tool .replay-bars button.is-active, .reverse-tool .replay-bars__exit { color: #fff; background: var(--reverse-blue); border-color: #3894f5; }
.reverse-tool .replay-bars button:not(:disabled):hover { filter: brightness(1.15); }
.reverse-tool .replay-bars button:disabled { color: #8192aa; background: #101b2b; border-color: #283950; }
.reverse-tool .replay-bars__status { color: #c7d4e8; }
.reverse-tool .replay-bars__status [data-replay-alert] { max-width: 340px; color: #ffd5d8; font-size: 11px; white-space: normal; }
.reverse-tool .replay-bars__status strong { color: #fff; }
.reverse-tool .replay-bars__status [data-replay-count] { font-variant-numeric: tabular-nums; }
.reverse-tool .replay-bars__status [data-replay-count]::before { content: 'Barra '; }
.reverse-tool .replay-bars__toolbar [data-replay-toggle] { min-width: 84px; }
.reverse-tool .replay-bars__toolbar [data-replay-state] { white-space: nowrap; }
.reverse-tool .replay-bars__toolbar [data-replay-time] { display: none; }
.reverse-symbol-picker { position: relative; flex: 0 0 190px; }
.reverse-symbol-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; height: 40px; padding: 0 12px; color: white; background: rgba(4, 12, 29, .9); border: 1px solid var(--reverse-line); border-radius: 6px; cursor: pointer; }
.reverse-symbol-trigger:focus-visible, .reverse-symbol-choice:focus-visible, .reverse-symbol-star:focus-visible { outline: 2px solid #65b4ff; outline-offset: 2px; }
.reverse-symbol-menu { position: absolute; z-index: 70; top: calc(100% + 5px); left: 0; width: 100%; max-height: min(60vh, 360px); overflow-y: auto; padding: 4px; background: #07162c; border: 1px solid var(--reverse-line); border-radius: 6px; box-shadow: 0 12px 28px rgba(0, 0, 0, .55); }
.reverse-symbol-menu[hidden] { display: none !important; }
.reverse-symbol-option { display: flex; align-items: center; gap: 4px; }
.reverse-symbol-option[aria-selected="true"] { background: rgba(8, 120, 236, .25); }
.reverse-tool .reverse-symbol-choice, .reverse-tool .reverse-symbol-star { min-width: 0; height: 34px; color: #e7f0ff; background: transparent; border: 0; cursor: pointer; }
.reverse-tool .reverse-symbol-choice { flex: 1; padding: 0 9px; text-align: left; }
.reverse-tool .reverse-symbol-choice:hover { color: white; background: rgba(8, 120, 236, .25); }
.reverse-tool .reverse-symbol-star { display: inline-flex; align-items: center; justify-content: center; width: 36px; padding: 0; color: #b9c8dc; border-radius: 4px; }
.reverse-tool .reverse-symbol-star:hover { color: #ffe08a; background: rgba(255, 200, 61, .12); }
.reverse-tool .reverse-symbol-star.is-favorite { color: #ffc83d; }
.reverse-tool .reverse-symbol-star:disabled { opacity: .45; cursor: default; }
.reverse-favorites { display: flex; flex: 1; flex-direction: column; min-height: 0; margin: 14px 9px 9px; border: 1px solid var(--reverse-line); border-radius: 7px; background: rgba(4, 12, 29, .42); }
.reverse-favorites > header { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px 10px; border-bottom: 1px solid var(--reverse-line); }
.reverse-favorites h3 { margin: 0; font-size: 13px; }
.reverse-favorites > header button { display: inline-flex; align-items: center; gap: 5px; padding: 4px; color: #13b9ec; background: transparent; border: 0; font-size: 11px; white-space: nowrap; cursor: pointer; }
.reverse-favorites > nav { display: flex; flex: 1; flex-direction: column; min-height: 0; gap: 7px; overflow-y: auto; padding: 9px; }
.reverse-favorites > nav:empty::after { content: "Agrega activos desde el selector del mercado."; padding: 12px 4px; color: #94a8c2; font-size: 12px; }
.reverse-tool .reverse-favorite-item { box-sizing: border-box; display: flex; align-items: center; gap: 5px; width: 100%; min-height: 64px; padding: 8px 6px 8px 10px; color: #f4f8ff; background: rgba(8, 24, 48, .86); border: 1px solid rgba(23, 105, 178, .65); border-radius: 7px; }
.reverse-tool .reverse-favorite-open { display: flex; flex: 1; align-items: center; gap: 9px; min-width: 0; min-height: 48px; padding: 0; color: inherit; background: transparent; border: 0; text-align: left; cursor: pointer; }
.reverse-tool .reverse-favorite-item:hover, .reverse-tool .reverse-favorite-item.is-selected { border-color: #168cdf; background: rgba(8, 68, 123, .38); }
.reverse-favorite-item img { width: 42px; height: 42px; flex: 0 0 42px; object-fit: cover; border-radius: 50%; background: #10233b; }
.reverse-favorite-details { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 3px; }
.reverse-favorite-details strong { font-size: 13px; }
.reverse-favorite-details small { overflow: hidden; color: #94aac8; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.reverse-tool .reverse-favorite-star { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; color: #ffc83d; font-size: 16px; background: transparent; border: 0; border-radius: 5px; cursor: pointer; }
.reverse-tool .reverse-favorite-star:hover { background: rgba(255, 200, 61, .12); }
.reverse-favorite-open:focus-visible, .reverse-favorite-star:focus-visible { outline: 2px solid #65b4ff; outline-offset: 2px; }
.reverse-tool .reverse-chart-row .chart-container { min-width: 0; }
body.reverse-tool:has(.reverse-favorite-dialog[open], .crackslab-account-dialog[open]) { overflow: hidden; }
.reverse-favorite-dialog { box-sizing: border-box; width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px; color: #f4f8ff; background: #07162c; border: 1px solid #237ee9; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); }
.reverse-favorite-dialog::backdrop { background: rgba(0, 5, 18, .75); }
.reverse-favorite-dialog form { display: flex; flex-direction: column; gap: 10px; }
.reverse-favorite-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.reverse-favorite-dialog h2 { margin: 0; font-size: 20px; }
.reverse-favorite-dialog label { font-size: 14px; }
.reverse-favorite-dialog select { box-sizing: border-box; width: 100%; min-width: 0; height: 44px; padding: 0 34px 0 12px; color: #fff; background-color: #0a1c38; border-color: var(--reverse-line); font-size: 16px; }
.reverse-favorite-dialog p { margin: 4px 0; color: #cad7e9; font-size: 13px; line-height: 1.5; }
.reverse-favorite-dialog footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.reverse-favorite-dialog button { min-height: 44px; padding: 0 14px; color: #fff; background: #10233b; border: 1px solid var(--reverse-line); border-radius: 6px; cursor: pointer; font: inherit; }
.reverse-favorite-dialog header button { width: 44px; padding: 0; }
.reverse-favorite-dialog button[type="submit"] { background: var(--reverse-blue); border-color: #3894f5; }
.reverse-favorite-dialog button:disabled, .reverse-favorites > header button:disabled { opacity: .5; cursor: default; }
.reverse-favorite-dialog button:focus-visible { outline: 2px solid #65b4ff; outline-offset: 2px; }
@media (max-width: 1150px) {
    .reverse-marketbar { grid-template-columns: 1fr auto; }
    .reverse-market-controls { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; }
    .reverse-mode { grid-column: 2; grid-row: 1; margin-left: 0; }
}
@media (max-width: 900px), (max-width: 1150px) and (hover: none) and (pointer: coarse) {
    .reverse-chart-row { grid-template-columns: minmax(0, 1fr); }
    .reverse-tool #retroceso-chart { height: 72vh; min-height: 440px; }
    .reverse-reading { display: grid; grid-template-columns: 1fr 1fr; }
    .reverse-reading h2 { grid-column: 1 / -1; }
    .reverse-reading .reverse-favorites { grid-column: 1 / -1; min-height: 220px; }
    .reverse-reading > div:last-child { border-left: 1px solid var(--reverse-line); }
}
/* Keep touch devices compact even when the browser uses a wider viewport. */
@media (max-width: 560px), (max-width: 1150px) and (hover: none) and (pointer: coarse) {
    body.reverse-tool { padding: 10px 8px calc(18px + var(--replay-controls-clearance, 0px)); }
    .reverse-workspace { display: flex; flex-direction: column; }
    .reverse-marketbar { order: 0; }
    .reverse-statistics { order: 1; margin-top: 10px; }
    .reverse-chart-row { order: 2; }
    .reverse-tool .replay-bars { bottom: calc(10px + env(safe-area-inset-bottom)); }
    .reverse-marketbar { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
    .reverse-asset { grid-column: 1; grid-row: 1; flex-wrap: wrap; gap: 6px; }
    .reverse-asset strong, .reverse-asset b { font-size: clamp(14px, 4.5vw, 23px); }
    .reverse-market-controls { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, .85fr) 38px; gap: 5px; }
    .reverse-market-controls label, .reverse-market-controls label:first-child, .reverse-market-controls label:nth-of-type(2) { width: 100%; flex: auto; }
    .reverse-market-controls > * { box-sizing: border-box; min-width: 0; }
    .reverse-market-controls .reverse-symbol-picker { width: 100%; flex: auto; }
    .reverse-market-controls label > span { font-size: 10px; white-space: nowrap; }
    .reverse-marketbar select { box-sizing: border-box; min-width: 0; padding: 0 16px 0 5px; font-size: 12px; background-position: right 3px center; background-size: 12px; }
    .reverse-symbol-trigger { box-sizing: border-box; gap: 3px; padding: 0 5px; font-size: 12px; }
    .reverse-symbol-menu { width: max(100%, 180px); box-sizing: border-box; }
    .reverse-market-controls .reverse-replay-trigger { justify-self: start; margin: 0; }
    .reverse-mode { grid-column: 2; grid-row: 1; justify-self: end; gap: 6px; font-size: clamp(9px, 2.3vw, 12px); }
    .reverse-mode span, .reverse-mode-button { padding: 8px 2px; }
    .reverse-favorites { min-height: 220px; }
    .reverse-tool .replay-bars__speed-control { width: 100%; justify-content: center; padding: 0 0 7px; border-right: 0; border-bottom: 1px solid var(--reverse-line); }
    .reverse-statistics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .reverse-statistics > div span { font-size: clamp(8px, 2.2vw, 12px); letter-spacing: 0; white-space: nowrap; }
    .reverse-statistics strong { font-size: 22px; }
    .reverse-statistics small { font-size: 11px; }
}
