/* Weekly Availability (0. Admin) — recurring-call planner across three zones */

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f5;
  color: #222;
}

/* ── toolbar ─────────────────────────────────────────────────────────── */
#toolbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  background: #fff; border-bottom: 1px solid #e4e4e4;
  position: sticky; top: 0; z-index: 20;
}
.app-title { font-weight: 700; }
.toolbar-info { color: #666; font-size: 13px; }
.back-btn {
  text-decoration: none; color: #444; font-size: 18px; line-height: 1;
  padding: 2px 8px; border: 1px solid #ddd; border-radius: 6px; background: #fff;
}
.back-btn:hover { border-color: #bbb; }

.tz-pick { font-size: 13px; color: #666; display: inline-flex; align-items: center; gap: 6px; }
#toolbar .tz-pick { margin-left: auto; }
select {
  padding: 5px 8px; font-size: 13px; border: 1px solid #d5d5d5;
  border-radius: 6px; background: #fff; color: #222;
}

/* ── who am I bar ────────────────────────────────────────────────────── */
#whobar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 18px; background: #fff; border-bottom: 1px solid #e4e4e4;
}
.whobar-label { font-size: 13px; font-weight: 600; color: #555; }
.people { display: flex; gap: 7px; flex-wrap: wrap; }
.person {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; font-size: 13.5px; font-weight: 600;
  border: 2px solid #e0e0e0; border-radius: 999px;
  background: #fff; color: #444; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.person .dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--c);
  border: 1px solid rgba(0,0,0,.12); flex: none;
}
.person:hover { border-color: #bbb; }
.person.active {
  border-color: var(--c); color: #111;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent);
}
#whobar .sep { flex: none; width: 1px; height: 22px; background: #e4e4e4; }
#my-zone-wrap.disabled { opacity: .4; pointer-events: none; }

.btn-sm {
  padding: 6px 11px; font-size: 12.5px; border: 1px solid #d5d5d5;
  border-radius: 6px; background: #fff; color: #333; cursor: pointer;
}
.btn-sm:hover { border-color: #aaa; }
.btn-sm.danger { color: #D41159; border-color: #f0cdd6; }
.btn-sm:disabled { opacity: .45; cursor: default; }

#hint {
  margin: 0; padding: 8px 18px; font-size: 13px; color: #777;
  background: #fafafa; border-bottom: 1px solid #eee;
}
#hint.warn { color: #D41159; }

/* ── layout ──────────────────────────────────────────────────────────── */
#layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px; padding: 18px; align-items: start;
}

/* ── the grid ────────────────────────────────────────────────────────── */
#grid {
  display: grid;
  grid-template-columns: 62px repeat(5, minmax(0, 1fr));
  gap: 2px;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 10px; user-select: none;
}
.cell { min-height: 20px; display: flex; align-items: center; justify-content: center; }

.cell.head {
  position: sticky; top: 48px; z-index: 10;
  background: #fff; font-weight: 700; font-size: 13px;
  padding: 6px 0 8px; border-bottom: 1px solid #eee;
}
.cell.corner { position: sticky; top: 48px; z-index: 10; background: #fff; }

.cell.time {
  justify-content: flex-end; padding-right: 8px;
  font-size: 11px; color: #bbb;
}
.cell.time.hour { color: #777; font-weight: 600; }

.cell.slot {
  background: #f1f1f1; border-radius: 4px; cursor: pointer;
  gap: 3px; padding: 2px; transition: background .1s;
}
.cell.slot:hover { background: #e4e4e4; }
.cell.slot.night { background: #e9e9ec; }
.cell.slot.hour-start { border-top: 1px solid #fff; }

/* filled by the count of people available: pale blue to solid */
.cell.slot[data-n="1"] { background: #dceafd; }
.cell.slot[data-n="2"] { background: #c2ddfc; }
.cell.slot[data-n="3"] { background: #a3cbfa; }
.cell.slot[data-n="4"] { background: #7fb6f7; }
.cell.slot[data-n="5"] { background: #57a0f4; }
.cell.slot.everyone   { background: #00BF7F; }

.cell.slot .chip {
  width: 8px; height: 8px; border-radius: 50%; background: var(--pc);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.12);
}
.cell.slot.mine { outline: 2px solid color-mix(in srgb, var(--c) 65%, transparent); outline-offset: -2px; }
.cell.slot.preview-add {
  background: color-mix(in srgb, var(--c) 35%, #f1f1f1);
  outline: 2px solid var(--c); outline-offset: -2px;
}
.cell.slot.preview-remove { outline: 2px dashed var(--c); outline-offset: -2px; opacity: .55; }
.cell.slot.picked { box-shadow: inset 0 0 0 2px #4F2C99; }

.footnote { color: #999; font-size: 11.5px; line-height: 1.5; margin: 10px 2px 0; }

/* ── best-slots panel ────────────────────────────────────────────────── */
#side {
  position: sticky; top: 60px;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; padding: 14px;
}
.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.side-head h2 { font-size: 14px; margin: 0 0 8px; }
.dur-pick { font-size: 12px; color: #888; display: inline-flex; align-items: center; gap: 5px; }
.dur-pick select { padding: 3px 6px; font-size: 12px; }

.win {
  border: 1px solid #ececec; border-radius: 8px; padding: 9px 10px;
  margin-top: 8px; cursor: pointer; transition: border-color .15s, background .15s;
}
.win:hover { border-color: #bbb; background: #fafafa; }
.win.sel { border-color: #4F2C99; background: #f7f4fd; }
.win.full { border-color: #9fe4c9; }
.win-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.win-count {
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: #eee; color: #666; flex: none;
}
.win.full .win-count { background: #00BF7F; color: #fff; }
.win-day { font-weight: 700; font-size: 13px; }
.win-zones { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; font-size: 12px; }
.win-zones .z { color: #999; }
.win-zones .t { font-variant-numeric: tabular-nums; }
.win-zones .t.odd { color: #D41159; }
.win-miss { font-size: 11.5px; color: #b06; margin-top: 5px; }
.win-who { display: flex; gap: 3px; margin-top: 6px; flex-wrap: wrap; }
.win-who .chip { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); border: 1px solid rgba(0,0,0,.1); }
.win-who .chip.off { background: #fff; }
.empty { color: #999; font-size: 12.5px; margin-top: 10px; line-height: 1.5; }

@media (max-width: 1100px) {
  #layout { grid-template-columns: minmax(0, 1fr); }
  #side { position: static; }
}
