/* ===========================================================================
   BLUE // OPERATIONS
   ---------------------------------------------------------------------------
   An instrument console, not a card dashboard.

   The aesthetic is deliberate: this page watches a machine that bills by the
   hour, so it borrows from the things that watch expensive machines - flight
   consoles, trading terminals, telemetry racks. Hairline rules instead of
   drop shadows, condensed technical caps for labels, tabular monospace for
   every number, and a single electric blue doing all the signalling against
   near-black.

   Type is entirely local. Nothing here fetches a font:
     display  Bahnschrift (Win11) / DIN Alternate + DIN Condensed (iOS, macOS)
     body     DM Sans, already self-hosted in this project at ./fonts.css
     numeric  Cascadia Mono (Win11) / SF Mono (Apple)
   Each stack degrades to the next real face on the platform that has it,
   which is why there is no bare sans-serif until the very end.

   Every number is tabular-nums. On a page that repaints itself every three
   seconds, proportional digits make the whole table twitch on each poll.
   =========================================================================== */

@import url("./fonts.css");

:root {
  --display: "Bahnschrift", "DIN Alternate", "DIN Condensed",
             "Oswald", "Haettenschweiler", sans-serif;
  --body:    "DM Sans", "Avenir Next", sans-serif;
  --mono:    "Cascadia Mono", "Cascadia Code", "SF Mono", ui-monospace,
             "Consolas", monospace;

  /* Black, and one blue doing everything. The status colours are the only
     hues allowed to interrupt it, which is what makes them readable at a
     glance from across a room. */
  --void:      #03060D;
  --deep:      #050A14;
  --panel:     #080F1C;
  --panel-2:   #0A1524;
  --panel-3:   #0D1B2E;
  --rule:      #12203A;
  --rule-lit:  #1D3861;

  --blue:      #2F8BFF;
  --blue-hi:   #7CBBFF;
  --blue-lo:   #0F3568;
  --cyan:      #3FE0FF;

  --ice:       #CFDFF5;
  --dim:       #66809F;
  --faint:     #3B5474;

  --good:      #35D7A1;
  --warn:      #FFB03A;
  --bad:       #FF4D6A;

  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --snap:      cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--ice);
  font: 400 14px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

/* -- atmosphere ------------------------------------------------------------
   Three stacked layers, all fixed and all inert. A flat #000 background reads
   as unfinished at this density; a lit horizon gives the panels something to
   sit against and makes the hairlines look like etching rather than borders. */

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* the horizon: two blue sources bleeding down from the top edge */
.sky::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90ch 46ch at 18% -14%,  rgba(47, 139, 255, 0.20), transparent 62%),
    radial-gradient(70ch 40ch at 84% -18%,  rgba(63, 224, 255, 0.11), transparent 60%),
    radial-gradient(120ch 70ch at 50% 118%, rgba(15, 53, 104, 0.30),  transparent 66%);
}

/* the instrument grid */
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(47, 139, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 139, 255, 0.045) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(110ch 80ch at 50% 0%, #000 12%, transparent 78%);
  -webkit-mask-image: radial-gradient(110ch 80ch at 50% 0%, #000 12%, transparent 78%);
}

/* film grain - an inline feTurbulence, so it costs one repaint and no request */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: drift 7s steps(6) infinite;
}
@keyframes drift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-6%, 4%); }
}

/* =========================================================================
   the shell: a rail, and one column beside it
   -------------------------------------------------------------------------
   Six pages instead of one long scroll. On a phone that is the difference
   between finding the GPU and scrolling past every account to reach it - and
   only the page you are looking at is mounted, so the poll repaints a screen
   rather than a document.

   The rail stays on the left at every width, as asked. Below 900px it drops
   its labels and keeps the icons, which is 58px of a 375px screen and leaves
   the content the rest. Every target in it is at least 44px tall.
   ========================================================================= */

/* The flex row goes on #root, not on body: the rail and the column are its
   children, and body's own children are the two fixed atmosphere layers plus
   #root. Putting it on body left the rail overlapping the first 58px of the
   page, clipped out of sight by body's overflow-x.

   z-index because .grain sits at 1 and would otherwise veil the whole
   console - it was .wrap's job before there was a rail. */
#root {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  z-index: 2;
}

