/* BSAFE Licensing Portal (PHP) */
:root{
  /* Panels: dark blue at rest. Warm accent border only on interactive targets (see .pricing-card, .card:focus-within, etc.). */
  --bsafe-panel-border:#1e3a8a;
  --bsafe-panel-border-inner-hover:#6b6348;
}
*{margin:0;padding:0;box-sizing:border-box}
html{background:#0b0f19}
body{
font-family:'Segoe UI',system-ui,-apple-system,sans-serif;
color:#d1d5db;
min-height:100vh;
display:flex;
flex-direction:column;
/* Stacking context so the background layer (z-index:0) sits above html but below chrome (z-index:1). */
isolation:isolate
}
/* Solid body paint was covering #bsafe-bg-layer when it used z-index:-1; keep portal body transparent so the tile shows. */
body:not(.bsafe-admin-page){background:transparent}
body.bsafe-admin-page{background:#0b0f19}
#bsafe-bg-layer{position:fixed;inset:0;z-index:0;pointer-events:none;background:#0b0f19}
#bsafe-bg-layer:not(.bsafe-bg-admin){
  background:
    radial-gradient(1200px 600px at 20% -10%,rgba(0,0,0,.45),transparent 60%),
    radial-gradient(900px 500px at 90% 10%,rgba(22,163,74,.08),transparent 60%),
    url('../images/hero-bg-tile.jpg');
  /* Repeating hero tile; fixed tile width keeps high-res JPEGs from dominating the viewport. */
  background-size:auto,auto,2048px auto;
  background-position:center,center,0 0;
  background-repeat:no-repeat,no-repeat,repeat
}

nav{background:#111827;border-bottom:none;padding:.75rem 2rem;display:flex;align-items:center;gap:1.5rem;flex-wrap:wrap;min-height:52px;position:relative;z-index:1}
nav .nav-links{display:flex;align-items:center;gap:1.5rem;flex-wrap:wrap}
nav a{color:#9ca3af;text-decoration:none;font-size:.9rem;transition:color .15s;white-space:nowrap}
nav a:hover{color:#fff}
nav .brand{color:#60a5fa;font-weight:700;font-size:1.1rem;margin-right:auto;display:flex;align-items:center;text-decoration:none;flex-shrink:0}
nav .brand img{height:36px;width:auto;max-width:180px;object-fit:contain;display:block}
nav .nav-active{color:#fff;font-weight:600}
nav .nav-user{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav-toggle{display:none;background:transparent;border:0;cursor:pointer;padding:.5rem;flex-direction:column;gap:5px;align-items:center;justify-content:center;color:#9ca3af}
.nav-toggle-bar{display:block;width:22px;height:2px;background:currentColor;border-radius:1px}
.nav-mobile-backdrop{display:none}

/* Staging gate (gate_page.php): in-flow sections must stack above #bsafe-bg-layer (z-index:0). */
body.gate-page{display:block;min-height:100vh}
body.gate-page > nav,
body.gate-page > .hero,
body.gate-page > #gate-form{position:relative;z-index:1}
body.gate-page #gate-form .card h3{color:#e5e7eb}
body.gate-page #gate-form label{color:#9ca3af}
body.gate-page #gate-form input:not([type="checkbox"]){background:#1f2937;color:#e5e7eb;border:1px solid #374151}
/* Staging gate: hero and form scale on narrow viewports; headline stays secondary to the logo */
body.gate-page .hero.gate-hero{
  min-height:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  padding:clamp(1rem,4vh,2rem) max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left));
  text-align:center
}
@media(min-width:769px){
  body.gate-page .hero.gate-hero{min-height:52vh;padding:2.5rem 1.5rem 3rem}
}
body.gate-page .gate-hero .hero-banner{
  margin-bottom:clamp(1rem,3vh,1.75rem);
  max-width:min(280px,78vw);
  height:auto
}
body.gate-page .gate-hero-copy{
  background:transparent!important;
  border:none!important;
  box-shadow:none!important;
  padding:clamp(.5rem,2vw,.75rem) 1rem 1rem!important;
  max-width:min(34rem,calc(100vw - 2rem))!important
}
body.gate-page .gate-cs-headline{
  font-size:clamp(1.35rem,5.2vw,2.35rem);
  font-weight:700;
  color:#f9fafb;
  letter-spacing:.02em;
  margin-bottom:.5rem;
  line-height:1.2;
  text-shadow:0 0 28px rgba(96,165,250,.18)
}
body.gate-page .gate-cs-tagline{
  color:#9ca3af;
  font-size:clamp(.9rem,3.2vw,1.05rem);
  max-width:min(28rem,calc(100vw - 2rem));
  margin:0 auto 1.25rem;
  line-height:1.55;
  padding:0 .25rem
}
body.gate-page .gate-cs-badge{
  display:inline-block;
  padding:.35rem .85rem;
  background:rgba(37,99,235,.2);
  border:1px solid rgba(59,130,246,.4);
  border-radius:9999px;
  color:#93c5fd;
  font-size:clamp(.72rem,2.5vw,.85rem);
  font-weight:600;
  letter-spacing:.05em;
  text-transform:uppercase;
  margin-top:.5rem;
  animation:gate-cs-glow 2.5s ease-in-out infinite
}
@keyframes gate-cs-glow{0%,100%{box-shadow:0 0 12px rgba(59,130,246,.15)}50%{box-shadow:0 0 22px rgba(59,130,246,.22)}}
body.gate-page #gate-form.wrap{
  padding-top:clamp(1rem,3vh,2rem);
  padding-bottom:clamp(2rem,5vh,3.5rem);
  padding-left:max(1rem, env(safe-area-inset-left));
  padding-right:max(1rem, env(safe-area-inset-right))
}
body.gate-page .gate-form-card{
  width:100%;
  max-width:min(360px,calc(100vw - 2rem));
  margin-left:auto;
  margin-right:auto;
  box-sizing:border-box;
  padding:clamp(1.1rem,3.5vw,1.5rem)
}
body.gate-page footer{
  text-align:center;
  padding:1rem max(.75rem, env(safe-area-inset-left)) 1.25rem max(.75rem, env(safe-area-inset-right));
  line-height:1.5;
  font-size:clamp(.72rem,2.8vw,.8rem);
  word-wrap:break-word
}

body.maint-page > main{position:relative;z-index:1}

.wrap{max-width:720px;margin:0 auto;padding:2rem 1.5rem}
.wrap-wide{max-width:960px;margin:0 auto;padding:2rem 1.5rem}

/* Auth flows: narrow centered column (similar density to BSAFE Manager login) */
.wrap.wrap-auth-narrow {
  max-width: min(400px, calc(100vw - 2rem));
  padding-top: clamp(1.25rem, 5vh, 2.75rem);
  padding-bottom: 2.5rem;
}
.wrap.wrap-auth-narrow > .portal-page-header {
  margin-bottom: 1.35rem;
}
.wrap.wrap-auth-narrow > .portal-page-header h1 {
  text-align: center;
  font-size: clamp(1.4rem, 4vw, 1.7rem);
  font-weight: 600;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}
.wrap.wrap-auth-narrow > .portal-page-header .subtitle {
  text-align: center;
  margin-top: 0;
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}
.wrap.wrap-auth-narrow .card {
  padding: clamp(1.2rem, 4vw, 1.65rem) clamp(1.1rem, 3.5vw, 1.5rem);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
  border-color: var(--bsafe-panel-border);
  background: linear-gradient(165deg, #151c2e 0%, #111827 48%, #111827 100%);
}
.wrap.wrap-auth-narrow .card h3 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  border-bottom: none;
  margin-bottom: 1rem;
  padding-bottom: 0;
}
.wrap.wrap-auth-narrow label:not(.agreement-label) {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin-bottom: 0.35rem;
}
.wrap.wrap-auth-narrow .agreement-label {
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: #d1d5db;
  margin-top: 0.65rem;
}
.wrap.wrap-auth-narrow input:not([type="checkbox"]),
.wrap.wrap-auth-narrow select,
.wrap.wrap-auth-narrow textarea {
  width: 100%;
  box-sizing: border-box;
}
.wrap.wrap-auth-narrow .pw-wrap {
  width: 100%;
  margin-bottom: 0.5rem;
}
.wrap.wrap-auth-narrow .card > button:not(.btn-outline):not(.btn-sm):not(.btn-oauth),
.wrap.wrap-auth-narrow .card .btn-green {
  width: 100%;
  margin-top: 0.5rem;
  min-height: 44px;
  font-weight: 600;
}
.wrap.wrap-auth-narrow #login-card > button#loginBtn {
  width: 100%;
  margin-top: 0.5rem;
  min-height: 44px;
}
.wrap.wrap-auth-narrow > .mt-2.text-muted,
.wrap.wrap-auth-narrow > p.mt-2,
.wrap.wrap-auth-narrow .login-auth-footer-wrap > .mt-2.text-muted {
  text-align: center;
  margin-top: 1.25rem !important;
  font-size: 0.88rem;
  line-height: 1.5;
}
/* Collapsed until “Sign in with BSAFE” (JS removes these classes; avoids [hidden] quirks) */
.login-email-reveal-collapsed,
.login-auth-footer-collapsed {
  display: none !important;
}
.wrap.wrap-auth-narrow #msg-slot {
  margin-top: 0.75rem;
}
.wrap.wrap-auth-narrow #msg-slot:empty {
  margin-top: 0;
}

/* Support: optional attachment (dark theme) */
.support-file-input {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0.45rem 0.5rem;
  margin-bottom: 0.25rem;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.4rem;
  color: #d1d5db;
  font-size: 0.88rem;
  box-sizing: border-box;
}
.support-file-input::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid #475569;
  border-radius: 0.35rem;
  background: #374151;
  color: #e5e7eb;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
}
.support-file-input::file-selector-button:hover {
  background: #4b5563;
}
.support-file-input::-webkit-file-upload-button {
  margin-right: 0.75rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid #475569;
  border-radius: 0.35rem;
  background: #374151;
  color: #e5e7eb;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
}

/* Federated login: Google / Microsoft brand-style rows + BSAFE */
.login-oauth-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}
.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  margin: 0;
  font-family: inherit;
  line-height: 1.2;
}
.btn-oauth:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.btn-oauth-icon {
  flex-shrink: 0;
  display: block;
}
.btn-oauth-icon-img {
  border-radius: 0.2rem;
  object-fit: contain;
}
/* Google / Microsoft: dark theme to match BSAFE row and portal card */
.btn-oauth-google {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  border-color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.btn-oauth-google:hover {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
  text-decoration: none;
}
.btn-oauth-microsoft {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  border-color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.btn-oauth-microsoft:hover {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
  text-decoration: none;
}
.btn-oauth-facebook {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  border-color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.btn-oauth-facebook:hover {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
  text-decoration: none;
}
/* BSAFE: matches portal dark card */
.btn-oauth-bsafe {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  border-color: #334155;
}
.btn-oauth-bsafe:hover {
  background: #1e293b;
  border-color: #475569;
}
.login-oauth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1rem 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}
.login-oauth-divider::before,
.login-oauth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #334155;
}
.login-oauth-divider span {
  padding: 0 0.75rem;
}
.login-bsafe-only-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.login-bsafe-only-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-align: left;
}
.login-bsafe-brand {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e5e7eb;
  letter-spacing: 0.02em;
}
.login-bsafe-sub {
  font-size: 0.78rem;
  font-weight: 400;
  color: #64748b;
  line-height: 1.3;
}
.login-bsafe-mark {
  border-radius: 0.25rem;
  flex-shrink: 0;
}

