:root{
  --bg:#0b1220;
  --panel:rgba(255,255,255,0.04);
  --panel-2:rgba(255,255,255,0.06);
  --border:rgba(255,255,255,0.10);
  --border-2:rgba(255,255,255,0.08);
  --text:rgba(255,255,255,0.92);
  --muted:rgba(255,255,255,0.70);
  --muted-2:rgba(255,255,255,0.55);
  --link:rgba(59,130,246,0.95);
  --focus:0 0 0 4px rgba(59,130,246,0.25);
  --font:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  min-height:100vh;
  display:flex;
  flex-direction:column;

  background-repeat:no-repeat;
  background-attachment:fixed;
  background-size:cover;
  background-image:
    radial-gradient(1200px 600px at 20% -10%, rgba(59,130,246,0.18), transparent 55%),
    radial-gradient(900px 500px at 85% 10%, rgba(99,102,241,0.14), transparent 60%),
    radial-gradient(1000px 700px at 50% 120%, rgba(16,185,129,0.07), transparent 60%),
    linear-gradient(180deg, rgba(11,18,32,1), rgba(11,18,32,1));

  color:var(--text);
  font-family:var(--font);
  line-height:1.45;
}

main{
  flex:1;
  display:flex;
  flex-direction:column;
}

a{ color:inherit; text-decoration:none; }
.container{ width:min(1200px, calc(100% - 48px)); margin:0 auto; }

.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* =========================
   Header
========================= */
.header{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  background:rgba(11,18,32,0.72);
  border-bottom:1px solid var(--border-2);
}

.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 0;
  gap:16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:240px;
}

.brand img{
  height:40px;
  width:auto;
  display:block;
}

.brand-title{
  display:grid;
  gap:2px;
}

.brand-title .sub{
  font-size:12px;
  letter-spacing:0.10em;
  text-transform:uppercase;
  color:var(--link);
  font-weight:700;
}

.brand-title .title{
  font-size:16px;
  font-weight:650;
  color:var(--text);
  margin:0;
}

.top-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* Pills */
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  background:var(--panel);
  border:1px solid var(--border-2);
  border-radius:999px;
  color:var(--muted);
  font-size:13px;
  white-space:nowrap;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--text);
  font-size:13px;
  font-weight:650;
  cursor:pointer;
  transition:transform .08s ease, background .12s ease, border-color .12s ease;
  user-select:none;
}
.btn:hover{ background:var(--panel-2); }
.btn:active{ transform:translateY(1px); }
.btn:focus{ outline:none; box-shadow:var(--focus); }

.btn.primary{
  background:rgba(59,130,246,0.16);
  border-color:rgba(59,130,246,0.40);
  color:rgba(219,234,254,0.95);
}
.btn.primary:hover{
  background:rgba(59,130,246,0.22);
  border-color:rgba(59,130,246,0.55);
}

/* Tool switcher select */
select{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;

  padding:10px 36px 10px 12px;
  border-radius:999px;
  border:1px solid var(--border-2);
  background-color:rgba(255,255,255,0.05);
  color:var(--text);
  font-size:13px;
  cursor:pointer;
  outline:none;

  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.65) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.65) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(1em + 1px),
    calc(100% - 11px) calc(1em + 1px);
  background-size:5px 5px, 5px 5px;
  background-repeat:no-repeat;
}

select option{
  background-color:#0f172a;
  color:#ffffff;
}

select:focus{
  box-shadow:var(--focus);
  background-color:rgba(255,255,255,0.08);
}

/* Desktop select sizing */
.top-actions select#tlinkToolSelect{
  max-width:320px;
}

/* Tablet: dropdown can expand full width */
@media (max-width: 980px){
  .top-actions select#tlinkToolSelect{
    width:100%;
    max-width:none;
  }
}

/* =========================
   Footer (sticky bottom)
========================= */

.footer{
  margin-top:auto; /* pushes footer to bottom */
  padding:24px 0 18px;
  border-top:1px solid rgba(255,255,255,0.08);
}

.footer-inner{
  width:min(1000px, calc(100% - 48px)); /* makes footer less wide */
  margin:0 auto; /* centers it */
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  flex-wrap:wrap;
}

.footer-left{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:12px;
  color:var(--muted-2);
}

.footer-right{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.footer-btn{
  padding:8px 12px;
  border-radius:999px;
}
/* Security note */
.security-note{
  font-size:12px;
  color:rgba(245,158,11,0.85);
  opacity:0.9;
  display:flex;
  align-items:center;
  gap:8px;
}

.shield-icon{
  display:inline-flex;
  width:16px;height:16px;
  align-items:center;
  justify-content:center;
  color:rgba(59,130,246,0.90);
}
.shield-icon svg{ width:16px;height:16px; }

/* Environment pill (footer only) */
.footer-env{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.03);
  color:var(--muted-2);
  font-size:12px;
}

.env-dot{
  width:8px;height:8px;
  border-radius:999px;
  display:inline-block;
  background:rgba(34,197,94,0.95);
  box-shadow:0 0 0 3px rgba(34,197,94,0.16);
}

.env-label{ color:rgba(255,255,255,0.80); font-weight:650; }

.env-build{
  margin-left:6px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.03);
  color:rgba(255,255,255,0.65);
  font-size:12px;
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.env-prod .env-dot{
  background:rgba(34,197,94,0.95);
  box-shadow:0 0 0 3px rgba(34,197,94,0.16);
}
.env-staging .env-dot{
  background:rgba(245,158,11,0.95);
  box-shadow:0 0 0 3px rgba(245,158,11,0.16);
}
.env-dev .env-dot{
  background:rgba(59,130,246,0.95);
  box-shadow:0 0 0 3px rgba(59,130,246,0.16);
}

/* =========================
   Mobile optimized header
========================= */
@media (max-width: 640px){
  .container{ width:min(1200px, calc(100% - 28px)); }

  .header-inner{
    flex-wrap:wrap;
    gap:12px;
    padding:12px 0;
  }

  .brand{
    min-width:0;
    flex:1 1 auto;
  }

  .brand-title{ display:none; }

  .top-actions{
    width:100%;
    justify-content:flex-start;
    gap:10px;
  }

  .top-actions select#tlinkToolSelect{
    width:100%;
    max-width:none;
    order:1;
  }

  .top-actions a.btn.primary{ order:2; }
  .top-actions a.btn:not(.primary){ order:3; }

  .btn{ padding:11px 14px; }
}