.rail {
  position: sticky;
  top: 0;
  z-index: 50;
  flex: none;
  width: 212px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  border-right: 1px solid var(--rule);
  background:
    linear-gradient(180deg, rgba(47, 139, 255, 0.06), transparent 40%),
    var(--panel);
  box-shadow: inset -1px 0 0 rgba(124, 187, 255, 0.05);
}

.rail-mark {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  padding: 6px 10px 16px;
}
.rail-mark i {
  font-style: normal;
  color: var(--blue);
  text-shadow: 0 0 18px rgba(47, 139, 255, 0.7);
}

.rail-links { display: flex; flex-direction: column; gap: 3px; }

.rail-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--dim);
  font-family: var(--body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  position: relative;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.rail-links a svg { width: 19px; height: 19px; flex: none; }
.rail-links a:hover { color: var(--ice); background: var(--panel-2); }

.rail-links a.on {
  color: #fff;
  background: linear-gradient(90deg, rgba(47, 139, 255, 0.20), transparent);
}
/* The lit edge, not a filled pill: at a glance you want to know which page
   you are on without the rail shouting over the page itself. */
.rail-links a.on::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--blue);
  box-shadow: 0 0 10px rgba(47, 139, 255, 0.9);
}
.rail-links a.on svg { color: var(--blue-hi); }

.rail-foot { margin-top: auto; padding-top: 12px; }

.rail-live {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--dim);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.rail-live:hover { color: var(--blue-hi); border-color: var(--rule-lit); }
.rail-live.on { color: var(--warn); border-color: rgba(255, 176, 58, 0.4); }

/* -- the column ---------------------------------------------------------- */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 22px 13px;
  background: linear-gradient(var(--void) 68%, rgba(3, 6, 13, 0));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-stretch: 75%;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

.page {
  flex: 1;
  min-width: 0;
  padding: 0 22px calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* The gap above owns the spacing, so the old per-block margins would double
   it on every page. */
.page > .vitals, .page > .panel, .page > .grid, .page > .foot { margin: 0; }

@media (max-width: 900px) {
  .rail { width: 58px; padding: 12px 6px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .rail-mark { justify-content: center; font-size: 17px; padding: 4px 0 12px; }
  .rail-mark i { display: none; }
  .rail-links a { justify-content: center; padding: 0; gap: 0; }
  .rail-links a span { display: none; }
  .rail-links a svg { width: 21px; height: 21px; }
  .rail-live { justify-content: center; padding: 0; }
  .rail-live span { display: none; }

  .topbar { padding: 12px 14px 10px; gap: 10px; }
  .topbar h1 { font-size: 16px; letter-spacing: 0.13em; }
  .page { padding: 0 14px calc(32px + env(safe-area-inset-bottom, 0px)); gap: 14px; }
}

@media (max-width: 560px) {
  /* The clock and uptime are the first thing to go: the page title and the
     live pip are what you actually glance at on a phone. */
  .bar-meta > div:nth-child(n + 3) { display: none; }
}

/* -- reveal ----------------------------------------------------------------
   One orchestrated page load. Every module carries --i and leans on the same
   curve, so the console assembles top-down instead of popping in at once. */

.rise {
  animation: rise 0.75s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 55ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to   { opacity: 1; transform: none;             filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  .grain { animation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; }
}

/* =========================================================================
   vitals strip - the numbers that answer "is anything wrong" in one look
   ========================================================================= */

.vitals {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border: 1px solid var(--rule);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(47, 139, 255, 0.05), transparent 60%),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(124, 187, 255, 0.09);
  overflow: hidden;
  margin-bottom: 18px;
}
.vital {
  padding: 14px 16px 13px;
  border-left: 1px solid var(--rule);
  position: relative;
}
.vital:first-child { border-left: 0; }
.vital .k {
  font-family: var(--display);
  font-stretch: 87.5%;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 7px;
}
.vital .v {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
}
.vital .v small { font-size: 13px; color: var(--dim); font-weight: 400; }
.vital .s {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--dim);
}
.vital.hot .v { color: var(--cyan); text-shadow: 0 0 20px rgba(63, 224, 255, 0.45); }
.vital.warn .v { color: var(--warn); }
.vital.bad  .v { color: var(--bad); }

/* a value that just changed flashes once, so a poll is visible as an event */
@keyframes tick {
  0%   { color: var(--cyan); text-shadow: 0 0 18px rgba(63, 224, 255, 0.7); }
  100% { }
}
.ticked { animation: tick 1.1s var(--ease); }

/* =========================================================================
   panels
   ========================================================================= */

.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}
.grid.two  { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.grid.feed { grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr); }

