:root{
  --bg:#060814;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.08);
  --text:#f1f5f9;
  --muted:#94a3b8;
  --border: rgba(255,255,255,.10);

  --primary:#2f6bff;
  --danger:#ff4d4d;
  --ok:#22c55e;
  --warn:#fbbf24;

  --radius:18px;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(900px 420px at 20% -10%, rgba(47,107,255,.25), transparent 60%),
    radial-gradient(900px 420px at 95% 0%, rgba(34,197,94,.14), transparent 55%),
    var(--bg);
  color:var(--text);
}

.wrap{
  max-width: 720px;            /* phone-first */
  margin: 0 auto;
  padding: 14px;
}

/* ===== Header ===== */
.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 12px 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.05));
  border:1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 10px;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.brandLeft{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 0;
}

.brandLogo{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 14px 30px rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.18);
  flex: 0 0 auto;
}

.brandTxt{min-width:0;}
.title{
  font-size: 16px;      /* not too big */
  font-weight: 900;
  letter-spacing: -0.2px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sub{
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topRight{
  display:flex;
  align-items:center;
  gap:8px;
  flex: 0 0 auto;
}

/* ===== Cards ===== */
.card{
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.05));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px;
  box-shadow: var(--shadow);
}

h2{
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 900;
}

p{color:var(--muted); margin:8px 0 0;}

.code{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px dashed rgba(255,255,255,.16);
  color: #cbd5e1;
  font-weight: 800;
  font-size: 12px;
  overflow:auto;
}

/* ===== Layout blocks ===== */
.row{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
}

.right{text-align:right;}

.value{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.2px;
  margin-top: 4px;
}

.label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .02em;
}

.row2{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.mini{
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.help{
  margin-top: 6px;
  font-size: 12px;
  color: #aab6c7;
  font-weight: 700;
}

/* ===== Inputs ===== */
.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

select,input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease, transform .12s ease;
}

select:focus,input:focus{
  border-color: rgba(47,107,255,.55);
  box-shadow: 0 0 0 4px rgba(47,107,255,.18);
}

::placeholder{color:#9aa8bd; font-weight:700;}

/* ===== Pills ===== */
.pill{
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  color: var(--text);
  cursor:pointer;
}

#netPill{
  cursor: default;
}

/* ===== Buttons ===== */
.btnRow{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.bottomRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn{
  width: 100%;
  padding: 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-weight: 950;
  font-size: 15px;
  letter-spacing: .02em;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.btn:hover{transform: translateY(-1px);}

.btn.primary{
  background: linear-gradient(135deg, rgba(47,107,255,1), rgba(47,107,255,.78));
  border-color: transparent;
  box-shadow: 0 18px 35px rgba(47,107,255,.22);
}

.btn.danger{
  background: linear-gradient(135deg, rgba(255,77,77,1), rgba(255,77,77,.78));
  border-color: transparent;
  box-shadow: 0 18px 35px rgba(255,77,77,.18);
}

/* your existing 'ghost' button should still work */
.btn.ghost{
  background: rgba(255,255,255,.06);
}

/* Message */
#msg{
  margin-top: 10px;
  font-size: 13px;
  font-weight: 800;
}

/* ===== Mobile tweaks ===== */
@media (max-width: 520px){
  .wrap{padding: 12px;}
  .top{position: relative; top: auto;}
  .grid, .grid2{grid-template-columns: 1fr;}
  .btnRow{grid-template-columns: 1fr;}
  .value{font-size: 20px;}
  .btn{font-size: 16px; padding: 16px 14px;}
  .title{font-size: 15px;}
}

/* ===== Disabled button fix ===== */
.btn:disabled,
.btn[disabled]{
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;   /* ðŸ”’ prevents clicks */
  filter: grayscale(40%);
  box-shadow: none !important;
}

.btn:disabled.primary{
  background: rgba(47,107,255,.25);
}

.btn:disabled.danger{
  background: rgba(255,77,77,.25);
}

/* ✅ Green STOP button */
.btn-stop-green{
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 14px 28px rgba(34,197,94,.22) !important;
}
.btn-stop-green:hover{ filter: brightness(1.02); }
.btn-stop-green:disabled{ opacity:.55; cursor:not-allowed; box-shadow:none !important; }

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9999;

  max-width: 92vw;
  padding: 12px 14px;
  border-radius: 14px;

  background: rgba(15,23,42,.92);
  color: #fff;
  font-weight: 800;
  font-size: 14px;

  box-shadow: 0 14px 40px rgba(2,6,23,.25);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
  text-align: center;
}

.toast.ok{
  background: rgba(16,185,129,.92);
}
.toast.bad{
  background: rgba(239,68,68,.92);
}

/* ================= STOP BUTTON (GREEN) ================= */
.btn-stop-green{
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
  border: none;
  box-shadow: 0 10px 24px rgba(22,163,74,.35);
  font-weight: 900;
}

.btn-stop-green:hover:not(:disabled){
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-stop-green:active:not(:disabled){
  transform: scale(0.97);
}

/* Disabled STOP (during lock / no trip) */
.btn-stop-green:disabled{
  background: linear-gradient(135deg, #86efac, #4ade80);
  color: #14532d;
  box-shadow: none;
  opacity: 0.75;
  cursor: not-allowed;
}

.btn-stop-green{
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 14px 28px rgba(34,197,94,.25) !important;
}
.btn-stop-green:disabled{
  opacity:.65;
  cursor:not-allowed;
}

