:root { --lc-bg: #050505; --lc-panel: #0b0a08; --lc-line: #26221b; --lc-gold: #d4a64a; --lc-text: #ece6da; --lc-muted: #8d877b; --lc-up: #22c55e; }
/* .lc is the standalone detail page's <body>, or the dashboard wrapper inside the site layout (/charts) */
body.lc { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
.lc { background: var(--lc-bg); color: var(--lc-text); font-family: var(--jb-sans); }
.lc-page { padding-bottom: 24px; }
.lc-page:fullscreen { overflow-y: auto; }
.lc-title { margin: 0 6px 0 0; color: var(--lc-text); font: 500 26px/1 var(--jb-serif); }
.lc :where(h1, h2, h3, p) { margin-top: 0; }
.lc .lc-chart__name, .lc .lc-rates__title, .lc .lc-title { color: var(--lc-text); }
.lc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--lc-line); }
.lc-brand { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px; background: #fff; }
.lc-brand img { display: block; height: 44px; width: auto; }
.lc-spacer { flex: 1; }
.lc-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border: 1px solid #3a352c; border-radius: 6px; background: #0f0e0b;
    color: var(--lc-text); font: 600 14px/1 var(--jb-sans); text-decoration: none; cursor: pointer; white-space: nowrap; transition: border-color .15s, background-color .15s; }
