/* ByteCam account + admin: dark glass. bytecam.app's near-black background and dark grey glass; colour only in charts, lines and controls behind frosted panels
   (Dennis's references: RevenuePulse glass layout, Fluxo palette), in ByteCam's fonts and orange. */
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url(/fonts/chakra-petch-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url(/fonts/chakra-petch-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Manrope; font-weight: 400; font-display: swap; src: url(/fonts/manrope-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Manrope; font-weight: 500; font-display: swap; src: url(/fonts/manrope-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Manrope; font-weight: 600; font-display: swap; src: url(/fonts/manrope-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url(/fonts/manrope-latin-700-normal.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  /* bytecam.app palette (site-src/input.css): pit, coal, ember, flare, ash, sand, smoke, dim */
  --bg: #0b0705;
  --ink: #f5eee8;
  --text: #e6dbd2;
  --muted: #9a8b80;
  --faint: #6e6158;
  --ember: #ff6a10;
  --ember-2: #ffb020;
  --steel: #c9bbb0;
  --steel-2: #5c4f46;
  --mint: #35d6a6;
  --rose: #ff5577;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);
  --edge: rgba(255, 255, 255, 0.09);
  --edge-hi: rgba(255, 255, 255, 0.16);
  --radius: 20px;
  --display: "Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --body: Manrope, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  /* the same background as bytecam.app */
  background: radial-gradient(1200px 700px at 72% 0%, #2a1408 0%, #0b0705 45%, #000 100%) no-repeat fixed, #000;
  color: var(--text);
  font: 14px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The glows behind the glass. Fixed, blurred, slowly drifting (still for reduced motion). */
.backdrop { display: none; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; animation: drift 28s ease-in-out infinite alternate; }
.backdrop i:nth-child(1) { width: 52vw; height: 52vw; left: -14vw; top: -18vw; background: radial-gradient(circle, rgba(255, 106, 16, 0.55), transparent 65%); }
.backdrop i:nth-child(2) { width: 46vw; height: 46vw; right: -12vw; top: 8vh; background: radial-gradient(circle, rgba(255, 140, 40, 0.22), transparent 65%); animation-delay: -9s; }
.backdrop i:nth-child(3) { width: 60vw; height: 40vw; left: 22vw; bottom: -22vw; background: radial-gradient(circle, rgba(140, 130, 124, 0.18), transparent 65%); animation-delay: -16s; }
.backdrop::after { content: ""; position: absolute; inset: 0; background: radial-gradient(1200px 700px at 50% 0%, transparent, rgba(0, 0, 0, 0.55)); }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(4vw, 3vh) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .backdrop i { animation: none; } }

a { color: var(--ember-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; letter-spacing: 0.01em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 12px; }
small, .muted { color: var(--muted); }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--ember-2); outline-offset: 2px; border-radius: 8px; }

/* ---------- glass ---------- */
.glass {
  position: relative;
  background: linear-gradient(180deg, var(--glass-2), var(--glass));
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.7);
}
.glass.lift { transition: border-color 0.2s, transform 0.2s; }
.glass.lift:hover { border-color: var(--edge-hi); }
.glass.accent { box-shadow: inset 0 2px 0 var(--ember), 0 20px 50px -20px rgba(0, 0, 0, 0.7); }
.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 18px; padding: 18px; min-height: 100vh; }
.side { align-self: stretch; display: flex; flex-direction: column; padding: 18px 14px; min-height: calc(100vh - 36px); }
/* The sidebar box runs the full height of the page (lined up with the cards); its links stay in view while scrolling. */
.side-top { position: sticky; top: 18px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--ink); font: 700 19px var(--display); }
.brand img { width: 30px; height: 30px; }
.brand span b { color: var(--ember); font-weight: 700; }
.nav-label { margin: 16px 10px 6px; font: 600 11px var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--glass-2); text-decoration: none; }
.nav a.on { background: var(--glass-2); color: var(--ink); box-shadow: inset 2px 0 0 var(--ember); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.side .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--edge); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--display); color: #1a0d05; background: linear-gradient(135deg, var(--ember-2), var(--ember)); flex: none; }
.me .who { min-width: 0; flex: 1; }
.me .who div { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 0; flex-wrap: wrap; }
.top .greet p { margin: 4px 0 0; color: var(--muted); }
.menu-btn { display: none; }
.mobile-bar { display: none; }

.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.span2 { grid-column: span 2; }

