/* VARUNA — design system: deep-ocean night, glass panels, aqua/violet light. */
:root {
  --bg: #050b14; --bg2: #081322; --ink: #e8f1ff; --ink2: #a9bdd6; --ink3: #6f87a6; --line: rgba(130, 200, 255, .12); --line2: rgba(130, 200, 255, .22);
  --glass: rgba(9, 20, 36, .74); --glass2: rgba(14, 30, 52, .82); --glass3: rgba(20, 40, 68, .9);
  --aqua: #38e1ff; --teal: #22d3a6; --violet: #8b7bff; --amber: #ffb547; --coral: #ff6b6b; --green: #36d399; --blue: #2f8bff; --pink: #ff7ad9;
  --core: #38e1ff; --related: #8b7bff; --exploratory: #ffb547; --none: #5d6f88;
  --r: 14px; --r2: 20px; --rail: 64px; --top: 60px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; --display: 'Space Grotesk', var(--font); --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45), 0 0 0 1px var(--line);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: var(--aqua); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(56, 225, 255, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: rgba(130, 200, 255, .18); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-track { background: transparent; }
.mono { font-family: var(--mono); font-feature-settings: 'zero' 1; }
.muted { color: var(--ink3); } .dim { color: var(--ink2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- globe stage ---------- */
#globe { position: fixed; inset: 0; z-index: 0; transition: filter .9s ease, transform 1.2s cubic-bezier(.2, .8, .2, 1); }
#globe .cesium-viewer-bottom, #globe .cesium-widget-credits { display: none !important; }
#globe-veil { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 90% at 70% 40%, transparent 30%, rgba(5, 11, 20, .55) 75%, rgba(5, 11, 20, .9)); transition: opacity .8s ease; }
body:not(.route-globe) #globe { filter: brightness(.42) saturate(1.1) blur(1.5px); transform: scale(1.04); }
body:not(.route-globe) #globe-veil { opacity: 1; background: linear-gradient(90deg, rgba(5, 11, 20, .96) 0%, rgba(5, 11, 20, .86) 45%, rgba(5, 11, 20, .62) 100%); }
body.route-globe #globe-veil { opacity: .85; }

/* ---------- boot ---------- */
#boot { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 10px; background: radial-gradient(60% 60% at 50% 45%, #0b1e36 0%, #050b14 70%); transition: opacity 1s ease, visibility 1s; }
body:not(.booting) #boot { opacity: 0; visibility: hidden; }
.boot-ring svg { width: 120px; height: 120px; fill: none; stroke-width: 3; stroke-linecap: round; }
.boot-ring .r1 { stroke: rgba(56, 225, 255, .25); stroke-dasharray: 60 280; animation: spin 2.4s linear infinite; transform-origin: center; }
.boot-ring .r2 { stroke: rgba(139, 123, 255, .5); stroke-dasharray: 30 220; animation: spin 1.6s linear infinite reverse; transform-origin: center; }
.boot-ring .wave { stroke: var(--aqua); stroke-dasharray: 120; animation: wave 2.2s ease-in-out infinite; }
.boot-title { font: 700 40px/1 var(--display); letter-spacing: .32em; padding-left: .32em; background: linear-gradient(90deg, var(--aqua), var(--violet), var(--aqua)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 3s linear infinite; }
.boot-sub { color: var(--ink2); letter-spacing: .04em; }
.boot-log { list-style: none; padding: 0; margin: 18px 0 0; font: 12px/1.9 var(--mono); color: var(--ink3); min-height: 120px; width: min(520px, 90vw); }
.boot-log li { opacity: 0; animation: rise .4s ease forwards; } .boot-log li b { color: var(--teal); font-weight: 600; } .boot-log li.err b { color: var(--amber); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wave { 0%, 100% { stroke-dashoffset: 120; } 50% { stroke-dashoffset: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(54, 211, 153, .6); } 70% { box-shadow: 0 0 0 9px rgba(54, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(54, 211, 153, 0); } }
@keyframes glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ---------- top bar ---------- */
#topbar { position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: var(--top); display: flex; align-items: center; gap: 18px; padding: 0 16px 0 calc(var(--rail) + 6px); background: linear-gradient(180deg, rgba(5, 11, 20, .92), rgba(5, 11, 20, .55)); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; min-width: 0; }
.brand-mark { width: 30px; height: 30px; fill: none; stroke: url(#none); stroke: var(--aqua); stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(56, 225, 255, .55)); }
.brand-mark path { stroke: var(--violet); animation: glow 3s ease-in-out infinite; }
.brand-name { font: 700 19px/1 var(--display); letter-spacing: .26em; }
.brand-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-left: 10px; border-left: 1px solid var(--line2); }
.brand-tag { color: var(--ink3); font-size: 11.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 290px; }
.brand-by { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--ink3); letter-spacing: .04em; }
.brand-by .by-mark { height: 14px; width: auto; }
.brand-by .by-word { height: 10px; width: auto; opacity: .92; }
.boot-by { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 18px; color: var(--ink3); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; opacity: 0; animation: rise .8s .5s ease forwards; }
.boot-by img { height: 58px; width: auto; filter: drop-shadow(0 0 18px rgba(19, 207, 198, .25)); }
.byline-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 48px 0 0; color: var(--ink3); font-size: 11.5px; }
.byline-foot img { height: 16px; } .byline-foot .w { height: 11px; }
.search-wrap { position: relative; flex: 1; max-width: 720px; margin: 0 auto; }
.search-wrap .ico { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; fill: none; stroke: var(--ink3); stroke-width: 2; }
#q { width: 100%; height: 40px; border-radius: 999px; border: 1px solid var(--line2); background: rgba(10, 24, 44, .8); padding: 0 46px 0 42px; outline: none; transition: border-color .2s, box-shadow .2s; }
#q:focus { border-color: var(--aqua); box-shadow: 0 0 0 4px rgba(56, 225, 255, .14); }
.search-wrap kbd { position: absolute; right: 14px; top: 50%; translate: 0 -50%; font: 11px var(--mono); color: var(--ink3); border: 1px solid var(--line2); border-radius: 6px; padding: 1px 6px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: rgba(10, 24, 44, .8); color: var(--ink2); font-size: 12px; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
.pill.warn .dot { background: var(--amber); }
.clock { font: 600 12px var(--mono); color: var(--ink2); white-space: nowrap; }
.lang { height: 32px; min-width: 44px; border-radius: 999px; border: 1px solid var(--line2); background: linear-gradient(135deg, rgba(56, 225, 255, .18), rgba(139, 123, 255, .18)); font-weight: 700; letter-spacing: .06em; }
.lang:hover { border-color: var(--aqua); }

/* ---------- rail ---------- */
#rail { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: var(--rail); display: flex; flex-direction: column; gap: 4px; padding: 70px 8px 12px; background: rgba(5, 11, 20, .86); border-right: 1px solid var(--line); backdrop-filter: blur(12px); transition: width .25s ease; overflow: hidden; }
#rail:hover { width: 214px; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
#rail a { display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 12px; border-radius: 12px; color: var(--ink2); white-space: nowrap; text-decoration: none; position: relative; transition: background .2s, color .2s; }
#rail a svg { flex: 0 0 22px; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#rail a:hover { background: rgba(56, 225, 255, .08); color: var(--ink); }
#rail a.on { color: var(--aqua); background: linear-gradient(90deg, rgba(56, 225, 255, .16), rgba(56, 225, 255, .02)); }
#rail a.on::before { content: ''; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--aqua); box-shadow: 0 0 12px var(--aqua); }
#rail .rail-bottom { margin-top: auto; }

/* ---------- main view ---------- */
#view { position: fixed; z-index: 10; top: var(--top); left: var(--rail); right: 0; bottom: 0; overflow: auto; outline: none; }
/* On the globe the view is a see-through deck: only its panels take clicks (.deck rules in views.css). */
body.route-globe #view { overflow: hidden; pointer-events: none; }
.page { padding: 26px 30px 60px; max-width: 1560px; margin: 0 auto; animation: rise .45s ease; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font: 700 30px/1.1 var(--display); margin: 0; letter-spacing: -.01em; }
.page-head p { margin: 6px 0 0; color: var(--ink2); max-width: 780px; }
.eyebrow { font: 600 11px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--aqua); }
h2.sec { font: 600 18px var(--display); margin: 30px 0 12px; display: flex; align-items: center; gap: 10px; }
h2.sec small { font: 500 12px var(--font); color: var(--ink3); }

/* ---------- glass & cards ---------- */
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r2); backdrop-filter: blur(16px) saturate(1.2); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r2); padding: 18px; position: relative; overflow: hidden; }
.card h3 { margin: 0 0 10px; font: 600 15px var(--display); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card h3 small { font: 500 11px var(--font); color: var(--ink3); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span4 { grid-column: 1 / -1; }
@media (max-width: 1200px) { .g4, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } .span3 { grid-column: 1 / -1; } }
@media (max-width: 760px) { .g2, .g3, .g4, .g6 { grid-template-columns: 1fr; } .span2, .span3 { grid-column: auto; } :root { --rail: 0px; } #rail { display: none; } .brand-tag, .clock { display: none; } .brand-text { border: 0; padding: 0; } .page { padding: 18px 16px 60px; } }

.kpi { padding: 16px 18px; }
.kpi .v { font: 700 30px/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--ink3); font-size: 12px; margin-top: 2px; }
.kpi .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--aqua), var(--violet)); transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.kpi::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120px 80px at 90% 0%, rgba(56, 225, 255, .12), transparent 70%); pointer-events: none; }