.panel {
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(124, 187, 255, 0.07);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.panel > header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(47, 139, 255, 0.055), transparent);
}
.panel > header h2 {
  margin: 0;
  font-family: var(--display);
  font-stretch: 75%;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ice);
}
.panel > header .note {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}
.panel > .body { padding: 16px; }

/* -- status pip ------------------------------------------------------------
   The only animated colour on the page. A pip pulses ONLY when something is
   genuinely happening, so motion in the corner of your eye always means
   something - which is the whole reason to ration it. */

.pip {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
  background: var(--faint);
}
.pip.good { background: var(--good); box-shadow: 0 0 9px rgba(53, 215, 161, 0.85); }
.pip.blue { background: var(--blue); box-shadow: 0 0 9px rgba(47, 139, 255, 0.85); }
.pip.warn { background: var(--warn); box-shadow: 0 0 9px rgba(255, 176, 58, 0.85); }
.pip.bad  { background: var(--bad);  box-shadow: 0 0 9px rgba(255, 77, 106, 0.85); }
.pip.live { animation: throb 1.5s ease-in-out infinite; }
@keyframes throb {
  0%, 100% { opacity: 1;    transform: scale(1); }
  50%      { opacity: 0.42; transform: scale(0.76); }
}

/* =========================================================================
   GPU module - the hero, because it is the only thing that costs money
   ========================================================================= */

.gpu-top {
  display: flex;
  align-items: flex-start;
  gap: 26px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.gpu-state {
  font-family: var(--display);
  font-stretch: 75%;
  font-size: clamp(38px, 6vw, 62px);
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--faint);
}
.gpu-state.running {
  color: var(--good);
  text-shadow: 0 0 34px rgba(53, 215, 161, 0.42);
}
.gpu-state.stopped  { color: var(--blue); text-shadow: 0 0 30px rgba(47, 139, 255, 0.4); }
.gpu-state.gone     { color: var(--bad); }
.gpu-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 9px;
}
.gpu-rate {
  margin-left: auto;
  text-align: right;
  font-family: var(--mono);
}
.gpu-rate .n {
  font-size: 30px;
  font-weight: 300;
  color: #fff;
  line-height: 1;
}
.gpu-rate .u {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 6px;
}

