:root{
  --bg1:#071326;
  --bg2:#0c1f3f;

  --card: rgba(10, 35, 85, 0.55);
  --stroke: rgba(120,200,255,0.20);

  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.62);

  --shadow: 0 18px 55px rgba(0,0,0,0.35);
  --radius: 20px;

  --accentBg: rgba(120,200,255,0.20);
  --accentStroke: rgba(120,200,255,0.35);

  --cta: rgba(255, 140, 40, 0.95);
  --ctaStroke: rgba(255, 140, 40, 0.75);
  --ctaText: rgba(0,0,0,0.92);

  /* bright state colours */
  --on: #20c96a;   /* green */
  --off: #ff2e2e;  /* red */

  /* Match column depth by setting list viewports */
  --list-gap: 10px;
  --row-h: 58px;
  --social-visible: 8;
  --sector-visible: 8;
  --social-max: calc((var(--row-h) * var(--social-visible)) + (var(--list-gap) * (var(--social-visible) - 1)));
  --sector-max: calc((var(--row-h) * var(--sector-visible)) + (var(--list-gap) * (var(--sector-visible) - 1)));
  
    /* NEW: trim + glow (older look) */
  --trim: #42B3EB;
  --trimSoft: rgba(66,179,235,0.28);
  --trimGlow1: rgba(66,179,235,0.40);
  --trimGlow2: rgba(66,179,235,0.18);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:#000;
}

.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(1000px 700px at 50% 20%, rgba(120,200,255,0.16), transparent 55%),
    radial-gradient(900px 650px at 20% 85%, rgba(112,255,204,0.10), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}

.app{
  position:relative;
  min-height:100vh;
  padding: 16px;
  display:flex;
  flex-direction:column;
  gap: 16px;
    /* NEW BORDER */
  border: 2pt solid rgba(51,194,255,0.7);
  border-radius: 18px;
}

.bg{ position:fixed; inset:0; z-index:0; }
.app{ position:relative; z-index:1; border:2pt solid rgba(51,194,255,0.7); border-radius:18px; }

