/*
  Typography, controls, and the vocabulary for the states a panel can be in.

  Loaded after bootstrap.min.css; every rule here is a deliberate override of it.
*/

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
    padding-bottom: 3rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

h1:focus {
    outline: none;
}

h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

/*
  Digits that do not line up cannot be compared at a glance, and comparison at a glance is the only
  reason a numeric table exists.
*/
.table td.text-end,
.table th.text-end,
.figure-value {
    font-variant-numeric: tabular-nums;
}

/* --- The states a panel can be in ------------------------------------------------------------

   Loading, loaded, empty, not-built, unmapped and failed are six different facts. The predecessor
   rendered "no data" and "the request failed" identically, so a quiet market and a broken API were
   indistinguishable on screen. Each gets its own left rule and its own words, and none of them is
   ever silent.
*/

.state-loading { color: #6c757d; }
.state-empty   { border-left: 3px solid #d68910; }  /* answered, and the answer was nothing */
.state-pending { border-left: 3px solid #5d6d7e; }  /* route real, read model not built */
.state-failed  { border-left: 3px solid #c0392b; }  /* no answer, or one we could not read */

/*
  Where a number came from, printed under it. A figure with no provenance is a figure nobody can
  check, and there is no way to tell a measured zero from a placeholder one without it.
*/
.provenance {
    font-size: 0.76rem;
    color: #6c757d;
}

/*
  Freshness without a clock. The figure is a count of refreshes since the last successful read,
  owned by the poller. Reading the current instant is banned outside the three named clock types,
  and a staleness count is more directly useful anyway than a timestamp the reader has to subtract
  from.
*/
.freshness {
    font-size: 0.76rem;
    color: #6c757d;
}

/* --- Price chart ------------------------------------------------------------------------------
   A dark island inside the light page, matching the predecessor's candle canvas. The colours are
   its #26a69a / #ef5350 pair, which is the one piece of that application's chart worth keeping.
   Scoped under .price-chart so the dark palette cannot leak into the content area. */

.price-chart {
    background: #1a1a2e;
    border-radius: 4px;
    padding: 0.5rem;
    overflow-x: auto;
}

.price-chart-canvas {
    width: 100%;
    height: auto;
    display: block;
    min-width: 640px;
}

.price-chart-grid {
    stroke: #2a2a3e;
    stroke-width: 1;
}

.price-chart-axis {
    fill: #8b94a8;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.price-chart-up   { stroke: #26a69a; fill: #26a69a; }
.price-chart-down { stroke: #ef5350; fill: #ef5350; }

.price-chart-wick { stroke-width: 1; }
.price-chart-body { stroke-width: 0; }

/* Where the system actually entered or exited. Dashed so it cannot be mistaken for price. */
.price-chart-marker {
    stroke: #6c9ef8;
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
}

/* The equity curve. Drawn as SVG on the server, so its only styling is stroke and fill. */
.equity-chart {
    width: 100%;
    height: auto;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
}

.equity-chart__line {
    fill: none;
    stroke: #0d6efd;
    stroke-width: 2;
}

.equity-chart__point {
    fill: #0d6efd;
}

.equity-chart__label {
    font-size: 11px;
    fill: #6c757d;
}
