/* ============================================================================
   LACERDA APEX — design system (prototype)
   Light, editorial, racing-inspired. White paper, carbon ink, one red.
   Tokens are the ONLY place colors/spacing are declared; components below
   never hardcode a hex. Single breakpoint family: 640 / 900 / 1200 / 1560.
   ========================================================================= */

:root {
  /* --- paper & ink ------------------------------------------------------- */
  --paper:      #ffffff;
  --paper-2:    #f7f8fa;   /* page ground, table head */
  --paper-3:    #eff1f4;   /* inset wells */
  --line:       #e4e7ec;
  --line-2:     #d0d5dd;
  --ink:        #0c0e12;
  --ink-2:      #343a44;
  --muted:      #6b7280;
  --faint:      #9aa3af;
  --carbon:     #101318;   /* dark blocks: hero, chips */
  --carbon-2:   #1b1f26;
  --on-carbon:  #f4f5f7;
  --on-carbon-muted: #98a0ac;

  /* --- the one red ------------------------------------------------------- */
  --red:        #e10600;
  --red-600:    #c00500;
  --red-050:    #fff0ef;
  --red-100:    #ffdedc;

  /* --- semantic scores (green / amber / red) ---------------------------- */
  --good:       #0f8a5f;
  --good-050:   #e9f8f1;
  --warn:       #b57500;
  --warn-050:   #fff6e5;
  --bad:        var(--red);
  --bad-050:    var(--red-050);
  --na:         #b6bcc5;

  /* --- podium / position chips ------------------------------------------ */
  --gold:       #caa02a;
  --gold-050:   #fdf6e2;
  --podium:     #b3571c;
  --podium-050: #fdf0e6;

  /* --- shape & motion --------------------------------------------------- */
  --r-sm: 6px;  --r: 10px;  --r-lg: 16px;  --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(12, 14, 18, .05);
  --sh-2: 0 2px 4px rgba(12, 14, 18, .04), 0 12px 28px -18px rgba(12, 14, 18, .22);
  --sh-3: 0 24px 60px -30px rgba(12, 14, 18, .35);
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* --- type ------------------------------------------------------------- */
  --sans: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --shell: 1360px;
  --gut: 32px;
}

* { box-sizing: border-box; }
/* overflow-y sempre visivel: sem isso a barra de rolagem aparece/desaparece
   quando um grafico muda de altura e a largura da pagina oscila. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-y: scroll; }
body {
  margin: 0;
  background: var(--paper-2);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  font-feature-settings: "cv05" 1, "ss01" 1;
  letter-spacing: -.005em;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.022em; font-weight: 680; }
p { margin: 0 0 1em; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--red); }
img { max-width: 100%; }
button { font: inherit; }
::selection { background: var(--red-100); }

/* numbers must align in a column — every figure gets tabular mono */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ============================ layout ===================================== */
.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gut); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.push { margin-left: auto; }
.sec { margin: 46px 0 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between;
            gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
           color: var(--red); display: flex; align-items: center; gap: 7px; }
.sec-head h2 { font-size: 21px; }
.sec-head .hint { color: var(--muted); font-size: 13.5px; max-width: 62ch; }

/* two-pane content: main + rail. Rail becomes sticky on wide screens only. */
.pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 1200px) {
  .pane { grid-template-columns: minmax(0, 1fr) 380px; gap: 26px; align-items: start; }
  .pane > .rail { position: sticky; top: 84px; }
}
.pane-wide { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 1200px) { .pane-wide { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cards-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ============================ chrome ==================================== */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .86);
          backdrop-filter: saturate(160%) blur(12px);
          border-bottom: 1px solid var(--line); }
.topbar::before { content: ""; display: block; height: 3px;
                  background: linear-gradient(90deg, var(--red) 0 38%, var(--carbon) 38% 100%); }
.topbar .inner { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gut);
                 display: flex; align-items: center; gap: 28px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px;
         letter-spacing: -.03em; text-transform: uppercase; }
/* A marca ja traz o proprio fundo escuro (circulo), entao nao vai dentro de um
   quadrado carbono como o glifo generico ia. */
.brand .mark { width: 28px; height: 28px; flex: none; display: block; border-radius: 50%; }
.brand b { color: var(--red); }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 8px 11px;
         border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 7px; }