h1{font-size:1.5rem;color:#f9fafb;margin-bottom:.25rem}
h2{font-size:1.25rem;color:#e5e7eb;margin-bottom:.5rem}
.subtitle{color:#6b7280;margin-bottom:1.5rem;font-size:.9rem}
a{color:#60a5fa;text-decoration:none}
a:hover{text-decoration:underline}

.card{background:#111827;border:1px solid var(--bsafe-panel-border);border-radius:.75rem;padding:1.25rem;margin-bottom:1rem;transition:border-color .2s ease}
.card:focus-within{border-color:var(--bsafe-panel-border-inner-hover)}
.card h3{font-size:1rem;color:#e5e7eb;margin-bottom:.75rem;padding-bottom:.5rem;border-bottom:1px solid #1f2937}

label{display:block;font-size:.85rem;color:#9ca3af;margin-bottom:.2rem;margin-top:.5rem}
input,select,textarea{display:block;width:100%;padding:.55rem .75rem;background:#1f2937;border:1px solid #374151;border-radius:.4rem;color:#e5e7eb;font-size:.9rem;margin-bottom:.25rem;outline:none;transition:border-color .15s}
input[type="checkbox"]{display:inline-block;width:auto;margin-right:.5rem;vertical-align:middle;flex-shrink:0}
.agreement-label{display:flex;align-items:flex-start;gap:.5rem;margin-top:.75rem;cursor:pointer}
.agreement-label span{flex:1;text-align:left}
input:focus,select:focus,textarea:focus{border-color:#2563eb}

/* Password visibility toggle */
.pw-wrap{position:relative;display:flex;align-items:center;width:100%;margin-bottom:.25rem}
.pw-wrap input{flex:1;padding-right:2.75rem;box-sizing:border-box;margin-bottom:0}
.pw-toggle-btn{position:absolute;right:.5rem;top:0;bottom:0;margin:auto 0;background:transparent;border:0;cursor:pointer;padding:.35rem;color:#9ca3af;border-radius:.25rem;display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;box-sizing:border-box}
.pw-toggle-btn:hover{color:#e5e7eb}
.pw-toggle-btn:focus{outline:2px solid #2563eb;outline-offset:-2px}
.pw-toggle-btn svg{width:18px;height:18px;display:block;flex-shrink:0;vertical-align:middle}
.pw-toggle-btn .pw-icon-off{display:none}
.pw-wrap.pw-visible .pw-toggle-btn .pw-icon-on{display:none}
.pw-wrap.pw-visible .pw-toggle-btn .pw-icon-off{display:block}
input::placeholder,textarea::placeholder{color:#6b7580;opacity:1}
input:-webkit-autofill{-webkit-text-fill-color:#e5e7eb;-webkit-box-shadow:0 0 0 30px #1f2937 inset}

button,.btn{display:inline-block;padding:.6rem 1.25rem;background:#2563eb;color:#fff;border:0;border-radius:.4rem;font-size:.9rem;cursor:pointer;text-decoration:none;transition:background .15s;margin-top:.5rem;margin-right:.25rem}
button:hover,.btn:hover{background:#1d4ed8;text-decoration:none}
.btn-green{background:#16a34a}.btn-green:hover{background:#15803d}
.btn-purple{background:#7c3aed}.btn-purple:hover{background:#6d28d9}
.btn-red{background:#dc2626}.btn-red:hover{background:#b91c1c}
.btn-outline{background:transparent;border:1px solid #374151;color:#d1d5db}.btn-outline:hover{background:#1f2937}
.btn-lg{padding:.85rem 2rem;font-size:1.05rem;border-radius:.5rem}

.msg{padding:.75rem;border-radius:.4rem;margin-bottom:.75rem;font-size:.9rem}
.msg-info{background:#1e3a5f;border:1px solid #2563eb;color:#93c5fd}
.msg-error{background:#450a0a;border:1px solid #dc2626;color:#fca5a5}
.msg-success{background:#052e16;border:1px solid #16a34a;color:#86efac}

/* Fixed toast: always visible where user is looking (no scroll) */
.bsafe-toast-container{position:fixed;top:1rem;left:50%;transform:translateX(-50%);z-index:10002;max-width:min(90vw,28rem);pointer-events:none}
.bsafe-toast-container .bsafe-toast{pointer-events:auto;padding:.75rem 1.25rem;border-radius:.5rem;font-size:.95rem;font-weight:500;box-shadow:0 4px 20px rgba(0,0,0,.4);cursor:pointer;animation:bsafe-toast-in .25s ease;margin-bottom:0}
.bsafe-toast-container .bsafe-toast-out{animation:bsafe-toast-out .3s ease forwards}
.bsafe-toast-success{background:#052e16;border:1px solid #16a34a;color:#86efac}
.bsafe-toast-error{background:#450a0a;border:1px solid #dc2626;color:#fca5a5}
.bsafe-toast-info{background:#1e3a5f;border:1px solid #2563eb;color:#93c5fd}
.bsafe-toast-warning{background:#422006;border:1px solid #f59e0b;color:#fcd34d}
@keyframes bsafe-toast-in{from{opacity:0;transform:translateY(-.5rem)}to{opacity:1;transform:translateY(0)}}
@keyframes bsafe-toast-out{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-.5rem)}}
.msg-loading{background:#1f2937;border:1px solid #374151;color:#9ca3af;text-align:center}
.msg-loading .spinner{display:inline-block;width:22px;height:22px;border:2px solid #374151;border-top-color:#60a5fa;border-radius:50%;animation:msg-spin .7s linear infinite;vertical-align:middle;margin-right:.5rem}
@keyframes msg-spin{to{transform:rotate(360deg)}}

table{width:100%;border-collapse:collapse;font-size:.85rem;color:#d1d5db}
table th{text-align:left;color:#6b7280;padding:.4rem .5rem;border-bottom:1px solid #1f2937;font-weight:600}
table td{padding:.4rem .5rem;border-bottom:1px solid #1f2937}
table tr:hover td{background:#1f2937}
.activity-table{font-size:.82rem}
.activity-table td{vertical-align:middle}
.activity-badge{display:inline-block;padding:.15rem .4rem;border-radius:.25rem;font-size:.75rem;font-weight:600}
.activity-badge-attack{background:#450a0a;color:#fca5a5;border:1px solid #dc2626}
.activity-badge-error{background:#422006;color:#fcd34d;border:1px solid #f59e0b}
.activity-badge-download{background:#052e16;color:#86efac;border:1px solid #16a34a}
.activity-summary-card:hover:not(.active),
.activity-summary-card:focus-within:not(.active){border-color:var(--bsafe-panel-border-inner-hover);background:#374151}
.activity-summary-card.active{border-color:#525252;background:#262626;color:#e5e5e5}
.activity-summary-card.activity-summary-attack.active{border-color:#dc2626;background:#450a0a}
.activity-summary-card.activity-summary-error.active{border-color:#f59e0b;background:#422006}
.activity-summary-card.activity-summary-download.active{border-color:#16a34a;background:#052e16}
.activity-detail-cell{font-size:.8rem;max-width:220px;word-break:break-word}
.btn-sm{padding:.25rem .5rem;font-size:.8rem;margin:0}
.logs-card-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin-bottom:.75rem}
.logs-card-actions .btn{margin:0}
.logs-log-box{background:#0f172a;border:1px solid #1e293b;border-radius:.4rem;padding:1rem;overflow:auto;font-size:.8rem;color:#94a3b8;max-height:400px;min-height:120px}
.analytics-grid{display:grid;grid-template-columns:1fr 340px;gap:1.5rem;align-items:start}
@media(max-width:900px){.analytics-grid{grid-template-columns:1fr}}
.analytics-section{display:flex;flex-direction:column;gap:1rem;min-width:0}
.analytics-section .card{margin-bottom:0;flex-shrink:0}
.analytics-range{display:flex;gap:.35rem;margin-bottom:1rem}
.analytics-range-btn{padding:.3rem .6rem;font-size:.8rem;border-radius:.25rem}
.analytics-range-btn.active{background:#2563eb;border-color:#2563eb;color:#fff}
.analytics-chart{min-height:200px;font-size:.8rem}
.analytics-chart-bars{display:flex;flex-direction:column;gap:.35rem}
.analytics-chart-row{display:flex;align-items:center;gap:.75rem}
.analytics-chart-label{width:5.5rem;flex-shrink:0;color:#9ca3af}
.analytics-chart-bar-wrap{flex:1;display:flex;min-width:0;height:1.25rem;border-radius:.25rem;overflow:hidden;background:#1f2937}
.analytics-bar{display:block;height:100%;min-width:2px}
.analytics-bar-requests{background:#2563eb}
.analytics-bar-attacks{background:#dc2626}
.analytics-bar-downloads{background:#16a34a}
.analytics-bar-errors{background:#f59e0b}
.analytics-chart-value{width:3rem;text-align:right;color:#6b7280;font-size:.75rem}
.analytics-legend{display:flex;flex-wrap:wrap;gap:1rem;margin-top:.75rem;font-size:.75rem;color:#9ca3af}
.analytics-legend-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:.25rem;vertical-align:middle}
.analytics-summary-grid{display:flex;flex-wrap:wrap;gap:.75rem;align-items:stretch}
.analytics-summary-grid .activity-summary-card{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:4.5rem;padding:.75rem 1rem;background:#1f2937;border:1px solid var(--bsafe-panel-border);border-radius:.5rem;cursor:pointer;text-decoration:none;color:#d1d5db;font-size:.85rem;transition:border-color .15s,background .15s}
.analytics-summary-grid .activity-summary-card:hover:not(.active),
.analytics-summary-grid .activity-summary-card:focus-within:not(.active){border-color:var(--bsafe-panel-border-inner-hover);background:#374151}
.analytics-summary-grid .activity-summary-card.active{border-color:#525252;background:#262626;color:#e5e5e5}
.analytics-summary-grid .activity-summary-attack .analytics-num{color:#fca5a5}
.analytics-summary-grid .activity-summary-attack.active{border-color:#dc2626;background:#450a0a}
.analytics-summary-grid .activity-summary-error .analytics-num{color:#fcd34d}
.analytics-summary-grid .activity-summary-error.active{border-color:#f59e0b;background:#422006}
.analytics-summary-grid .activity-summary-download .analytics-num{color:#86efac}
.analytics-summary-grid .activity-summary-download.active{border-color:#16a34a;background:#052e16}
.analytics-num{font-size:1.25rem;font-weight:600;color:#e5e7eb}
.analytics-err .analytics-num{color:#fca5a5}
.analytics-warn .analytics-num{color:#fcd34d}
.analytics-error-list{font-size:.82rem;max-height:220px;overflow-y:auto;min-height:3rem}
.analytics-error-section ul{margin:.25rem 0 0 1rem;padding:0}
.analytics-error-ul{list-style:disc}
.analytics-error-ul li{margin:.35rem 0;word-break:break-all}

.pricing-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1.25rem;margin:1.5rem 0;align-items:stretch}
@media(max-width:900px){.pricing-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.pricing-grid{grid-template-columns:1fr}}
.pricing-card{display:flex;flex-direction:column;background:#111827;border:1px solid var(--bsafe-panel-border);border-radius:.75rem;padding:1.5rem;text-align:left;transition:border-color .2s ease;cursor:pointer}
.pricing-card:hover,
.pricing-card:focus-within{border-color:var(--bsafe-panel-border-inner-hover)}
.pricing-card.featured{box-shadow:0 0 0 1px rgba(255,255,255,.07),0 12px 32px rgba(0,0,0,.4)}
.pricing-card h3{font-size:1.15rem;color:#f9fafb;margin-bottom:.25rem;padding:0;border:0}
.pricing-card-seats{font-size:.9rem;color:#9ca3af;font-weight:500;margin:0 0 .75rem;padding:0}
.pricing-card .price{font-size:2rem;font-weight:700;color:#e5e7eb;margin:.75rem 0 .25rem;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:flex-start;gap:.25rem .5rem}
.pricing-card .price span{font-size:.9rem;font-weight:400;color:#6b7280}
.pricing-card .price .price-option{font-size:2rem;font-weight:700;color:#e5e7eb}
.pricing-card .price .price-option span{font-size:.9rem;font-weight:400;color:#6b7280}
.pricing-card .price{margin-bottom:1rem}
.pricing-card .desc{margin-top:1.5rem}
.pricing-card .price.price-dual{display:flex;flex-direction:row;flex-wrap:wrap;align-items:flex-start;justify-content:flex-start;gap:1rem}
.pricing-card .price.price-dual .price-option{display:flex;flex-direction:column;align-items:flex-start;gap:.15rem}
.pricing-card .price.price-dual .price-option .price-amount{font-size:2rem;font-weight:700;color:#e5e7eb}
.pricing-card .price.price-dual .price-option .price-desc{font-size:.85rem;font-weight:400;color:#6b7280;text-align:left}
.pricing-card .price.price-dual .price-or{font-size:.85rem;color:#6b7280;flex-shrink:0;align-self:center}
.pricing-card .desc{color:#9ca3af;font-size:.85rem;margin-bottom:1rem}
.pricing-card-faq-link{display:inline-block;color:#a3a3a3;font-size:.85rem;margin-bottom:1rem;position:relative;z-index:2;text-decoration:underline;cursor:pointer}
.pricing-card-faq-link:hover{color:#d4d4d4}
.pricing-card ul{list-style:none;text-align:left;margin:0 0 1.25rem;padding:0}
.pricing-card .btn{margin-top:auto;align-self:flex-start}
.pricing-card ul li{padding:.35rem 0;color:#d1d5db;font-size:.88rem}
.pricing-card ul li::before{content:'\2713';color:#16a34a;font-weight:700;margin-right:.5rem}
.pricing-card ul li.disabled{color:#4b5563}
.pricing-card ul li.disabled::before{content:'\2717';color:#6b7280}
.pricing-card.featured .btn{background:#16a34a}.pricing-card.featured .btn:hover{background:#15803d}

.hero{text-align:center;padding:2.75rem 1.5rem 2.5rem;border-bottom:1px solid #1f2937;position:relative;overflow:visible}
/* Home: headline above, large banner center, copy then a smaller panel (bullets + CTAs only) */
.hero--home{display:flex;flex-direction:column;align-items:center;padding:1.75rem 1rem 2.5rem;text-align:center}
.hero-above{width:100%;max-width:42rem;margin:0 auto .65rem;padding:0 .5rem}
/* Pull-quote style tagline: supports the logo instead of competing with it (beats .hero h1) */
.hero--home .hero-above h1.hero-tagline--quote{
  margin:0 auto;
  font-size:clamp(.92rem,2.6vw,1.08rem);
  font-weight:500;
  font-style:italic;
  line-height:1.35;
  letter-spacing:.03em;
  color:#94a3b8;
  max-width:22rem;
  border:0;
  padding:0
}
.hero--home .hero-above h1.hero-tagline--quote::before{content:'\201C';opacity:.65;margin-right:.06em}
.hero--home .hero-above h1.hero-tagline--quote::after{content:'\201D';opacity:.65;margin-left:.06em}
.hero--home .hero-banner{display:block;width:auto;height:auto;max-width:min(92vw,720px);max-height:min(42vw,220px);margin:0 auto 1.5rem;object-fit:contain;box-sizing:border-box}
@media(min-width:480px){
  .hero--home .hero-banner{max-width:min(90vw,820px);max-height:min(36vw,260px);margin-bottom:1.65rem}
}
@media(min-width:768px){
  .hero--home{padding-top:2rem;padding-bottom:3rem}
  .hero--home .hero-banner{max-width:min(88vw,900px);max-height:min(32vw,280px)}
}
@media(min-width:1100px){
  .hero--home .hero-banner{max-height:300px}
}
.hero-below{width:100%;max-width:40rem;margin:0 auto;padding:0 .5rem}
.hero-below .lead{color:#9ca3af;font-size:1.02rem;line-height:1.55;margin:0 auto 1.25rem;text-align:center;max-width:36rem}
.hero-below-panel{width:100%;max-width:28rem;margin:0 auto;padding:1.15rem 1.25rem 1.25rem;background:rgba(11,19,36,.92);border:1px solid var(--bsafe-panel-border);border-radius:.65rem;box-shadow:0 10px 36px rgba(0,0,0,.42),inset 0 0 0 1px rgba(255,255,255,.04);transition:border-color .2s ease;text-align:left}
.hero-below-panel:focus-within{border-color:var(--bsafe-panel-border-inner-hover)}
.hero-inner{max-width:34rem;margin:0 auto;padding:1.75rem 1.75rem;background:rgba(11,19,36,.92);border:1px solid var(--bsafe-panel-border);border-radius:.5rem;box-shadow:0 16px 48px rgba(0,0,0,.45),inset 0 0 0 1px rgba(255,255,255,.04)}
.hero h1{font-size:1.95rem;margin-bottom:.65rem;line-height:1.22}
.hero .lead{color:#9ca3af;font-size:1.02rem;max-width:36rem;margin:0 auto 1.1rem;line-height:1.55}
.hero-value-list{list-style:none;text-align:left;max-width:24rem;margin:0 auto 1.35rem;padding:0;font-size:.88rem;color:#d1d5db;line-height:1.5}
.hero-below-panel .hero-value-list{margin:0 0 1rem;max-width:none}
.hero-value-list li{position:relative;padding-left:1.35rem;margin-bottom:.4rem}
.hero-value-list li::before{content:'';position:absolute;left:0;top:.45rem;width:.45rem;height:.45rem;border-radius:2px;background:linear-gradient(135deg,#22c55e,#16a34a)}
.hero-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.5rem .75rem}
.hero-below-panel .hero-actions{margin-top:.15rem}
.hero .hero-btn-secondary{margin-left:0}
.features-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem;margin:2rem 0}
.feature-card{background:#111827;border:1px solid var(--bsafe-panel-border);border-radius:.75rem;padding:1.25rem}
.feature-card h3{font-size:1rem;color:#e5e7eb;margin-bottom:.4rem;border:0;padding:0}
.feature-card p{color:#9ca3af;font-size:.88rem;line-height:1.5}

pre{background:#0f172a;border:1px solid #1e293b;border-radius:.4rem;padding:1rem;overflow:auto;font-size:.8rem;color:#94a3b8;margin-top:.75rem;max-height:400px}
code{font-family:'Cascadia Code',Consolas,monospace;font-size:.85em;background:#1f2937;padding:.15rem .35rem;border-radius:.25rem}

.row{display:flex;gap:.75rem;flex-wrap:wrap}.row>*{flex:1;min-width:200px}
.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -.5rem}
.table-scroll table{min-width:500px}

/* License user pills */
.lic-user-pills{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:1rem;padding-bottom:.75rem;border-bottom:1px solid #374151}
.lic-user-pill{background:#1f2937;color:#9ca3af;border:1px solid #374151;border-radius:2rem;padding:.3rem .85rem;font-size:.8rem;cursor:pointer;white-space:nowrap;transition:all .15s}
.lic-user-pill:hover{border-color:#6b7280;color:#d1d5db}
.lic-user-pill-active{background:#2563eb;color:#fff;border-color:#2563eb}
.lic-user-pill-active:hover{background:#1d4ed8;border-color:#1d4ed8;color:#fff}

/* License cards */
.lic-card{background:#1f2937;border:1px solid var(--bsafe-panel-border);border-radius:.5rem;padding:1rem;margin-bottom:.75rem;transition:border-color .2s ease}
.lic-card:focus-within{border-color:var(--bsafe-panel-border-inner-hover)}
.lic-card-header{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-bottom:.5rem}
.lic-card-badge{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;padding:.15rem .5rem;border-radius:2rem}
.lic-badge-used{background:rgba(34,197,94,.15);color:#4ade80}
.lic-badge-unused{background:rgba(156,163,175,.12);color:#9ca3af}
.lic-badge-revoked{background:rgba(239,68,68,.15);color:#fca5a5}
.lic-card-seats{font-size:.8rem;color:#9ca3af}
.lic-card-plan{font-size:.8rem;color:#9ca3af;margin-left:auto}
.lic-card-key{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-bottom:.6rem}
.lic-card-key code{font-size:.82rem;word-break:break-all;background:#111827;padding:.3rem .5rem;border-radius:.25rem;flex:1;min-width:0}
.lic-card-meta{display:flex;flex-wrap:wrap;gap:.25rem .75rem;font-size:.8rem;color:#9ca3af;margin-bottom:.6rem}
.lic-meta-label{color:#6b7280;margin-right:.2rem}
.lic-card-actions{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;padding-top:.5rem;border-top:1px solid #374151}
.lic-card-actions .lic-seats-form{display:inline-flex;align-items:center;gap:.3rem}
.lic-card-actions .lic-seats-input{width:3.5rem;padding:.2rem .3rem;font-size:.82rem}
.lic-card-actions .lic-seats-form .btn{margin:0}
.lic-btn-delete{color:#fca5a5!important;border-color:#dc2626!important}
.lic-btn-delete:hover{background:rgba(239,68,68,.1)!important}
@media(max-width:480px){
  .lic-card-plan{margin-left:0}
  .lic-card-meta{flex-direction:column;gap:.15rem}
  .lic-card-actions{flex-direction:column;align-items:flex-start;gap:.4rem}
}
.required{color:#ef4444}
.hidden{display:none}
/* Main content hidden until JS runs to avoid flash of wrong state (e.g. error bar on login) */
#app-main{opacity:0;transition:opacity .12s ease-out;position:relative;z-index:1}
#app-main.app-ready{opacity:1}
/* Kill default focus paint on <main> (Windows often shows a light horizontal line). Only show our ring for real keyboard focus (e.g. skip link). */
#app-main:focus{outline:none;box-shadow:none}
#app-main:focus-visible{outline:2px solid #60a5fa;outline-offset:2px;box-shadow:none}
.text-muted{color:#6b7280;font-size:.85rem}
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}
.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}
.mono{font-family:Consolas,monospace;font-size:.9rem;word-break:break-all}

#app-main{flex:1;padding-bottom:4.5rem}
footer{position:fixed;bottom:0;left:0;right:0;border-top:1px solid #1f2937;padding:1.5rem 2rem;text-align:center;color:#4b5563;font-size:.8rem;background:#0b0f19;z-index:101}
footer a{color:#6b7280}

/* Admin page section navigation */
.admin-tabs{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1.25rem;padding:.5rem 0;border-bottom:1px solid #1f2937}
.admin-tabs a{color:#9ca3af;text-decoration:none;font-size:.9rem;padding:.45rem .85rem;border-radius:.35rem;transition:color .15s,background .15s;white-space:nowrap}
.admin-tabs a:hover{color:#fff;background:#1f2937;text-decoration:none}
.admin-tabs a.admin-tab-active{color:#60a5fa;background:#1e3a5f;text-decoration:none}
.admin-sub-tabs{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:1rem;padding:.4rem 0;border-bottom:1px solid #374151}
.admin-sub-tabs a{color:#9ca3af;text-decoration:none;font-size:.85rem;padding:.35rem .7rem;border-radius:.3rem;transition:color .15s,background .15s;white-space:nowrap}
.admin-sub-tabs a:hover{color:#fff;background:#1f2937;text-decoration:none}
.admin-sub-tabs a.admin-tab-active{color:#60a5fa;background:#1e3a5f;text-decoration:none}
@media(max-width:768px){.admin-tabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin;padding-bottom:.25rem;margin-left:-.5rem;margin-right:-.5rem;padding-left:.5rem;padding-right:.5rem}.admin-tabs::-webkit-scrollbar{height:4px}.admin-tabs a{flex-shrink:0}.admin-sub-tabs{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}.admin-sub-tabs a{flex-shrink:0}}
@media(max-width:640px){.admin-tabs{gap:.35rem}.admin-tabs a{padding:.4rem .6rem;font-size:.85rem}.admin-sub-tabs a{padding:.3rem .55rem;font-size:.8rem}}

/* Account page: same tab chrome as Admin; one panel visible at a time */
.account-tabs{margin-bottom:1.15rem}
.account-tab-panel{margin-bottom:1.25rem}
.account-tab-panel > .card + .card{margin-top:1rem}

.wrap-wide.docs-page-wide{max-width:1080px}
.docs-list{margin:.75rem 0 0 1.5rem;color:#d1d5db;line-height:1.8}
.docs-lead{color:#9ca3af;font-size:.95rem;line-height:1.65;margin:.5rem 0 1rem}
.docs-figure{margin:1.35rem 0;display:flex;flex-direction:column;height:100%}
.docs-figure-link{display:block;text-decoration:none}
.docs-figure-link:hover{text-decoration:none}
.docs-figure-frame{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:16/9;overflow:hidden;background:#0f172a;border:1px solid #374151;border-radius:.5rem;box-shadow:0 10px 40px rgba(0,0,0,.4);transition:border-color .15s ease,transform .15s ease,box-shadow .15s ease}
.docs-figure-link:hover .docs-figure-frame,.docs-figure-link:focus-visible .docs-figure-frame{border-color:#60a5fa;transform:translateY(-1px);box-shadow:0 14px 44px rgba(0,0,0,.48)}
.docs-figure-link:focus-visible{outline:none}
.docs-figure img{display:block;max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain}
.docs-figure figcaption{margin-top:.55rem;font-size:.85rem;color:#9ca3af;line-height:1.5}
.docs-figure-grid{display:grid;grid-template-columns:1fr 1fr;gap:1.1rem;margin:1.35rem 0;align-items:stretch}
@media(max-width:800px){.docs-figure-grid{grid-template-columns:1fr}}
.docs-hero-strip{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:1.1rem;margin:1.35rem 0;align-items:stretch}
.docs-section-label{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:#6b7280;font-weight:600;margin:1.5rem 0 .35rem}
.docs-section-label:first-child{margin-top:.25rem}
.docs-lightbox-open{overflow:hidden}
.docs-lightbox{position:fixed;inset:0;z-index:10020;background:rgba(7,10,17,.92);display:flex;align-items:center;justify-content:center;padding:2rem}
.docs-lightbox[hidden]{display:none}
.docs-lightbox img{max-width:min(96vw,1600px);max-height:90vh;width:auto;height:auto;border:1px solid #374151;border-radius:.65rem;box-shadow:0 24px 64px rgba(0,0,0,.65);background:#0f172a}
.docs-lightbox-close{position:absolute;top:1rem;right:1rem;margin:0;padding:.55rem .9rem;background:#111827;border:1px solid #374151;border-radius:.45rem;color:#e5e7eb;font-size:.9rem;cursor:pointer}
.docs-lightbox-close:hover{background:#1f2937}
.docs-sidebar{width:220px;flex-shrink:0}
.docs-sidebar a{display:block;padding:.4rem .75rem;color:#9ca3af;border-radius:.35rem;font-size:.88rem;margin-bottom:.15rem}
.docs-sidebar a:hover{background:#1f2937;color:#e5e7eb;text-decoration:none}
.docs-sidebar a.active{background:#1e3a5f;color:#93c5fd}
.docs-content{flex:1;min-width:0}
.docs-layout{display:flex;gap:2rem;align-items:flex-start}

/* Shared page title panel (all portal pages except landing hero) */
.portal-page-header{
  background:linear-gradient(165deg,#141b2e 0%,#111827 45%,#111827 100%);
  border:1px solid var(--bsafe-panel-border);
  border-radius:.75rem;
  box-shadow:0 8px 36px rgba(0,0,0,.28);
  margin-bottom:1.25rem;
  padding:1.35rem 1.5rem 1.4rem
}
.portal-page-header--center{text-align:center}
.portal-page-header--center .subtitle{margin-left:auto;margin-right:auto}
.portal-page-header h1{font-size:clamp(1.35rem,3.2vw,1.85rem);font-weight:600;letter-spacing:-.02em;margin-bottom:.35rem}
.portal-page-header .subtitle{margin-bottom:.35rem;color:#9ca3af}
.portal-page-header .docs-lead{margin-bottom:0;margin-top:.55rem;max-width:48rem}
.portal-page-header .subtitle + p{margin-top:.55rem}
.portal-page-header .text-muted:last-child{margin-bottom:0}
.wrap-wide.docs-page-wide .admin-tabs{margin-bottom:1.5rem;margin-left:0;margin-right:0;padding:.55rem 1.5rem;border-bottom:1px solid #243244;gap:.45rem}
.wrap.wrap-wide:not(.docs-page-wide) > .admin-tabs{margin-left:0;margin-right:0;padding-left:1.5rem;padding-right:1.5rem}
.wrap.wrap-wide:not(.docs-page-wide) > .admin-sub-tabs{padding-left:1.5rem;padding-right:1.5rem}
.wrap .admin-tabs.account-tabs{margin-left:0;margin-right:0;padding-left:1.5rem;padding-right:1.5rem}
.wrap-wide.docs-page-wide .admin-tabs a{border:1px solid transparent;font-weight:500}
.wrap-wide.docs-page-wide .admin-tabs a:hover{border-color:#374151}
.wrap-wide.docs-page-wide .admin-tabs a.admin-tab-active{border-color:#525252;box-shadow:0 0 0 1px rgba(255,255,255,.06)}
.docs-card-body{background:linear-gradient(165deg,#141b2e 0%,#111827 45%,#111827 100%);border:1px solid var(--bsafe-panel-border);border-radius:.75rem;padding:0;overflow:hidden;box-shadow:0 8px 36px rgba(0,0,0,.28);margin-bottom:1.25rem}
.docs-card-body > h3.docs-card-title{font-size:1.06rem;font-weight:600;color:#f9fafb;margin:0;padding:1rem 1.5rem;background:rgba(15,23,42,.6);border-bottom:1px solid #1f2937;letter-spacing:.02em}

.docs-prose{padding:1.35rem 1.5rem 1.65rem}
@media(min-width:640px){.docs-prose{padding:1.5rem 1.75rem 1.9rem}}
.docs-prose{font-size:.95rem;line-height:1.75;color:#d1d5db;max-width:50rem}
.docs-prose > p{margin:.7rem 0}
.docs-prose > p:first-child{margin-top:0}
.docs-prose h4,.docs-prose h4.mt-2{font-size:.98rem;font-weight:600;color:#f3f4f6;margin:1.85rem 0 .55rem;padding-bottom:.38rem;border-bottom:1px solid #374151;letter-spacing:.01em}
.docs-prose h4:first-child,.docs-prose > h4.mt-2:first-of-type{margin-top:.15rem}
.docs-prose h4 + p{margin-top:.4rem}
.docs-prose .docs-list{margin-top:.45rem;margin-bottom:.5rem}
.docs-prose code:not(pre code){background:#0f172a;border:1px solid #334155;padding:.12rem .42rem;border-radius:.25rem;font-size:.86em;color:#7dd3fc;word-break:break-word}
.docs-prose pre{background:#080c14;border:1px solid #334155;border-radius:.5rem;padding:1rem 1.15rem;overflow-x:auto;font-size:.82rem;line-height:1.62;color:#e2e8f0;margin:.9rem 0;font-family:Consolas,"Cascadia Mono","Segoe UI Mono",monospace}
.docs-prose pre code{background:transparent;border:0;padding:0;color:inherit;font-size:inherit}
.docs-prose a{font-weight:500;color:#60a5fa}
.docs-prose a:hover{color:#93c5fd}
.docs-prose table.docs-table{width:100%;border-collapse:collapse;font-size:.86rem;margin:1rem 0;border:1px solid #374151;border-radius:.5rem;overflow:hidden}
.docs-prose table.docs-table th{text-align:left;background:#0f172a;color:#94a3b8;font-weight:600;padding:.55rem .75rem;border-bottom:1px solid #374151}
.docs-prose table.docs-table td{padding:.5rem .75rem;border-bottom:1px solid #1f2937;vertical-align:top;color:#d1d5db}
.docs-prose table.docs-table tr:last-child td{border-bottom:0}
.docs-prose table.docs-table tbody tr:hover td{background:rgba(30,41,59,.45)}
.docs-intro{font-size:1.02rem;color:#e5e7eb;line-height:1.68;margin:0 0 .35rem}
.docs-callout{border-radius:.5rem;padding:.88rem 1.08rem;margin:1.2rem 0;font-size:.9rem;line-height:1.62;border:1px solid}
.docs-callout-title{display:block;font-weight:600;margin-bottom:.3rem;font-size:.88rem}
.docs-callout-note{background:rgba(30,41,59,.55);border-color:#475569;color:#cbd5e1}
.docs-callout-note .docs-callout-title{color:#e2e8f0}
.docs-callout-tip{background:rgba(20,83,45,.24);border-color:#166534;color:#bbf7d0}
.docs-callout-tip .docs-callout-title{color:#86efac}
.docs-callout-important{background:rgba(69,10,10,.38);border-color:#991b1b;color:#fecaca}
.docs-callout-important .docs-callout-title{color:#fca5a5}

@media(max-width:768px){.docs-layout{flex-direction:column}.docs-sidebar{width:100%}
.nav-toggle{display:flex;order:2;margin-left:auto}
.nav-mobile-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:10000}
nav.nav-open .nav-mobile-backdrop{display:block}
.nav-links{display:flex;position:fixed;top:0;left:0;bottom:0;width:min(280px,85vw);max-width:280px;background:#111827;flex-direction:column;align-items:stretch;gap:0;padding:2rem 0;z-index:10001;overflow-y:auto;-webkit-overflow-scrolling:touch;box-shadow:4px 0 24px rgba(0,0,0,.5);visibility:hidden;transform:translateX(-100%);pointer-events:none;transition:transform .25s ease-out,visibility .25s}
nav.nav-open .nav-links{visibility:visible;transform:translateX(0);pointer-events:auto}
/* nav { z-index:1 } creates a stacking context; fixed children cannot paint above #app-main (also z-index:1, later in DOM). Lift the whole bar while the drawer is open. */
nav.nav-open{z-index:10100}
nav.nav-open .brand,nav.nav-open .nav-toggle{position:relative;z-index:10102}
.nav-links a,.nav-links .nav-user{padding:1rem 1.5rem;border-bottom:1px solid #1f2937;font-size:1.05rem;min-height:44px;display:flex;align-items:center}.nav-links > *:last-child{border-bottom:0}}
@media(max-width:600px){.wrap,.wrap-wide{padding:1.5rem 1rem};nav{padding:.5rem 1rem;gap:.5rem};nav .brand img{height:28px;max-width:120px};nav .nav-user{max-width:100px};.hero:not(.hero--home) .hero-banner{max-height:72px;max-width:min(260px,78vw)};.hero--home .hero-banner{max-width:min(94vw,640px);max-height:min(42vw,150px)};.hero h1{font-size:1.45rem};.hero--home .hero-above h1.hero-tagline--quote{font-size:.88rem;letter-spacing:.025em};.hero{padding:2rem 1rem 1.75rem};.hero-inner .btn,.hero-below-panel .btn{margin-left:0!important;margin-top:.5rem;display:block;width:100%;text-align:center};.hero-inner .btn:first-of-type,.hero-below-panel .btn:first-of-type{margin-top:0};.hero-actions .btn{margin-top:.5rem};.hero-actions .btn:first-of-type{margin-top:0};.row>*{min-width:0};.row [style*="min-width"]{min-width:0!important};#app-main{padding-bottom:5rem};footer{padding:.75rem 1rem;font-size:.75rem};.card{overflow-x:auto;-webkit-overflow-scrolling:touch};table{font-size:.8rem};table th,table td{padding:.35rem .4rem};.pricing-card .btn{width:100%;text-align:left};table input[type="number"]{min-width:4rem;max-width:100%}}
@media(max-width:480px){nav{gap:.4rem};nav a{font-size:.82rem};.wrap,.wrap-wide{padding:1rem .75rem};.card{padding:1rem};.admin-tabs a{padding:.35rem .5rem;font-size:.8rem};.cookie-notice{flex-direction:column;text-align:center;padding:1rem};.cookie-notice .cookie-notice-ok{width:100%;max-width:12rem}}

/* Cookie notice (dismissible; preference in localStorage) */
.cookie-notice{position:fixed;bottom:0;left:0;right:0;background:#111827;border-top:1px solid #1f2937;padding:.75rem 1.5rem;display:flex;align-items:center;justify-content:center;gap:1rem;flex-wrap:wrap;z-index:9999;font-size:.875rem;color:#9ca3af;box-shadow:0 -4px 20px rgba(0,0,0,.3)}
.cookie-notice a{color:#60a5fa;text-decoration:none}
.cookie-notice a:hover{text-decoration:underline}
.cookie-notice .cookie-notice-ok{padding:.4rem 1rem;background:#2563eb;color:#fff;border:0;border-radius:.25rem;cursor:pointer;font-size:.875rem}
.cookie-notice .cookie-notice-ok:hover{background:#1d4ed8}
.cookie-notice.hidden{display:none}

/* Styled file input (matches dark theme; native button hidden) */
.bsafe-file-wrap{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;margin-bottom:.25rem}
.bsafe-file-wrap input[type="file"]{position:absolute;width:0.1px;height:0.1px;opacity:0;overflow:hidden;z-index:-1;margin:0;padding:0}
.bsafe-file-btn{display:inline-block;padding:.55rem 1rem;background:#1f2937;border:1px solid #374151;border-radius:.4rem;color:#e5e7eb;font-size:.9rem;cursor:pointer;transition:border-color .15s,background .15s}
.bsafe-file-btn:hover{background:#374151;border-color:#4b5563;color:#f3f4f6}
.bsafe-file-btn:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
.bsafe-file-wrap:focus-within .bsafe-file-btn{outline:2px solid #2563eb;outline-offset:2px}
.bsafe-file-name{color:#9ca3af;font-size:.9rem}

/* Release upload progress ring (Add release overlay) */
.release-upload-progress-ring{position:relative;width:72px;height:72px;flex-shrink:0}
.release-upload-progress-ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.release-upload-progress-ring .release-upload-ring-bg{fill:none;stroke:#1f2937;stroke-width:5}
.release-upload-progress-ring .release-upload-ring-fill{fill:none;stroke:#60a5fa;stroke-width:5;stroke-linecap:round;transition:stroke-dashoffset .15s ease-out}
.release-upload-progress-ring .release-upload-percent{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:1rem;font-weight:600;color:#e5e7eb}
.release-upload-progress-ring.indeterminate .release-upload-ring-fill{stroke-dasharray:31.4 94.2;stroke-dashoffset:0;animation:release-upload-indeterminate 1.2s linear infinite;transform-origin:center}
@keyframes release-upload-indeterminate{to{transform:rotate(360deg)}}

/* Upload progress (logo fill) */
.upload-progress{display:inline-flex;align-items:center;gap:.75rem;margin-left:.5rem;vertical-align:middle}
.upload-progress-ring{position:relative;width:48px;height:48px;flex-shrink:0}
.upload-progress-ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.upload-progress-ring .ring-bg{fill:none;stroke:#1f2937;stroke-width:4}
.upload-progress-ring .ring-fill{fill:none;stroke:#16a34a;stroke-width:4;stroke-linecap:round;transition:stroke-dashoffset .15s ease-out}
.upload-progress-logo{position:absolute;inset:0;margin:auto;width:28px;height:28px;object-fit:contain;border-radius:4px;pointer-events:none}
.upload-progress-text{font-size:.85rem;color:#9ca3af;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.oops-wrap{min-height:60vh;display:flex;align-items:center;justify-content:center;padding:2rem}
.oops-card{max-width:420px;text-align:center}
.oops-title{font-size:1.75rem;color:#7aa2f7;margin-bottom:.5rem}
.oops-lead{color:#a9b1d6;margin-bottom:.75rem}
.oops-detail{color:#6b7280;font-size:.9rem;margin-bottom:1.5rem}
.oops-actions{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center}

/* Renderer: overlay until images load, spinners for data fields */
#bsafe-renderer-overlay{position:fixed;inset:0;background:rgba(11,15,25,.92);z-index:9999;display:flex;align-items:center;justify-content:center;transition:opacity .25s}
#bsafe-renderer-overlay .bsafe-overlay-hero{position:absolute;width:0;height:0;opacity:0;pointer-events:none}
#bsafe-renderer-overlay .bsafe-overlay-shade{display:none}
#bsafe-renderer-overlay .bsafe-spinner{position:relative;z-index:2;width:24px;height:24px;border-width:2px}
#bsafe-renderer-overlay.bsafe-overlay-admin{background-image:none;background:#0b0f19}
#bsafe-renderer-overlay.bsafe-overlay-admin .bsafe-overlay-hero{display:none}
#bsafe-renderer-overlay.bsafe-hidden{opacity:0;pointer-events:none}
/* Once the page is marked ready, never let the overlay intercept clicks (defense in depth). */
body.bsafe-ready #bsafe-renderer-overlay{pointer-events:none!important}
.bsafe-spinner{display:inline-block;width:32px;height:32px;border:3px solid #1f2937;border-top-color:#60a5fa;border-radius:50%;animation:bsafe-spin .7s linear infinite}
.hydrate-pending{color:#9ca3af;font-size:.9rem}
.hydrate-pending .bsafe-spinner{display:inline-block;width:20px;height:20px;border:2px solid #374151;border-top-color:#60a5fa;border-radius:50%;animation:bsafe-spin .7s linear infinite;vertical-align:middle;margin-right:.5rem}
@keyframes bsafe-spin{to{transform:rotate(360deg)}}

/* Payment success page */
.success-page{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem 1.5rem;text-align:center}
.success-page .success-brand{margin-bottom:2rem}
.success-page .success-brand a{display:inline-block;text-decoration:none}
.success-page .success-brand img{height:40px;width:auto;max-width:200px;object-fit:contain}
.success-page .success-card{max-width:440px;width:100%;background:#111827;border:1px solid var(--bsafe-panel-border);border-radius:1rem;padding:2rem 2.25rem;box-shadow:0 4px 24px rgba(0,0,0,.3);transition:border-color .2s ease}
.success-page .success-card:focus-within{border-color:var(--bsafe-panel-border-inner-hover)}
.success-page .success-icon{width:64px;height:64px;margin:0 auto 1.25rem;background:linear-gradient(135deg,#16a34a,#15803d);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:2rem;color:#fff;line-height:1}
.success-page .success-card h3{font-size:1.5rem;color:#f9fafb;margin-bottom:.75rem;padding:0;border:0}
.success-page .success-card .success-lead{font-size:1.05rem;color:#d1d5db;line-height:1.6;margin-bottom:1.5rem}
.success-page .success-card .success-actions{display:flex;flex-wrap:wrap;gap:.75rem;justify-content:center;margin-top:1.5rem}
.success-page .success-card .success-actions .btn{margin:0}
.success-page .success-card .success-note{font-size:.85rem;color:#6b7280;margin-top:1.25rem;line-height:1.5}
.success-page .success-card .success-note a{color:#60a5fa}
.success-page .success-card details{margin-top:1.25rem;text-align:left}
.success-page .success-card details summary{cursor:pointer;color:#6b7280;font-size:.8rem}
.success-page .success-card details[open] summary{margin-bottom:.5rem}
.success-page .success-card details .webhook-hint{font-size:.8rem;color:#6b7280;line-height:1.5;padding:.5rem 0}

/* Skip link and keyboard focus */
.skip-link{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;z-index:10000;padding:.5rem 1rem;background:#1e3a5f;color:#f9fafb;border-radius:.25rem;font-size:.9rem;text-decoration:none}
.skip-link:focus{position:fixed;left:.75rem;top:.75rem;width:auto;height:auto;overflow:visible;outline:2px solid #60a5fa;outline-offset:2px}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,.nav-toggle:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}

/* Nav layout while /api/account/me is in flight (reduces cluster jump) */
body.bsafe-nav-pending .nav-links{display:flex;align-items:center;gap:1.5rem;flex-wrap:wrap;min-height:2.25rem}

/* Alerts icon in nav */
a.nav-alerts-link{display:inline-flex;align-items:center;gap:.25rem;vertical-align:middle;color:inherit}
a.nav-alerts-link .nav-alerts-icon{display:block;flex-shrink:0}
.nav-alerts-badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.1rem;padding:0 .2rem;font-size:.65rem;font-weight:600;line-height:1.2;border-radius:999px;background:#dc2626;color:#fff}

/* Admin: sticky tab rows and zebra tables */
.admin-tabs,.admin-sub-tabs{position:sticky;top:0;z-index:50;background:#0b0f19;padding-top:.25rem;padding-bottom:.25rem;margin-top:-.25rem}
body.bsafe-admin-page .admin-tabs,body.bsafe-admin-page .admin-sub-tabs{background:#0b0f19}
.admin-table-zebra tbody tr:nth-child(even){background:rgba(31,41,55,.45)}

/* Cookie notice: card-like alignment on wide screens */
@media(min-width:640px){
  .cookie-notice{left:50%;right:auto;transform:translateX(-50%);max-width:42rem;border-radius:.5rem .5rem 0 0;border-left:1px solid #1f2937;border-right:1px solid #1f2937}
}

/* Account: licenses as expandable rows (plan summary; key inside) */
.lic-acc-list{list-style:none;margin:.75rem 0 0;padding:0;display:flex;flex-direction:column;gap:.75rem}
.lic-acc-item{border:1px solid var(--bsafe-panel-border);border-radius:.75rem;background:#111827;overflow:hidden;transition:border-color .2s ease}
.lic-acc-item:hover,
.lic-acc-item:focus-within{border-color:var(--bsafe-panel-border-inner-hover)}
.lic-acc-item > summary{
  list-style:none;
  cursor:pointer;
  padding:1rem 1.25rem;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:.35rem;
  color:#e5e7eb;
  outline-offset:-2px
}
.lic-acc-item > summary::-webkit-details-marker{display:none}
.lic-acc-title{font-weight:600;font-size:1rem;line-height:1.3}
.lic-acc-meta{font-weight:400;font-size:.85rem;color:#9ca3af;line-height:1.4;width:100%}
.lic-acc-item > summary::after{
  content:'Show key';
  align-self:flex-start;
  margin-top:.25rem;
  font-size:.78rem;
  font-weight:500;
  color:#a3a3a3;
}
.lic-acc-item[open] > summary::after{content:'Hide key'}
.lic-acc-body{padding:0 1.25rem 1.25rem;border-top:1px solid #1f2937}
.lic-acc-key-label{font-size:.8rem;margin:1rem 0 .35rem}
.lic-acc-key-row{display:flex;flex-wrap:wrap;align-items:flex-start;gap:.5rem}
.lic-acc-key-code{flex:1;min-width:min(100%,12rem);word-break:break-all;background:#0f172a;padding:.5rem .65rem;border-radius:.35rem;border:1px solid #374151;font-size:.85rem;line-height:1.4}
.lic-acc-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.75rem;align-items:center}
.lic-acc-created{font-size:.78rem;margin:.75rem 0 0}

/* Reduced motion: spinners and indeterminate rings */
@media(prefers-reduced-motion:reduce){
  .bsafe-spinner,.hydrate-pending .bsafe-spinner,.release-upload-progress-ring.indeterminate .release-upload-ring-fill{animation:none;border-top-color:#60a5fa;opacity:.85}
  .bsafe-toast-container .bsafe-toast,.bsafe-toast-container .bsafe-toast-out{animation:none}
}