.lc-btn:hover { border-color: var(--lc-gold); color: #fff; }
.lc-btn:focus-visible { outline: 2px solid var(--lc-gold); outline-offset: 2px; }
.lc-btn--gold { background: var(--lc-gold); border-color: var(--lc-gold); color: #17130b; }
.lc-btn--gold:hover { background: #e2b65a; color: #17130b; }
.lc-btn--light { background: #f1e3c2; border-color: #f1e3c2; color: #17130b; }
.lc-btn--light:hover { color: #17130b; }
.lc-status { cursor: default; }
.lc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lc-muted); flex: none; }
.lc-dot--live { background: var(--lc-up); box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }

.lc-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; padding: 12px; min-height: 0; }
.lc.lc--norates .lc-main { grid-template-columns: minmax(0, 1fr); }
.lc.lc--norates .lc-rates { display: none; }
.lc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(380px, calc((100vh - 140px) / 2)); gap: 12px; }
.lc-grid.is-focused { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(480px, calc(100vh - 110px)); }
.lc-grid.is-focused .lc-chart:not(.is-focus) { display: none; }

.lc-chart { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--lc-line); border-radius: 10px; background: var(--lc-panel); overflow: hidden; }
.lc-chart:hover { border-color: #4a4235; }
.lc-chart__head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.lc-chart__name { margin: 0; color: var(--lc-text); font: 700 15px/1.2 var(--jb-sans); letter-spacing: .04em; text-transform: uppercase; }
.lc-chart__sub { display: block; margin-top: 2px; color: var(--lc-muted); font: 500 11.5px/1.2 var(--jb-sans); letter-spacing: 0; text-transform: none; }
.lc-chart__head .lc-btn { min-height: 32px; padding: 0 12px; font-size: 13px; }
.lc-chart__frame { flex: 1; min-height: 0; }
.lc-chart__frame iframe { display: block; width: 100%; height: 100%; border: 0; }

.lc-rates { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--lc-line); border-radius: 10px; background: var(--lc-panel); align-self: start; }
.lc-rates__title { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; color: var(--lc-text); font: 800 12.5px/1 var(--jb-sans); letter-spacing: .22em; text-transform: uppercase; }
.lc-rates__title::before, .lc-rates__title::after { content: ""; flex: 1; height: 1px; background: var(--lc-line); }
.lc-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lc-tile { padding: 10px 12px; border: 1px solid #2c2820; border-radius: 8px; background: #0f0e0b; }
.lc-tile__label { display: block; color: #cfc6b4; font: 700 11px/1.2 var(--jb-sans); letter-spacing: .06em; text-transform: uppercase; }
.lc-tile__value { display: block; margin-top: 8px; padding: 8px 10px; border-radius: 6px; background: #050505; color: #fff; font: 800 21px/1 var(--jb-sans); font-variant-numeric: tabular-nums; text-align: center; }
.lc-quote { border: 1px solid #2c2820; border-radius: 8px; overflow: hidden; }
.lc-quote__label { display: block; padding: 8px 12px 0; color: #cfc6b4; font: 700 11px/1.2 var(--jb-sans); letter-spacing: .06em; }
.lc-note { margin: 4px 2px 0; color: var(--lc-muted); font-size: 12px; line-height: 1.55; }
.lc-note a { color: var(--lc-gold); }
.lc-sample { display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 4px; background: #5a4410; color: #ffd98a; font-size: 10.5px; letter-spacing: .04em; vertical-align: middle; }

@media (max-width: 1100px) {
    .lc-main { grid-template-columns: minmax(0, 1fr); }
    .lc-rates { align-self: stretch; }
}
@media (max-width: 760px) {
    .lc-grid, .lc-grid.is-focused { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 380px; }
    .lc-bar { padding: 10px 12px; }
    .lc-brand img { height: 36px; }
    .lc-spacer { display: none; }
    .lc-btn { min-height: 34px; padding: 0 12px; font-size: 13px; }
    .lc-hide-sm { display: none; }
    .lc-main { padding: 10px; }
}

/* Rates panel. Badges stay in place; their colour fades in and out (dark → colour → dark, 2 s), blue or red only:
   blue = the price went up, red = it went down (live spot: against the previous live price; our products: against
   our previous published rate). Unchanged badges alternate blue / red. A moved live price gets one soft glow. */
.lp-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lp-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lp-tile { min-width: 0; padding: 8px 9px 9px; border: 1px solid #2c2820; border-radius: 8px; background: #0f0e0b; }
.lp-tile__label { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: #ece5d5; font: 800 11.5px/1.2 var(--jb-sans); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.lp-tile .jb-spot-dir { flex: none; font-size: 11px; color: #8f8674; }
.lp-tile .jb-spot-dir--up { color: #5b7cff; }
.lp-tile .jb-spot-dir--down { color: #ff4d4d; }
.lp-tile__value { display: block; margin-top: 7px; padding: 7px 4px; border-radius: 5px; background: #0b0a08; color: #fff; font: 800 18px/1.1 var(--jb-sans);
    font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    animation: lp-pulse-blue 2s ease-in-out infinite; }
.lp-tiles--3 .lp-tile__value { font-size: 16px; }
.lp-tile:nth-child(2n) .lp-tile__value { animation-name: lp-pulse-red; }
.lp-tile:nth-child(4n+3) .lp-tile__value, .lp-tile:nth-child(4n+4) .lp-tile__value { animation-delay: -1s; }
/* Real direction wins over the alternation */
.lp-tile.is-up .lp-tile__value, .lp-tile.is-flash-up .lp-tile__value { animation-name: lp-pulse-blue; color: #fff; }
.lp-tile.is-down .lp-tile__value, .lp-tile.is-flash-down .lp-tile__value { animation-name: lp-pulse-red; color: #fff; }
@keyframes lp-pulse-blue { 0%, 100% { background-color: #0b0a08; } 50% { background-color: #1d3fd8; } }
@keyframes lp-pulse-red  { 0%, 100% { background-color: #0b0a08; } 50% { background-color: #c8161d; } }
/* Fresh update: one soft glow around the card (replaces the site-wide flash) */
.lp-tile.is-flash-up { animation: lp-hit-up 1.6s ease-out 1; }
.lp-tile.is-flash-down { animation: lp-hit-down 1.6s ease-out 1; }
@keyframes lp-hit-up { 0% { border-color: #3b5bff; box-shadow: 0 0 0 3px rgba(59, 91, 255, .45); } 100% { border-color: #2c2820; box-shadow: 0 0 0 3px transparent; } }
@keyframes lp-hit-down { 0% { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .45); } 100% { border-color: #2c2820; box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) {
    .lp-tile__value { animation: none; background-color: #1d3fd8; }
    .lp-tile:nth-child(2n) .lp-tile__value, .lp-tile.is-down .lp-tile__value, .lp-tile.is-flash-down .lp-tile__value { background-color: #c8161d; }
    .lp-tile.is-up .lp-tile__value, .lp-tile.is-flash-up .lp-tile__value { background-color: #1d3fd8; }
    .lp-tile.is-flash-up, .lp-tile.is-flash-down { animation: none; }
}
.lp-key { font-size: 11px; }
.lp-key--up { color: #5b7cff; }
.lp-key--down { color: #ff4d4d; margin-left: 4px; }
@media (max-width: 420px) {
    .lp-tiles--3 .lp-tile__value { font-size: 14px; }
    .lp-tile__value { font-size: 16px; }
    .lp-tile { padding: 7px 7px 8px; }
}

/* Detail page: one chart, full height */
.lc-one { display: flex; flex-direction: column; min-height: min(calc(100vh - 120px), 820px); }
.lc-one .lc-chart { flex: 1; min-height: 520px; }
.lc-select { min-height: 38px; padding: 0 34px 0 14px; border: 1px solid #3a352c; border-radius: 6px; background: #0f0e0b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='m2 3.5 3 3 3-3' fill='none' stroke='%23d4a64a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center / 10px;
    color: var(--lc-text); font: 700 14px/1 var(--jb-sans); appearance: none; cursor: pointer; }
.lc-select:focus-visible { outline: 2px solid var(--lc-gold); outline-offset: 2px; }
.lc-updated { color: var(--lc-muted); font-size: 13px; white-space: nowrap; }
.lc-updated b { color: var(--lc-text); font-weight: 600; }
.lc.lc--nodetails .lc-main { grid-template-columns: minmax(0, 1fr); }
.lc.lc--nodetails .lc-rates { display: none; }

/* Our own candle charts (public/js/live-charts.js) */
.lc-chart__frame { position: relative; }
.lc-canvas { position: absolute; inset: 0 4px 2px 6px; }
.lc-empty { position: absolute; left: 50%; top: 50%; z-index: 1; width: min(340px, 86%); margin: 0; padding: 12px 14px; transform: translate(-50%, -50%);
    border: 1px solid #3a352c; border-radius: 8px; background: rgba(11, 10, 8, .92); color: var(--lc-muted); font-size: 12.5px; line-height: 1.5; text-align: center; }
.lc-ohlc { margin: -4px 12px 2px; color: var(--lc-muted); font: 500 12px/1.4 var(--jb-sans); font-variant-numeric: tabular-nums; min-height: 17px; }
.lc-ohlc b { margin-right: 8px; color: var(--lc-text); font-weight: 600; }
.lc-ohlc b.is-up { color: #22c55e; }
.lc-ohlc b.is-down { color: #ef4444; }
.lc-tfs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #2c2820; border-radius: 6px; background: #0b0a08; }
.lc-tf { min-width: 34px; min-height: 28px; padding: 0 7px; border: 0; border-radius: 4px; background: transparent; color: var(--lc-muted); font: 600 12px/1 var(--jb-sans); cursor: pointer; }
.lc-tf:hover { color: var(--lc-text); }
.lc-tf[aria-pressed="true"] { background: #2c2820; color: var(--lc-gold); }
.lc-tf:focus-visible { outline: 2px solid var(--lc-gold); outline-offset: 1px; }
.lc-chart__actions { display: inline-flex; gap: 8px; }

/* Phones: title on its own line, then timeframe and buttons; charts a comfortable fixed height */
@media (max-width: 760px) {
    .lc-chart__head { flex-wrap: wrap; gap: 8px; padding: 10px 10px 8px; }
    .lc-chart__name { flex: 1 1 auto; font-size: 14px; }
    .lc-chart__head > .lc-spacer { display: none; }
    .lc-tfs { order: 3; }
    .lc-chart__actions { order: 4; margin-left: auto; }
    .lc-chart__head .lc-btn { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
    .lc-grid, .lc-grid.is-focused { grid-auto-rows: 400px; }
    .lc-one .lc-chart { min-height: 420px; }
    .lc-ohlc { margin: 0 10px 2px; font-size: 11.5px; }
    .lc-ohlc b { margin-right: 5px; }
    .lc-bar { gap: 8px; }
    .lc-title { font-size: 22px; }
}
.lc-sample--chart { margin-left: 0; cursor: help; }
.lc-chart__name { min-width: 0; white-space: nowrap; }
.lc-chart__sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-sample--chart { margin-left: 4px; padding: 1px 5px; font-size: 10px; text-transform: none; letter-spacing: .02em; }
@media (min-width: 761px) and (max-width: 1500px) {
    .lc-grid .lc-chart__head { flex-wrap: wrap; row-gap: 6px; }
    .lc-grid .lc-chart__head > .lc-spacer { flex-basis: 0; }
}
