*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }
input, textarea { font: inherit; }

:root {
  --bg:     #09090e;
  --panel:  #101018;
  /* chrome: slightly elevated — used for sidebar + header bars (the "parent" nav chrome) */
  --chrome: #161621;
  /* sink: slightly darker — used for the script list (the "child" content area) */
  --sink:   #0c0c12;
  --surf:   #17172280;
  --surf2:  #1c1c2a;
  --hover:  #20202e;
  --b:      #21213299;
  --bhi:    #2e2e48;
  --txt:    #c4c7de;
  --txt2:   #7a7d9a;
  --txt3:   #3a3d56;
  --teal:   #0a4038;
  --teal2:  #00e5aa;
  --tealg:  rgba(0, 229, 170, .08);
  --grn:    #0a3530;
  --grn2:   #103d38;
  --grntxt: #00e5aa;
  --amb:    #3d2800;
  --ambhi:  #ffc200;
  --ambg:   rgba(255, 194, 0, .08);
  --red:    #3d0808;
  --redhi:  #ff3030;
  --redg:   rgba(255, 48, 48, .08);
  --vio:    #1c0b33;
  --vio2:   #b061ff;
  --viog:   rgba(176, 97, 255, .10);
  --blu:    #081430;
  --bluhi:  #3da0ff;
  --blug:   rgba(61, 160, 255, .08);
  --r:      13px;
  --rsm:    8px;
  --rxs:    6px;
  --sb:     214px;

  /* shared header height — keeps sidebar and panel headers exactly aligned */
  --panel-hd-h: 52px;
  /* shared row padding — both grp-row and sc-row use same vertical padding
     so their heights are: content(26px) + 2*padding + border(1px) = equal */
  --row-py: 11px;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
* { scrollbar-width: thin; scrollbar-color: var(--bhi) transparent; }
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--bhi); border-radius: 3px; }

/* ── LOGIN ──
   Same layout as the other sh-development apps (menu is the reference):
   exactly one screen tall, no scroll — card centered in the top zone,
   description + divider anchored at the bottom. */
.login-wrap {
  height: 100vh; height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 20px 28px;
}
.login-card-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  width: 100%;
}
.login-card {
  border: 1.5px solid var(--bhi);
  border-radius: var(--r);
  padding: 44px 40px 36px;
  text-align: center;
  width: 100%; max-width: 380px;
  background: var(--panel);
}
.login-logo {
  font-size: 28px; font-weight: 700; letter-spacing: 3px;
  color: var(--txt); margin-bottom: 10px;
}
.login-sub { font-size: 12px; color: var(--txt3); margin-bottom: 36px; letter-spacing: .5px; }
.login-sub a { color: inherit; text-decoration: none; }
.login-sub a:hover { color: var(--txt2); }
.login-btn {
  display: block; width: 100%;
  padding: 14px;
  border: 1.5px solid var(--bhi); border-radius: var(--rsm);
  background: var(--surf2); color: var(--txt); font-size: 14px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.login-btn:hover { background: var(--hover); border-color: var(--txt2); }
.login-form { display: none; margin-top: 4px; }
.login-input {
  width: 100%; padding: 11px 14px; margin-bottom: 10px;
  background: var(--surf2); border: 1.5px solid var(--bhi); border-radius: var(--rxs);
  color: var(--txt); font-size: 13px; outline: none;
  transition: border-color .15s;
}
.login-input:focus { border-color: var(--teal); }
.login-input::placeholder { color: var(--txt3); }

.login-hello {
  max-width: 380px; padding-bottom: 20px;
  color: var(--txt2); font-size: 13px; text-align: center; line-height: 1.8;
}
.login-hello code {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  color: var(--teal2); font-size: 12px;
}
.login-divider {
  width: 100%; max-width: 380px;
  display: flex; align-items: center;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--b);
}
.login-divider-dot {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--bhi); flex-shrink: 0;
  margin: 0 -1px; /* lines run flush to the circle edge */
}

/* ── APP SHELL ── */
.app-wrap { flex: 1; display: none; flex-direction: column; min-height: 0; }

