/* ============================================================================
   HookGuard Protect — obfuscator pane styles.
   Self-contained: only depends on the site tokens in style.css (:root).
   No layout assumptions beyond .tab-pane inside .dash-content.
   ============================================================================ */

.hgobf {
  --obf-line: 20px;
  --obf-font: 12.5px;
  display: grid;
  gap: 16px;
}

.hgobf-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hgobf-head .ptitle { margin: 0; }
.hgobf-lead {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin: -4px 0 2px;
  max-width: 76ch;
}

/* ---------- quota pill ---------------------------------------------------- */
.hgobf-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.hgobf-pill b { color: #fff; font-weight: 700; }
.hgobf-pill.warn { border-color: rgba(241, 196, 15, .35); color: var(--yellow); }
.hgobf-pill.ok { border-color: rgba(46, 204, 113, .3); color: var(--green); }
.hgobf-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

/* ---------- editor -------------------------------------------------------- */
.hgobf-editor {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(6, 8, 14, .62);
  overflow: hidden;
  transition: border-color .16s, box-shadow .16s;
}
.hgobf-editor:focus-within {
  border-color: rgba(255, 53, 53, .55);
  box-shadow: 0 0 0 3px rgba(255, 53, 53, .09);
}
.hgobf-editor.is-drag { border-color: var(--accent); border-style: dashed; }

.hgobf-gutter {
  padding: 12px 8px 12px 0;
  text-align: right;
  font-family: var(--mono);
  font-size: var(--obf-font);
  line-height: var(--obf-line);
  color: rgba(255, 255, 255, .24);
  background: rgba(255, 255, 255, .022);
  border-right: 1px solid var(--border);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.hgobf-gutter span { display: block; height: var(--obf-line); }
.hgobf-gutter span.cur { color: var(--accent); font-weight: 700; }

.hgobf-ta {
  position: relative;
  width: 100%;
  min-height: 320px;
  max-height: 62vh;
  padding: 12px 14px;
  border: 0;
  outline: none;
  resize: vertical;
  background: transparent;
  color: #e9ecf5;
  font-family: var(--mono);
  font-size: var(--obf-font);
  line-height: var(--obf-line);
  tab-size: 4;
  white-space: pre;
  overflow: auto;
}
.hgobf-ta::placeholder { color: rgba(255, 255, 255, .26); }

/* caret row highlight lives behind the text, aligned to the gutter metrics */
.hgobf-curlines {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--obf-line);
  background: rgba(255, 53, 53, .07);
  border-left: 2px solid rgba(255, 53, 53, .5);
  pointer-events: none;
  transition: transform .06s linear;
}

.hgobf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.hgobf-foot-l { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hgobf-stats { color: var(--text-muted); font-size: 12px; font-family: var(--mono); }
.hgobf-stats b { color: #fff; font-weight: 600; }

/* ---------- profile chips (no checkboxes, no toggles) ------------------- */
.hgobf-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.hgobf-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  color: var(--text-muted);
  font: 600 12.5px/1 var(--font);
  cursor: pointer;
  transition: border-color .14s, color .14s, background .14s, transform .14s;
}
.hgobf-chip:hover { color: #fff; border-color: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.hgobf-chip.on {
  color: #fff;
  border-color: rgba(255, 53, 53, .55);
  background: rgba(255, 53, 53, .13);
  box-shadow: 0 0 14px rgba(255, 53, 53, .16);
}
.hgobf-chip .lock { width: 12px; height: 12px; opacity: .75; }
.hgobf-chip[data-locked="1"] { opacity: .78; }
.hgobf-chip small { font-weight: 500; opacity: .7; }
.hgobf-chip.dim { opacity: .55; }

/* ---------- main action --------------------------------------------------- */
.hgobf-go { min-width: 190px; justify-content: center; padding: 12px 20px; border-radius: 12px; }
.hgobf-go svg { width: 16px; height: 16px; }
.hgobf-go.is-busy { pointer-events: none; opacity: .9; }

/* ---------- progress ------------------------------------------------------ */
.hgobf-busy {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 14px;
  background: rgba(6, 8, 14, .86);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.hgobf-busy[hidden] { display: none; }
.hgobf-busy-in { width: min(420px, 100%); text-align: center; }
.hgobf-orb { position: relative; width: 118px; height: 118px; margin: 0 auto 16px; }
.hgobf-orb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hgobf-orb .ring {
  fill: none; stroke: url(#hgObfGrad); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 70 260; transform-origin: 50% 50%;
  animation: hgObfSpin 1.5s linear infinite;
}
.hgobf-orb .ring2 {
  fill: none; stroke: rgba(255, 255, 255, .09); stroke-width: 3;
}
.hgobf-orb .shield {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--accent);
  animation: hgObfPulse 1.8s ease-in-out infinite;
}
.hgobf-orb .shield svg { width: 42px; height: 42px; position: static; }
@keyframes hgObfSpin { to { transform: rotate(360deg); } }
@keyframes hgObfPulse { 0%, 100% { opacity: .55; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }

.hgobf-stage { color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .1px; }
.hgobf-sub { color: var(--text-muted); font-size: 12px; margin-top: 5px; font-family: var(--mono); }
.hgobf-bar {
  height: 4px; margin: 14px 0 0; border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, .07);
}
.hgobf-bar i {
  display: block; height: 100%; width: 4%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #b428a0);
  transition: width .5s cubic-bezier(.22, .61, .36, 1);
}
.hgobf-note { color: var(--text-muted); font-size: 11.5px; margin-top: 10px; }

/* ---------- result -------------------------------------------------------- */
.hgobf-out {
  position: relative;
  border: 1px solid rgba(46, 204, 113, .28);
  border-radius: 14px;
  background: rgba(6, 8, 14, .55);
  overflow: hidden;
}
.hgobf-out-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .022);
}
.hgobf-out-bar .tag {
  font: 600 11px/1 var(--mono);
  padding: 5px 8px; border-radius: 7px;
  border: 1px solid var(--border); color: var(--text-muted);
}
.hgobf-out-bar .tag.good { color: var(--green); border-color: rgba(46, 204, 113, .3); }
.hgobf-out-code {
  display: grid;
  grid-template-columns: 52px 1fr;
  max-height: 46vh;
  overflow: auto;
}
.hgobf-out-code .hgobf-gutter { background: rgba(255, 255, 255, .015); }
.hgobf-out-pre {
  margin: 0; padding: 12px 14px;
  max-height: 46vh; overflow: auto;
  font-family: var(--mono); font-size: var(--obf-font); line-height: var(--obf-line);
  color: #cfd6e6; white-space: pre;
}
.hgobf-out-more {
  padding: 8px 14px; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 11.5px; font-family: var(--mono);
}
.hgobf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hgobf-actions .btn-table { display: inline-flex; align-items: center; gap: 7px; }

.hgobf-err {
  display: none;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 53, 53, .34);
  background: rgba(255, 53, 53, .07);
  color: #ffd9d9;
  font-size: 12.5px;
  line-height: 1.45;
}
.hgobf-err.show { display: block; }
.hgobf-err b { display: block; margin-bottom: 3px; }
.hgobf-err code { font-family: var(--mono); font-size: 11.5px; opacity: .8; }