.app { border: 6px solid #33C2FF !important; }

/* Header */
.header{
  height:70px;
  display:flex;
  align-items:center;
  gap:16px;
  position:relative;
}

/* Brand larger + shifted right */
.brand{
  display:flex;
  align-items:center;
  gap:14px;
  cursor:pointer;
  user-select:none;
  margin-left: 220px;
}
.brand:focus{ outline:none; }

.brand-icon{
  width:40px;
  height:40px;
  border-radius:0;     /* square */
  box-shadow:none;     /* no glow */
  display:block;
  object-fit:contain;
}
  .brand-icon{
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

.brand-text{ display:flex; flex-direction:column; }
.brand-name{
  font-weight:950;
  letter-spacing:0.2px;
  font-size: 18px;
}

/* Header actions — centered */
.header-actions{
  flex: 1;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:center;
}

/* --- Brand row above Control Lock (lean, no card) --- */
.brand-panel{
  display:flex !important;
  flex-direction: row !important;
  align-items:center !important;
  gap:12px;

  margin: 0 0 12px 0;
  padding: 0;

  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;

  cursor:pointer;
  user-select:none;
}

/* Force square icon (defeats WP global img radius) */
.brand-panel img,
.brand-panel .brand-icon{
  width:44px;
  height:44px;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  display:block;
  object-fit: contain;
}

/* Brand text */
.brand-panel .brand-text{
  display:flex;
  flex-direction:column;
}
.brand-panel .brand-name{
  font-weight: 950;
  font-size: 16px;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

/* We don't use the subtitle anymore */
.brand-panel .brand-sub{ display:none !important; }

.right-brand{
  justify-content:center;
  text-align:center;
}
/* Center brand panel only when it's in the right column */
.col:last-child .brand-panel{
  align-self: center;
  text-align: center;
}


/* Buttons */
.btn{
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  cursor:pointer;
}
.btn:hover{ background: rgba(255,255,255,0.10); }
.btn:disabled{ opacity:0.45; cursor:not-allowed; }

.btn-primary{
  background: var(--accentBg);
  border-color: var(--accentStroke);
}
.btn-primary:hover{ background: rgba(120,200,255,0.26); }

.btn-ghost{ background: rgba(255,255,255,0.05); }

.btn-sm{
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12.5px;
}

.btn-cta{
  background: var(--cta);
  border-color: var(--ctaStroke);
  color: var(--ctaText);
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.btn-cta:hover{ background: rgba(255, 140, 40, 1); }

/* Main layout */
.main{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:16px;
  align-items:start;
  flex: 1;
}

/* Columns */
.col{
  display:flex;
  flex-direction:column;
  gap:8px;
}

/* Cards */
.card{
  background: var(--card);
  border: 1px solid rgba(66,179,235,0.18); /* trim */
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  overflow:hidden;

  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card:hover{
  transform: translateY(-1px);
  border-color: rgba(66,179,235,0.40);
  box-shadow:
    0 0 0 1px var(--trimSoft),
    0 14px 46px rgba(0,0,0,0.38),
    0 0 38px var(--trimGlow2),
    0 0 18px var(--trimGlow1);
}


.card-head{
  position: relative;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 10px 16px 10px;
  gap:10px;
}

.card-title{
  font-weight:900;
  letter-spacing:0.2px;
  display:flex;
  align-items:center;
  gap:10px;
  margin: 0 auto;
  text-align:center;
}

.card-head > .pill,
.card-head > .btn,
.card-head > .switch{
  position:absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.card-body{ padding: 0 16px 16px; }

.muted{ color: var(--muted); }

.icon-badge{
  width:28px; height:28px;
  display:grid; place-items:center;
  border-radius: 12px;
  background: rgba(120,200,255,0.10);
  border: 1px solid rgba(120,200,255,0.25);
}

/* Pill + lock colours */
.pill{
  font-size:12px;
  padding: 4px 10px;
  border-radius:999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.78);
}
.pill-locked{
  background: var(--on);
  border-color: rgba(255,255,255,0.18);
  color:#fff;
}
.pill-unlocked{
  background: var(--off);
  border-color: rgba(255,255,255,0.18);
  color:#fff;
}

/* Inputs */
.input{
  width:100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  outline:none;
}
.input:focus{
  border-color: rgba(120,200,255,0.45);
  box-shadow: 0 0 0 4px rgba(120,200,255,0.12);
}

/* Rows */
.row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.row-actions{ margin-top: 10px; }

/* Control Lock */
.lock .pin-row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.input.pin{
  width: 170px;
  text-align:center;
  letter-spacing: 0.8px;
  font-weight: 950;
}

/* System panel */
.system-panel{
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  padding: 12px 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.system-state{
  font-weight: 950;
  letter-spacing: 0.2px;
}
.system-panel.system-on{
  border-color: rgba(32,201,106,0.55);
  background: rgba(32,201,106,0.16);
}
.system-panel.system-off{
  border-color: rgba(255,46,46,0.55);
  background: rgba(255,46,46,0.12);
}

/* Radar */
.radar-row{
  display:flex;
  align-items:baseline;
  gap:10px;
}
.radar-num{
  font-size: 34px;
  font-weight: 950;
  letter-spacing: 0.5px;
}

/* Switches */
.switch{
  position:relative;
  display:inline-block;
  width: 48px; height: 28px;
  flex: 0 0 auto;
}
.switch-lg{
  width: 56px;
  height: 32px;
}
.switch input{ display:none; }

.slider{
  position:absolute; inset:0;
  border-radius:999px;
  transition: background 150ms ease, border-color 150ms ease;
  background: var(--off);
  border: 1px solid rgba(255,255,255,0.20);
}
.slider::after{
  content:"";
  position:absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius:999px;
  background: #ffffff;
  transition: transform 150ms ease;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}
.switch-lg .slider::after{
  width: 26px; height: 26px;
}
.switch input:checked + .slider{
  background: var(--on);
  border-color: rgba(255,255,255,0.20);
}
.switch input:checked + .slider::after{ transform: translateX(20px); }
.switch-lg input:checked + .slider::after{ transform: translateX(24px); }

/* Lists */
.list{
  display:flex;
  flex-direction:column;
  gap: 10px;
  padding-right: 4px;
}

/* List items */
.item{
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
  padding: 12px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.item:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.12);
}
.item-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 0;
}
.item-icon{
  width:24px; height:24px;
  border-radius: 10px;
  display:grid; place-items:center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  flex: 0 0 auto;
}
.item-text{ min-width: 0; }
.item-name{
  font-weight: 950;
  font-size: 14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.item-desc{
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height:1.25;
}

/* Social list viewport */
#socialList{
  max-height: var(--social-max);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

/* Sectors list viewport (match depth; show ~8 with scrollbar) */
#catList{
  max-height: var(--sector-max);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

/* Show all link */
.link{
  margin-top: 12px;
  background: transparent;
  border: none;
  padding: 0;
  color: rgba(120,200,255,0.92);
  font-weight: 950;
  cursor:pointer;
  text-align:left;
}
.link:hover{ text-decoration: underline; }

/* Allow/Block buttons (green/red) */
#btnAddAllow{
  background: var(--on);
  border-color: rgba(255,255,255,0.18);
  color:#fff;
}
#btnAddAllow:hover{ filter: brightness(1.05); }

#btnAddBlock{
  background: var(--off);
  border-color: rgba(255,255,255,0.18);
  color:#fff;
}
#btnAddBlock:hover{ filter: brightness(1.05); }

/* Allow/Block */
.rule-block{
  margin-top: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
  padding: 10px;
}
.rule-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom: 8px;
}
.rule-title{ font-weight: 950; }
.rule-count{ font-size: 12.5px; }
.rule-list{
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.rule-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.rule-item small{ color: var(--muted); }

/* Explainer placeholder */
.explainer{
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.035);
  padding: 12px;
}
.explainer-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 12px;
  font-weight: 950;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(120,200,255,0.14);
  border: 1px solid rgba(120,200,255,0.22);
  margin-bottom: 10px;
}
.explainer-title{
  font-weight: 950;
  letter-spacing: 0.2px;
}
.explainer-sub{
  margin-top: 4px;
  font-size: 12.5px;
}
.explainer-frame{
  margin-top: 12px;
  height: 150px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.18);
  display:flex;
  align-items:center;
  justify-content:center;
}
.explainer-frame .play{
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  font-weight: 950;
  font-size: 20px;
}

