:root{
  --bg:#0b0c10; --panel:#0f1218; --text:#e8eaed; --muted:#a1a1aa;
  --border:#1f2430; --accent:#2563eb; --ok:#22c55e; --err:#ef4444;
}
@media (prefers-color-scheme: light){
  :root{
    --bg:#f8fafc; --panel:#ffffff; --text:#0f172a; --muted:#475569;
    --border:#e5e7eb; --accent:#2563eb; --ok:#16a34a; --err:#dc2626;
  }
}

/* Base */
*{box-sizing:border-box}
body{
  margin:0; background:var(--bg); color:var(--text);
  font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,sans-serif;
}
.wrap{max-width:960px;margin:0 auto;padding:24px}

/* Back link (top-left) */
a.back, a.back:visited{
  color:var(--muted);
  text-decoration:none;
  display:inline-flex;
  gap:.4rem;
  align-items:center;
  margin-bottom:14px;
  font-weight:600;
}
a.back:hover{color:var(--accent)}

/* Panels & headings */
.panel{
  background:var(--panel); border:1px solid var(--border); border-radius:16px; padding:18px;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
}
h1{margin:6px 0 18px 0;font-size:1.8rem;color:var(--accent)}
h2{margin:0 0 6px 0}

/* ---------- Form layout (rows like Chat Tester) ---------- */
#meetingForm {        /* kill any previous grid layout */
  display:block !important;
}
#meetingForm .row{
  display:flex; align-items:center; gap:12px; margin-bottom:12px;
}
#meetingForm .row:last-child{ margin-bottom:0; }

label{font-size:.95rem;color:var(--muted);min-width:140px}
select,
input[type=text],
input[type=password],
input[type=email],
input[type=search],
input[type=url],
input[type=tel],
textarea{
  background:transparent;color:var(--text);
  border:1px solid var(--border); padding:10px 12px; border-radius:12px; outline:none;
  min-width:200px; flex:1;
}
input::placeholder,textarea::placeholder{color:color-mix(in oklab, var(--text) 35%, transparent)}
input:focus,textarea:focus,select:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent);
}

/* Stack label above input on small screens */
@media (max-width:640px){
  #meetingForm .row{ flex-direction:column; align-items:stretch; }
  label{ min-width:0; }
}

/* Buttons */
.btn{
  background:var(--accent); color:#fff; border:0; padding:10px 16px; border-radius:12px;
  font-weight:600; cursor:pointer; transition:background .2s ease,transform .06s ease;
  display:inline-block; text-decoration:none; /* works for <a> and <button> */
}
.btn, .btn:visited, .btn:hover, .panel a.btn{ text-decoration:none !important; } /* never underline */
.btn:hover{ background:#1e40af }
.btn:active{ transform:translateY(1px) }

/* Secondary/soft action (Delete) */
.btn.delete{
  background:#6b7280; 
  color:#fff; 
  padding:10px 16px;
  min-width:120px;
  text-align:center;
  border-radius:12px;
}
.btn.delete:hover{ background:#4b5563 }

/* Status text */
.status{font-size:.92rem;color:var(--muted)}

/* ===== Recordings list ===== */
#fileList{display:grid;grid-template-columns:1fr;gap:12px;margin-top:16px}
.file{
  display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:center;
  background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:12px 14px;
}
.file-name{
  font-weight:400 !important; /* not bold */
  word-break:break-word;
  overflow-wrap:anywhere;
  line-height:1.3;
}
.file-name strong{ font-weight:400 !important; } /* guard if <strong> appears */
.meta{font-size:12px;color:var(--muted);margin-top:4px}
.file .btn{min-width:120px;text-align:center}

/* Responsive list */
@media (max-width:540px){
  .file{grid-template-columns:1fr;gap:8px}
  .file .btn{width:100%;min-width:0}
}
/* === Participants editor === */
#participantsEditor{display:flex;flex-direction:column;gap:10px}
#participantsEditor .participant-row{
  display:flex;align-items:center;gap:12px;flex-wrap:wrap;
}
#participantsEditor .participant-row .input{
  background:var(--pill);
  border:1px solid var(--border);
  color:var(--txt);
  padding:10px 12px;
  border-radius:12px;
  height:44px;
  outline:none;
}
#participantsEditor .participant-row .input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(47,102,255,.20);
}
/* Make fields align & stretch like the rest of the form */
#participantsEditor .participant-row .p-name{flex:1 1 340px;min-width:280px}
#participantsEditor .participant-row .p-email{flex:1 1 360px;min-width:280px}