.hgobf-upsell {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 11px 13px;
  border: 1px dashed rgba(255, 255, 255, .16);
  border-radius: 12px;
  color: var(--text-muted); font-size: 12.5px;
}
.hgobf-upsell a { color: var(--accent); font-weight: 700; text-decoration: none; }
.hgobf-upsell a:hover { text-decoration: underline; }

/* ---------- ledger rows --------------------------------------------------- */
.hgobf-jobs { display: grid; gap: 7px; }
.hgobf-job {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 11px;
  background: rgba(255, 255, 255, .02);
  font-size: 12px; color: var(--text-muted);
}
.hgobf-job .mono { font-family: var(--mono); }
.hgobf-job .st { font-weight: 700; }
.hgobf-job .st.ok { color: var(--green); }
.hgobf-job .st.failed { color: var(--accent); }
.hgobf-empty { color: var(--text-muted); font-size: 12.5px; padding: 10px 2px; }

/* ---------- loader-pane strip -------------------------------------------- */
.hgobf-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(46, 204, 113, .22);
  border-radius: 12px;
  background: rgba(46, 204, 113, .05);
}
.hgobf-strip[data-tone="warn"] { border-color: rgba(241, 196, 15, .3); background: rgba(241, 196, 15, .05); }
.hgobf-strip[data-tone="bad"] { border-color: rgba(255, 53, 53, .3); background: rgba(255, 53, 53, .06); }
.hgobf-strip-t { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 12.5px; line-height: 1.45; }
.hgobf-strip-t svg { width: 17px; height: 17px; flex: none; color: var(--green); }
.hgobf-strip[data-tone="warn"] .hgobf-strip-t svg,
.hgobf-strip[data-tone="bad"] .hgobf-strip-t svg { color: currentColor; }
.hgobf-strip-t b { color: #fff; }

/* ---------- light theme --------------------------------------------------- */
html[data-theme="light"] .hgobf-editor,
html[data-theme="light"] .hgobf-out { background: rgba(255, 255, 255, .72); }
html[data-theme="light"] .hgobf-ta { color: #14161f; }
html[data-theme="light"] .hgobf-ta::placeholder { color: rgba(20, 22, 31, .38); }
html[data-theme="light"] .hgobf-gutter { color: rgba(20, 22, 31, .38); background: rgba(20, 22, 31, .04); }
html[data-theme="light"] .hgobf-out-pre { color: #2b3040; }
html[data-theme="light"] .hgobf-busy { background: rgba(250, 250, 252, .88); }
html[data-theme="light"] .hgobf-chip { background: rgba(20, 22, 31, .03); }
html[data-theme="light"] .hgobf-chip.on { background: rgba(255, 53, 53, .1); color: #b41f1f; }

@media (max-width: 860px) {
  .hgobf-editor { grid-template-columns: 40px 1fr; }
  .hgobf-out-code { grid-template-columns: 40px 1fr; }
  .hgobf-go { width: 100%; }
  .hgobf-ta { min-height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .hgobf-orb .ring, .hgobf-orb .shield { animation: none; }
}
