/* Schedule optimization sample panels (optimize.py, 2026-11-01): /routes #optimize and the /network band.
   Adapted from the carrier performance dashboard. Light "app window" panels; orange stays a mark colour (dots, meters, markers),
   the dot is #E8590C (3.6:1 on white, WCAG 1.4.11), and every value is also written as text. */

.split-x { margin-top: 56px; }

/* four numbered steps */
.opt-steps { list-style: none; margin: 0 0 44px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; counter-reset: step; }
.opt-steps li { counter-increment: step; display: grid; align-content: start; gap: 10px; padding-top: 18px; border-top: 2px solid var(--graphite); }
.opt-steps li::before { content: counter(step); width: 34px; height: 34px; border-radius: 10px; background: var(--orange); color: var(--btn-ink);
  font-weight: 800; font-size: 16px; display: grid; place-items: center; }
.opt-steps h3 { font-size: 18px; }
.opt-steps p { color: var(--grey); font-size: 16px; }
@media (max-width: 1000px) { .opt-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 18px; } }
@media (max-width: 560px) { .opt-steps { grid-template-columns: minmax(0, 1fr); } }

/* the window */
.opt-win { margin: 0; color: var(--graphite); background: var(--white); border: 1px solid var(--silver); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.opt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 16px; border-bottom: 1px solid var(--silver); font-size: 13px; }
.opt-app { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.opt-app i { width: 10px; height: 10px; border-radius: 3px; background: var(--orange); }
.opt-sub { color: var(--grey); }
.opt-tag { margin-left: auto; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border: 1px solid var(--silver); border-radius: 6px; padding: 1px 7px; background: var(--off); }
.opt-body { background: var(--off); padding: 18px; display: grid; gap: 16px; min-width: 0; }
.opt-card { background: var(--white); border: 1px solid var(--silver); border-radius: 12px; padding: 18px 20px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.opt-card h3 { font-size: 17px; letter-spacing: -.01em; }
.opt-card h4 { margin: 0; font-size: 15px; font-weight: 700; }
.opt-note { font-size: 14px; color: var(--grey); max-width: 42em; line-height: 1.5; }
.opt-foot { font-size: 12.5px; color: var(--grey); padding: 10px max(16px, calc(100% - 46em)) 10px 16px; border-top: 1px solid var(--silver); line-height: 1.45; }
@media (max-width: 560px) { .opt-body { padding: 10px; gap: 10px; } .opt-card { padding: 14px; } }

/* joined KPI tiles */
.opt-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--white); border: 1px solid var(--silver); border-radius: 12px; overflow: hidden; }
.opt-kpis div { display: grid; gap: 2px; padding: 14px 18px; }
/* tiles share row tracks (subgrid), so a label that wraps to two lines doesn't push its value below its neighbours' (QA 2026-11-01) */
@supports (grid-template-rows: subgrid) { .opt-kpis { row-gap: 0; } .opt-kpis > div { grid-row: span 4; grid-template-rows: subgrid; row-gap: 2px; align-content: start; } .opt-kpis > div > span { align-self: end; } }
.opt-kpis div + div { border-left: 1px solid var(--silver); }
.opt-kpis span { font-size: 13px; font-weight: 600; color: var(--grey); line-height: 1.3; }
.opt-kpis b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.opt-kpis em { font-style: normal; font-size: 12.5px; color: var(--grey); }
@media (max-width: 760px) {
  .opt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opt-kpis div:nth-child(3) { border-left: 0; }
  .opt-kpis div:nth-child(n+3) { border-top: 1px solid var(--silver); }
  .opt-kpis div { padding: 12px 14px; } .opt-kpis b { font-size: 24px; }
}
@media (max-width: 400px) { .opt-kpis div { padding: 10px 10px; } .opt-kpis b { font-size: 20px; letter-spacing: -.03em; } }   /* "4,82 M$ US" fits a half-width tile at 320 px */

