/*
 * FlightPro "Blueprint" theme — the node-graph editor look (owner's reference
 * screenshots, 2026-10-21): a dark gridded canvas, nodes with coloured title
 * bars, typed pins and curved wires. Dark only.
 *
 * First used by the sign-in page (public/login.html). Pages read these tokens
 * through var(--bp-*); do not hardcode the hex values in a page.
 */
:root {
  /* Canvas */
  --bp-canvas:        #262626;
  --bp-grid-minor:    #2f2f2f;
  --bp-grid-major:    #161616;
  --bp-grid-step:     16px;
  --bp-grid-major-step: 128px;

  /* Editor chrome (tab bar, breadcrumb, details panel) */
  --bp-chrome:        #1a1a1a;
  --bp-chrome-edge:   #0b0b0b;
  --bp-panel:         #3c3c3c;
  --bp-panel-head:    #2b2b2b;

  /* Nodes */
  --bp-node:          rgba(14, 14, 14, .92);
  --bp-node-edge:     #050505;
  --bp-node-select:   #f5a623;
  --bp-node-radius:   8px;
  --bp-node-shadow:   0 1px 2px rgba(0, 0, 0, .55);

  /* Node title bars — one per node kind */
  --bp-head-event:    #7a2d8c;   /* event / entry node (purple) */
  --bp-head-func:     #3f6a3a;   /* pure function (green) */
  --bp-head-cast:     #1d6876;   /* cast / flow (teal) */
  --bp-head-macro:    #4a4a4a;   /* flow control (grey) */
  --bp-head-blue:     #1565a8;   /* the object/wire blue, as a title bar */
  --bp-head-fade:     rgba(14, 14, 14, .0);

  /* Pin / wire colours by data type */
  --bp-exec:          #ffffff;
  --bp-pin-bool:      #a10000;
  --bp-pin-float:     #9ef24f;
  --bp-pin-int:       #1fe0ad;
  --bp-pin-vector:    #fdc827;
  --bp-pin-object:    #00a8f2;
  --bp-pin-string:    #f50fd1;

  /* Text */
  --bp-text:          #e6e6e6;
  --bp-text-dim:      #a8a8a8;
  --bp-text-faint:    #6e6e6e;
  --bp-watermark:     rgba(255, 255, 255, .13);

  /* Inline literal fields (the boxed value inside a node) */
  --bp-field:         #0c0c0c;
  --bp-field-edge:    #5a5a5a;
  --bp-field-focus:   #00a8f2;
  --bp-field-radius:  3px;       /* literal boxes and buttons are near-square */

  /* Messages */
  --bp-error:         #e04848;
  --bp-error-bg:      rgba(161, 0, 0, .18);
  --bp-ok:            #9ef24f;
  --bp-ok-bg:         rgba(158, 242, 79, .10);
  --bp-info:          #00a8f2;
  --bp-info-bg:       rgba(0, 168, 242, .12);

  --bp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* The gridded canvas: fine lines every step, dark lines every eighth. */
.bp-canvas {
  background-color: var(--bp-canvas);
  background-image:
    linear-gradient(var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(var(--bp-grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid-minor) 1px, transparent 1px);
  background-size:
    var(--bp-grid-major-step) var(--bp-grid-major-step),
    var(--bp-grid-major-step) var(--bp-grid-major-step),
    var(--bp-grid-step) var(--bp-grid-step),
    var(--bp-grid-step) var(--bp-grid-step);
  color: var(--bp-text);
  font-family: var(--bp-font);
}

/* A node: dark body, coloured title bar fading to the right. */
.bp-node {
  background: var(--bp-node);
  border: 1px solid var(--bp-node-edge);
  border-radius: var(--bp-node-radius);
  box-shadow: var(--bp-node-shadow);
  overflow: hidden;
}
.bp-node-head {
  --head: var(--bp-head-event);
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: linear-gradient(90deg, var(--head) 0%, var(--head) 35%, var(--bp-head-fade) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .6);
}
.bp-node-head.func  { --head: var(--bp-head-func); }
.bp-node-head.cast  { --head: var(--bp-head-cast); }
.bp-node-head.macro { --head: var(--bp-head-macro); }
.bp-node-head.blue  { --head: var(--bp-head-blue); }
.bp-node-sub { font-size: 10.5px; font-style: italic; font-weight: 400; color: var(--bp-text-dim); }

/* Pins: a filled dot in the type colour; exec pins are white arrows. */
.bp-pin {
  --pin: var(--bp-pin-object);
  display: inline-block; flex: none;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--pin);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .6);
}
.bp-pin.hollow { background: transparent; box-shadow: inset 0 0 0 2px var(--pin); }
.bp-pin.bool   { --pin: var(--bp-pin-bool); }
.bp-pin.float  { --pin: var(--bp-pin-float); }
.bp-pin.int    { --pin: var(--bp-pin-int); }
.bp-pin.vector { --pin: var(--bp-pin-vector); }
.bp-pin.string { --pin: var(--bp-pin-string); }
.bp-exec {
  display: inline-block; flex: none;
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--bp-exec);
}

/* Variable getter: the stadium-shaped node with a single output pin. */
.bp-var {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 14px;
  background: var(--bp-node);
  border: 1px solid var(--bp-node-edge);
  border-radius: 999px;
  font-size: 12px; color: var(--bp-text);
  box-shadow: var(--bp-node-shadow);
  white-space: nowrap;
}

