/* Stats page (graphs1090 at /graphs1090/) in the fleet theme. The front nginx (nginx-ads-b.conf,
 * "location = /graphs1090/") drops graphs1090's Bootstrap and portal.css and links this file
 * instead, so everything the page shows is styled here. Same tokens and type as the map
 * (theme/fleet-theme.css); the charts are drawn on the server in the dark palette
 * (stats/graphs1090-fleet.sh), and light mode inverts them, which keeps the hues and swaps the
 * greys (#0a0a0a page -> #f5f5f5). */

@font-face { font-family: "B612"; src: url("/fonts/b612-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "B612"; src: url("/fonts/b612-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fleet KR"; src: url("/fonts/plex-kr-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+1100-11FF, U+3130-318F, U+AC00-D7A3, U+00B7, U+FF5E; size-adjust: 104%; ascent-override: 92.8%; descent-override: 24%; line-gap-override: 0%; }
@font-face { font-family: "Fleet KR"; src: url("/fonts/plex-kr-semibold.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+1100-11FF, U+3130-318F, U+AC00-D7A3, U+00B7, U+FF5E; size-adjust: 104%; ascent-override: 92.8%; descent-override: 24%; line-gap-override: 0%; }

html[data-fleet-theme="dark"] {
  --fl-page: #0a0a0a;
  --fl-border: #232323;
  --fl-field: #66666c;
  --fl-text: #f4f4f5;
  --fl-muted: #a1a1aa;
  --fl-act: #31b180;
  --fl-act-ink: #05120d;
  --fl-act-soft: rgba(49, 177, 128, 0.14);
  color-scheme: dark;
}
html[data-fleet-theme="light"] {
  --fl-page: #f5f5f5;
  --fl-border: #e6e6e7;
  --fl-field: #84848c;
  --fl-text: #09090b;
  --fl-muted: #3f3f46;
  --fl-act: #0a775c;
  --fl-act-ink: #ffffff;
  --fl-act-soft: rgba(10, 119, 92, 0.10);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fl-page); color: var(--fl-text); }
body {
  font: 400 13px/1.5 "B612", "Fleet KR", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--fl-act); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--fl-act); outline-offset: 2px; }

.container { max-width: 1290px; margin: 0 auto; padding: 0 16px; }
.padding, #push { display: none; }

/* header: the site name back to the map, then the page */
.fl-head { display: flex; align-items: baseline; gap: 8px; padding: 20px 0 12px; }
.fl-head a, .fl-head h1 { font-size: 16px; font-weight: 700; margin: 0; white-space: nowrap; }
.fl-head a { color: var(--fl-text); }
.fl-head span { color: var(--fl-muted); }

/* range: one row of segments, scrolled sideways where it does not fit */
.sticky-bar { position: sticky; top: 0; z-index: 2; background: var(--fl-page); padding: 8px 0; margin: 0; }
.btn-group.sticky-bar {
  position: static; display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; padding: 0;
}
.btn-group::-webkit-scrollbar { display: none; }
.btn {
  flex: none;
  font: inherit; font-size: 12px; line-height: 1;
  color: var(--fl-muted); background: transparent;
  border: 1px solid var(--fl-field); border-left-width: 0; border-radius: 0;
  padding: 8px 10px; cursor: pointer; white-space: nowrap;
}
.btn:first-child { border-left-width: 1px; border-radius: 2px 0 0 2px; }
#btn-3650d { border-radius: 0 2px 2px 0; }
.btn:hover { color: var(--fl-text); background: var(--fl-act-soft); }
.btn.active { color: var(--fl-act-ink); background: var(--fl-act); border-color: var(--fl-act); }
#btn-crosshair { margin-left: 12px; border-left-width: 1px; border-radius: 2px; }
#btn-crosshair.on { color: var(--fl-act); border-color: var(--fl-act); }
@media (hover: none) { #btn-crosshair { display: none; } }

/* sections and charts */
.panel { margin: 16px 0 8px; }
.panel-heading { font-size: 13px; font-weight: 700; margin: 0 0 10px; }
.panel-body { padding: 0; }
.row { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 16px; }
.column { flex: 1 1 400px; min-width: 0; padding: 0; }
.column a { display: block; }
/* drawn at 619 px (the message rate at 1258): never wider than that, so never blurred */
.column img { display: block; width: 100%; max-width: 619px; height: auto; }
.row:first-child .column img { max-width: 1258px; }
/* charts this host does not draw are removed by stats.js; one that fails to load waits here */
.column.fl-gone { display: none; }
html[data-fleet-theme="light"] .column img { filter: invert(1) hue-rotate(180deg); }

/* footer */
.container > p { margin: 8px 0 24px; font-size: 11px; color: var(--fl-muted); }
.container > p a { color: var(--fl-muted); text-decoration: underline; text-underline-offset: 2px; }

/* crosshair (desktop) */
.cursor { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.cursor .vt { position: fixed; top: 0; bottom: 0; width: 1px; background: var(--fl-muted); }
.cursor .hl { position: fixed; left: 0; right: 0; height: 1px; background: var(--fl-muted); }

@media (max-width: 640px) {
  .fl-head { padding-top: 14px; }
  .row { gap: 12px; margin-bottom: 12px; }
  /* the two wide charts at the scale of the others (619 px in the screen width), scrolled */
  .row:first-child .column { overflow-x: auto; }
  .row:first-child .column img { width: calc((100vw - 32px) * 1258 / 619); max-width: none; }
}
