.bakvindu {
  --bk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bk-accent: #14643b;
  --bk-text: #112219;
  --bk-muted: #485b50;
  --bk-line: #b9c9bf;
  --bk-subtle: #f0f6f2;
  --bk-glass: #061710;
  --bk-rain-ink: #6af29a;
  --bk-rain-head: #d2ffcb;
  color: var(--bk-text);
}
:root[data-theme=dark] .bakvindu {
  --bk-accent: #85efaa;
  --bk-text: #e4f3e8;
  --bk-muted: #afc1b5;
  --bk-line: #3c5145;
  --bk-subtle: #1d2922;
}
.bakvindu { position: relative; isolation: isolate; }
.bk-ambient, .bk-rain-setting { display: none; }
@media screen and (forced-colors: none) {
  :root[data-theme=dark] body:has(.bakvindu) { overflow-x: clip; }
  :root[data-theme=dark] main:has(> .bakvindu) { display: grid; }
  :root[data-theme=dark] .bk-ambient {
    display: block;
    position: absolute;
    inset-block: calc(0px - var(--content-top-gap)) calc(0px - var(--content-bottom-gap));
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;
    opacity: .25;
  }
  :root[data-theme=dark] .bk-rain-setting {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    padding: 0 .85rem;
    color: var(--bk-muted);
    font: .76rem var(--bk-mono);
  }
  .bk-rain-setting input { width: 6rem; height: 2rem; margin: 0; accent-color: var(--bk-accent); }
  .bk-rain-setting span { min-width: 5ch; text-align: right; }
  .bk-ambient canvas {
    display: block;
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    max-height: 100%;
  }
}
.bk-monitor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.bk-finds {
  min-width: 0;
  min-height: 6rem;
  border: 1px solid var(--bk-line);
  background: var(--bk-subtle);
}
.bk-scan { min-width: 0; }
.bk-intro-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-bottom: 1rem;
}
.bk-link-state, .bk-connection, .bk-state, .bk-signal, .bk-controls, .bk-channel header, .bk-channel-detail {
  display: flex;
  align-items: center;
}
.bk-link-state, .bk-state, .bk-signal, .bk-controls, .bk-category, .bk-queue, .bk-clock-label {
  font-family: var(--bk-mono);
}
.bk-link-state, .bk-state, .bk-signal, .bk-category, .bk-queue {
  font-size: .76rem;
  line-height: 1.4;
}
.bk-link-state { gap: .85rem; color: var(--bk-muted); }
.bk-contact:not(:empty) { padding-left: .85rem; border-left: 1px solid var(--bk-line); font-variant-numeric: tabular-nums; }
.bk-connection, .bk-state { gap: .5rem; }
.bk-connection { text-transform: uppercase; letter-spacing: .095em; font-weight: 650; }
.bk-connection::before, .bk-state::before {
  content: "";
  width: .45rem;
  height: .45rem;
  border: 1px solid currentColor;
}
.bakvindu[data-connected=yes] .bk-connection,
.bk-channel:is([data-state=idle], [data-state=polling]) .bk-state { color: var(--bk-accent); }
.bakvindu[data-connected=yes] .bk-connection::before,
.bk-channel:is([data-state=idle], [data-state=polling]) .bk-state::before { background: currentColor; }
.bk-intro h1 {
  margin: clamp(.65rem, 1.5vw, 1.4rem) 0 .5rem;
  font: 650 clamp(2.2rem, 4.9vw, 4.7rem)/.98 var(--display);
  letter-spacing: -.055em;
}
.bk-intro h1::after {
  content: "";
  display: inline-block;
  width: .25em;
  height: .085em;
  margin-left: .065em;
  background: var(--bk-accent);
}
@media (prefers-reduced-motion: no-preference) {
  .bk-clock-blink .bk-intro h1::after,
  .bk-clock-blink .bk-connection::before { opacity: 0; }
}
.bk-intro p { max-width: 39ch; margin: .18rem 0 0; line-height: 1.45; }
.bk-screen {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(9rem, 1fr) auto;
  background: var(--bk-glass);
  color: #d5ffdf;
  border: 1px solid var(--bk-line);
  color-scheme: dark;
}
.bk-glass {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 48% 50%, #103820, transparent 74%),
              repeating-linear-gradient(90deg, transparent 0 63px, #a9ffc80e 63px 64px);
}
.bk-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, #0002 3px 4px);
}
.bk-rain { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bk-sights {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  --mark: linear-gradient(#b1f7c6, #b1f7c6);
  background: var(--mark) left top / 10px 1px, var(--mark) left top / 1px 10px,
              var(--mark) right top / 10px 1px, var(--mark) right top / 1px 10px,
              var(--mark) left bottom / 10px 1px, var(--mark) left bottom / 1px 10px,
              var(--mark) right bottom / 10px 1px, var(--mark) right bottom / 1px 10px;
  background-repeat: no-repeat;
  opacity: .65;
}
.bk-motion {
  position: absolute;
  z-index: 1;
  right: 12px;
  top: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #cbffce;
}
.bk-motion span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid #678f76;
  background: var(--bk-glass);
}
.bk-motion span::before { content: ""; width: 8px; height: 10px; border-inline: 2px solid currentColor; }
.bk-motion[aria-pressed=true] span::before { width: 0; height: 0; border: solid transparent; border-width: 5px 0 5px 8px; border-left-color: currentColor; }
.bk-motion:hover span, .bk-motion:focus-visible span { border-color: currentColor; }
.bk-motion:focus-visible { outline: 2px solid #d2ffcb; outline-offset: -3px; }
.bk-signal {
  min-height: 2.65rem;
  padding: .45rem 1rem;
  border-top: 1px solid #31543f;
  gap: .65rem;
  background: #0a2015;
}
.bk-volume { color: #b3ffba; font-size: 1rem; font-variant-numeric: tabular-nums; }
.bk-bars { flex: 1; min-width: 0; display: flex; align-items: end; gap: 2px; height: 1.15rem; margin-left: .6rem; }
.bk-bars i { flex: 1; height: max(2px, calc(var(--level, 0) * 100%)); background: #365844; }
.bk-bars .has-events { background: #93e9a8; }
.bk-stats {
  border: 1px solid var(--bk-line);
  border-top: 0;
}
.bk-stats > summary {
  min-height: 44px;
  padding: .75rem 1rem;
  color: var(--bk-text);
  cursor: pointer;
  font: 600 .88rem/1.4 var(--display);
}
.bk-stats > summary::marker { color: var(--bk-accent); }
.bk-stats > summary:hover { background: var(--bk-subtle); }
.bk-stats > summary:focus-visible { outline: 2px solid var(--bk-accent); outline-offset: -2px; }
.bk-stats-body {
  padding: .25rem 1rem 1rem;
}
.bk-stat-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr));
  gap: 1.15rem clamp(1rem, 3vw, 3rem);
}
.bk-stat-tables > div { min-width: 0; }
.bk-stats table { width: 100%; border-collapse: collapse; }
.bk-stats th, .bk-stats td {
  padding: .32rem .35rem;
  border-bottom: 1px solid var(--bk-line);
  line-height: 1.3;
}
.bk-stats th:first-child { padding-left: .5rem; text-align: left; }
.bk-stats :is(td, th):last-child { padding-right: .5rem; }
.bk-stats thead { border-top: 1px solid var(--bk-line); background: var(--bk-subtle); }
.bk-stats thead th, .bk-stats td {
  text-align: right;
  font-family: var(--bk-mono);
  font-variant-numeric: tabular-nums slashed-zero;
}
.bk-stats thead th { font-size: .76rem; font-weight: 500; color: var(--bk-muted); }
.bk-stats thead th:first-child { color: var(--bk-text); }
.bk-stats sup { font-size: .72em; line-height: 0; }
.bk-stats tbody th { font-weight: 400; font-size: .92rem; }
.bk-stats td { white-space: nowrap; font-size: .86rem; }
.bk-stats tr:is([data-stat=assessed], [data-stat=received]) > * { color: var(--bk-accent); font-weight: 700; }
.bk-stats tr:is([data-stat=furniture], [data-stat=lego]) > * { color: var(--bk-muted); font-size: .8rem; }
.bk-stats tr:is([data-stat=furniture], [data-stat=lego]) th { padding-left: 1rem; }
.bk-stats p {
  max-width: 65ch;
  margin: .55rem 0 0;
  color: var(--bk-muted);
  font-size: .81rem;
  line-height: 1.4;
}
.bk-stats-status { font-family: var(--bk-mono); }
.bk-channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: clamp(1.65rem, 3vw, 2.75rem); }
.bk-channel {
  position: relative;
  min-width: 0;
  border: 1px solid var(--bk-line);
  padding: clamp(.9rem, 2vw, 1.65rem);
}
.bk-channel::before { content: ""; position: absolute; inset: -1px auto auto -1px; width: 1.25rem; height: 2px; background: var(--bk-accent); }
.bk-channel header, .bk-channel-detail { justify-content: space-between; gap: .45rem 1rem; flex-wrap: wrap; }
.bk-channel h2 { margin: 0; font: 600 clamp(1.1rem, 2vw, 1.5rem)/1.18 var(--display); }
.bk-state { color: var(--bk-muted); font-size: .75rem; }
.bk-instrument { display: flex; align-items: baseline; gap: .5rem 1.1rem; flex-wrap: wrap; margin: 1.4rem 0 .95rem; }
.bk-countdown { display: inline-flex; align-items: baseline; gap: .35rem; color: var(--bk-accent); }
.bk-prefix { font: 500 .85rem/1 var(--bk-mono); }
.bk-readout { font: 750 clamp(2.8rem, 4.9vw, 4.8rem)/.95 var(--bk-mono); font-variant-numeric: tabular-nums slashed-zero; letter-spacing: -.07em; }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .bk-readout {
    background: radial-gradient(circle, currentColor 53%, transparent 66%) 0 0 / 2.5px 2.5px;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.bk-clock-label { color: var(--bk-muted); font-size: .78rem; }
.bk-scale {
  --remaining: 0%;
  --ticks: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 7px);
  height: 7px;
  background: var(--ticks) left bottom / 100% 2px no-repeat;
  color: var(--bk-line);
}
.bk-scale i { display: block; width: var(--remaining); height: 100%; background: var(--ticks); color: var(--bk-accent); }
.bk-channel-detail { margin-top: .8rem; align-items: baseline; }
.bk-work { min-width: 0; flex: 1 1 9em; overflow-wrap: anywhere; font-size: .93rem; }
.bk-queue { white-space: nowrap; color: var(--bk-muted); }
.bk-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; margin-bottom: .85rem; }
.bk-toolbar .section-title { margin: 0; }
.bk-controls { flex-wrap: wrap; gap: .5rem; }
.bk-controls select, .bk-controls button {
  width: auto;
  max-width: 100%;
  min-height: 42px;
  margin: 0;
  padding: .45rem .7rem;
  border: 1px solid var(--bk-line);
  border-radius: 2px;
  background-color: var(--surface);
  color: var(--bk-text);
  font: 500 .85rem var(--bk-mono);
  cursor: pointer;
}
.bk-controls button:is(:hover,[aria-pressed=true]) { border-color: var(--bk-accent); background: var(--bk-subtle); }
.bk-controls :focus-visible, .bk-ad a:focus-visible { outline: 2px solid var(--bk-accent); outline-offset: 2px; }
.bk-events { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--bk-line); }
.bk-event {
  position: relative;
  display: grid;
  grid-template-columns: 5.4rem .9rem minmax(0, 1fr) auto;
  grid-template-areas: "at node entry category";
  align-items: start;
  gap: 0 .7rem;
  padding: .78rem .65rem;
  border-bottom: 1px solid var(--timeline-divider);
  line-height: 1.4;
}
.bk-event:first-child, .bk-event[data-kind=match] { background: var(--bk-subtle); }
.bk-event time, .bk-category { color: var(--bk-muted); font: .78rem/1.6 var(--bk-mono); font-variant-numeric: tabular-nums; }
.bk-event time { grid-area: at; }
.bk-event time small { display: block; }
.bk-node { grid-area: node; align-self: stretch; position: relative; display: grid; justify-items: center; }
.bk-node::before { content: ""; position: absolute; top: -.82rem; bottom: -.82rem; width: 1px; background: var(--bk-line); }
.bk-event:first-child .bk-node::before { top: .5rem; }
.bk-event:last-child .bk-node::before { bottom: auto; height: 1.5rem; }
.bk-event:only-child .bk-node::before { display: none; }
.bk-node::after { content: ""; position: relative; top: .45rem; width: .42rem; height: .42rem; border: 1px solid var(--bk-accent); background: var(--surface); }
.bk-event:is([data-kind=image],[data-kind=analysis],[data-kind=match]) .bk-node::after { background: var(--bk-accent); }
.bk-event[data-kind=error] .bk-node::after { transform: rotate(45deg); }
.bk-entry { grid-area: entry; display: flow-root; min-width: 0; overflow-wrap: anywhere; }
.bk-preview { float: left; width: 3.5rem; height: 3.5rem; margin-right: .75rem; object-fit: cover; }
.bk-message { display: block; }
.bk-event[data-kind=match] .bk-message { font-weight: bold; }
.bk-ad { display: block; margin-top: .15rem; font-size: .92rem; }
.bk-ad a { text-decoration: underline; text-underline-offset: .17em; }
.bk-category { grid-area: category; }
.bk-feedback, .bk-empty { margin: .9rem 0; }
@media (max-width: 900px) {
  .bk-stat-tables { grid-template-columns: minmax(0, 1fr); }
  .bk-stats table { table-layout: fixed; }
  .bk-stats th:first-child { width: 40%; }
}
@media (max-width: 760px) {
  .bk-signal { padding-inline: .65rem; gap: .4rem; }
}
@media (max-width: 660px) {
  .bk-monitor { grid-template-columns: minmax(0, 1fr); gap: .7rem; margin-bottom: .7rem; }
  .bk-intro h1 { font-size: clamp(1.95rem, 8.8vw, 3.5rem); }
  .bk-intro p { font-size: .94rem; }
  .bk-screen { grid-template-rows: clamp(5.5rem, 22vw, 7rem) auto; }
  .bk-signal { min-height: 2rem; }
  .bk-stats > summary { padding-inline: .65rem; }
  .bk-stats-body { padding-inline: .65rem; }
  .bk-stats :is(th, td) { padding-inline: .2rem; overflow-wrap: anywhere; }
  .bk-stats tbody th { font-size: .84rem; }
  .bk-stats td { font-size: .8rem; white-space: normal; }
  .bk-stats :is(td, th):last-child { padding-right: .25rem; }
  .bk-stats thead th { font-size: .71rem; }
  .bk-motion { top: 4px; right: 4px; }
  .bk-channels { grid-template-columns: minmax(0, 1fr); gap: .65rem; }
  .bk-instrument { gap: .5rem; margin: .7rem 0; }
  .bk-channel-detail { margin-top: .5rem; }
  .bk-event { grid-template-columns: 4.15rem .6rem minmax(0, 1fr); grid-template-areas: "at node entry" ". node category"; column-gap: .45rem; padding-inline: .3rem; }
  .bk-category { font-size: .72rem; margin-top: .15rem; }
  .bk-preview { width: 2.75rem; height: 2.75rem; margin-right: .45rem; }
}
@media (prefers-reduced-motion: reduce) { .bk-motion { display: none; } }
@media (forced-colors: active) {
  .bk-motion, .bk-rain { display: none; }
  .bk-readout { -webkit-text-fill-color: CanvasText; background: none; }
  .bk-node::after { border-color: CanvasText; }
}

.bk-display-settings, .bk-period-setting { display: flex; align-items: center; }
.bk-display-settings { flex-wrap: wrap; justify-content: flex-end; gap: 0 .8rem; padding: 0 .85rem; }
.bk-display-settings .bk-rain-setting { padding: 0; }
.bk-period-setting { gap: .5rem; color: var(--bk-muted); font: .76rem var(--bk-mono); }
.bk-period-setting input { width: 6rem; height: 2rem; margin: 0; accent-color: var(--bk-accent); }
.bk-history-note { color: var(--bk-muted); font-size: .75rem; }
