:root{
  --bg: #071b22;
  --bg-panel: #0c2830;
  --bg-panel-2: #0f323c;
  --green: #8bc53f;
  --green-dark: #5a9c2c;
  --green-glow: rgba(139,197,63,0.35);
  --text: #eaf2ee;
  --text-dim: #9fb8b0;
  --border: rgba(139,197,63,0.18);
  --danger: #ff8a8a;
}
*{box-sizing:border-box;}
html, body{ height:100%; }
body{
  margin:0;
  height:100vh;
  height:100dvh;
  overflow:hidden;
  background: radial-gradient(ellipse at 50% -10%, #0d3038 0%, var(--bg) 55%, #041216 100%);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
}
h1,h2,h3,.brand,.step-title,.tab{ font-family:'Sora', sans-serif; }

.app-shell{
  max-width: 480px; margin: 0 auto; height:100vh; height:100dvh;
  display:flex; flex-direction:column; padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  overflow:hidden;
}

.logo-row{ display:flex; align-items:center; justify-content:center; gap:10px; padding: 6px 0 14px; flex-shrink:0; }
.brand{ font-weight:800; font-size:1.15rem; letter-spacing:0.4px; }
.brand span{ color: var(--green); }

.screen{ display:none; flex:1; flex-direction:column; min-height:0; overflow-y:auto; }
.screen.active{ display:flex; }

.card{
  background: var(--bg-panel);
  border:1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
}

.center-text{ text-align:center; }
.title{ font-weight:700; font-size:1.3rem; margin: 4px 0 8px; }
.subtitle{ color:var(--text-dim); font-size:0.9rem; line-height:1.5; }

.qr-box{
  width:150px; height:150px; margin: 22px auto; background:#fff; border-radius:14px;
  display:flex; align-items:center; justify-content:center; box-shadow: 0 0 40px var(--green-glow);
}

.venue-chip{
  margin: 18px auto 0; display:flex; align-items:center; gap:8px; width:fit-content;
  background: var(--bg-panel-2); border:1px solid var(--border);
  padding:8px 14px; border-radius:999px; font-size:0.78rem; color:var(--text-dim);
}
.dot-live{ width:7px; height:7px; border-radius:50%; background:var(--green); box-shadow:0 0 8px var(--green); }

.btn{
  border:none; border-radius:14px; padding:14px; font-weight:700; font-size:0.95rem;
  cursor:pointer; font-family:'Sora',sans-serif; width:100%;
}
.btn-primary{ background: linear-gradient(135deg, var(--green), var(--green-dark)); color:#08221a; }
.btn-primary:disabled{ opacity:0.5; cursor:not-allowed; }
.btn-ghost{ background: var(--bg-panel-2); color: var(--text); border:1px solid var(--border); }
.btn-danger{ background: transparent; color: var(--danger); border:1px solid rgba(255,138,138,0.4); }

.field{ margin-bottom:14px; }
.field label{ display:block; font-size:0.72rem; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-dim); margin-bottom:6px; }
.field input, .field select, .field textarea{
  width:100%; background: var(--bg-panel-2); border:1px solid var(--border); border-radius:10px;
  padding:11px 13px; font-size:0.92rem; color:var(--text); font-family:'Inter',sans-serif;
}
.field input:focus, .field select:focus{ outline: 2px solid var(--green); }

.avatar-picker{ display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin: 16px 0 20px; }
.avatar-opt{
  width:50px; height:50px; border-radius:50%; background: var(--bg-panel-2); border:2px solid transparent;
  display:flex; align-items:center; justify-content:center; font-size:1.35rem; cursor:pointer;
}
.avatar-opt.selected{ border-color: var(--green); box-shadow:0 0 14px var(--green-glow); }

.chip-row{ display:flex; flex-wrap:wrap; gap:7px; margin-top:6px; }
.chip{
  padding:6px 12px; border-radius:999px; font-size:0.78rem; cursor:pointer;
  background: var(--bg-panel-2); border:1px solid var(--border); color: var(--text-dim);
}
.chip.selected{ background: rgba(139,197,63,0.14); color: var(--green); border-color: var(--green); }

.tabs{ display:flex; gap:6px; margin-bottom:14px; }
.tab{ flex:1; text-align:center; padding:10px; border-radius:10px; font-size:0.82rem; font-weight:600; cursor:pointer; background: var(--bg-panel-2); color: var(--text-dim); }
.tab.active{ background: var(--green); color:#08221a; }

.people-grid{ display:flex; flex-wrap:wrap; gap:12px; overflow-y:auto; padding-bottom: 10px;}
.person-card{
  width:100%; display:flex; align-items:center; gap:12px; background:var(--bg-panel-2);
  border:1px solid var(--border); border-radius:14px; padding:10px 12px; cursor:pointer;
}
.person-card .av{ width:40px; height:40px; border-radius:50%; background:var(--bg); display:flex; align-items:center; justify-content:center; font-size:1.2rem; flex-shrink:0; }
.person-card .meta{ flex:1; }
.person-card .meta .nm{ font-weight:600; font-size:0.88rem; }
.person-card .meta .sub{ font-size:0.72rem; color:var(--text-dim); }
.person-card button{ background: var(--green); color:#08221a; border:none; border-radius:8px; padding:7px 10px; font-size:0.72rem; font-weight:700; }

.chat-log{ flex:1; overflow-y:auto; display:flex; flex-direction:column; justify-content:flex-end; gap:9px; padding: 4px 2px 12px; }
.msg{ max-width:80%; padding:9px 12px; border-radius:14px; font-size:0.86rem; line-height:1.4; word-wrap:break-word; }
.msg.other{ background: var(--bg-panel-2); align-self:flex-start; border-bottom-left-radius:4px; }
.msg.me{ background: linear-gradient(135deg, var(--green), var(--green-dark)); color:#08221a; align-self:flex-end; border-bottom-right-radius:4px; }
.msg.system{ align-self:center; color:var(--text-dim); font-size:0.72rem; background:transparent; }
.msg .who{ font-size:0.68rem; opacity:0.7; margin-bottom:2px; font-weight:600; }

.composer{ position:relative; display:flex; gap:8px; align-items:center; padding-top:10px; flex-shrink:0; }
.composer input{
  flex:1; background:var(--bg-panel-2); border:1px solid var(--border); border-radius:999px;
  padding:12px 16px; font-size:0.86rem; color:var(--text); font-family:'Inter',sans-serif;
}
.composer button{
  width:42px; height:42px; border-radius:50%; background:var(--green); border:none; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:1.1rem;
}
.emoji-btn{ background: var(--bg-panel-2); border:1px solid var(--border); }
.emoji-panel{
  position:absolute; bottom: 58px; left:0; right:0; z-index:30;
  background: var(--bg-panel); border:1px solid var(--border); border-radius:14px; padding:8px;
  display:none; grid-template-columns: repeat(8, 1fr); gap:4px; max-height:150px; overflow-y:auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.emoji-panel.open{ display:grid; }
.emoji-panel button{
  background:none; border:none; font-size:1.25rem; cursor:pointer; padding:4px; border-radius:8px; width:auto; height:auto;
}
.emoji-panel button:hover{ background: var(--bg-panel-2); }

.invite-toast{
  position:fixed; top:16px; left:50%; transform:translateX(-50%); z-index:50;
  background: var(--bg-panel); border:1px solid var(--green); border-radius:14px; padding:12px 16px;
  display:flex; align-items:center; gap:10px; box-shadow:0 10px 30px rgba(0,0,0,0.5); max-width:90vw;
}
.invite-toast button{ border:none; border-radius:8px; padding:7px 10px; font-size:0.75rem; font-weight:700; cursor:pointer; }
.invite-toast .accept{ background: var(--green); color:#08221a; }
.invite-toast .decline{ background: var(--bg-panel-2); color:var(--text-dim); }

.error-text{ color: var(--danger); font-size:0.8rem; margin-top:8px; min-height:1em; }
.small-note{ text-align:center; color:var(--text-dim); font-size:0.72rem; margin-top:10px; }

.back-row{ display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.back-btn{ background:none; border:none; color:var(--text-dim); font-size:1.1rem; cursor:pointer; }

label.checkbox-row{ display:flex; align-items:flex-start; gap:8px; font-size:0.8rem; color:var(--text-dim); margin: 10px 0 16px; cursor:pointer; }
label.checkbox-row input{ margin-top:3px; }

@media (max-width: 420px){
  .app-shell{ padding: 12px; }
}
