:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --border: #2a2f3a;
  --text: #e6e8ee;
  --muted: #949cad;
  --accent: #4f8cff;
  --ok: #3fb950;
  --warn: #d29922;
  --err: #f85149;
}
* {
  box-sizing: border-box;
}
/* The UA rule for [hidden] is display:none, which ANY author display rule outranks — and .wrap sets
   display:grid, so a hidden panel would otherwise stay on screen. */
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.5 ui-sans-serif,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
}
header {
  padding: 14px 20px 0;
  border-bottom: 1px solid var(--border);
}
.topline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.env {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid;
  justify-self: start;
}
.env.staging {
  color: #58a6ff;
  border-color: #1f3b61;
  background: #0d1f33;
}
.env.uat {
  color: #e3b341;
  border-color: #4a3a12;
  background: #2a2008;
}
.env.production {
  color: #fff;
  border-color: #f85149;
  background: #a21b17;
}
.env.development {
  color: var(--muted);
  border-color: var(--border);
  background: var(--panel-2);
}
.spacer {
  flex: 1;
}
.prodwarn {
  margin: 0;
  padding: 10px 20px;
  background: #2a0f0f;
  color: #ffb3b0;
  border-bottom: 1px solid #4d2226;
  font-size: 13px;
  font-weight: 600;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.loginbox {
  width: min(360px, 100%);
  padding: 24px;
  display: grid;
  gap: 12px;
}
.wrap {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  padding: 16px 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .wrap {
    grid-template-columns: 1fr;
  }
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.controls {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
}
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
textarea {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  width: 100%;
}
input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.controls input[type="search"] {
  flex: 1 1 200px;
  width: auto;
}
label.check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
button.btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.secondary {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 500;
}
button.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.tablewrap {
  max-height: 58vh;
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th {
  position: sticky;
  top: 0;
  background: var(--panel-2);
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
th.col-check {
  width: 34px;
}
td {
  padding: 8px 10px;
  border-bottom: 1px solid #22262f;
}
tbody tr:hover {
  background: #1b1f27;
}
.muted {
  color: var(--muted);
}
.pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.pill.has {
  color: var(--ok);
  border-color: #27432c;
  background: #122017;
}
.pill.del {
  color: #ff9492;
  border-color: #4d2226;
  background: #2a1416;
  margin-left: 6px;
}
.side h2 {
  font-size: 13px;
  margin: 0;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.side .body {
  padding: 12px;
  display: grid;
  /* An auto track grows to its widest unbreakable content, so one long URL would widen every field
     past the panel and get clipped. */
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.count {
  font-size: 13px;
  color: var(--muted);
}
.count strong {
  color: var(--text);
}
.result {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, monospace;
}
.result.ok {
  background: #122017;
  color: #7ee787;
  border: 1px solid #27432c;
}
.result.err {
  background: #2a1416;
  color: #ff9492;
  border: 1px solid #4d2226;
}
.hint {
  font-size: 12px;
  color: var(--muted);
}
#imagePreview {
  max-width: 100%;
  max-height: 160px;
  border-radius: 6px;
  object-fit: contain;
  justify-self: start;
}
#linkHint {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}
.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}