.meters { display: grid; gap: 15px; padding-top: 16px; }
.meter .row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
}
.meter .row b {
  margin-left: auto;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ice);
  text-transform: none;
}
.bar {
  height: 5px;
  border-radius: 3px;
  background: var(--panel-3);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue-lo), var(--blue) 60%, var(--cyan));
  box-shadow: 0 0 12px rgba(47, 139, 255, 0.6);
  transition: width 0.6s var(--ease);
}
.bar.warn span { background: linear-gradient(90deg, #7a4d00, var(--warn)); box-shadow: 0 0 12px rgba(255, 176, 58, 0.5); }
.bar.bad  span { background: linear-gradient(90deg, #6d0c22, var(--bad));  box-shadow: 0 0 12px rgba(255, 77, 106, 0.55); }

/* The economics footnote sits on its own rule at the foot of the module, so
   it reads as a note about the meters rather than as another meter. */
.econ {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}
.econ span {
  display: block;
  font-family: var(--display);
  font-stretch: 87.5%;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 5px;
}
.econ b { color: var(--ice); font-weight: 500; font-size: 13px; }

.flag {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 3px;
  border: 1px solid rgba(255, 176, 58, 0.34);
  background: rgba(255, 176, 58, 0.075);
  color: var(--warn);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
}
.flag.bad { border-color: rgba(255, 77, 106, 0.36); background: rgba(255, 77, 106, 0.08); color: var(--bad); }

/* =========================================================================
   services
   ========================================================================= */

.svc {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}
.svc:first-child { border-top: 0; padding-top: 0; }
.svc .pip { margin-top: 6px; }
.svc .n {
  font-family: var(--display);
  font-stretch: 87.5%;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ice);
  width: 92px;
  flex: none;
}
.svc .d {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--dim);
  min-width: 0;
  word-break: break-word;
}
.svc .d em { font-style: normal; color: var(--blue-hi); }
.svc .d .off { color: var(--bad); }

/* =========================================================================
   accounts
   ========================================================================= */

/* The table is the one block that cannot shrink past its content. It scrolls
   inside its own box so the PAGE never scrolls sideways - a horizontal
   scrollbar on the document is how a dense dashboard stops being readable. */
.tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tblwrap::-webkit-scrollbar { height: 8px; }
.tblwrap::-webkit-scrollbar-track { background: var(--deep); }
.tblwrap::-webkit-scrollbar-thumb { background: var(--rule-lit); border-radius: 4px; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl.cards { min-width: 780px; }
.tbl.mid.cards { min-width: 880px; }
.tbl.mid td, .tbl.mid th { padding: 8px 10px; font-size: 11.5px; }
.tbl.mid .sub { color: var(--faint); font-size: 10px; }
.tbl.mid .zero { color: var(--faint); }
.tbl.mid .when { color: var(--dim); white-space: nowrap; }
.tbl.mid .bal { color: var(--blue-hi); }
.tbl.mid .amt.pos { color: var(--good); }
.tbl.mid .amt.neg { color: var(--bad); }
.tbl.mid .open { color: var(--cyan); }
.tbl.mid tr:hover td { background: rgba(47, 139, 255, 0.04); }
.tbl th {
  text-align: left;
  padding: 9px 12px;
  font-family: var(--display);
  font-stretch: 87.5%;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.tbl th.r, .tbl td.r { text-align: right; }
.tbl td {
  padding: 12px;
  border-bottom: 1px solid rgba(18, 32, 58, 0.6);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ice);
  vertical-align: middle;
}
.tbl tr.acct { cursor: pointer; transition: background 0.18s var(--ease); }
.tbl tr.acct:hover { background: rgba(47, 139, 255, 0.055); }
.tbl tr.acct.open { background: rgba(47, 139, 255, 0.085); }

.who { display: flex; align-items: center; gap: 10px; }
.who .id {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 2px 5px;
  flex: none;
}
.who .em {
  font-family: var(--body);
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who .em.off { color: var(--faint); text-decoration: line-through; }

.doing { display: flex; align-items: center; gap: 9px; min-width: 0; }
.doing .t {
  font-family: var(--body);
  font-size: 13px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doing .t b { color: var(--blue-hi); font-weight: 500; }
.doing.busy .t { color: var(--cyan); }
.doing.busy .t b { color: var(--cyan); }
.doing.live .t { color: var(--good); }

.num { font-size: 13px; }
.num.zero { color: var(--faint); }
.num.neg  { color: var(--bad); }
.num.hot  { color: var(--cyan); }

.chev {
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid var(--faint);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  transition: transform 0.25s var(--snap);
}
tr.acct:hover .chev { border-left-color: var(--blue); transform: translateX(2px); }


.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid var(--rule-lit);
  color: var(--dim);
}
.tag.blue { color: var(--blue-hi); border-color: rgba(47, 139, 255, 0.42); background: rgba(47, 139, 255, 0.1); }
.tag.good { color: var(--good);    border-color: rgba(53, 215, 161, 0.38); background: rgba(53, 215, 161, 0.09); }
.tag.warn { color: var(--warn);    border-color: rgba(255, 176, 58, 0.38); background: rgba(255, 176, 58, 0.09); }
.tag.bad  { color: var(--bad);     border-color: rgba(255, 77, 106, 0.38); background: rgba(255, 77, 106, 0.09); }

/* =========================================================================
   activity feed
   ========================================================================= */

.stream { max-height: 460px; overflow-y: auto; padding: 4px 0; }
.stream::-webkit-scrollbar { width: 8px; }
.stream::-webkit-scrollbar-track { background: var(--deep); }
.stream::-webkit-scrollbar-thumb { background: var(--rule-lit); border-radius: 4px; }

.ev {
  display: grid;
  grid-template-columns: 52px 9px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  padding: 7px 16px;
  border-bottom: 1px solid rgba(18, 32, 58, 0.45);
  font-size: 12.5px;
}
.ev:hover { background: rgba(47, 139, 255, 0.045); }
.ev .at {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  text-align: right;
}
.ev .pip { align-self: center; }
.ev .tx {
  font-family: var(--body);
  color: var(--dim);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ev .tx b { color: var(--ice); font-weight: 500; }
.ev .tx i { font-style: normal; color: var(--blue-hi); }
.ev .tx u { text-decoration: none; color: var(--faint); }
.ev .tx .cr { font-family: var(--mono); font-size: 11px; }
.ev.fresh { animation: slidein 0.5s var(--ease); }
@keyframes slidein {
  from { opacity: 0; transform: translateX(-10px); background: rgba(47, 139, 255, 0.14); }
  to   { opacity: 1; transform: none; }
}

/* =========================================================================
   cast
   ========================================================================= */

.cast { display: grid; gap: 1px; background: var(--rule); }
.cast .c {
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  background: var(--panel);
  transition: background 0.18s var(--ease);
}
.cast .c:hover { background: var(--panel-2); }
.cast .accent { align-self: stretch; border-radius: 2px; min-height: 26px; }
.cast .nm {
  font-family: var(--body);
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.cast .nm span {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cast .st {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  text-align: right;
  white-space: nowrap;
}
.cast .st b { color: var(--ice); font-weight: 500; }
.cast .st u { text-decoration: none; color: var(--cyan); }

/* =========================================================================
   24h traffic
   ========================================================================= */

.spark {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  align-items: end;
  height: 96px;
  padding: 16px 16px 0;
}
.spark .col {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1px;
}
.spark .m, .spark .i {
  border-radius: 1.5px 1.5px 0 0;
  transition: height 0.6s var(--ease);
}
.spark .m { background: linear-gradient(180deg, var(--blue), var(--blue-lo)); }
.spark .i { background: var(--cyan); box-shadow: 0 0 8px rgba(63, 224, 255, 0.6); }
.spark .col:hover .m { background: var(--blue-hi); }
.axis {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  padding: 8px 16px 16px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
  text-align: center;
}



/* -- grant ---------------------------------------------------------------
   The one control on this console that writes anything, so it is the one
   place a button is filled rather than outlined. */

.grant-quick { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }

.grant-row { display: flex; gap: 8px; flex-wrap: wrap; }

.grant-amt, .grant-why {
  font: 400 13px/1 var(--mono);
  color: var(--ice);
  background: var(--panel-3);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.grant-amt { width: 128px; flex: none; }
.grant-why { flex: 1; min-width: 180px; }
.grant-amt:focus, .grant-why:focus { border-color: var(--blue); }
.grant-amt::placeholder, .grant-why::placeholder { color: var(--faint); }

.grant-go { flex: none; padding: 10px 18px; }

.grant-note {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--dim);
}
.grant-note b { color: var(--blue-hi); font-weight: 500; }
.grant-note.bad { color: var(--bad); }
.grant-note.bad b { color: var(--bad); }

@media (max-width: 700px) {
  .grant-amt { width: 100%; }
  .grant-go { width: 100%; }
}

/* =========================================================================
   analytics
   ========================================================================= */


/* A funnel step. Five columns so the numbers line up down the page and the
   eye can run the "lost" column on its own - which is the only column
   anybody actually acts on. */
.funnel { display: grid; gap: 9px; }

.fstep {
  display: grid;
  grid-template-columns: minmax(96px, 1.1fr) minmax(0, 2.4fr) 58px 52px 52px;
  gap: 10px;
  align-items: center;
}
.flabel {
  font-family: var(--body);
  font-size: 12.5px;
  color: var(--ice);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fbar {
  height: 16px;
  border-radius: 2px;
  background: var(--panel-3);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.fbar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue-lo), var(--blue));
  box-shadow: 0 0 10px rgba(47, 139, 255, 0.45);
  transition: width 0.6s var(--ease);
}
.fnum {
  font-family: var(--mono);
  font-size: 15px;
  color: #fff;
  text-align: right;
}
.fpct, .flost {
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
  color: var(--dim);
}
.flost { color: var(--faint); }

/* The step that loses the most. Amber, not red: people dropping out is
   normal, and colouring every funnel like an outage teaches you to ignore
   the colour. */
.fstep.worst .fbar span {
  background: linear-gradient(90deg, #7a4d00, var(--warn));
  box-shadow: 0 0 10px rgba(255, 176, 58, 0.45);
}
.fstep.worst .flost { color: var(--warn); }
.fstep.worst .flabel { color: var(--warn); }

.fworst {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}
.fworst b { color: var(--warn); font-weight: 500; }

.tbl.mid .sub {
  display: block;
  margin-top: 3px;
  font-family: var(--body);
  font-size: 11px;
  line-height: 1.4;
  color: var(--faint);
  white-space: normal;
}

.trow {
  padding: 11px 0;
  border-top: 1px solid var(--rule);
}
.trow:first-child { border-top: 0; padding-top: 0; }
.tname {
  font-family: var(--display);
  font-stretch: 87.5%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ice);
  margin-bottom: 7px;
}
.tvals { display: flex; gap: 18px; flex-wrap: wrap; }
.tvals span {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--blue-hi);
}
.tvals i {
  display: block;
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 3px;
}

@media (max-width: 700px) {
  .fstep { grid-template-columns: minmax(74px, 1fr) minmax(0, 1.6fr) 44px 42px; }
  .flost { display: none; }
}


.signin-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 4px;
  background: #fff;
  color: #1f1f1f;
  font: 600 14.5px/1 var(--body);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.85);
}
.signin-google:hover { background: #f2f5f9; }

.signin-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 14px;
  color: var(--faint);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.signin-or::before, .signin-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.signin-foot {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--faint);
}

.signin { display: grid; gap: 9px; text-align: left; }
.signin input {
  font: 400 15px/1 var(--body);
  color: var(--ice);
  background: var(--panel-3);
  border: 1px solid var(--rule);
  border-radius: 4px;
  /* 15px or larger, or iOS zooms the whole page in on focus and the console
     ends up scrolled sideways before you have typed anything. */
  padding: 13px 14px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.signin input:focus { border-color: var(--blue); }
.signin input::placeholder { color: var(--faint); }
.signin button {
  margin-top: 4px;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--void);
  background: var(--blue);
  border: 0;
  border-radius: 4px;
  padding: 14px;
  cursor: pointer;
}
.signin button:disabled { opacity: 0.5; }
.signin-note {
  min-height: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}
.signin-note.bad { color: var(--bad); }

/* =========================================================================
   gate states + footer
   ========================================================================= */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 2;
}
.gate .card {
  max-width: 400px;
  text-align: center;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(124, 187, 255, 0.08);
  padding: 40px 34px;
}
.gate h1 {
  font-family: var(--display);
  font-stretch: 75%;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 12px;
  color: var(--blue);
}
.gate p { color: var(--dim); font-size: 14px; margin: 0 0 18px; line-height: 1.65; }
.gate code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue-hi);
  background: var(--panel-3);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 2px 6px;
}
.gate a {
  display: inline-block;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--void);
  background: var(--blue);
  border-radius: 3px;
  padding: 12px 20px;
  text-decoration: none;
}