.nav a:hover { color: var(--ink); background: var(--paper-3); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--paper-3); }
.nav a[aria-current="page"] svg { color: var(--red); }
.nav a.soon { color: var(--faint); }
.topbar .ext { display: flex; gap: 6px; margin-left: auto; }
.iconbtn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm);
           color: var(--muted); border: 1px solid transparent; }
.iconbtn:hover { color: var(--red); background: var(--paper-3); border-color: var(--line); }
@media (max-width: 900px) {
  .topbar .inner { gap: 12px; min-height: 56px; }
  .nav { gap: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 8px; }
  .nav a span { display: none; }
  .topbar .ext { display: none; }
}

.foot { margin-top: 64px; border-top: 1px solid var(--line); background: var(--paper);
        padding: 30px 0 46px; color: var(--muted); font-size: 13.5px; }
.foot .inner { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gut);
               display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.foot a { color: var(--ink-2); font-weight: 600; }
.foot a:hover { color: var(--red); }

/* ============================ surfaces ================================== */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
        box-shadow: var(--sh-1); }
.card.pad { padding: 16px 18px; }
.card.pad-lg { padding: 22px 24px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
             padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h3 { font-size: 15px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.card-body { padding: 16px 18px; }
.well { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r);
        padding: 14px 16px; font-size: 13.5px; color: var(--ink-2); }
.well strong { color: var(--ink); }
.well.accent { background: var(--red-050); border-color: var(--red-100); }
.hairline { height: 1px; background: var(--line); border: 0; margin: 18px 0; }

/* ============================ hero ====================================== */
.hero { background: var(--carbon); color: var(--on-carbon); border-radius: var(--r-lg);
        overflow: hidden; margin-top: 26px; position: relative; box-shadow: var(--sh-3); }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .38;
                  filter: grayscale(.35) contrast(1.05); }
.hero-media::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(16,19,24,.97) 0 46%, rgba(16,19,24,.72) 68%, rgba(16,19,24,.5) 100%); }
.hero-in { position: relative; padding: 46px 44px 40px; display: grid; gap: 26px;
           grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .hero-in { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
                                        align-items: center; gap: 40px; } }
.hero h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.035em; }
.hero h1 em { font-style: normal; color: var(--red); }
.hero .lead { color: var(--on-carbon-muted); font-size: clamp(15px, 1.4vw, 17px); max-width: 56ch;
              margin: 14px 0 0; line-height: 1.6; }
.hero .eyebrow { color: var(--red); }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 13.5px;
       font-weight: 650; border-radius: var(--r-pill); border: 1px solid var(--line-2);
       background: var(--paper); color: var(--ink); transition: .16s var(--ease);
       cursor: pointer; }
.btn:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.btn-ghost { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .22);
             color: var(--on-carbon); }
.btn-ghost:hover { background: rgba(255, 255, 255, .13); border-color: #fff; color: #fff; }
.btn[aria-disabled="true"] { opacity: .55; cursor: default; transform: none; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* Identidade do piloto no hero: avatar + handle antes do titulo. Sem isso a home
   abre com uma afirmacao ("every lap has the data") sem dizer de quem e. */
.hero-who { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.hero-who .avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
                    flex: none; border: 2px solid rgba(255, 255, 255, .22); }
.hero-who .handle { font-weight: 700; font-size: 16px; letter-spacing: -.01em;
                    margin-top: 3px; }
.hero-who .handle span { color: var(--on-carbon-muted); font-weight: 500; }

/* driver status panel inside the hero */
.status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
          background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .16);
          border-radius: var(--r); overflow: hidden; }
.status .cell { background: rgba(16, 19, 24, .72); padding: 14px 16px; }
.status .k { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
             color: var(--on-carbon-muted); display: flex; align-items: center; gap: 6px; }
.status .v { font-family: var(--mono); font-size: 22px; font-weight: 600; margin-top: 4px;
             letter-spacing: -.03em; }
.status .d { font-size: 11.5px; color: var(--on-carbon-muted); margin-top: 1px; }

/* ============================ KPIs ===================================== */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
       padding: 13px 15px; box-shadow: var(--sh-1); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
               background: var(--line-2); }
.kpi.is-good::before { background: var(--good); }
.kpi.is-warn::before { background: var(--warn); }
.kpi.is-bad::before  { background: var(--bad); }
.kpi.is-key::before  { background: var(--red); }
.kpi .k { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
          display: flex; align-items: center; gap: 6px; }
.kpi .v { font-family: var(--mono); font-size: 24px; font-weight: 600; letter-spacing: -.035em;
          margin-top: 3px; line-height: 1.1; }
