/* ============================================================
   BSNK LegalDir — monochrome terminal redesign
   Pure black, strict grayscale, monospace, sharp corners.
   Same selectors/IDs as before — app.js and index.html untouched.
   ============================================================ */

:root{
  --bg:       #000000;
  --panel:    #0a0a0a;
  --panel-2:  #060606;

  --line:      #262626;
  --line-soft: #171717;

  --fg:      #e8e8e8;
  --fg-dim:  #8a8a8a;
  --fg-mute: #4c4c4c;

  --invert-bg: #eaeaea;
  --invert-fg: #050505;

  --radius: 0px;
  --mono: 'JetBrains Mono', 'IBM Plex Mono', 'Share Tech Mono', ui-monospace,
          'SFMono-Regular', Menlo, Consolas, monospace;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

/* faint CRT scanline overlay across the whole page */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.018) 0px,
    rgba(255,255,255,0.018) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

::selection{ background: var(--invert-bg); color: var(--invert-fg); }

.wrap{ max-width: 1020px; margin: 0 auto; padding: 0 18px; }

/* ---------- header ---------- */

.top{
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0,0,0,.92);
  border-bottom: 1px solid var(--line);
}

.brandbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0 12px;
  border-bottom: 1px solid var(--line-soft);
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark{
  width: 22px;
  height: 22px;
  opacity: .92;
}

.brandtext{ line-height: 1.1; }

.brandname{
  font-weight: 700;
  letter-spacing: 3px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.brandname::before{ content: "// "; color: var(--fg-mute); }

.brandsub{
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .2px;
  color: var(--fg);
  margin-top: 4px;
}

.rightmeta{
  font-size: 11px;
  letter-spacing: .3px;
  color: var(--fg-mute);
  text-align: right;
  white-space: nowrap;
  text-transform: uppercase;
}

/* ---------- tabs ---------- */

.tabs{
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 12px 0 0;
  border-bottom: 1px solid var(--line-soft);
}

.tab{
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 0;
  background: var(--panel-2);
  color: var(--fg-dim);
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-right: -1px;
  transition: background .12s ease, color .12s ease;
}

.tab::before{ content: "["; color: var(--fg-mute); margin-right: 6px; }
.tab::after{ content: "]"; color: var(--fg-mute); margin-left: 6px; }

.tab:hover{ color: var(--fg); background: var(--panel); }

.tab.active{
  color: var(--invert-fg);
  background: var(--invert-bg);
  border-color: var(--invert-bg);
}
.tab.active::before,
.tab.active::after{ color: var(--invert-fg); }

/* ---------- controls ---------- */

.controls{
  display: flex;
  gap: 10px;
  padding: 14px 0 10px;
}

#search{
  display: none;
}

#search::placeholder{ color: var(--fg-mute); }
#search:focus{ border-color: var(--fg-dim); }

button{
  padding: 11px 14px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--fg-dim);
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
button:hover{
  color: var(--invert-fg);
  background: var(--invert-bg);
  border-color: var(--invert-bg);
}

/* ---------- mode bar ---------- */

.modebar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 16px;
}

.modepill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 0;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--fg-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .6px;
  text-transform: uppercase;
  cursor: pointer;
}
.modepill:hover{ border-color: var(--fg-dim); color: var(--fg); }
.modepill:disabled{ cursor: default; opacity: .55; }
.modepill:disabled:hover{ border-color: var(--line); color: var(--fg-dim); }

.hint{
  font-size: 11px;
  color: var(--fg-mute);
}

/* ---------- tree / directory ---------- */

.tree{ padding: 16px 0 26px; }

details{
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  margin: 10px 0;
  overflow: hidden;
}

details > summary{
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--fg);
}
details > summary::-webkit-details-marker{ display: none; }

details > summary::before{
  content: "+";
  color: var(--fg-mute);
  margin-right: 10px;
  font-weight: 700;
  width: 10px;
  display: inline-block;
}
details[open] > summary::before{ content: "\2212"; } /* minus sign */

details > summary{ position: relative; }

.count{
  color: var(--fg-mute);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.section{
  padding: 2px 14px 12px 34px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel-2);
}

/* nested details (counties) sit inside a section, keep them flush */
.section > details{
  margin: 10px -34px;
  border-left: none;
  border-right: none;
  background: var(--panel);
}
.section > details > summary{ padding-left: 14px; }
.section > details .section{ padding-left: 34px; }

ul{ list-style: none; margin: 0; padding: 6px 0 0 0; }
li{ padding: 10px 4px; border-bottom: 1px dashed var(--line-soft); }
li:last-child{ border-bottom: none; }

a{
  color: var(--fg-dim);
  text-decoration: none;
  font-weight: 600;
}
a:hover{ color: var(--fg); text-decoration: underline; text-decoration-style: dotted; }
a::before{ content: "\2192 "; color: var(--fg-mute); } /* right arrow */

.note{
  margin-top: 5px;
  padding-left: 14px;
  font-size: 11px;
  color: var(--fg-mute);
}
.note::before{ content: "# "; }

.chips{ display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 10px; vertical-align: middle; }
.chip{
  font-size: 10px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--fg-mute);
  padding: 3px 7px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: transparent;
}

.hidden{ display: none !important; }

.empty{
  margin: 10px 0 20px;
  padding: 16px;
  border-radius: 0;
  border: 1px dashed var(--line);
  background: var(--panel);
  color: var(--fg-mute);
  text-align: center;
  letter-spacing: .3px;
}
.empty::before{ content: "// "; }

/* ---------- footer ---------- */

.footer{
  padding: 20px 18px 30px;
  border-top: 1px solid var(--line);
  color: var(--fg-mute);
  font-size: 11px;
  letter-spacing: .3px;
}

@media (max-width: 640px){
  .brandbar{ flex-direction: column; align-items: flex-start; gap: 8px; }
  .rightmeta{ text-align: left; white-space: normal; }
  .tabs{ flex-wrap: wrap; }
  .tab{ margin-bottom: -1px; }
  .controls{ flex-direction: column; }
  button{ width: 100%; }
  .section{ padding-left: 18px; }
  .section > details{ margin: 10px -18px; }
  .section > details .section{ padding-left: 18px; }
}