/* ---------- chips, badges, buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(14, 30, 52, .8); color: var(--ink); font-weight: 500; white-space: nowrap; transition: border-color .2s, background .2s, transform .1s; text-decoration: none !important; }
.btn:hover { border-color: var(--aqua); background: rgba(56, 225, 255, .08); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #1fb7e0, #6e5cff); border-color: transparent; color: #fff; box-shadow: 0 6px 24px rgba(56, 225, 255, .25); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.ghost { background: transparent; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line2); background: rgba(14, 30, 52, .7); color: var(--ink2); font-size: 12px; cursor: pointer; user-select: none; transition: all .15s; white-space: nowrap; }
.chip:hover { color: var(--ink); border-color: var(--line2); background: rgba(56, 225, 255, .08); }
.chip.on { color: #04121f; background: var(--aqua); border-color: var(--aqua); font-weight: 600; }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip .x { opacity: .7; margin-left: 2px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font: 600 11px/1.6 var(--font); letter-spacing: .02em; white-space: nowrap; border: 1px solid transparent; }
.badge.core { background: rgba(56, 225, 255, .14); color: var(--core); border-color: rgba(56, 225, 255, .35); }
.badge.related { background: rgba(139, 123, 255, .16); color: #b3a8ff; border-color: rgba(139, 123, 255, .4); }
.badge.exploratory { background: rgba(255, 181, 71, .13); color: var(--amber); border-color: rgba(255, 181, 71, .35); }
.badge.none { background: rgba(93, 111, 136, .2); color: var(--ink3); }
.badge.open { background: rgba(54, 211, 153, .14); color: var(--green); }
.badge.closing { background: rgba(255, 107, 107, .15); color: var(--coral); }
.badge.closed, .badge.unknown { background: rgba(93, 111, 136, .2); color: var(--ink3); }
.badge.upcoming { background: rgba(47, 139, 255, .16); color: #7fb6ff; }
.badge.awarded { background: rgba(255, 122, 217, .14); color: var(--pink); }
.badge.extended { background: rgba(255, 181, 71, .14); color: var(--amber); }
.badge.cancelled { background: rgba(255, 107, 107, .12); color: var(--coral); text-decoration: line-through; }
.badge.retendered { background: rgba(139, 123, 255, .14); color: #b3a8ff; }
.badge.project, .badge.plan, .badge.signal, .badge.test { background: rgba(34, 211, 166, .12); color: var(--teal); }
.ns { color: var(--ink3); font-style: italic; }
.ns::before { content: '◌ '; font-style: normal; }

/* ---------- inputs ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 11px; color: var(--ink3); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.inp, select.inp, textarea.inp { height: 36px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(8, 20, 38, .85); padding: 0 12px; outline: none; min-width: 0; }
textarea.inp { height: auto; padding: 10px 12px; font: 12px/1.5 var(--mono); }
.inp:focus { border-color: var(--aqua); }
select.inp { padding-right: 28px; }
input[type=checkbox], input[type=radio] { accent-color: var(--aqua); }
input[type=range] { accent-color: var(--aqua); }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { position: sticky; top: 0; z-index: 1; text-align: left; font: 600 11px var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--ink3); padding: 10px 12px; background: var(--glass3); border-bottom: 1px solid var(--line2); white-space: nowrap; cursor: default; }
.tbl th.sortable { cursor: pointer; } .tbl th.sortable:hover { color: var(--ink); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr.row { cursor: pointer; transition: background .15s; }
.tbl tr.row:hover td { background: rgba(56, 225, 255, .05); }
.tbl .t-title { font-weight: 600; color: var(--ink); line-height: 1.35; }
.tbl .t-sub { color: var(--ink3); font-size: 12px; margin-top: 3px; }
.tbl tr.fresh td { animation: flash 2.4s ease; }
@keyframes flash { 0% { background: rgba(56, 225, 255, .25); } 100% { background: transparent; } }

/* ---------- countdown ---------- */
.cd { display: inline-flex; flex-direction: column; gap: 3px; min-width: 120px; }
.cd .when { font: 600 12px var(--mono); }
.cd .left { font-size: 11px; color: var(--ink3); }
.cd .track { height: 4px; border-radius: 4px; background: rgba(130, 200, 255, .12); overflow: hidden; }
.cd .track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--green), var(--amber), var(--coral)); }
.cd.over .when { color: var(--ink3); text-decoration: line-through; }

