:root{
  --bg:#0b1220;
  --panel:rgba(255,255,255,.07);
  --panel2:rgba(255,255,255,.11);
  --text:rgba(255,255,255,.95);
  --muted:rgba(255,255,255,.65);
  --shadow:0 18px 50px rgba(0,0,0,.40);
  --radius:22px;
  --danger:#ff5a5a;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(900px 500px at 80% 30%, rgba(0,212,255,.18), transparent 55%),
    linear-gradient(180deg, #070b14, var(--bg));
  color:var(--text);
  min-height:100vh;
}

header{
  max-width:1100px;
  margin:auto;
  padding:24px 20px 10px;
}

.headerTop{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
}

h1{
  font-size:20px;
  margin:0;
}
.titleLink{
  color:inherit;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.titleLink:hover{
  text-decoration:underline;
}
.sub{
  font-size:13px;
  color:var(--muted);
  margin-top:6px;
}
.sub .spaceMeta{
  color:rgba(255,255,255,.82);
  margin-left:6px;
}
.sub .spaceMeta strong{
  color:var(--text);
}
.inlineLink{
  color:#9fd5ff;
  text-decoration:underline;
  text-decoration-color:rgba(255,255,255,.7);
  text-underline-offset:3px;
}
.inlineLink:hover{
  color:#fff;
  text-decoration-color:#fff;
}

.actionsRow{
  margin-top:12px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.btn{
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  color:var(--text);
  cursor:pointer;
  font-weight:650;
  font-size:13px;
  transition:.15s ease;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.10); }
.btn:active{ transform: translateY(0px); }

.btnPrimary{
  background:linear-gradient(135deg, rgba(124,92,255,.35), rgba(0,212,255,.22));
  border-color: rgba(255,255,255,.20);
}
.btnDanger{
  background:rgba(255,90,90,.18);
  border-color:rgba(255,90,90,.35);
}

main{
  max-width:1100px;
  margin:auto;
  padding:20px 20px 100px;
}

/* 4 per row */
.grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:16px;
}

.card{
  height:210px;
  padding:18px 18px 14px;
  border-radius:var(--radius);
  background:linear-gradient(180deg,var(--panel),rgba(255,255,255,.04));
  border:1px solid rgba(255,255,255,.14);
  box-shadow:var(--shadow);
  cursor:grab;
  transition:.18s ease;
  position:relative;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.card:active{ cursor:grabbing; }
.card.drag-over{
  outline: 2px dashed rgba(255,255,255,.35);
  outline-offset: -6px;
}

.card:hover{
  transform:translateY(-3px);
  background:linear-gradient(180deg,var(--panel2),rgba(255,255,255,.06));
  border-color: rgba(255,255,255,.20);
}

.cardTitle{
  font-size:16px;
  font-weight:750;
  margin-bottom:10px;
  line-height:1.2;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.value{
  font-size:28px;
  font-weight:850;
  line-height:1.1;
  letter-spacing:.2px;
}

.desc{
  margin-top:10px;
  font-size:14px;
  color:var(--muted);
  line-height:1.25;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
  flex: 1 1 auto;
}

.typePill{
  margin-top:auto;
  align-self:center;
  font-size:11px;
  letter-spacing:.35px;
  text-transform:uppercase;
  color: rgba(255,255,255,.75);
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 6px 10px;
}

/* Home */
.homeShell{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
  gap:18px;
  align-items:start;
}

.hero{
  display:grid;
  gap:14px;
  padding:18px;
  border-radius:22px;
  border:1px solid rgba(255,255,255,.14);
  background:linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow:var(--shadow);
}

.appName{
  font-weight:800;
  font-size:18px;
  letter-spacing:.2px;
}

.tagline{
  color:var(--muted);
  line-height:1.4;
  margin:0;
}

.heroActions{
  display:grid;
  gap:10px;
}

.secondaryAction{
  display:grid;
  gap:8px;
  color:var(--muted);
  font-size:13px;
}

.secondaryLabel{
  color:rgba(255,255,255,.72);
  font-size:12px;
  letter-spacing:.1px;
}

.inputRow{
  display:flex;
  gap:8px;
  align-items:center;
}

.btnGhost{
  background:rgba(255,255,255,.05);
  border-color:rgba(255,255,255,.10);
}

.savedSpaces{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:2px;
}

.chip{
  padding:8px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.05);
  color:var(--text);
  font-size:13px;
  cursor:pointer;
  transition:.12s ease;
}
.chip:hover{ background:rgba(255,255,255,.08); }

.shots{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

.shot{
  position:relative;
  border-radius:22px;
  border:1px solid rgba(255,255,255,.12);
  background:radial-gradient(120% 90% at 30% 20%, rgba(124,92,255,.20), transparent 50%),
             linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  min-height:180px;
  overflow:hidden;
  box-shadow:var(--shadow);
}

.shot.desktop{ min-height:220px; }
.shot.mobile{ max-width:360px; }

.shot::after{
  content:"";
  position:absolute;
  inset:16px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background:linear-gradient(180deg, rgba(0,0,0,.32), rgba(0,0,0,.15));
  box-shadow:0 12px 30px rgba(0,0,0,.35);
}

.shotLabel{
  position:absolute;
  top:12px;
  left:12px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.14);
  font-size:12px;
  color:var(--text);
  z-index:2;
}

.statusPill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  font-size:12px;
  color:rgba(255,255,255,.85);
}

.dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:rgba(255,255,255,.35);
}
.dot.ok{ background:#22c55e; }
.dot.warn{ background:#f59e0b; }
.dot.bad{ background:#ef4444; }
.dot.neutral{ background:rgba(255,255,255,.35); }

.statusFooter{
  position:static;
  margin-top:32px;
  display:flex;
  justify-content:center;
  width:100%;
  padding:8px 12px 18px;
}
.statusFooterInner{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.35);
  backdrop-filter: blur(5px);
  box-shadow:0 10px 26px rgba(0,0,0,.28);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}
.statusFooterRow{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:rgba(255,255,255,.85);
}
.statusFooter .dot{
  width:10px;
  height:10px;
}
.copyright{
  font-size:12px;
  color:rgba(255,255,255,.7);
  letter-spacing:.15px;
}

/* Modal */
.backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index: 50;
}
.backdrop.open{display:flex}

.modal{
  width:min(640px,100%);
  background:linear-gradient(180deg,rgba(20,28,48,.95),rgba(12,18,32,.95));
  border-radius:22px;
  border:1px solid rgba(255,255,255,.14);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.modalHeader{
  padding:16px;
  border-bottom:1px solid rgba(255,255,255,.12);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
}
.modalHeader strong{ font-size:14px; letter-spacing:.2px; }
.eyebrow{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.3px;
  color: rgba(255,255,255,.6);
  font-weight:750;
}
.iconBtn{
  width:34px; height:34px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  font-weight:900;
}
.iconBtn:hover{ background: rgba(255,255,255,.10); }

.modalBody{
  padding:16px;
  display:grid;
  gap:14px;
}

.row2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label{
  font-size:13px;
  color:var(--muted);
  margin-bottom:6px;
  display:block;
}

input,select,textarea{
  width:100%;
  padding:12px 14px;
  font-size:15px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.07);
  color:var(--text);
  outline:none;
}

/* Fix dropdown readability */
select{
  appearance:auto;
  background-color: rgba(255,255,255,.07);
  color: var(--text);
}
select option{
  background-color: #0b1220;
  color: #ffffff;
}

/* textarea styling */
textarea{
  min-height: 90px;
  resize: vertical;
  line-height: 1.3;
}

.hint{
  font-size:12px;
  color: rgba(255,255,255,.58);
  margin-top: -8px;
}

.modalFooter{
  padding:16px;
  border-top:1px solid rgba(255,255,255,.12);
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.typeModal{
  max-width:760px;
}

.typeList{
  display:grid;
  gap:12px;
  max-height: min(70vh, 520px);
  overflow:auto;
  padding-bottom: 6px;
}

.typeCard{
  width:100%;
  text-align:left;
  border-radius:16px;
  padding:14px;
  border:1px solid rgba(255,255,255,.14);
  background:linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  color:var(--text);
  cursor:pointer;
  transition:.14s ease;
  display:grid;
  gap:10px;
}
.typeCard:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.18);
  background: linear-gradient(160deg, rgba(124,92,255,.16), rgba(0,212,255,.08));
}

.typeCardTop{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.typeName{
  font-size:16px;
  font-weight:750;
}
.typeDesc{
  font-size:14px;
  color:var(--muted);
  margin-top:4px;
}
.typeExamples{
  font-size:13px;
  color:rgba(255,255,255,.75);
  display:flex;
  gap:8px;
  align-items:center;
}
.typeExamples span{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.25px;
  color:rgba(255,255,255,.6);
}
.typeChevron{
  font-size:18px;
  color: rgba(255,255,255,.75);
  padding-top: 2px;
}

/* Responsive */
@media (max-width:900px){ .grid{grid-template-columns:repeat(2,1fr)} }
@media (max-width:520px){
  .grid{grid-template-columns:1fr}
  .row2{ grid-template-columns: 1fr; }
}