/* Editor chrome: the breadcrumb bar across the top of the graph. */
.bp-bar {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 16px;
  background: var(--bp-chrome);
  border-bottom: 1px solid var(--bp-chrome-edge);
  color: var(--bp-text-dim);
  font-size: 14px;
}
.bp-bar b { color: var(--bp-text); font-weight: 500; }
.bp-bar .role { color: var(--bp-text-faint); }
/* The editor's tab strip, under the title bar: each page of the FlightLog site is a tab. */
.bp-tabs { display: flex; align-items: flex-end; gap: 2px; height: 32px; padding: 0 12px; background: var(--bp-chrome); border-bottom: 1px solid var(--bp-chrome-edge); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; min-width: 0; }
.bp-tabs::-webkit-scrollbar { display: none; }
.bp-tab { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 14px; font-size: 12.5px; color: var(--bp-text-dim); text-decoration: none; background: #242424; border: 1px solid var(--bp-chrome-edge); border-bottom: none; border-radius: 5px 5px 0 0; }
.bp-tab:hover { color: var(--bp-text); background: #2c2c2c; }
.bp-tab.on { color: var(--bp-text); background: var(--bp-canvas); height: 28px; }
.bp-tab .bp-exec { border-left-width: 6px; border-top-width: 4px; border-bottom-width: 4px; }
.bp-tab .x { color: var(--bp-text-faint); font-size: 14px; line-height: 1; margin-left: 2px; }
/* Weather, NOTAM and Route groups sit at the right end of the strip (owner's call, 2026-10-24). */
.bp-tab.end { margin-left: auto; }
.bp-watermark {
  position: fixed; right: 18px; bottom: 6px;
  font-size: 54px; font-weight: 800; letter-spacing: .02em;
  color: var(--bp-watermark);
  pointer-events: none; user-select: none;
}

/* eFlightLog navigation (js/elog-nav.js, owner's ask 2026-10-26): the brand, then the four menus in
   the title bar; each menu drops its pages on hover or keyboard focus; the current menu's pages are
   the tab strip below. The breadcrumb gives way to the menus. */
.bp-bar { position: relative; z-index: 20; }
.bp-bar .crumbs { display: none !important; }
.elog-nav { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.elog-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--bp-text) !important; text-decoration: none; font-size: 14px; }
.elog-brand b { font-weight: 700; letter-spacing: .01em; }
.elog-mark { width: 24px; height: 24px; border-radius: 6px; background: var(--bp-head-blue); color: #fff; display: grid; place-items: center; }
.elog-mark svg { width: 15px; height: 15px; }
.elog-menus { display: flex; align-items: stretch; height: 40px; min-width: 0; }
.elog-menu { position: relative; display: flex; }
.elog-top { display: inline-flex; align-items: center; flex: none; white-space: nowrap; padding: 0 12px; font-size: 13px; color: var(--bp-text-dim) !important; text-decoration: none; border-bottom: 2px solid transparent; }
.elog-top:hover, .elog-top:focus-visible { color: var(--bp-text) !important; background: rgba(255,255,255,.04); }
.elog-menu.cur .elog-top { color: var(--bp-text) !important; font-weight: 600; border-bottom-color: var(--bp-node-select); }
.elog-drop { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; padding: 4px 0; background: var(--bp-node); border: 1px solid var(--bp-node-edge); border-radius: 0 0 6px 6px; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
/* No drop-down (owner's ask, 2026-10-29): a menu goes to its first page; .elog-drop only keeps the other menus' links in the page, hidden. */
.elog-drop[hidden] { display: none !important; }
.elog-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 12.5px; color: var(--bp-text) !important; text-decoration: none; white-space: nowrap; }
.elog-item:hover, .elog-item:focus { background: rgba(255,255,255,.06); outline: none; }
.elog-item small, .bp-tab small { margin-left: auto; padding-left: 10px; font-size: 10.5px; color: var(--bp-text-faint); }
.elog-item.soon, .bp-tab.soon { color: var(--bp-text-faint) !important; cursor: default; }
.elog-item .bp-exec { border-left-width: 6px; border-top-width: 4px; border-bottom-width: 4px; }
.bp-tab.soon { opacity: .7; }
@media (max-width: 900px) { .elog-brand b { display: none; } .elog-top { padding: 0 8px; font-size: 12px; } .elog-nav { gap: 8px; } }
@media (max-width: 600px) { .elog-top { padding: 0 5px; font-size: 11px; white-space: normal; line-height: 1.1; text-align: center; flex: 0 1 auto; } }
@media (max-width: 760px) { .bp-bar .who #user-name, .bp-bar .who .role { display: none; } }

/* The title bar on a narrow screen: one line — the breadcrumb and the name give way, the role goes. */
.bp-bar { min-width: 0; white-space: nowrap; }
.bp-bar .crumbs { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .bp-bar { padding: 0 10px; gap: 8px; }
  .bp-bar .role { display: none; }
  .bp-bar .who #user-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
  .bp-tabs { padding: 0 6px; }
  .bp-tab { padding: 0 10px; }
}

/* Moving between the FlightLog pages: the browser's own view transitions (Chrome, Edge, Safari 18.2+;
   elsewhere the page simply changes). A short cross-fade for every page; the flight opened from Today's
   flights is named "flight-node" on both pages, so its node grows into the flight page's node. */
@view-transition { navigation: auto; }
::view-transition { background: #262626; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: ease; }
::view-transition-group(flight-node) { animation-duration: 340ms; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(flight-node), ::view-transition-new(flight-node) { animation-duration: 340ms; height: 100%; object-fit: cover; object-position: top left; }
.bp-bar, .bp-tabs { view-transition-name: none; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
