/* public/css/side-panel.css: the styles of the side panel and the history chart, shared by /forex and /dashboard (dashboard-panel-2026-11-10).
 * Colours: Slate, Peach Gold and White for lines, fills and buttons. Green and red (--up and --down) are for numbers and arrows only.
 * The cards and the list of each page keep their own styles in the page. */
:root { --up: #1E8E5A; --down: #C8453B; }
:root.dark { --up: #4CC38A; --down: #F07167; }

/* Change figures, trend lines and the detail panel (forex-history-2026-11-10). Colours: Slate and Peach Gold tokens only. */
.forex-change { font-size: 0.9rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.forex-change .fx-arrow { color: inherit; font-size: 0.8rem; }
.forex-change.fx-up { color: var(--up); }
.forex-change.fx-down { color: var(--down); }
.forex-change.fx-flat { color: var(--dim); }
.forex-change.fx-na { font-weight: 500; color: var(--dim); }
.fx-overlay { position: fixed; inset: 0; background: rgba(26, 37, 53, 0.6); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 1000; }
.fx-overlay.open { display: flex; }
.fx-panel { background: #fff; color: var(--slate-deep); width: 100%; max-width: 720px; max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 12px; padding: 24px; box-shadow: var(--shadow-lg); }
:root.dark .fx-panel { background: var(--slate-deep); color: #f5f3ee; }
/* Header: title, latest value, Expand and Close stay in one row; the title shortens with an ellipsis (panel-fixes-2026-11-11). */
.fx-head { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.fx-head-main { flex: 1 1 0; min-width: 0; }
.fx-title { font-size: 1.1rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-sub { font-size: 0.85rem; opacity: 0.8; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-head-price { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; white-space: nowrap; }
.fx-head-actions { flex: 0 0 auto; display: flex; gap: 6px; }
.fx-close, .fx-expand { min-width: 44px; min-height: 44px; border: 1px solid var(--pline); border-radius: 8px; background: transparent; color: inherit; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fx-expand { display: none; padding: 0; }
.fx-expand svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fx-expand[data-state="expanded"] .fx-ic-expand, .fx-expand:not([data-state="expanded"]) .fx-ic-restore { display: none; }
.fx-now { font-size: 1.5rem; font-weight: 700; margin: 0; white-space: nowrap; }
.fx-changes { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 2px 14px; margin: 0; font-size: 0.9rem; white-space: nowrap; }
.fx-changes b { font-weight: 700; }
.fx-ranges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.fx-btn { min-height: 44px; min-width: 52px; padding: 6px 10px; border: 1px solid var(--pline); border-radius: 8px; background: transparent; color: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.fx-btn.active { background: #e2b273; color: #1a2535; border-color: #e2b273; }
.fx-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.fx-btn.active[disabled] { opacity: 0.85; }
.fx-chartwrap { position: relative; }
.fx-chart { width: 100%; touch-action: pan-y; padding-top: 10px; }
.fx-legend { position: absolute; top: 6px; left: 8px; z-index: 3; pointer-events: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; max-width: calc(100% - 80px); padding: 4px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.78); font-size: 0.85rem; }
:root.dark .fx-legend { background: rgba(26, 37, 53, 0.78); }
.fx-legend:empty { display: none; }
.fx-leg-date { opacity: 0.85; }
.fx-leg-pair { font-weight: 700; }
.fx-leg-rate { font-weight: 700; }
.fx-leg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.fx-dot-main { background: var(--slate); }
:root.dark .fx-dot-main { background: #f5f3ee; }
.fx-dot-alt { background: #e2b273; }
.fx-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.fx-modes { display: flex; gap: 8px; }
.fx-with { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 700; }
.fx-with select { min-height: 44px; padding: 6px 10px; border: 1px solid var(--pline); border-radius: 8px; background: transparent; color: inherit; font-size: 0.9rem; }
.fx-with[hidden] { display: none; }
.fx-hint { font-size: 0.85rem; margin: 6px 0 0; opacity: 0.85; }
.fx-hint:empty { display: none; }
.fx-up { color: var(--up); }
.fx-down { color: var(--down); }
.fx-flat { color: var(--dim); }
/* Summary row: five values that drop to a second row when the panel is narrow; each value stays on one line (panel-fixes-2026-11-11). */
.fx-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 12px 8px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--pline); }
.fx-sum { min-width: 0; }
.fx-sum-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; opacity: 0.8; white-space: nowrap; }
.fx-sum-value { font-size: 0.95rem; font-weight: 700; margin-top: 2px; white-space: nowrap; }
.fx-sum-value .fx-arrow { color: inherit; font-size: 0.75rem; margin-right: 3px; }
.fx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fx-readout { margin: 0; }
.fx-note { font-size: 0.85rem; margin: 8px 0 0; opacity: 0.85; }
@media (max-width: 600px) {
  .fx-overlay { align-items: flex-end; padding: 0; }
  .fx-panel { max-width: none; border-radius: 12px 12px 0 0; max-height: 92vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .fx-now { font-size: 1.5rem; }
}
/* Split view (1024px and up): list on the left, detail panel on the right, a draggable divider between them. */
.fx-split { display: block; }
.fx-divider, .fx-side { display: none; }
.fx-pairs { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; margin: 0 -4px 12px; padding: 2px 4px; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, transparent 0, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) calc(100% - 20px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) calc(100% - 20px), transparent 100%); }
.fx-pairs::-webkit-scrollbar { display: none; }
.fx-pair-btn { flex: 0 0 auto; min-height: 36px; padding: 4px 11px; border: 1px solid var(--pline); border-radius: 999px; background: transparent; color: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
@media (pointer: coarse) { .fx-pair-btn { min-height: 44px; } }
.fx-pair-btn[aria-pressed="true"] { background: #e2b273; color: #1a2535; border-color: #e2b273; }
.fx-pair-btn:focus-visible, .fx-divider:focus-visible { outline: 3px solid var(--goldink); outline-offset: 2px; }
.fx-left { min-width: 0; }
.fx-left.fx-tiny .list-view { overflow-x: auto; }
body.fx-dragging { user-select: none; cursor: col-resize; }
.fx-divider { position: relative; }
.fx-grip-hint { position: absolute; right: 100%; top: 50%; margin-right: 8px; transform: translateY(-50%); white-space: nowrap; background: var(--slate); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: 700; opacity: 1; transition: opacity 0.6s; pointer-events: none; z-index: 5; }
.fx-grip-hint.fx-hide { opacity: 0; }
.fx-grip-hint[hidden] { display: none; }
@media (min-width: 1024px) {
  .fx-split.fx-open { display: flex; align-items: flex-start; }
  .fx-split.fx-open .fx-left { flex: 1 1 0; min-width: 0; }
  .fx-split.fx-open .fx-divider { display: flex; flex: 0 0 14px; align-self: stretch; align-items: center; justify-content: center; cursor: col-resize; touch-action: none; }
  .fx-divider::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; margin-left: -0.5px; background: var(--pline); }
  .fx-grip { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 6px; height: 44px; border-radius: 3px; background: rgba(44, 62, 80, 0.45); }
  :root.dark .fx-grip { background: rgba(245, 243, 238, 0.45); }
  .fx-grip i { display: block; width: 2px; height: 2px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); }
  :root.dark .fx-grip i { background: rgba(26, 37, 53, 0.9); }
  .fx-divider:hover .fx-grip, .fx-divider:focus-visible .fx-grip, body.fx-dragging .fx-grip { background: #e2b273; }
  .fx-divider:hover .fx-grip i, .fx-divider:focus-visible .fx-grip i, body.fx-dragging .fx-grip i { background: rgba(26, 37, 53, 0.85); }
  .fx-divider:hover::after, .fx-divider:focus-visible::after, body.fx-dragging .fx-divider::after { background: #e2b273; }
  .fx-split.fx-open .fx-side { display: block; flex: 0 0 var(--fx-w, 42%); width: var(--fx-w, 42%); position: sticky; top: 16px; height: calc(100vh - 32px); }
  .fx-side .fx-panel { max-width: none; height: 100%; max-height: none; display: flex; flex-direction: column; overflow-y: auto; box-shadow: var(--shadow); border: 1px solid var(--pline); }
  .fx-side .fx-expand { display: flex; }
  .fx-side .fx-chartwrap { flex: 1 1 0; min-height: 260px; display: flex; flex-direction: column; }
  .fx-side .fx-chart { flex: 1 1 0; min-height: 0; overflow: hidden; }
}
.fx-btn:focus-visible, .fx-close:focus-visible, .fx-expand:focus-visible { outline: 3px solid var(--goldink); outline-offset: 2px; }

/* Dashboard additions: the period next to the price, the unit label over the chart, locked ranges and the notes under the summary. */
.fx-period { font-size: 0.85rem; font-weight: 600; opacity: 0.8; margin-left: 4px; }
/* The unit label is a small line above the chart, outside the plot; only the legend sits inside the plot (panel-fixes-2026-11-11). */
.fx-unit { margin: 0 0 4px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.3px; opacity: 0.8; }
.fx-unit:empty { display: none; }
.fx-marks { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.fx-mk { position: absolute; white-space: nowrap; font-size: 0.8rem; font-weight: 700; line-height: 1.2; padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.82); color: var(--up); }
:root.dark .fx-mk { background: rgba(26, 37, 53, 0.82); }
.fx-mk-low { color: var(--down); }
.fx-btn.fx-locked { opacity: 0.75; cursor: not-allowed; flex-direction: row; gap: 6px; }
.fx-lock { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fx-extra { margin-top: 8px; font-size: 0.85rem; }
.fx-extra:empty { display: none; }
.fx-extra p { margin: 6px 0 0; opacity: 0.9; }
.fx-extra a { color: var(--goldink); text-decoration: underline; }


/* Sheet bar (below 1024 px): Back to the page and Close, sticky at the top of the panel (panel-fixes-2026-11-11). Safe-area aware. */
.fx-sheetbar { display: none; }
.fx-overlay .fx-sheetbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 6; margin: -24px -24px 12px; padding: max(8px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); background: #fff; border-bottom: 1px solid var(--pline); }
:root.dark .fx-overlay .fx-sheetbar { background: var(--slate-deep); }
.fx-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 10px; border: 1px solid var(--pline); border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 0.95rem; font-weight: 700; cursor: pointer; }
.fx-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.fx-back:focus-visible { outline: 3px solid var(--goldink); outline-offset: 2px; }
.fx-sheetbar .fx-close { flex: 0 0 auto; }
@media (max-width: 600px) { .fx-overlay .fx-sheetbar { margin: -20px -16px 12px; } }
.fx-expand { display: none; }   /* only the split view (1024 px and up) shows it; phones and tablets never do */

/* Wide pages (the dashboard, like Forex): one 1600 px container for the navbar, header, body and footer. */
.wide-page .container { max-width: 1600px; padding: 0 24px; }