/* Optional tiny remove button */
#participantsEditor .participant-row .remove{
  background:transparent;border:1px solid var(--border);
  color:var(--muted);border-radius:10px;padding:8px 10px;cursor:pointer
}
#participantsToolbar{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}

/* (Optional helpers) */
.mb12{margin-bottom:12px}

/* =========================
   Emergency Evacuation layout
   ========================= */

.wrap {
  max-width: 1280px;
}

.evac-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  table-layout: fixed;
}

.evac-table th,
.evac-table td {
  padding: 10px 8px;
  vertical-align: middle;
  text-align: left;
  font-size: 15px;
  line-height: 1.35;
}

.evac-table th {
  font-weight: 800;
  white-space: normal;
}

.evac-table .status {
  font-size: 13px;
  line-height: 1.35;
}

.evac-table strong {
  font-size: 15px;
}

/* Shared column widths */
.evac-table th:nth-child(1),
.evac-table td:nth-child(1) {
  width: 7%;
  text-align: center;
}

.evac-table th:nth-child(2),
.evac-table td:nth-child(2) {
  width: 25%;
}

.evac-table th:nth-child(3),
.evac-table td:nth-child(3) {
  width: 14%;
}

.evac-table th:nth-child(4),
.evac-table td:nth-child(4) {
  width: 11%;
}

.evac-table th:nth-child(5),
.evac-table td:nth-child(5) {
  width: 17%;
}

.evac-table th:nth-child(6),
.evac-table td:nth-child(6) {
  width: 12%;
}

.evac-table th:nth-child(7),
.evac-table td:nth-child(7) {
  width: 14%;
}

.evac-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.action-cell {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 6px !important;
}

.action-cell .btn,
.action-cell .btn.delete {
  width: 100% !important;
  min-width: 0 !important;
  padding: 7px 8px !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  border-radius: 10px !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Emergency SMS panel */
#emergencySmsMessage {
  min-height: 110px;
  max-width: 520px;
}

#smsFromNumber {
  max-width: 420px;
}

/* Fix Emergency Action buttons - show full text */
.action-cell {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  align-items: stretch !important;
  width: 100% !important;
}

.action-cell .btn,
.action-cell .btn.delete {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  border-radius: 10px !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: unset !important;
}

/* Give action column more room */
.evac-table th:nth-child(7),
.evac-table td:nth-child(7) {
  width: 18% !important;
}
.response-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

.response-safe {
  background: #dcfce7;
  color: #166534;
}

.response-help {
  background: #fee2e2;
  color: #991b1b;
}

.response-none {
  background: #fef3c7;
  color: #92400e;
}

.response-unknown {
  background: #e5e7eb;
  color: #374151;
}
.response-summary {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.response-summary .pill {
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-block;
  font-size: 18px;
  font-weight: 700;
}

.response-summary .safe {
  background: #dcfce7;
  color: #166534;
}

.response-summary .help {
  background: #fee2e2;
  color: #991b1b;
}

.response-summary .none {
  background: #fef3c7;
  color: #92400e;
}

.response-summary .unknown {
  background: #e5e7eb;
  color: #374151;
}

.emergency-action-btn {
  opacity: 0.65;
  border: 3px solid transparent;
}

.emergency-action-btn.active-safe {
  background: #16a34a !important;
  color: white !important;
  opacity: 1;
  border-color: #14532d;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.18);
}

.emergency-action-btn.active-help {
  background: #dc2626 !important;
  color: white !important;
  opacity: 1;
  border-color: #7f1d1d;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.18);
}

.emergency-action-btn.active-no-response {
  background: #f59e0b !important;
  color: #111827 !important;
  opacity: 1;
  border-color: #92400e;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}