/* Shared look for the AlgoMaster post pieces: the Lines theme's dark ground, type and rules. */
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-display: swap;
  src: url("/wp-content/themes/antonio-trotta-2026/assets/fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2"),
       url("../../theme/antonio-trotta-2026/assets/fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-display: swap;
  src: url("/wp-content/themes/antonio-trotta-2026/assets/fonts/hanken-grotesk-latin-500-normal.woff2") format("woff2"),
       url("../../theme/antonio-trotta-2026/assets/fonts/hanken-grotesk-latin-500-normal.woff2") format("woff2"); }

:root {
  --ground: #101B2D;
  --step: #16233A;
  --text: #EEF0F3;
  --text-2: #C7CFDB;
  --muted: #8792A6;
  --rule: #2A3A55;
  --grid: #1F2D45;
  --saffron: #FFC93C;
  /* Chart marks: the site's blue and orange stepped into the dark-mode band (validated). */
  --gain: #688FD3;
  --loss: #E4621F;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ground);
  color: var(--text);
  font: 400 15px/1.45 "Hanken Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.piece { display: flex; flex-direction: column; height: 100%; padding: 16px 20px 14px; gap: 10px; }
.piece-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.piece-title { margin: 0; font-size: 15px; font-weight: 500; color: var(--text); }
.piece-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); max-width: 52ch; }
.piece-body { position: relative; flex: 1; min-height: 0; }
.chart-view { position: absolute; inset: 0; overflow: hidden; }
.chart-view svg { display: block; }
.piece-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; font-size: 12px; color: var(--muted); }

.controls { display: flex; flex-wrap: wrap; gap: 6px; }
.btn {
  font: 500 12px/1 "Hanken Grotesk", system-ui, sans-serif;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--ground); }
.btn:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }
select.btn { appearance: none; padding-right: 26px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23C7CFDB' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center; }
select.btn option { background: var(--step); color: var(--text); }

/* Chart text wears text tokens, never the series colour. */
svg text { font-family: "Hanken Grotesk", system-ui, sans-serif; fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg .label-strong { fill: var(--text); font-weight: 500; }
svg .label-2 { fill: var(--text-2); }
svg .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
svg .axis { stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }

.tip {
  position: absolute; z-index: 5; pointer-events: none;
  min-width: 160px; max-width: 240px;
  background: var(--step); border: 1px solid var(--rule); border-radius: 6px;
  padding: 8px 10px; font-size: 12px; color: var(--text-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  opacity: 0; transition: opacity .12s;
}
.tip.on { opacity: 1; }
.tip strong { display: block; color: var(--text); font-size: 14px; font-weight: 500; }
.tip .row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.tip .key { width: 12px; height: 2px; border-radius: 1px; flex: none; }

/* The table view: every value reachable without hovering. */
.table-view { position: absolute; inset: 0; overflow: auto; display: none; }
.piece.show-table .table-view { display: block; }
.piece.show-table .chart-view { visibility: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--grid); }
th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--ground); }
td { color: var(--text-2); }
td.num, th.num { text-align: right; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
