:root { color-scheme: dark; }
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background: #0b0f17;
  color: #e9eefc;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 44px 18px; }

.top h1 { margin: 0; font-size: 28px; }
.sub { opacity: .75; margin-top: 6px; }

.grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 16px;
}

.card h2 { margin: 0 0 10px; font-size: 16px; opacity: .9; }

a.item {
  display: block;
  padding: 10px 12px;
  margin-top: 8px;
  border-radius: 12px;
  text-decoration: none;
  color: #e9eefc;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

a.item:hover { background: rgba(255,255,255,0.10); }

.meta { font-size: 12px; opacity: .7; margin-top: 10px; }

.foot { margin-top: 18px; opacity: .65; font-size: 12px; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  opacity: .85;
  margin-right: 6px;
}

/* --- your appended styles --- */
.toprow { display:flex; align-items:flex-start; justify-content:space-between; gap: 12px; }
.controls { min-width: 170px; }
.label { display:block; font-size: 12px; opacity:.75; margin-bottom: 6px; }

.select {
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  background: #1a2233;          /* darker solid background */
  color: #ffffff;               /* readable text */
  border: 1px solid rgba(255,255,255,0.15);
}


.searchrow { display:flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.search {
  flex: 1;
  min-width: 240px;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  color: #e9eefc;
  border: 1px solid rgba(255,255,255,0.10);
  outline: none;
}

.search:focus { border-color: rgba(255,255,255,0.22); }

.btn {
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  color: #e9eefc;
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer;
}

.btn:hover { background: rgba(255,255,255,0.10); }

.row {
  display:flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.star {
  width: 40px;
  min-width: 40px;
  text-align: center;
  border-radius: 12px;
  padding: 10px 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer;
  user-select: none;
}

.star:hover { background: rgba(255,255,255,0.10); }
.star.on { background: rgba(255,255,255,0.14); }

.refrow {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.refleft { min-width: 0; }
.refname { font-size: 14px; }

.refright {
  display: flex;
  align-items: center;
  gap: 10px;
}

.refcode {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.copybtn { padding: 8px 10px; border-radius: 12px; }

@keyframes pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.btn.copied {
  animation: pop 180ms ease-out;
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.22);
}

.btn.copybtn {
  min-width: 76px; /* keeps layout stable when text changes */
}

.today-events {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-row {
  display: grid;
  grid-template-columns: 170px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}

.event-row.live {
  outline: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
}

.event-left {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px;
  align-items: center;
}

.event-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  opacity: 0.9;
  white-space: nowrap;
}

.event-time {
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
  white-space: nowrap;
}

.event-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.join-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.10);
  text-decoration: none;
  font-weight: 600;
}

.join-btn:hover {
  background: rgba(255,255,255,0.14);
}

/* Mobile: show only next event nicely */
@media (max-width: 520px) {
  .event-row {
    grid-template-columns: 1fr auto;
  }
  .event-left {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .event-time {
    opacity: 0.75;
  }
}

/* ===== Today card placement (above grid) ===== */
#today.card.todaycard {
  margin-top: 14px;
}

/* If Today sits inside the same grid container by accident, force full width */
#today {
  grid-column: 1 / -1;
}

/* ===== Today rows (new layout) ===== */
.today-events {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.event-row {
  display: grid;
  grid-template-columns: 190px 1fr auto; /* a bit more room for badge+time */
  gap: 12px;
  align-items: center;

  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

/* live meeting highlight */
.event-row.live {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset;
}

/* blocked/busy is subtle (only relevant if you ever showBusy=true) */
.event-row.busy {
  opacity: 0.78;
  background: rgba(255,255,255,0.035);
}

/* left stack */
.event-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* reuse your existing .badge; just ensure it doesn't blow up the grid */
.event-left .badge {
  margin-right: 0;
  white-space: nowrap;
}

/* time */
.todaytime {
  min-width: 64px;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
  white-space: nowrap;
}

/* title */
.event-main {
  min-width: 0;
}

.event-title {
  font-weight: 650;
  line-height: 1.25;
  min-width: 0;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Join button tuned to match your .btn aesthetic */
.join-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 12px;
  border-radius: 12px;

  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);

  color: #e9eefc;
  text-decoration: none;
  font-weight: 650;
}

.join-btn:hover {
  background: rgba(255,255,255,0.10);
}

/* ===== Mobile ===== */
@media (max-width: 520px) {
  .event-row {
    grid-template-columns: 1fr auto;
  }

  .event-left {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .todaytime {
    opacity: 0.75;
  }
}