/* ---------- popovers, drawer, toasts ---------- */
.pop { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 50; max-height: min(70vh, 640px); overflow: auto; padding: 8px; background: var(--glass2); border: 1px solid var(--line2); border-radius: 16px; backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.pop .grp { padding: 8px 10px 4px; font: 600 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--aqua); display: flex; justify-content: space-between; }
.pop .it { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--ink); text-decoration: none !important; }
.pop .it:hover, .pop .it.sel { background: rgba(56, 225, 255, .1); }
.pop .it .s { color: var(--ink3); font-size: 12px; }
.pop .nlq { margin: 4px; padding: 10px 12px; border-radius: 12px; background: linear-gradient(135deg, rgba(56, 225, 255, .12), rgba(139, 123, 255, .12)); border: 1px solid var(--line2); cursor: pointer; }
#drawer { position: fixed; z-index: 60; top: var(--top); right: 0; bottom: 0; width: min(760px, 100vw); transform: translateX(105%); transition: transform .45s cubic-bezier(.2, .8, .2, 1); background: rgba(6, 15, 28, .96); border-left: 1px solid var(--line2); backdrop-filter: blur(20px); box-shadow: -30px 0 80px rgba(0, 0, 0, .55); overflow: auto; }
#drawer.open { transform: none; }
#toasts { position: fixed; z-index: 90; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(380px, calc(100vw - 36px)); }
.toast { padding: 12px 14px; border-radius: 14px; background: var(--glass2); border: 1px solid var(--line2); backdrop-filter: blur(16px); box-shadow: var(--shadow); animation: rise .35s ease; font-size: 13px; cursor: pointer; }
.toast b { color: var(--aqua); }
.toast .s { color: var(--ink3); font-size: 12px; margin-top: 2px; }
.skel { background: linear-gradient(90deg, rgba(130, 200, 255, .06), rgba(130, 200, 255, .14), rgba(130, 200, 255, .06)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 10px; min-height: 16px; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink3); }
.note { padding: 10px 14px; border-radius: 12px; background: rgba(56, 225, 255, .06); border: 1px solid var(--line); color: var(--ink2); font-size: 13px; }
.note.warn { background: rgba(255, 181, 71, .08); border-color: rgba(255, 181, 71, .25); }
/* Shown when the data server (the PC running the portal) cannot be reached. */
.offline-banner { position: fixed; z-index: 5000; top: 12px; left: 50%; translate: -50% 0; width: min(680px, calc(100% - 32px)); padding: 14px 18px; border-radius: 14px; background: rgba(40, 24, 6, .94); border: 1px solid rgba(255, 181, 71, .45); color: var(--ink); font-size: 14px; line-height: 1.5; box-shadow: var(--shadow); }
.offline-banner b { color: var(--amber); }
.offline-banner .muted { font-size: 12px; margin-top: 4px; }
.chart { width: 100%; height: 300px; }
.chart.tall { height: 420px; } .chart.short { height: 220px; }
.split { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.kv { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: 0; font-size: 13px; }
.kv > div { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.kv > div:nth-child(odd) { color: var(--ink3); }
.kv .ev { display: block; font-size: 11px; color: var(--ink3); margin-top: 2px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--ink3); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; }
.tabs button.on { color: var(--aqua); border-bottom-color: var(--aqua); }
.dotlive { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; margin-right: 6px; vertical-align: middle; }