/* Activity log */
.log{
  margin-top: 12px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.logline{
  font-size: 12.5px;
  color: rgba(255,255,255,0.86);
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.log-actions{
  margin-top: 12px;
  display:flex;
  justify-content:center;
}

/* Fixed blocked sector row */
.fixed-off{
  opacity: 0.90;
}
.fixed-off .switch{
  opacity: 0.75;
  pointer-events:none;
}

/* Footer */
.footer{
  font-size: 12.5px;
  padding: 2px 4px;
}

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  z-index: 999;
}
.modal.open{ display:flex; }

.modal-panel{
  width: min(520px, 92vw);
  max-height: 82vh;
  background: rgba(10, 35, 85, 0.78);
  border: 1px solid rgba(120,200,255,0.22);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
  overflow:hidden;
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.modal-title{
  font-weight: 950;
  letter-spacing: 0.2px;
}
.modal-body{
  padding: 14px 16px 16px;
  overflow: auto;
  max-height: 70vh;
}

/* Responsive */
@media (max-width: 1200px){
  .main{ grid-template-columns: 1fr 1fr; }
  .brand{ margin-left: 0; }
  .header-actions{ justify-content:flex-start; flex-wrap:wrap; }
}
@media (max-width: 820px){
  .main{ grid-template-columns: 1fr; }
  .header{ flex-wrap:wrap; height:auto; }
  .header-actions{ width:100%; justify-content:flex-start; flex-wrap:wrap; }
  .brand{ margin-left: 0; }
}
/* ===== SafeTenet Brand Frame ===== */

.app-frame{
  max-width: 1460px;
  margin: 40px auto;
  padding: 18px;

  border-radius: 30px;

  background:
    linear-gradient(180deg,#071326,#0C1F3F);

  border: 2px solid #33C2FF;

  box-shadow:
    0 0 0 2px rgba(51,194,255,0.25),
    0 0 60px rgba(51,194,255,0.35),
    0 0 140px rgba(51,194,255,0.18),
    0 40px 120px rgba(0,0,0,0.65);
}

*{
  backface-visibility:hidden;
}

