:root{
  --bg:#0c0f14;
  --panel:#121726;
  --panel2:#0f1421;
  --text:#e6e9f2;
  --muted:#a9b0c3;
  --accent:#6df2c6;
  --danger:#ff4d4d;
  --shadow:0 8px 30px rgba(0,0,0,0.35);
  --radius:16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
*{box-sizing:border-box}
html,body{
  min-height:100%;
  height:100%;
  background:#0c0f14;
  color:#e6e9f2;
}
body{
  margin:0;
  font-family:var(--sans);
  background:radial-gradient(1200px 700px at 10% 0%, rgba(109,242,198,0.08), transparent 55%),
             radial-gradient(1200px 700px at 90% 0%, rgba(111,139,255,0.08), transparent 55%),
             var(--bg);
  color:var(--text);
}
body.booting{overflow:hidden}

a{color:inherit}

#bootSplash{
  position:fixed;
  inset:0;
  z-index:200;
  display:grid;
  place-items:center;
  padding:1.5rem;
  background:
    radial-gradient(900px 520px at 15% 0%, rgba(109, 242, 198, 0.14), transparent 58%),
    radial-gradient(900px 520px at 85% 0%, rgba(111, 139, 255, 0.10), transparent 55%),
    #0c0f14;
  transition:opacity 180ms ease;
}
body:not(.booting) #bootSplash{
  opacity:0;
  pointer-events:none;
}
.bootSplashCard{
  width:min(28rem, calc(100vw - 3rem));
  padding:1.5rem 1.35rem;
  border-radius:1.4rem;
  border:1px solid rgba(255,255,255,0.09);
  background:rgba(18,23,38,0.82);
  box-shadow:0 30px 80px rgba(0,0,0,0.42);
  text-align:center;
  -webkit-backdrop-filter:blur(14px);
  backdrop-filter:blur(14px);
}
.bootSpinner{
  width:2.6rem;
  height:2.6rem;
  margin:0 auto 1rem;
  border-radius:999px;
  border:3px solid rgba(109,242,198,0.18);
  border-top-color:rgba(109,242,198,0.95);
  animation:bootSpin 0.9s linear infinite;
}
.bootSplashTitle{
  margin:0;
  font:700 1.4rem/1.1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  animation:bootLift 1.2s ease-in-out infinite alternate;
}
.bootSplashStatus{
  margin:0.55rem 0 0;
  color:rgba(230,233,242,0.72);
  font:400 0.98rem/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

@keyframes bootSpin{to{transform:rotate(360deg)}}
@keyframes bootLift{
  from{transform:translateY(0) scale(1); text-shadow:0 0 0 rgba(109,242,198,0)}
  to{transform:translateY(-2px) scale(1.015); text-shadow:0 10px 28px rgba(109,242,198,0.18)}
}

.small{font-size:0.85rem}
.muted{color:var(--muted)}
.mono{font-family:var(--mono)}
.ghost{opacity:0.8}

.main{
  padding:1rem;
}

.sectionTitle{
  margin:1.4rem 0 0.65rem;
  font-size:0.92rem;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:var(--muted);
}

.activity.hidden{display:none}
.hidden{display:none !important}

.card{
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.10);
  border-radius:var(--radius);
  padding:1rem;
  box-shadow:var(--shadow);
  margin:1rem 0;
}
.cardTitle{font-weight:700; margin-bottom:0.5rem}

.kv{
  display:grid;
  grid-template-columns: 160px 1fr;
  gap:0.5rem;
  padding:0.4rem 0;
}
.kv .k{color:var(--muted)}
.kv .v{
  font-family:var(--mono);
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.row{display:flex; gap:0.5rem; align-items:center; margin-top:0.6rem}
.u-mt-sm{margin-top:0.5rem !important}
.u-mt-md{margin-top:0.75rem !important}

input,textarea,select{
  width:100%;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(0,0,0,0.20);
  color:var(--text);
  border-radius:12px;
  padding:0.6rem 0.7rem;
  font-size:1rem;
  margin:0.3rem 0 0.7rem 0;
  outline:none;
}
textarea{min-height:90px; resize:vertical}

button{
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.04);
  color:var(--text);
  border-radius:12px;
  padding:0.55rem 0.8rem;
  cursor:pointer;
}
button:hover{background:rgba(255,255,255,0.07)}
button:disabled{opacity:0.5; cursor:not-allowed}

.tabs{
  display:flex;
  gap:0.5rem;
  margin:0.5rem 0 1rem 0;
}
.tab{
  padding:0.4rem 0.7rem;
  border-radius:999px;
}
.tab.active, .tab.tab-active{
  border-color:rgba(109,242,198,0.4);
  color:var(--accent);
}
.tabpane.hidden{display:none}

.list{display:flex; flex-direction:column; gap:0.6rem; margin-top:0.5rem}
.listSection{display:flex; flex-direction:column; gap:0.5rem}
.listSectionHeader{
  padding:0.2rem 0.1rem 0;
}
.listSectionBody{
  display:flex;
  flex-direction:column;
  gap:0.6rem;
}