.view { display: none; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }
.view.active { display: flex; }

.navbar {
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  padding: 16px; flex-shrink: 0;
}

.nav-tabs {
  display: flex; align-items: center;
  background: rgba(22, 22, 33, 0.94);
  border: 1px solid var(--bhi);
  border-radius: 28px; padding: 5px; gap: 2px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tab {
  background: transparent; border: none; border-radius: 20px;
  min-width: 44px; height: 44px; padding: 0 18px;
  color: var(--txt2); font-family: inherit; font-size: 14px;
  white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--txt); }
.tab.active { background: var(--bhi); color: var(--teal2); }

.profile-area { position: relative; }

.profile-btn {
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.50);
  color: rgba(255, 255, 255, 0.88); font-family: inherit; font-size: 18px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 2px 12px rgba(0, 0, 0, 0.4);
  transition: border-color .15s, color .15s;
}
.profile-btn:hover,
.profile-btn.open { border-color: rgba(255, 255, 255, 0.80); color: #fff; }

.profile-popover {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 256px;
  background: rgba(0, 0, 0, 0.42); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px; padding: 14px;
  z-index: 101; display: none; flex-direction: column; gap: 8px;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
}
.profile-popover.open { display: flex; }

.pi-info { display: flex; flex-direction: column; gap: 3px; margin-bottom: 2px; }
.pi-label { font-size: 10px; color: rgba(255, 255, 255, 0.45); letter-spacing: .1em; text-transform: uppercase; }
.pi-name  { font-size: 15px; color: rgba(255, 255, 255, 0.92); word-break: break-all; }
.pi-sub   { font-size: 11px; color: rgba(255, 255, 255, 0.45); word-break: break-all; }

.pi-list {
  display: flex; flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px; overflow: hidden;
}
.pi-action {
  display: block; width: 100%; text-align: left;
  padding: 11px 14px; border: none; border-radius: 0;
  background: transparent; color: rgba(255, 255, 255, 0.88);
  text-decoration: none; font: inherit; font-size: 13px; cursor: pointer;
  transition: background .15s, color .15s;
}
.pi-action + .pi-action { border-top: 1px solid rgba(255, 255, 255, 0.10); }
.pi-action:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.pi-logout { color: #ff9f9f; }
.pi-logout:hover { color: #ffbfbf; background: rgba(255, 80, 80, 0.12); }

/* circle icon button */
.ib {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid #3a3a55; background: #252540;
  color: var(--txt); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ib:hover { border-color: var(--txt2); background: #2e2e4a; box-shadow: 0 0 10px rgba(154,157,192,.12); }
.ib.sm { width: 26px; height: 26px; }
.ib.amber  { border-color: #7a5000; color: var(--ambhi); background: var(--amb); }
.ib.amber:hover  { background: #4d3200; border-color: var(--ambhi); box-shadow: 0 0 10px var(--ambg); }
.ib.danger { border-color: #7a1212; color: var(--redhi);  background: var(--red); }
.ib.danger:hover { background: #4d0a0a; border-color: var(--redhi); box-shadow: 0 0 10px var(--redg); }

.main { flex: 1; display: flex; padding: 0 20px 20px; min-height: 0; }
.app-box {
  flex: 1; display: flex; max-width: 1060px; width: 100%; margin: 0 auto;
  border: 1.5px solid var(--bhi); border-radius: var(--r);
  overflow: hidden; background: var(--sink); min-height: 0;
}

/* ── SIDEBAR ── */
.sb {
  width: var(--sb); min-width: var(--sb);
  display: flex; flex-direction: column;
  background: var(--chrome);
  border-right: 1.5px solid var(--bhi);
}

/* Fixed height — must equal rp-hd height so rows align */
.sb-hd {
  height: var(--panel-hd-h);
  display: flex; align-items: center;
  padding: 0 10px;
  border-bottom: 1.5px solid var(--bhi); flex-shrink: 0;
}
.sb-search {
  flex: 1; min-width: 0;
  background: var(--surf2); border: 1.5px solid var(--bhi);
  border-radius: 20px; padding: 5px 12px;
  color: var(--txt); font-size: 12px; outline: none;
  transition: border-color .15s;
}
.sb-search:focus { border-color: var(--teal2); }
.sb-search::placeholder { color: #52546e; }

.grp-list { flex: 1; overflow-y: auto; }
.grp-row {
  display: flex; align-items: center; gap: 10px;
  padding: var(--row-py) 13px; cursor: pointer;
  border-bottom: 1px solid var(--b);
  transition: background .12s; position: relative;
}
.grp-row:hover { background: var(--hover); }
.grp-row.active { background: var(--surf2); }
.grp-row.active::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2.5px; background: var(--teal2); border-radius: 0 2px 2px 0;
}
.grp-init {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--bhi); background: var(--surf2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--txt2);
  flex-shrink: 0; text-transform: uppercase;
  transition: border-color .15s, color .15s;
}
.grp-row.active .grp-init { border-color: var(--teal); color: var(--teal2); }
.grp-lbl { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sb-add, .rp-add {
  padding: 14px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #52546e;
  transition: color .15s;
}
.sb-add:hover, .rp-add:hover { color: var(--txt2); }
.sb-add { background: var(--chrome); }
.rp-add { background: transparent; }

.new-grp-row {
  display: flex; align-items: center; gap: 8px;
  padding: var(--row-py) 13px;
  border-bottom: 1px solid var(--b);
}
.new-grp-inp {
  flex: 1; background: transparent; border: none;
  border-bottom: 1.5px solid var(--teal);
  color: var(--txt); font-size: 13px; outline: none; padding: 2px 3px;
}

/* ── RIGHT PANEL ── */
.rp { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* Fixed height — must equal sb-hd height so rows align */
.rp-hd {
  height: var(--panel-hd-h);
  display: flex; align-items: center;
  padding: 0 14px;
  background: var(--chrome);
  border-bottom: 1.5px solid var(--bhi);
  gap: 8px; flex-shrink: 0;
}
.rp-title { flex: 1; text-align: center; font-size: 13px; font-weight: 500; }
.sc-list { flex: 1; overflow-y: auto; }

/* ── SCRIPT ITEM ── */
.sc-item { border-bottom: 1px solid var(--b); }
.sc-row {
  display: flex; align-items: center; gap: 10px;
  padding: var(--row-py) 14px;
}
.sc-name {
  flex: 1; min-width: 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; font-size: 13px;
}
.sc-name-inp {
  flex: 1; min-width: 0; background: transparent; border: none;
  border-bottom: 1.5px solid var(--teal);
  color: var(--txt); font-size: 13px; outline: none; padding: 1px 3px;
}
.wget-btn {
  height: 26px;
  padding: 0 13px;
  display: inline-flex; align-items: center;
  background: var(--grn);
  border: 1px solid #147060;
  border-radius: var(--rxs);
  color: var(--grntxt);
  font-size: 11px; font-weight: 700;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  letter-spacing: .8px; cursor: pointer; flex-shrink: 0;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.wget-btn:hover { background: var(--grn2); border-color: var(--teal2); box-shadow: 0 0 10px var(--tealg); }
.wget-btn.ok { background: #0a2e2a; color: var(--teal2); border-color: #147060; }

.sc-content { padding: 0 14px 12px 14px; }
.ta-wrap { position: relative; display: block; }
.sc-hl {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12px; line-height: 1.7;
  padding: 10px 13px;
  border: 1.5px solid transparent; border-radius: var(--rsm);
  white-space: pre-wrap; overflow-wrap: break-word;
  overflow: hidden; pointer-events: none;
  color: var(--txt); background: var(--surf2);
}
.sc-hl .cm { color: var(--txt2); }
.sc-ta {
  position: relative;
  width: 100%; background: transparent;
  border: 1.5px solid var(--b); border-radius: var(--rsm);
  color: transparent; caret-color: var(--txt);
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12px; line-height: 1.7;
  padding: 10px 13px; resize: none; min-height: 88px; outline: none;
  overflow: hidden; transition: border-color .15s;
}
.sc-ta:not([readonly]):focus { border-color: var(--teal); }

/* read view — replaces the textarea when the script is not being edited. Same
   metrics as .sc-ta/.sc-hl so switching to edit mode does not shift the text. */
.sc-view {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 12px; line-height: 1.7;
  padding: 10px 13px;
  border: 1.5px solid var(--b); border-radius: var(--rsm);
  white-space: pre-wrap; overflow-wrap: break-word;
  min-height: 88px;
  color: var(--txt); background: var(--surf2);
}
.sc-view .cm { color: var(--txt2); }

/* markdown — read view only, see markdown.js */
.md-a { color: var(--bluhi); text-decoration: underline; text-underline-offset: 2px; }
.md-a:hover { color: #7bc0ff; }
.md-hr { border: none; border-top: 1px solid var(--bhi); margin: 8px 0; }
.sc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }

/* visibility toggle — "make:" label + the state the button switches to:
   neon purple = private, grey = public */
.priv-wrap { display: inline-flex; align-items: center; gap: 8px; }
.priv-lbl {
  font-size: 11px; color: var(--txt2); letter-spacing: .4px;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
}
.priv-btn {
  height: 26px;
  padding: 0 13px;
  display: inline-flex; align-items: center;
  background: var(--surf2);
  border: 1px solid var(--bhi);
  border-radius: var(--rxs);
  color: var(--txt2);
  font-size: 11px; font-weight: 700;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  letter-spacing: .8px; cursor: pointer; flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.priv-btn:hover { background: var(--hover); border-color: var(--txt2); color: var(--txt); }
.priv-btn.on {
  background: var(--vio); border-color: #6d2fc4;
  color: var(--vio2); box-shadow: 0 0 10px var(--viog);
}
.priv-btn.on:hover {
  background: #2a1052; border-color: var(--vio2);
  box-shadow: 0 0 14px rgba(176, 97, 255, .28);
}

.sc-lock {
  display: inline-flex; align-items: center; flex-shrink: 0;
  color: var(--vio2); opacity: .8;
}

/* ── DROPDOWNS ── */
.dd { position: relative; }
.drop {
  position: absolute; right: 0; top: 38px;
  background: var(--surf2); border: 1.5px solid var(--bhi);
  border-radius: var(--rsm); padding: 6px; z-index: 100;
  width: 200px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .65);
}
.drop-row { min-height: 36px; }
.drop-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--rxs);
  cursor: pointer; transition: background .12s; font-size: 12px;
}
.drop-row:hover { background: var(--hover); }
.drop-lbl { flex: 1; color: var(--txt2); }
.drop-inp {
  flex: 1; background: transparent; border: none;
  border-bottom: 1.5px solid var(--teal);
  color: var(--txt); font-size: 12px; outline: none; padding: 1px 3px; min-width: 0;
}

/* ── MODAL ── */
.overlay {
  position: fixed; inset: 0; background: transparent;
  display: flex; align-items: center; justify-content: center;
  z-index: 200; backdrop-filter: blur(6px);
}
.ib.teal { border-color: #147060; color: var(--teal2); background: var(--teal); }
.ib.teal:hover { background: #0f5045; border-color: var(--teal2); box-shadow: 0 0 10px var(--tealg); }
.modal {
  background: var(--surf2); border: 1.5px solid var(--bhi);
  border-radius: var(--r); padding: 28px 36px; text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .75);
}
.modal-q { font-size: 14px; color: var(--txt); margin-bottom: 20px; }
.modal-btns { display: flex; justify-content: center; gap: 14px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surf2); border: 1.5px solid var(--teal);
  color: var(--teal2); padding: 9px 18px;
  border-radius: 20px; font-size: 12px; z-index: 300;
  pointer-events: none; opacity: 0;
  transition: transform .28s ease, opacity .28s ease; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── MOBILE (iPad and below ≤ 1024px) ── */
@media (max-width: 1024px) {
  /* lock body to viewport, internal lists scroll via their own overflow-y */
  body { height: 100dvh; overflow: hidden; }
  .app-wrap { min-height: 0; }

  /* scale up base font */
  body { font-size: 16px; }

  /* bump shared size vars */
  :root {
    --panel-hd-h: 64px;
    --row-py:     18px;
  }

  /* taller header + extra top gap so user menu tap doesn't hit app area */
  .navbar { padding: 12px 16px; }

  /* bigger icon buttons */
  .ib    { width: 46px; height: 46px; }
  .ib.sm { width: 40px; height: 40px; }

  /* no side margins — use full width */
  .main { padding: 10px 0 0; }

  /* full-width box, drop side borders + bottom border */
  .app-box {
    border-left: none; border-right: none; border-bottom: none;
    border-radius: var(--r) var(--r) 0 0;
    max-width: 100%;
  }

  /* sidebar takes full width */
  .sb { width: 100% !important; min-width: 100% !important; border-right: none; }

  /* bigger search bar */
  .sb-hd { padding: 12px 16px; }
  .sb-search { font-size: 16px; padding: 10px 20px; border-radius: 24px; }

  /* bigger new-group input */
  .new-grp-inp { font-size: 18px; }
  .new-grp-row { padding: var(--row-py) 16px; }

  /* bigger group rows */
  .grp-init { width: 40px; height: 40px; font-size: 16px; }
  .grp-lbl  { font-size: 18px; }

  /* bigger right panel */
  .rp-title   { font-size: 18px; }
  .sc-name    { font-size: 18px; }
  .sc-name-inp{ font-size: 18px; }

  /* bigger wget button */
  .wget-btn { height: 40px; padding: 0 18px; font-size: 14px; letter-spacing: 1px; }
  .priv-btn { height: 40px; padding: 0 18px; font-size: 14px; letter-spacing: 1px; }
  .priv-lbl { font-size: 14px; }

  /* mobile view switching: show only one panel at a time */
  body.vg .rp { display: none; }
  body.vs .sb { display: none; }
  #backBtn { display: inline-flex !important; }

  /* bigger dropdowns */
  .drop      { width: 240px; }
  .drop-row  { min-height: 50px; font-size: 16px; }
  .drop-lbl  { font-size: 16px; }
  .drop-inp  { font-size: 16px; }

  /* bigger toast */
  .toast { font-size: 15px; padding: 12px 22px; }
}

/* ══════════════════════════════════════════════════════════════
   LOGER VIEW
   ══════════════════════════════════════════════════════════════ */

#viewLoger {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 13px;
  color: var(--txt);
}

/* action bar */
.lgr-acts {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; flex-shrink: 0;
  background: var(--chrome); border-bottom: 1.5px solid var(--bhi);
}
.lgr-btn {
  height: 26px; padding: 0 12px;
  background: var(--surf2); border: 1.5px solid var(--bhi);
  border-radius: var(--rxs); color: var(--txt2); font-family: inherit;
  font-size: 12px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.lgr-btn:hover { background: var(--hover); border-color: var(--txt2); color: var(--txt); }
.lgr-btn.danger:hover { background: var(--red); border-color: var(--redhi); color: var(--redhi); }
.lgr-btn.primary { background: var(--grn); border-color: #147060; color: var(--grntxt); }
.lgr-btn.primary:hover { background: var(--grn2); border-color: var(--teal2); }
.lgr-count { margin-left: auto; font-size: 11px; color: var(--txt3); }

/* load screen */
.lgr-load {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px; padding: 32px; overflow-y: auto;
}
.lgr-drop {
  width: 100%; max-width: 560px;
  border: 2px dashed var(--bhi); border-radius: 12px;
  padding: 40px 56px; text-align: center; cursor: pointer; color: var(--txt2);
  transition: border-color .2s, background .2s;
}
.lgr-drop:hover, .lgr-drop.over { border-color: var(--teal2); background: rgba(0,229,170,.04); }
.lgr-drop p { line-height: 1.7; }
.lgr-drop strong { color: var(--txt); }
.lgr-fmts { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 12px; }
.lgr-fmt {
  background: var(--surf2); border: 1px solid var(--b);
  border-radius: 4px; padding: 2px 7px; font-size: 11px; color: var(--txt3);
}
.lgr-drop-err { margin-top: 10px; color: var(--redhi); font-size: 12px; display: none; }
.lgr-drop-err.show { display: block; }

.lgr-paste-wrap { width: 100%; max-width: 560px; }
.lgr-paste-wrap label {
  display: block; font-size: 11px; color: var(--txt3);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px;
}
#lgrPaste {
  width: 100%; height: 110px;
  background: var(--surf2); border: 1.5px solid var(--bhi); border-radius: var(--rsm);
  color: var(--txt); font-family: inherit; font-size: 12px;
  padding: 10px; resize: none; outline: none;
  transition: border-color .15s;
}
#lgrPaste:focus { border-color: var(--teal2); }
#lgrPaste::placeholder { color: var(--txt3); }

/* workspace */
.lgr-workspace {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}

/* filter bars */
.lgr-bar {
  display: flex; gap: 16px; padding: 10px 16px; flex-shrink: 0;
  background: var(--chrome); border-bottom: 1.5px solid var(--bhi);
  overflow-x: auto;
}
.lgr-col { display: flex; flex-direction: column; gap: 6px; min-width: 240px; flex: 1; }
.lgr-col-hd { display: flex; align-items: center; gap: 8px; }
.lgr-lbl {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600;
}
.lgr-lbl.focus  { color: var(--ambhi); }
.lgr-lbl.remove { color: var(--redhi); }
.lgr-lbl.grep   { color: var(--teal2); }
.lgr-lbl.math   { color: var(--bluhi); }
.lgr-hint { font-size: 10px; color: var(--txt3); }
.lgr-sep-v { width: 1px; background: var(--bhi); align-self: stretch; flex-shrink: 0; }

/* focus row */
.lgr-focus-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.lgr-field { display: flex; align-items: center; gap: 6px; }
.lgr-field label { font-size: 11px; color: var(--txt3); white-space: nowrap; }
.lgr-field input[type=number] {
  background: var(--sink); border: 1px solid var(--bhi); border-radius: var(--rxs);
  color: var(--ambhi); font-family: inherit; font-size: 12px;
  padding: 3px 8px; width: 72px; outline: none;
  transition: border-color .15s; -moz-appearance: textfield;
}
.lgr-field input[type=number]::-webkit-inner-spin-button,
.lgr-field input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }
.lgr-field input[type=number]:focus { border-color: var(--ambhi); }
.lgr-sep { color: var(--txt3); font-size: 13px; }
.lgr-focus-acts { display: flex; gap: 4px; margin-left: 4px; }
.lgr-pill-btn {
  background: none; border: none; cursor: pointer; padding: 2px 7px;
  border-radius: 10px; display: flex; align-items: center; gap: 4px;
  color: var(--txt3); font-family: inherit; font-size: 11px;
  transition: color .15s, background .15s;
}
.lgr-pill-btn:hover { color: var(--txt); background: var(--hover); }
.lgr-pill-btn.active { color: var(--ambhi); }
.lgr-pill-btn.del:hover { color: var(--redhi); }

/* condition lists */
.lgr-cond-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.lgr-add-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--sink); border: 1px dashed var(--bhi); border-radius: 20px;
  padding: 3px 10px; cursor: pointer; color: var(--txt3);
  font-size: 12px; font-family: inherit;
  transition: border-color .15s, color .15s;
}
.lgr-add-btn:hover    { border-color: var(--txt2); color: var(--txt2); }
.lgr-add-btn.grep:hover   { border-color: var(--teal2); color: var(--teal2); }
.lgr-add-btn.remove:hover { border-color: var(--redhi); color: var(--redhi); }
.lgr-add-btn.math:hover   { border-color: var(--bluhi); color: var(--bluhi); }

/* condition pills */
.lgr-pill {
  display: flex; align-items: center; gap: 4px;
  background: var(--sink); border: 1px solid var(--bhi);
  border-radius: 20px; padding: 3px 4px 3px 10px;
  transition: opacity .15s;
}
.lgr-pill.grep-pill   { border-color: #0d3a1e; }
.lgr-pill.remove-pill { border-color: #3a0d0d; }
.lgr-pill.off { opacity: .4; }
.lgr-pill input {
  background: transparent; border: none; outline: none;
  color: var(--txt); font-family: inherit; font-size: 12px;
  width: 100px; min-width: 40px;
}
.lgr-pill.grep-pill input   { color: var(--teal2); }
.lgr-pill.remove-pill input { color: var(--redhi); }
.lgr-pbtn {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  border-radius: 10px; display: flex; align-items: center;
  color: var(--txt3); transition: color .15s, background .15s; line-height: 1;
}
.lgr-pbtn:hover        { color: var(--txt); background: var(--hover); }
.lgr-pbtn.tog:hover    { color: var(--ambhi); }
.lgr-pbtn.del:hover    { color: var(--redhi); }

/* math pill */
.lgr-math-pill {
  display: flex; align-items: center; gap: 4px;
  background: var(--sink); border: 1px solid #0d1a3a;
  border-radius: 20px; padding: 3px 4px 3px 10px;
  transition: opacity .15s;
}
.lgr-math-pill.off { opacity: .4; }
.lgr-mpfx {
  background: transparent; border: none; outline: none;
  color: var(--txt); font-family: inherit; font-size: 12px;
  width: 60px; min-width: 20px;
}
.lgr-mpfx::placeholder { color: var(--txt3); }
.lgr-mop {
  background: transparent; border: none; outline: none;
  color: var(--bluhi); font-family: inherit; font-size: 12px;
  cursor: pointer; padding: 0 2px; appearance: none; -webkit-appearance: none;
}
.lgr-mop option { background: var(--panel); color: var(--txt); }
.lgr-mval {
  background: transparent; border: none; outline: none;
  color: var(--txt); font-family: inherit; font-size: 12px;
  width: 72px; -moz-appearance: textfield;
}
.lgr-mval::-webkit-inner-spin-button,
.lgr-mval::-webkit-outer-spin-button { -webkit-appearance: none; }

/* log display */
.lgr-display {
  flex: 1; overflow-y: auto; background: var(--bg);
  scrollbar-width: thin; scrollbar-color: var(--bhi) transparent;
}
.lgr-display::-webkit-scrollbar { width: 6px; }
.lgr-display::-webkit-scrollbar-thumb { background: var(--bhi); border-radius: 3px; }

.lgr-line {
  display: flex; align-items: baseline;
  padding: 1px 16px; line-height: 1.6;
  transition: background .08s; position: relative;
}
.lgr-line:hover { background: var(--chrome); }
.lgr-line.center::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--ambhi); border-radius: 0 2px 2px 0;
}
.lgr-num {
  color: var(--txt3); font-size: 11px; min-width: 52px;
  text-align: right; padding-right: 16px; user-select: none; flex-shrink: 0;
}
.lgr-txt { white-space: pre-wrap; word-break: break-all; flex: 1; }
.lgr-txt.lvl-error { color: var(--redhi); }
.lgr-txt.lvl-warn  { color: var(--ambhi); }
.lgr-txt.lvl-info  { color: var(--txt); }
.lgr-txt.lvl-debug { color: var(--txt2); }
.lgr-txt.lvl-trace { color: var(--txt3); }

/* highlights */
.lgr-hl {
  background: rgba(0,229,170,.13); color: var(--teal2);
  border-radius: 2px; padding: 0 1px;
  outline: 1px solid rgba(0,229,170,.22); outline-offset: -1px;
}
.lgr-hl-m {
  background: rgba(61,160,255,.12); color: var(--bluhi);
  border-radius: 2px; padding: 0 1px;
  outline: 1px solid rgba(61,160,255,.2); outline-offset: -1px;
}
.lgr-rm {
  display: inline-block; width: 1.2em; height: .85em;
  background: rgba(255,48,48,.16); border-radius: 2px;
  outline: 1px solid rgba(255,48,48,.2); outline-offset: -1px;
  vertical-align: middle;
}
.lgr-empty { padding: 48px; text-align: center; color: var(--txt3); }