@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-wide, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; padding: 12px; }
  .side { position: fixed; z-index: 20; left: 12px; top: 12px; bottom: 12px; height: auto; min-height: 0; width: 260px; transform: translateX(-120%); transition: transform 0.25s; }
  .side-top { position: static; }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
  .mobile-bar .brand { padding: 0; }
  .g2, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
}

/* ---------- stat tiles ---------- */
.stat { padding: 18px 18px 0; overflow: hidden; min-height: 168px; display: flex; flex-direction: column; }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.stat .label svg { width: 16px; height: 16px; }
.stat .value { margin-top: 10px; font: 700 30px/1.1 var(--display); color: var(--ink); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.stat .delta { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.up { color: var(--mint); }
.down { color: var(--rose); }
.stat .spark { margin: auto -18px 0; height: 64px; display: block; width: calc(100% + 36px); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--glass-2); border: 1px solid var(--edge); color: var(--text); white-space: nowrap; }
.pill.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.pill.ok { color: var(--mint); border-color: rgba(53, 214, 166, 0.3); background: transparent; }
.pill.warn { color: var(--ember-2); border-color: rgba(255, 176, 32, 0.3); background: transparent; }
.pill.bad { color: var(--rose); border-color: rgba(255, 85, 119, 0.3); background: transparent; }
.pill.accent { color: var(--ember); border-color: rgba(255, 106, 16, 0.35); background: transparent; }

/* ---------- charts ---------- */
.chart { width: 100%; height: 240px; display: block; overflow: visible; }
.chart text { fill: var(--faint); font: 11px var(--body); }
.chart .grid-line { stroke: rgba(255, 255, 255, 0.06); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: center; }
.donut-list { display: grid; gap: 10px; }
.donut-list div { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 10px; align-items: center; }
.donut-list i { width: 10px; height: 10px; border-radius: 50%; }
.donut-list b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } .donut-list { width: 100%; } }
.stripes { height: 34px; display: flex; gap: 3px; align-items: stretch; }
.stripes span { flex: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.07); }
.bars-h { display: grid; gap: 12px; }
.bars-h .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.bars-h .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars-h .num { color: var(--ink); font-variant-numeric: tabular-nums; }
.bars-h .bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.bars-h .bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--steel-2), var(--steel)); }
.bars-h.ember .bar i { background: linear-gradient(90deg, var(--ember), var(--ember-2)); }
.tip { position: fixed; z-index: 50; pointer-events: none; padding: 10px 12px; border-radius: 12px; background: rgba(18, 12, 8, 0.94); border: 1px solid var(--edge-hi); backdrop-filter: blur(12px); font-size: 12.5px; min-width: 140px; }
.tip b { color: var(--ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font: 600 11px var(--body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--edge); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: rgba(255, 255, 255, 0.03); }
td.r, th.r { text-align: right; }
td .sub { display: block; color: var(--muted); font-size: 12px; }

/* ---------- forms and buttons ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px var(--body); color: var(--ink); background: var(--glass-2); border: 1px solid var(--edge);
  border-radius: 999px; padding: 10px 18px; min-height: 40px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--edge-hi); text-decoration: none; }
button.primary, .btn.primary { background: linear-gradient(180deg, #ff7a24, var(--ember)); border-color: transparent; color: #1a0d05; box-shadow: 0 8px 24px -8px rgba(255, 106, 16, 0.7); }
button.primary:hover { background: linear-gradient(180deg, var(--ember-2), #ff7a24); }
button.danger { color: var(--rose); border-color: rgba(255, 85, 119, 0.35); }
button.small { min-height: 32px; padding: 6px 12px; font-size: 13px; }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--ember-2); font-weight: 600; }
button:disabled { opacity: 0.5; cursor: default; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label { display: block; margin: 0 0 14px; color: var(--muted); font-weight: 500; }
label > span { display: block; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; font: 500 15px var(--body); color: var(--ink); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--edge);
  border-radius: 12px; padding: 11px 14px; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(255, 106, 16, 0.6); box-shadow: 0 0 0 3px rgba(255, 106, 16, 0.15); }
input.code { font: 600 22px/1 ui-monospace, Menlo, monospace; letter-spacing: 0.3em; text-align: center; }
.search { position: relative; min-width: 240px; flex: 1; max-width: 420px; }
.search input { padding-left: 38px; border-radius: 999px; background: var(--glass); }
.search svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); opacity: 0.6; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--edge); }
.seg button { border: 0; background: none; min-height: 30px; padding: 5px 12px; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: var(--glass-2); color: var(--ink); box-shadow: 0 0 0 1px var(--edge-hi) inset; }
.error { color: var(--rose); margin: 0 0 12px; }
.notice { padding: 12px 14px; border-radius: 14px; background: var(--glass); border: 1px solid rgba(255, 176, 32, 0.3); color: var(--text); margin-bottom: 14px; }
.notice.ok { border-color: rgba(53, 214, 166, 0.3); }

/* ---------- sign-in pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: min(440px, 100%); padding: 32px; }
.auth .brand { justify-content: center; padding-bottom: 8px; }
.auth h1 { text-align: center; margin-bottom: 6px; }
.auth .lede { text-align: center; color: var(--muted); margin-bottom: 22px; }
.auth .alt { text-align: center; margin-top: 18px; color: var(--muted); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); margin: 18px 0; font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--edge); }
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 16px; width: 212px; margin: 0 auto 14px; }
.qr svg { width: 184px; height: 184px; display: block; }
.secret { text-align: center; word-break: break-all; color: var(--muted); margin-bottom: 16px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 16px; }
.codes code { padding: 8px; text-align: center; border-radius: 10px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--edge); color: var(--ink); font-size: 14px; }
.full { width: 100%; }

/* ---------- licences ---------- */
.lic { padding: 22px; display: grid; gap: 16px; }
.lic-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.lic-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lic-meta > div { padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.05); }
.lic-meta b { display: block; color: var(--ink); font: 700 18px var(--display); margin-top: 2px; }
@media (max-width: 640px) { .lic-meta { grid-template-columns: 1fr; } }
.macs { display: grid; gap: 8px; }
.mac { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.05); }
.mac svg { width: 22px; height: 22px; opacity: 0.8; flex: none; }
.mac .what { flex: 1; min-width: 0; }
.mac .what div { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.keybox { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.35); border: 1px dashed rgba(255, 176, 32, 0.35); }
.keybox code { flex: 1; word-break: break-all; color: var(--ink); }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.feed { display: grid; gap: 2px; }
.feed div { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.feed div:last-child { border-bottom: 0; }
.feed .dot { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--glass-2); }
.feed .dot svg { width: 15px; height: 15px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); word-break: break-all; }
dialog { padding: 0; border: 0; background: none; color: var(--text); max-width: min(480px, calc(100vw - 32px)); width: 100%; }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
dialog .glass { padding: 24px; background: rgba(18, 12, 8, 0.96); }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 12px 18px; border-radius: 14px; background: rgba(18, 12, 8, 0.96); border: 1px solid var(--edge-hi); backdrop-filter: blur(12px); color: var(--ink); max-width: calc(100vw - 32px); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--edge-hi); border-top-color: var(--ember); animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; min-height: 40vh; }
.source-off { color: var(--muted); font-size: 13px; }