.foot {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.foot b { color: var(--dim); font-weight: 400; }

.empty {
  padding: 30px 16px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}


/* =========================================================================
   dossier - one account, all the way down
   ========================================================================= */

.back {
  display: inline-block;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  padding: 8px 12px;
  margin-bottom: 16px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--panel-2);
  transition: all 0.2s var(--ease);
}
.back:hover {
  color: var(--blue-hi);
  border-color: var(--rule-lit);
  transform: translateX(-3px);
}

.dhead {
  border: 1px solid var(--rule);
  border-radius: 4px;
  background:
    radial-gradient(60ch 22ch at 0% 0%, rgba(47, 139, 255, 0.10), transparent 70%),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(124, 187, 255, 0.09);
  padding: 18px 20px 20px;
  margin-bottom: 18px;
}
.dhead .back { margin-bottom: 14px; }

.dident { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dident .id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  border: 1px solid var(--rule-lit);
  border-radius: 2px;
  padding: 3px 7px;
}
.dident h1 {
  margin: 0;
  font-family: var(--display);
  font-stretch: 87.5%;
  font-size: clamp(22px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  word-break: break-all;
}

.dbadges { margin-top: 12px; display: flex; gap: 7px; flex-wrap: wrap; }
.dnow { margin-top: 14px; }
.dnow .doing .t { font-size: 15px; }

.holds { margin-top: 12px; display: grid; gap: 7px; }
.hold {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid rgba(47, 139, 255, 0.32);
  border-radius: 3px;
  background: rgba(47, 139, 255, 0.075);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
}
.hold b { color: var(--cyan); font-weight: 500; }
.hold u { text-decoration: none; color: var(--faint); margin-left: auto; }

.dmeta {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ice);
}
.dmeta span {
  display: block;
  font-family: var(--display);
  font-stretch: 87.5%;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 5px;
}