.kpi .v.sm { font-size: 19px; }
.kpi .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .v.good { color: var(--good); } .kpi .v.bad { color: var(--bad); } .kpi .v.warn { color: var(--warn); }

/* ============================ chips & pills ============================= */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650;
        padding: 3px 9px; border-radius: var(--r-pill); background: var(--paper-3);
        color: var(--ink-2); border: 1px solid transparent; white-space: nowrap; }
.chip svg { width: 13px; height: 13px; }
.chip-good { background: var(--good-050); color: var(--good); }
.chip-warn { background: var(--warn-050); color: var(--warn); }
.chip-bad  { background: var(--bad-050);  color: var(--bad); }
.chip-key  { background: var(--red); color: #fff; }
.chip-ai   { background: var(--carbon); color: #fff; }
.chip-soon { background: var(--paper-3); color: var(--muted); border-color: var(--line-2); }
.chip-out  { background: transparent; border-color: var(--line-2); color: var(--muted); }
.chip-lg { font-size: 12.5px; padding: 5px 11px; }

/* square badge, 18px, for the compact flags in the race rows */
.flagbit { width: 19px; height: 19px; border-radius: 5px; display: inline-grid; place-items: center;
           font-size: 10px; font-weight: 800; background: var(--paper-3); color: var(--muted);
           border: 1px solid var(--line); letter-spacing: 0; }
.flagbit.on { background: var(--carbon); color: #fff; border-color: var(--carbon); }
.flagbit.red { background: var(--red-050); color: var(--red); border-color: var(--red-100); }

/* position chip — podium hierarchy has to read at a glance */
.pos { min-width: 42px; height: 38px; border-radius: 9px; display: inline-grid; place-items: center;
       font-family: var(--mono); font-weight: 700; font-size: 17px; letter-spacing: -.04em;
       background: var(--paper-3); color: var(--ink-2); padding: 0 8px; }
.pos.p1 { background: var(--gold); color: #2a2003; }
.pos.p2, .pos.p3 { background: var(--podium); color: #fff; }
.pos.top { background: var(--carbon); color: #fff; }
.pos.mid { background: var(--paper-3); color: var(--ink-2); }

.delta { font-family: var(--mono); font-size: 12.5px; font-weight: 650; display: inline-flex;
         align-items: center; gap: 2px; }
.up   { color: var(--good); } .down { color: var(--bad); } .flat { color: var(--faint); }
.up svg, .down svg, .flat svg { width: 13px; height: 13px; }

/* score dot row (per-lap dimension scores) */
.dots { display: inline-flex; gap: 3px; align-items: center; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--na); display: block; }
.dots i.green { background: var(--good); } .dots i.yellow { background: var(--warn); }
.dots i.red { background: var(--bad); } .dots i.na { background: var(--line-2); }

/* ============================ tables ==================================== */
.tbl-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
            box-shadow: var(--sh-1); overflow: hidden; }
.tbl-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--paper-2); font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
           text-transform: uppercase; color: var(--muted); text-align: left;
           padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px;
           vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.hot:hover { background: var(--paper-2); }
td.right, th.right { text-align: right; }
td.mid, th.mid { text-align: center; }
.t-strong { font-weight: 650; }
.t-sub { color: var(--muted); font-size: 12.5px; }
tr.is-dirty td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.is-off   td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.is-best  { background: var(--red-050); }
tr.is-best td { font-weight: 650; }
tr.is-ref td { background: var(--paper-2); color: var(--muted); }

/* race-log rows: a list of "event cards" rendered as a table for alignment */
.racerow { display: grid; align-items: center; gap: 16px; padding: 14px 18px;
           border-bottom: 1px solid var(--line); transition: background .14s var(--ease);
           grid-template-columns: 74px minmax(0, 1fr) auto 26px; }
.racerow:last-child { border-bottom: 0; }
.racerow:hover { background: var(--paper-2); }
.racerow .when { text-align: center; line-height: 1.25; }
.racerow .when .dow { font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
                      text-transform: uppercase; color: var(--muted); }
.racerow .when .day { font-family: var(--mono); font-size: 15px; font-weight: 650; }
.racerow .when .yr  { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.racerow .what .ttl { font-weight: 650; font-size: 14.5px; display: flex; align-items: center;
                      gap: 8px; flex-wrap: wrap; }
.racerow .what .meta { color: var(--muted); font-size: 12.5px; margin-top: 3px;
                       display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.racerow .what .meta em { font-style: normal; color: var(--ink-2); }
.racerow .figs { display: grid; grid-auto-flow: column; gap: 22px; align-items: center; }
.racerow .fig { text-align: right; min-width: 62px; }
.racerow .fig .k { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
                   color: var(--faint); }
.racerow .fig .v { font-family: var(--mono); font-size: 14px; font-weight: 600; margin-top: 1px;
                   white-space: nowrap; }
.racerow .go { color: var(--faint); display: grid; place-items: center; width: 26px; }
.racerow:hover .go { color: var(--red); }
@media (max-width: 1200px) { .racerow .fig.lvl3 { display: none; } }
/* Abaixo de 900px a linha QUEBRA em duas faixas em vez de espremer: em uma
   grade `auto` pros numeros, a coluna de texto (minmax(0,1fr)) cede tudo e o
   nome da pista vira uma coluna de 30px de largura e 350px de altura. */
@media (max-width: 900px) {
  .racerow { grid-template-columns: 56px minmax(0, 1fr) 22px;
             grid-template-areas: "when what go" "figs figs figs";
             gap: 10px 12px; padding: 12px 14px; }
  .racerow .when { grid-area: when; }
  .racerow .what { grid-area: what; }
  .racerow .go { grid-area: go; align-self: start; }
  .racerow .figs { grid-area: figs; width: 100%; justify-content: space-between; gap: 12px;
                   border-top: 1px solid var(--line); padding-top: 10px; }
  .racerow .fig { text-align: left; min-width: 0; }
  .racerow .when .yr { display: none; }
}
@media (max-width: 640px) { .racerow .fig.lvl2 { display: none; } }

/* gap bar used in the records table */
.gapbar { position: relative; height: 6px; background: var(--paper-3); border-radius: var(--r-pill);
          min-width: 70px; overflow: hidden; }
.gapbar i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--red);
            border-radius: var(--r-pill); }
.gapbar.ahead i { background: var(--good); }

/* meter used in the dimension scorecard */
.meter { height: 6px; border-radius: var(--r-pill); background: var(--paper-3); overflow: hidden;
         position: relative; }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: var(--r-pill); background: var(--na); }
.meter i.green { background: var(--good); } .meter i.yellow { background: var(--warn); }
.meter i.red { background: var(--bad); }

/* ============================ scorecard ================================= */
.score { display: grid; gap: 10px; }
.scorecard { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper);
             box-shadow: var(--sh-1); overflow: hidden; }
.scorecard > summary { list-style: none; cursor: pointer; padding: 13px 16px;
                       display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto;
                       gap: 12px; align-items: center; }
.scorecard > summary::-webkit-details-marker { display: none; }
.scorecard .glyph { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
                    background: var(--paper-3); color: var(--muted); }
.scorecard .glyph svg { width: 15px; height: 15px; }
.scorecard .nm { font-weight: 650; font-size: 14.5px; }
.scorecard .hl { color: var(--muted); font-size: 12.5px; margin-top: 2px;
                 display: block; overflow: hidden; text-overflow: ellipsis; }
.scorecard .cost { font-family: var(--mono); font-weight: 650; font-size: 13.5px; text-align: right;
                   white-space: nowrap; }
.scorecard .caret { color: var(--faint); transition: transform .18s var(--ease); }
.scorecard[open] .caret { transform: rotate(90deg); }
.scorecard .expand { padding: 0 16px 16px 54px; font-size: 13.5px; color: var(--ink-2); }
.scorecard .expand .what { color: var(--muted); }
.scorecard .expand .cue { margin-top: 10px; padding: 10px 12px; background: var(--red-050);
                          border-left: 3px solid var(--red); border-radius: 0 var(--r-sm) var(--r-sm) 0;
                          color: var(--ink); }
.scorecard.green { border-left: 3px solid var(--good); }
.scorecard.yellow { border-left: 3px solid var(--warn); }
.scorecard.red { border-left: 3px solid var(--bad); }
.scorecard.na { border-left: 3px solid var(--line-2); }
.scorecard.na .nm, .scorecard.na .hl { color: var(--faint); }
.scorecard.green .glyph { background: var(--good-050); color: var(--good); }
.scorecard.yellow .glyph { background: var(--warn-050); color: var(--warn); }
.scorecard.red .glyph { background: var(--bad-050); color: var(--bad); }
@media (max-width: 640px) {
  .scorecard > summary { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .scorecard .caret { display: none; }
  .scorecard .expand { padding-left: 16px; }
}

/* ============================ priority cards ============================ */
.prios { display: grid; gap: 12px; }
.prio { background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--red);
        border-radius: var(--r); box-shadow: var(--sh-1); padding: 16px 18px;
        display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.prio .rk { width: 34px; height: 34px; border-radius: 50%; background: var(--carbon); color: #fff;
            display: grid; place-items: center; font-family: var(--mono); font-weight: 700;
            font-size: 14px; }
.prio.yellow { border-left-color: var(--warn); }
.prio.green { border-left-color: var(--good); }
.prio h4 { font-size: 15.5px; }
.prio .where { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.prio .why { color: var(--muted); font-size: 13.5px; margin-top: 7px; }
.prio .do { margin-top: 10px; font-size: 13.5px; padding-left: 12px;
            border-left: 2px solid var(--line-2); }
.prio .do b { color: var(--red); font-weight: 700; }
.prio .gain { text-align: right; }
.prio .gain .v { font-family: var(--mono); font-size: 19px; font-weight: 650; color: var(--red);
                 letter-spacing: -.03em; }
.prio .gain .k { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
                 color: var(--faint); }
@media (max-width: 640px) {
  .prio { grid-template-columns: 28px minmax(0, 1fr); }
  .prio .rk { width: 28px; height: 28px; font-size: 12.5px; }
  .prio .gain { grid-column: 2; text-align: left; margin-top: 8px; }
}

/* ============================ charts ==================================== */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .zero line { stroke: var(--line-2); }
.chart .ax text { font: 500 10.5px var(--mono); fill: var(--faint); }
.chart .lbl { font: 600 10.5px var(--sans); fill: var(--muted); }
.chart .hit { fill: transparent; }
.chart .cursor { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart.live .cursor { opacity: .5; }
.chart .pt { transition: r .12s var(--ease); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted);
          margin-top: 10px; align-items: center; }
.legend b { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.legend i.line { width: 14px; height: 2px; border-radius: 0; }
.caption { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.55; }
.caption b { color: var(--ink-2); }

/* floating tooltip — one instance per page, positioned at the cursor */
.tip { position: fixed; z-index: 90; pointer-events: none; opacity: 0;
       transform: translateY(2px); transition: opacity .1s linear;
       background: var(--carbon); color: var(--on-carbon); border-radius: var(--r-sm);
       padding: 9px 11px; font-size: 12.5px; box-shadow: var(--sh-3); max-width: 280px; }
.tip.on { opacity: 1; }
.tip .th { font-weight: 700; font-size: 12px; letter-spacing: -.01em; margin-bottom: 5px; }
.tip .tr { display: flex; align-items: center; gap: 8px; justify-content: space-between;
           font-family: var(--mono); font-size: 12px; }
.tip .tr span:first-child { display: flex; align-items: center; gap: 6px;
                            font-family: var(--sans); color: var(--on-carbon-muted); }
.tip .tr i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.tip .tn { color: var(--on-carbon-muted); font-family: var(--sans); font-size: 11.5px;
           margin-top: 6px; line-height: 1.45; }

/* activity heatmap */
.heat rect { rx: 2; }
.heat text { font: 500 9.5px var(--mono); fill: var(--faint); }
.heat-l0 { fill: var(--paper-3); }
.heat-l1 { fill: #ffd2cf; } .heat-l2 { fill: #ff9b95; }
.heat-l3 { fill: #f0463d; } .heat-l4 { fill: var(--red-600); }
.heat-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end;
               font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.heat-legend i { width: 10px; height: 10px; border-radius: 2px; display: block; }
.heat-legend i.heat-l0 { background: var(--paper-3); }
.heat-legend i.heat-l1 { background: #ffd2cf; } .heat-legend i.heat-l2 { background: #ff9b95; }
.heat-legend i.heat-l3 { background: #f0463d; } .heat-legend i.heat-l4 { background: var(--red-600); }

/* ============================ misc ====================================== */
.seg { display: inline-flex; background: var(--paper-3); border-radius: var(--r-pill); padding: 3px;
       gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; color: var(--muted); font-size: 12.5px;
              font-weight: 650; padding: 6px 13px; border-radius: var(--r-pill); cursor: pointer;
              white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--sh-1); }

/* min-width:0 nos dois niveis: um <select> com option longa ("Porsche 911 Cup
   (992.2) · Autodromo Nazionale Monza") tem min-content maior que a tela e
   estoura a pagina inteira no mobile se puder crescer. */
.field { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.field select { font: inherit; font-size: 13.5px; padding: 8px 11px; border-radius: var(--r-sm);
                border: 1px solid var(--line-2); background: var(--paper); color: var(--ink);
                min-width: 0; max-width: 100%; }
.spread > * { min-width: 0; }

.acc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
       overflow: hidden; box-shadow: var(--sh-1); }
.acc details { border-bottom: 1px solid var(--line); }
.acc details:last-child { border-bottom: 0; }
.acc summary { list-style: none; cursor: pointer; padding: 13px 16px; font-weight: 650;
               font-size: 14px; display: flex; align-items: center; gap: 10px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .caret { color: var(--faint); transition: transform .18s var(--ease); }
.acc details[open] summary .caret { transform: rotate(90deg); }
.acc .body { padding: 0 16px 16px 42px; }
.acc ul { margin: 0; padding: 0; list-style: none; }
.acc li { font-size: 13.5px; color: var(--ink-2); padding: 4px 0; display: flex; gap: 9px; }
.acc li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--red);
                  margin-top: 9px; flex: none; }
.acc li a { color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.acc li a:hover { color: var(--red); border-color: var(--red); }

.pitch { display: grid; gap: 14px; }
.pitch .step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; align-items: start; }
.pitch .n { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2);
            display: grid; place-items: center; font-family: var(--mono); font-size: 13px;
            font-weight: 650; color: var(--muted); }
.pitch h4 { font-size: 14.5px; }
.pitch p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.code { font-family: var(--mono); font-size: 12.5px; background: var(--carbon); color: #e8eaee;
        border-radius: var(--r-sm); padding: 12px 14px; overflow-x: auto; }
.code .c { color: #8b93a1; } .code .r { color: #ff8a82; }
code { font-family: var(--mono); font-size: .9em; background: var(--paper-3); padding: 1px 5px;
       border-radius: 4px; }

.empty { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 26px;
         text-align: center; color: var(--muted); font-size: 13.5px; background: var(--paper); }
.err { background: var(--red-050); border: 1px solid var(--red-100); border-left: 3px solid var(--red);
       border-radius: var(--r); padding: 16px 18px; font-size: 13.5px; }
.err h3 { font-size: 15px; margin-bottom: 6px; }

.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted);
         margin: 22px 0 0; }
.crumb a { color: var(--muted); font-weight: 600; }
.crumb a:hover { color: var(--red); }
.crumb svg { width: 13px; height: 13px; color: var(--line-2); }

.banner { border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-2); }
.banner img { display: block; width: 100%; height: clamp(160px, 26vw, 300px); object-fit: cover; }

.mono-lg { font-family: var(--mono); font-size: 27px; font-weight: 600; letter-spacing: -.04em; }

/* ===================== acessibilidade e carregamento ===================== */
/* Foco visivel em TUDO que recebe foco -- o site e navegavel por teclado, e o
   :hover sozinho nao ajuda quem nao usa mouse. Cor de marca, nao a default. */
:where(a, button, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px;
}
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; background: var(--carbon);
        color: #fff; padding: 10px 16px; border-radius: var(--r-sm); font-weight: 650;
        font-size: 13.5px; transition: top .16s var(--ease); }
.skip:focus { top: 12px; color: #fff; }

/* Esqueleto enquanto o corpus carrega. Sem ele a pagina fica BRANCA ate o
   fetch voltar -- em rede lenta isso le como site quebrado, nao como carregando. */
.skel { display: grid; gap: 14px; margin-top: 26px; }
.skel .bar { border-radius: var(--r); background:
  linear-gradient(90deg, var(--paper-3) 25%, #f4f5f7 37%, var(--paper-3) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s linear infinite; }
.skel .bar.hero { height: 240px; border-radius: var(--r-lg); }
.skel .bar.line { height: 52px; }
.skel .bar.half { height: 52px; max-width: 46%; }
@keyframes shimmer { to { background-position: -135% 0; } }
@media (prefers-reduced-motion: reduce) { .skel .bar { animation: none; } }

/* Resumo do coach na home: o texto do agente e longo de proposito (o debrief
   inteiro cabe nele). Na home ele e chamada, nao leitura -- 4 linhas e o link. */
.clamp-4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
           overflow: hidden; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 900px) { :root { --gut: 16px; } .hero-in { padding: 30px 22px 26px; } }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto; } }