/* needs attention: label + one plain sentence; the stripe colour repeats what the label says */
.opt-att { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opt-att li { display: grid; gap: 4px; align-content: start; padding: 12px 14px; border: 1px solid #E5E7EB; border-left: 4px solid var(--c); border-radius: 8px; }
.opt-att .opt-k { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.opt-att p { font-size: 15px; line-height: 1.45; color: #374151; }
.opt-late { --c: #DC2626; } .opt-early { --c: #D97706; } .opt-data { --c: #2563EB; }
@media (max-width: 760px) { .opt-att { grid-template-columns: minmax(0, 1fr); } }

/* time gained and lost: one row per segment, dot = median, band = middle half (p25–p75); centre line = the timetable */
.opt-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--grey); margin: 4px 0 2px; }
.opt-legend span { display: inline-flex; align-items: center; gap: 7px; }
.opt-legend .dot, .opt-prof .dot { width: 12px; height: 12px; border-radius: 50%; background: #E8590C; box-shadow: 0 0 0 2px var(--white); }
.opt-legend .dot.lay, .opt-prof .lay .dot { background: var(--white); border: 2px solid #E8590C; }
.opt-legend .band { width: 22px; height: 8px; border-radius: 4px; background: rgba(255, 121, 0, .26); }
.opt-prof { list-style: none; margin: 0; padding: 0; }
.opt-prof li, .opt-axis { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) 72px; align-items: center; gap: 14px; }
.opt-prof li { padding: 4px 0; font-size: 14px; }
.opt-prof li + li { border-top: 1px solid #F3F4F6; }
.opt-seg { text-align: right; line-height: 1.3; }
.opt-prof .lay .opt-seg { color: var(--grey); font-style: italic; }
.opt-track { position: relative; height: 20px;
  background: linear-gradient(90deg, transparent calc(50% - .5px), #6B7280 calc(50% - .5px), #6B7280 calc(50% + .5px), transparent calc(50% + .5px)),
              linear-gradient(90deg, transparent calc(12.5% - .5px), #E5E7EB calc(12.5% - .5px), #E5E7EB calc(12.5% + .5px), transparent calc(12.5% + .5px)),
              linear-gradient(90deg, transparent calc(87.5% - .5px), #E5E7EB calc(87.5% - .5px), #E5E7EB calc(87.5% + .5px), transparent calc(87.5% + .5px)); }
.opt-track .band { position: absolute; top: 6px; height: 8px; border-radius: 4px; background: rgba(255, 121, 0, .26); }
.opt-track .dot { position: absolute; top: 4px; transform: translateX(-50%); }
.opt-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--grey); }
.opt-prof .big .opt-val { color: var(--graphite); font-weight: 700; }
.opt-axis { font-size: 12.5px; color: var(--grey); margin-top: 6px; padding-bottom: 6px; border-bottom: 1px solid #E5E7EB; }
.opt-scale { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; }
.opt-scale span:nth-child(2) { text-align: center; font-weight: 700; color: var(--graphite); }
.opt-scale span:last-child { text-align: right; }
@media (max-width: 640px) {
  .opt-prof li, .opt-axis { grid-template-columns: minmax(0, 1fr) 62px; gap: 2px 10px; }
  .opt-seg { grid-column: 1 / -1; text-align: left; }
  .opt-axis > span:empty { display: none; }
  .opt-prof li { padding: 6px 0; }
}

/* tables */
.opt-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .opt-two { grid-template-columns: minmax(0, 1fr); } }
.opt-scroll { overflow-x: auto; }
.opt-scroll:focus-visible { outline: 3px solid var(--graphite); outline-offset: 2px; }
.opt-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.opt-table th, .opt-table td { padding: 7px 10px; border-bottom: 1px solid #E5E7EB; text-align: right; white-space: nowrap; vertical-align: top; }
.opt-table th:first-child { text-align: left; padding-left: 0; white-space: normal; }
.opt-table td:last-child, .opt-table th:last-child { padding-right: 0; }
.opt-table thead th { font-size: 12.5px; font-weight: 700; color: var(--grey); border-bottom: 1.5px solid var(--graphite); vertical-align: bottom; }
.opt-table tbody th { font-weight: 600; min-width: 140px; }
.opt-table tbody tr:last-child > * { border-bottom: 0; }
.opt-table small { display: block; font-size: 12.5px; font-weight: 500; color: var(--grey); }
.opt-table td small { display: inline; }
.opt-table .late { color: #B91C1C; font-weight: 700; }
.opt-table .early { color: #92400E; font-weight: 700; }
.opt-table .gain { color: #166534; font-weight: 800; }
.opt-table .moved { font-weight: 700; }

/* suggested timetables: native <details>, one open */
.opt-opts { display: grid; gap: 10px; margin-top: 6px; }
.opt-opt { border: 1px solid var(--silver); border-radius: 10px; background: var(--white); }
.opt-opt[open] { border-color: var(--graphite); }
.opt-opt summary { list-style: none; cursor: pointer; position: relative; display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto; align-items: center;
  gap: 6px 18px; padding: 12px 16px 12px 42px; border-radius: 10px; }
.opt-opt summary::-webkit-details-marker { display: none; }
.opt-opt summary::before { content: ""; position: absolute; left: 18px; top: 21px; width: 7px; height: 7px; border-right: 2px solid var(--graphite); border-bottom: 2px solid var(--graphite);
  transform: rotate(-45deg); transition: transform .15s; }
.opt-opt[open] summary::before { transform: rotate(45deg); top: 18px; }
.opt-opt summary:hover { background: var(--off); }
.opt-oname { font-weight: 700; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.opt-badge { font-size: 11.5px; font-weight: 700; color: #166534; background: #DCFCE7; border-radius: 999px; padding: 1px 8px; }
.opt-odesc { font-size: 14px; color: var(--grey); line-height: 1.45; }
.opt-stats { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 16px; font-size: 13.5px; color: var(--grey); }
.opt-stats b { color: var(--graphite); }
.opt-gain { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
@media (max-width: 400px) { .opt-gain { white-space: normal; flex-wrap: wrap; row-gap: 2px; } .opt-gain b { white-space: nowrap; } }   /* "34% → 45% a tiempo" drops under its meter at 320 px */
.opt-opt .opt-scroll { padding: 4px 16px 14px 42px; }
@media (max-width: 1000px) {
  .opt-opt summary { grid-template-columns: minmax(0, 1fr); }
  .opt-stats { justify-content: flex-start; }
}
@media (max-width: 560px) { .opt-opt summary, .opt-opt .opt-scroll { padding-left: 36px; padding-right: 12px; } .opt-opt summary::before { left: 14px; } }

/* on-time meter: grey = on time now, orange = added by the suggestion */
.opt-meter { position: relative; display: inline-block; flex: none; width: 76px; height: 8px; border-radius: 4px; background: #E5E7EB; overflow: hidden; vertical-align: middle; }
.opt-meter i { position: absolute; top: 0; bottom: 0; }
.opt-meter i:first-child { left: 0; width: var(--a); background: #6B7280; }
.opt-meter i:last-child { left: var(--a); width: calc(var(--b) - var(--a)); background: #E8590C; }

/* /network: dark band with a compact panel */
.opt-points { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 10px; }
.opt-points li { display: flex; gap: 12px; font-weight: 600; }
.opt-points li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--orange); flex: none; margin-top: 8px; }
.opt-band .split { align-items: center; }
.opt-mini { box-shadow: var(--shadow-dark); border-color: transparent; }
.opt-mini-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.opt-mini-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px; padding: 11px 0; font-size: 15px; }
.opt-mini-list li + li { border-top: 1px solid #E5E7EB; }
.opt-mini-list .opt-meter { width: 110px; height: 10px; border-radius: 5px; }
.opt-mini-list b { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 6.2em; text-align: right; }
@media (max-width: 480px) { .opt-mini-list li { grid-template-columns: minmax(0, 1fr) auto; } .opt-mini-list .opt-meter { grid-column: 1 / -1; grid-row: 2; width: 100%; } }
.opt-opt summary { font-size: 15px; }
.opt-tt { max-width: 680px; }
.opt-body, .opt-card, .opt-opts { grid-template-columns: minmax(0, 1fr); }   /* tables scroll inside their region instead of widening the card (320 px) */
@media (max-width: 560px) {
  .opt-opt .opt-scroll { padding: 0 10px 10px; }
  .opt-table { font-size: 13px; } .opt-table th, .opt-table td { padding: 6px 6px; }
  .opt-table tbody th { min-width: 96px; }
}
@media (max-width: 900px) {   /* wide sample tables: one card per row instead of a sideways scroll, phones and tablets (build.stack_tables, QA 2026-11-01) */
  .stk, .stk thead, .stk tbody { display: block; }
  .stk thead tr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stk tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; padding: 10px 0; border-bottom: 1px solid #E5E7EB; }
  .stk.stk-3 tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stk tbody tr:last-child { border-bottom: 0; }
  .stk th, .stk td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; white-space: normal; min-width: 0 !important; }
  .stk tbody th { grid-column: 1 / -1; font-size: 14px; }
  .stk td::before { content: attr(data-label); content: attr(data-label) / ""; display: block; font-size: 11.5px; font-weight: 600; color: var(--grey); line-height: 1.3; margin-bottom: 1px; }
  .stk td { font-size: 14px; }
  .stk tr.now { padding-left: 8px; padding-right: 8px; border-radius: 8px; }
}
@media (max-width: 900px) { .opt-table thead th { white-space: normal; } }   /* headers wrap so tables fit tablets and phones; values stay on one line */
@media (max-width: 440px) {   /* four-column tables (segments, timetables, channels) fit at 320-440 px without scrolling */
  .opt-table th, .opt-table td { padding: 6px 4px; } .opt-table { font-size: 12.5px; }
  .opt-table tbody th { min-width: 72px; } .opt-table thead th { font-size: 11.5px; hyphens: auto; }
  .opt-opt .opt-scroll { padding: 0 6px 8px; }
  .opt-tt td, .opt-tt th { white-space: normal; }
}
@media (max-width: 360px) { .opt-table { font-size: 12px; } .opt-table tbody th { min-width: 60px; } .opt-table th, .opt-table td { padding-left: 3px; padding-right: 3px; } .opt-table thead th { font-size: 11.5px; } }
.opt-more { margin-top: 24px; color: var(--grey); max-width: 46em; }
.opt-more a { font-weight: 700; white-space: nowrap; }
@media (max-width: 560px) { .opt-more a { white-space: normal; } }

/* ---------- revenue performance samples (revenue.py, /revenue) ---------- */
/* five joined tiles: value, last year, change (text colour follows the sign, as on the dashboards; the sign is always written) */
.opt-kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.opt-kpis strong { font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.up { color: #166534; } .down { color: #B91C1C; }
.opt-table td.up, .opt-table td.down { font-weight: 700; }
@media (max-width: 1000px) { .opt-kpis.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .opt-kpis.five div:nth-child(4) { border-left: 0; } .opt-kpis.five div:nth-child(n+4) { border-top: 1px solid var(--silver); } }
@media (max-width: 760px) { .opt-kpis.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opt-kpis.five div { border-left: 1px solid var(--silver); border-top: 0; }
  .opt-kpis.five div:nth-child(odd) { border-left: 0; } .opt-kpis.five div:nth-child(n+3) { border-top: 1px solid var(--silver); }
  .opt-kpis.five div:last-child { grid-column: 1 / -1; } }   /* fifth tile spans the row instead of leaving a blank half (QA 2026-11-01) */

/* legend swatches */
.rv-sw { width: 18px; height: 3px; border-radius: 2px; }
.rv-sw.now { background: #E8590C; } .rv-sw.ly { background: #6B7280; }
.rv-sw.hol { width: 0; height: 12px; border-left: 2px dashed #2563EB; border-radius: 0; }
.rv-sw.bar { width: 10px; height: 12px; border-radius: 3px; }

/* revenue by day: lines in a stretched SVG (non-scaling strokes), axis text in HTML so it stays readable at 320 px */
.rv-chart { margin-top: 6px; }
.rv-plot { position: relative; height: 210px; margin-left: 58px; }
.rv-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rv-area { fill: rgba(255, 121, 0, .12); }
.rv-now, .rv-ly { fill: none; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rv-now { stroke: #E8590C; } .rv-ly { stroke: #6B7280; }
.rv-hits rect { fill: transparent; }
.rv-hits rect:hover { fill: rgba(41, 45, 50, .06); }
.rv-grid { position: absolute; left: 0; right: 0; border-top: 1px solid #E5E7EB; }
.rv-grid:first-child { border-top-color: #9CA3AF; }
.rv-grid span { position: absolute; right: calc(100% + 8px); top: -9px; font-size: 12px; color: var(--grey); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rv-hol { position: absolute; top: -4px; bottom: 0; border-left: 2px dashed #2563EB; pointer-events: none; }
.rv-hol span { position: absolute; left: 6px; top: -2px; font-size: 12px; font-weight: 700; color: #1D4ED8; background: var(--white); padding: 0 3px; white-space: nowrap; }
.rv-x { display: grid; grid-template-columns: repeat(4, 1fr); margin: 6px 0 0 58px; font-size: 12.5px; color: var(--grey); text-align: center; }
.rv-weeks { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rv-weeks li { display: grid; gap: 1px; padding: 10px 12px; border: 1px solid #E5E7EB; border-radius: 8px; font-variant-numeric: tabular-nums; }
.rv-weeks span, .rv-weeks em { font-size: 12.5px; color: var(--grey); font-style: normal; }
.rv-weeks b { font-size: 18px; font-weight: 800; }
.rv-weeks strong { font-size: 13.5px; }
@media (max-width: 640px) { .rv-weeks { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rv-plot { height: 170px; margin-left: 50px; } .rv-x { margin-left: 50px; } }

/* booking window: paired bars, value written on this year's bar */
.rv-hist { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; align-items: end; margin-top: 8px; border-bottom: 1px solid #9CA3AF; }
.rv-col { display: contents; }
.rv-bars { height: 190px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding-top: 22px; }
.rv-bars i { position: relative; width: 42%; max-width: 26px; border-radius: 4px 4px 0 0; }
.rv-bars .ly { background: #6B7280; } .rv-bars .now { background: #E8590C; }
.rv-bars .now span { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--graphite); white-space: nowrap; }
.rv-lab { grid-row: 2; font-size: 12px; color: var(--grey); text-align: center; line-height: 1.25; padding-top: 6px; }
.rv-hist { grid-template-rows: auto auto; border-bottom: 0; }
.rv-bars { border-bottom: 1px solid #9CA3AF; }
@media (max-width: 640px) { .rv-hist { gap: 4px; } .rv-bars { height: 150px; } .rv-bars i { width: 46%; } .rv-bars .now span { font-size: 10.5px; } .rv-lab { font-size: 10.5px; } }

.rv-table tbody th { min-width: 180px; }
.rv-bars .now span { font-style: normal; }
:lang(es) .rv-plot, :lang(es) .rv-x, :lang(fr) .rv-plot, :lang(fr) .rv-x { margin-left: 72px; }   /* "US$60 mil" / "60 k$ US" are longer than "$60K" */
@media (max-width: 640px) { :lang(es) .rv-plot, :lang(es) .rv-x, :lang(fr) .rv-plot, :lang(fr) .rv-x { margin-left: 66px; } :lang(es) .rv-grid span, :lang(fr) .rv-grid span { font-size: 11px; } }
.rv-x span { white-space: nowrap; }
.rv-hol.lft span { left: auto; right: 6px; }   /* marker in the right half: label sits left of the line */
@media (max-width: 360px) {   /* 320 px: fewer ticks, long end labels wrap, "2.6 mil" stacks (QA 2026-11-01) */
  .pl-x span.nx2 { display: none; }
  :lang(es) .pl-x, :lang(fr) .pl-x { height: 30px; }
  .pl-x span.first, .pl-x span.last { white-space: normal; max-width: 48%; width: max-content; line-height: 1.2; }
  .pl-x span.last { text-align: right; }
}
@media (max-width: 400px) { :lang(es) .rv-val { white-space: normal; width: min-content; text-align: center; line-height: 1.05; } }
@media (max-width: 480px) { .rv-x span:nth-child(even) { visibility: hidden; overflow: hidden; } }   /* phones: label weeks 1 and 3 only, so "Semaine 1…4" never collide (QA 2026-11-01) */
@media (max-width: 640px) { .rv-x { font-size: 11px; } }
.rv-bars { position: relative; padding-top: 0; }
.rv-val { position: absolute; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--graphite); white-space: nowrap; }
.rv-lab { overflow-wrap: normal; hyphens: manual; }
@media (max-width: 640px) { .rv-val { font-size: 10.5px; } .rv-lab { font-size: 11px; } .rv-hist { gap: 3px; } .rv-lw { display: none; } }

/* ---------- dynamic pricing + loyalty samples (pricing_loyalty.py, charts.py) ---------- */
.rv-sw.fc { background: repeating-linear-gradient(90deg, #E8590C 0 4px, transparent 4px 7px); }
.pl-fc { fill: none; stroke: #E8590C; stroke-width: 2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.pl-x { position: relative; height: 18px; margin: 6px 0 0 58px; font-size: 12px; color: var(--grey); }
.pl-x span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.pl-x span.first { transform: none; } .pl-x span.last { transform: translateX(-100%); }
.pl-mark { position: absolute; width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%; background: #E8590C; box-shadow: 0 0 0 2px var(--white); }
.pl-mark b { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 800; white-space: nowrap; background: rgba(255,255,255,.85); padding: 0 2px; border-radius: 3px; }
:lang(es) .pl-x, :lang(fr) .pl-x { margin-left: 72px; }
@media (max-width: 640px) { .pl-x { margin-left: 50px; font-size: 11px; } .pl-x span.nx { display: none; } :lang(es) .pl-x, :lang(fr) .pl-x { margin-left: 66px; } }
.pl-pair { align-items: stretch; }   /* side-by-side cards end level (QA 2026-11-01; was start) */
@media (min-width: 1001px) { .pl-pair { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.pl-ladder tr.done td, .pl-ladder tr.done th { color: var(--grey); }
.pl-ladder tr.now { background: #FFF4EB; }
.pl-ladder tr.now th, .pl-ladder tr.now .pl-status { font-weight: 800; color: var(--graphite); }
.pl-status { white-space: normal !important; min-width: 120px; text-align: left !important; }
.pl-insight { margin-top: 6px; padding: 12px 14px; border-radius: 10px; background: var(--off); border: 1px solid var(--silver); font-size: 14.5px; line-height: 1.45; }
.pl-insight b { display: block; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--graphite); margin-bottom: 2px; }
.pl-rules { margin: 6px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.pl-rules div { display: grid; grid-template-columns: minmax(120px, 40%) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid #E5E7EB; align-items: baseline; }
.pl-rules dt { font-size: 13.5px; font-weight: 600; color: var(--grey); }
.pl-rules dd { margin: 0; font-size: 15px; font-weight: 600; }
.pl-rules.one { grid-template-columns: minmax(0, 1fr); }
.pl-rules.one div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.pr-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pr-chips li { font-size: 13.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--silver); background: var(--off); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .pl-rules { grid-template-columns: minmax(0, 1fr); } }
.ly-progs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ly-ex { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); }
.ly-prog h3 { font-size: 19px; }
@media (max-width: 900px) { .ly-progs { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 761px) { .opt-kpis:not(.five):not(.three) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.opt-kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .opt-kpis.three { grid-template-columns: minmax(0, 1fr); }
  .opt-kpis.three div { border-left: 0 !important; } .opt-kpis.three div + div { border-top: 1px solid var(--silver); } }
/* value labels sit on this year's (orange, right-hand) bar; a white halo keeps them legible where last year's bar is taller */
.rv-val { left: calc(50% + 1px + min(21%, 13px)); font-size: 11.5px; padding: 0 2px; border-radius: 3px; background: rgba(255,255,255,.9); }
@media (max-width: 640px) { .rv-val { left: calc(50% + 1px + 23%); font-size: 10px; } }
.opt-table thead th { white-space: normal; }
@media (max-width: 1100px) { .pl-pair { grid-template-columns: minmax(0, 1fr); } }

/* ---------- AI pill + TDS insight callouts (2026-11-01): mark every sample-panel section as AI-enhanced, linking to /ai ---------- */
.sec-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ai-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px 5px 10px; border-radius: 999px; border: 1.5px solid var(--orange);
  background: linear-gradient(90deg, #FFF4EB, var(--white)); font-size: 13.5px; line-height: 1.3; text-decoration: none; color: var(--graphite); }
.ai-pill b { font-weight: 800; }
.ai-pill span { color: #4B5563; padding-left: 8px; border-left: 1px solid var(--silver); }
.ai-pill span::after { content: " \2192"; }
.ai-pill:hover span, .ai-pill:focus-visible span { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ai-pill .spk { width: 15px; height: 15px; }
@media (max-width: 370px) {   /* French/Spanish are too long for one line on small phones: the link text drops to a second line, aligned under the label (QA 2026-11-01) */
  :lang(fr) .ai-pill, :lang(es) .ai-pill { flex-wrap: wrap; row-gap: 1px; border-radius: 16px; padding: 6px 14px 6px 10px; }
  :lang(fr) .ai-pill b, :lang(fr) .ai-pill span, :lang(es) .ai-pill b, :lang(es) .ai-pill span { white-space: nowrap; }
  :lang(fr) .ai-pill span, :lang(es) .ai-pill span { flex-basis: 100%; border-left: 0; padding-left: 22px; }
}
.dark .ai-pill { background: rgba(255, 255, 255, .07); color: var(--white); }
.dark .ai-pill span { color: #D1D5DB; border-left-color: rgba(255, 255, 255, .25); }
.ai-insight { margin: 8px 0 0; padding: 12px 14px; border-radius: 10px; background: #FFF8F1; border: 1px solid #FBD5B0; font-size: 14.5px; line-height: 1.45; }
.ai-insight b { display: flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--graphite); margin-bottom: 3px; }
.ai-insight .spk { width: 14px; height: 14px; }
.ai-insight span { display: block; max-width: 41em; }   /* insight text stays ~90 characters a line in full-width panels */
.pl-band { fill: rgba(255, 121, 0, .16); stroke: none; }

/* ---------- forecasting + data samples (forecast_data.py) ---------- */
.fd-act { white-space: normal !important; min-width: 150px; text-align: left !important; font-weight: 600; }
.fd-act.warn { font-weight: 800; }
@media (max-width: 560px) {   /* phones: departure, then its three numbers, then the suggestion, instead of a sideways scroll (QA 2026-11-01); ARIA roles keep it a table */
  .fd-tbl, .fd-tbl thead, .fd-tbl tbody { display: block; }
  .fd-tbl tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 8px; padding: 8px 0; border-bottom: 1px solid #E5E7EB; }
  .fd-tbl thead tr { border-bottom: 1.5px solid var(--graphite); padding: 0 0 6px; }
  .fd-tbl tbody tr:last-child { border-bottom: 0; }
  .fd-tbl th, .fd-tbl td { border-bottom: 0 !important; white-space: normal; text-align: left !important; padding: 0 !important; min-width: 0 !important; }
  .fd-tbl thead th:first-child, .fd-tbl thead th.fd-act { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fd-tbl tbody th { grid-column: 1 / -1; margin-bottom: 2px; }
  .fd-tbl td.fd-act { grid-column: 1 / -1; margin-top: 4px; }
}
.fd-events { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--grey); }
.fd-events b { color: var(--graphite); margin-right: 4px; }
.fd-feed { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; }
.fd-feed li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 12px 0; border-top: 1px solid #E5E7EB; }
.fd-feed p { margin: 0; font-size: 15px; max-width: 40.5em; }
.fd-tag { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; justify-self: start; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px; background: #FFF4EB; border: 1px solid #FBD5B0; }
.fd-tag .spk { width: 12px; height: 12px; }
:lang(fr) .fd-feed li { grid-template-columns: 136px minmax(0, 1fr); }   /* "À surveiller" tag */
@media (max-width: 640px) { .fd-feed li, :lang(fr) .fd-feed li { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
.fd-share { display: inline-block; width: 64px; height: 8px; margin-right: 8px; border-radius: 4px; background: #E5E7EB; vertical-align: middle; overflow: hidden; }
.fd-share i { display: block; height: 100%; background: #E8590C; border-radius: 4px; }
.fd-review { color: #92400E; font-weight: 800; }
.fd-ok { color: #166534; font-weight: 700; }