/* share-of-conversation bar, inline in the table */
.share {
  height: 4px;
  border-radius: 2px;
  background: var(--panel-3);
  border: 1px solid var(--rule);
  overflow: hidden;
  min-width: 70px;
}
.share span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue-lo), var(--blue));
  box-shadow: 0 0 8px rgba(47, 139, 255, 0.5);
}

.scroll { max-height: 460px; overflow: auto; }
.scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-track { background: var(--deep); }
.scroll::-webkit-scrollbar-thumb { background: var(--rule-lit); border-radius: 4px; }
.scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
}
.stream.tall { max-height: 460px; }
.spark.tall { height: 120px; }

/* thirty days, one cell each - blank days stay blank on purpose */
.days {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 3px;
  padding: 4px 16px 18px;
}
.day {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--panel-3);
  border: 1px solid var(--rule);
}
.day.lit {
  background: var(--blue);
  border-color: transparent;
  opacity: var(--lit, 1);
  box-shadow: 0 0 7px rgba(47, 139, 255, 0.45);
}

/* -- media ---------------------------------------------------------------
   Private conversation content. Counted always, shown only when asked. */

.veil { padding: 34px 20px; text-align: center; }
.veil p {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--dim);
}
.btn.tiny { margin-left: auto; padding: 5px 9px; font-size: 9.5px; }

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px;
}
.shot { margin: 0; }
.shot img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  border-radius: 3px;
  border: 1px solid var(--rule);
  background: var(--panel-3);
}
.shot figcaption {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--faint);
}
.shot figcaption em {
  display: block;
  margin-top: 5px;
  font-style: normal;
  color: var(--dim);
  /* Captions run long and are not the point of this grid. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 700px) {
  .dhead { padding: 14px; }
  .days { grid-template-columns: repeat(15, 1fr); }
  .shots { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); padding: 12px; }
  .hold { flex-wrap: wrap; }
  .hold u { margin-left: 0; flex-basis: 100%; }
}

/* =========================================================================
   responsive - RUNNING.md says this gets opened on a phone, so it has to
   survive 390px rather than merely not crash there
   ========================================================================= */

@media (max-width: 1180px) {
  .vitals { grid-template-columns: repeat(4, 1fr); }
  .vital:nth-child(4n + 1) { border-left: 0; }
  .vital:nth-child(n + 5) { border-top: 1px solid var(--rule); }
  .grid.two, .grid.feed { grid-template-columns: minmax(0, 1fr); }
}

/* The table becomes a stack of cards well before phone width. A nine-column
   table squeezed into 800px hides the columns furthest right, which on this
   page are the two that say when someone was last here. */
@media (max-width: 900px) {
  .tblwrap { overflow-x: visible; }
  /* Both selectors, not just the first. `.tbl.mid.cards` outranks
     `.tbl.cards`, so resetting only the shorter one leaves the wider table
     sitting on an 880px floor and shoves the whole page sideways. */
  .tbl.cards, .tbl.mid.cards { min-width: 0; }
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td {
    display: block;
    width: 100%;
  }
  .tbl.cards tr {
    border: 1px solid var(--rule);
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 6px 0;
    background: var(--panel-2);
  }
  .tbl.cards td { border: 0; padding: 5px 13px; }
  .tbl.cards td.r { text-align: left; }
  .tbl.cards td[data-k]::before {
    content: attr(data-k);
    font-family: var(--display);
    font-stretch: 87.5%;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--faint);
    display: inline-block;
    min-width: 96px;
  }
  /* The chevron column carries no label and would render as an empty line. */
  .tbl.cards td:not([data-k]):empty,
  .tbl.cards td:not([data-k]):has(.chev) { display: none; }
}

@media (max-width: 700px) {
  .bar-meta { gap: 14px; font-size: 9.5px; }
  .vitals { grid-template-columns: repeat(2, 1fr); }
  .vital:nth-child(odd) { border-left: 0; }
  .vital:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .vital .v { font-size: 21px; }

  .spark { height: 70px; padding: 12px 10px 0; gap: 2px; }
  .axis { display: none; }
  .ev { grid-template-columns: 44px 9px minmax(0, 1fr); padding: 7px 12px; }
  .gpu-state { font-size: 40px; }
  .gpu-rate { margin-left: 0; text-align: left; }
}