[hidden] { display: none !important; }
.me button svg { width: 16px; height: 16px; }

/* the site's film grain */
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.06; mix-blend-mode: overlay; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
button svg { width: 16px; height: 16px; flex: none; }

.connect-list{display:grid;gap:12px;max-height:60vh;overflow:auto;padding-right:4px}
.connect-row{border:1px solid rgba(255,255,255,.07);border-radius:12px;padding:12px 14px;background:rgba(18,12,8,.55)}
.connect-row h3{margin:0;font-size:14px}
.connect-row p.muted{margin:4px 0 8px;font-size:12.5px}
.connect-row textarea,.connect-row input{width:100%;font-family:ui-monospace,Menlo,monospace;font-size:12px}
.connect-row textarea{-webkit-text-security:disc;resize:vertical}
.connect-row .row-btns{margin-top:8px}

.connect-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.connect-tile{display:flex;flex-direction:column;align-items:flex-start;gap:6px;text-align:left;padding:12px 14px;border-radius:12px;border:1px solid rgba(255,255,255,.08);background:rgba(28,19,13,.6);color:var(--text);font:inherit;min-height:0;width:100%;cursor:default;white-space:normal;overflow:hidden;justify-content:flex-start;height:auto}
button.connect-tile{cursor:pointer;transition:border-color .2s,transform .2s}
button.connect-tile:hover{border-color:rgba(255,106,16,.55);transform:translateY(-1px)}
.connect-tile .ct-name{font-weight:600;font-size:14px}
.connect-tile .ct-how{overflow-wrap:anywhere;font-weight:400;font-size:12px;color:var(--dim,#9a8b80);line-height:1.35;flex:1}
.connect-tile .pill{margin-top:2px}
button.pill{cursor:pointer;min-height:0;font:inherit;font-size:12px;font-weight:600}