.item{
  border:1px solid rgba(255,255,255,0.12);
  border-radius:14px;
  padding:0.75rem;
  background:rgba(255,255,255,0.02);
}
.itemTop{display:flex; justify-content:space-between; gap:0.5rem; align-items:flex-start}
.itemTitle{font-weight:700}
.itemMeta{
  color:var(--muted);
  font-size:0.85rem;
  margin-top:0.2rem;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.itemActions{display:flex; gap:0.4rem; align-items:center; flex-wrap:wrap}
.resourceActionBar{
  display:flex;
  gap:0.45rem;
  align-items:center;
  flex-wrap:wrap;
  margin-top:0.85rem;
}
.actionIconButton{
  width:2.35rem;
  height:2.35rem;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  font-size:1rem;
  line-height:1;
}
.actionIconButton-primary{
  border-color:rgba(109,242,198,0.35);
  color:var(--accent);
}
.actionIconButton-pending{
  border-color:rgba(246,197,107,0.3);
  color:#f6c56b;
}
.actionIconButton-busy{
  opacity:0.7;
}
.actionTextButton{
  border-radius:999px;
}
.resourceActionState{
  margin-top:0.7rem;
  color:var(--muted);
  font-size:0.85rem;
}
.resourceActionState[data-state="resolving"]{
  color:#f6c56b;
}
.resourceActionState[data-state="error"]{
  color:#ffb4b4;
}
.resourceScope{
  display:inline-flex;
  align-items:center;
  gap:0.35rem;
  margin-top:0.55rem;
  font-size:0.78rem;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.08em;
}
.resourceScopeOwned{color:var(--accent)}
.resourceScopeShared{color:#9ecbff}
.resourceScopeDiscoverable{color:#f6c56b}
.resourceGrantSummary{
  margin-top:0.75rem;
  padding-top:0.7rem;
  border-top:1px solid rgba(255,255,255,0.08);
  display:grid;
  gap:0.45rem;
}
.resourceGrantSummaryTitle{
  font-size:0.82rem;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.08em;
}
.resourceGrantRow{
  display:flex;
  gap:0.5rem;
  flex-wrap:wrap;
  align-items:center;
}
.inlineLabelInput{
  width:clamp(160px, 28vw, 260px);
  margin:0;
  padding:0.35rem 0.5rem;
  font-size:0.85rem;
}
.freshnessDot{
  display:inline-block;
  width:0.55rem;
  height:0.55rem;
  border-radius:50%;
  margin-right:0.4rem;
  vertical-align:middle;
  box-shadow:0 0 0 1px rgba(255,255,255,0.12);
}
.freshness-live{background:rgba(109,242,198,0.95)}
.freshness-recent{background:rgba(150,220,255,0.92)}
.freshness-stale{background:rgba(255,196,110,0.92)}
.freshness-offline{background:rgba(255,102,102,0.9)}
.freshness-unknown{background:rgba(255,255,255,0.35)}
.danger{border-color:rgba(255,77,77,0.4); color:#ffd1d1}
.ok{border-color:rgba(76,255,154,0.35); color:#c6ffe2}
.warn{color:#ffd1d1}

.appItem{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:.75rem;
}

.appItemLabel{
  display:flex;
  align-items:center;
  gap:.5rem;
}

.appItemLabel input[type="checkbox"]{
  width:auto;
  margin:0;
}

/* Onboarding “radio” choice buttons */
.choiceRow{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:.6rem;
  margin-top:.6rem;
}
.choiceBtn{
  text-align:left;
  padding:.75rem;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.03);
}
.choiceBtn:hover{background:rgba(255,255,255,0.06)}
.choiceBtn.selected{
  border-color: rgba(109,242,198,0.45);
  box-shadow: 0 0 0 2px rgba(109,242,198,0.10) inset;
}
.choiceTitle{font-weight:800}
.choiceSub{font-size:.85rem; color:var(--muted); margin-top:.15rem}

.row.wrap{flex-wrap:wrap}

input[type="checkbox"]{
  width:auto;
  margin:0;
}

.gatewayInstallOptions{
  display:flex;
  flex-direction:column;
  gap:.35rem;
  margin-top:.55rem;
}

.toggleRow{
  display:flex;
  align-items:center;
  gap:.55rem;
  color:var(--text);
}

.row.compact{
  margin-top:.2rem;
}

.row.compact input{
  margin:0;
  max-width:220px;
}

.commandPreview{
  margin:.4rem 0 0 0;
  padding:.6rem .7rem;
  border:1px solid rgba(255,255,255,0.12);
  border-radius:12px;
  background:rgba(0,0,0,0.2);
  color:var(--text);
  font-family:var(--mono);
  font-size:.82rem;
  white-space:pre-wrap;
  word-break:break-word;
}
.inlineSpinner{
  width:1rem;
  height:1rem;
  border-radius:999px;
  border:2px solid rgba(109,242,198,0.18);
  border-top-color:rgba(109,242,198,0.95);
  animation:bootSpin 0.9s linear infinite;
}

.modal{
  position:fixed;
  inset:50% auto auto 50%;
  transform:translate(-50%, -50%);
  width:min(720px, calc(100vw - 1.5rem));
  max-height:calc(100vh - 2rem);
  overflow:auto;
  background:rgba(18,23,38,0.98);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:20px;
  box-shadow:var(--shadow);
  z-index:95;
  padding:1rem;
}
.modal.hidden{display:none}
.modalHeader{
  display:flex;
  justify-content:space-between;
  gap:1rem;
  align-items:flex-start;
}
.modalEyebrow{
  color:var(--accent);
  font-size:0.72rem;
  text-transform:uppercase;
  letter-spacing:0.12em;
  margin-bottom:0.25rem;
}
.modalTitle{
  font-size:1.4rem;
  font-weight:800;
}
.modalBody{
  margin-top:1rem;
  display:grid;
  gap:0.9rem;
}
.modalActions{
  margin-top:1rem;
  display:flex;
  gap:0.55rem;
  flex-wrap:wrap;
}
.modalSection{
  border:1px solid rgba(255,255,255,0.08);
  border-radius:16px;
  background:rgba(255,255,255,0.025);
  padding:0.9rem;
}
.modalSectionTitle{
  font-weight:700;
  margin-bottom:0.55rem;
}
