/* ===== Context sheets (Options / Workflows) ===== */
.context-row{display:flex;gap:10px;align-items:center;justify-content:flex-end;flex-wrap:wrap;}
.context-btn{display:inline-flex;align-items:center;gap:8px;margin:1em 0;}

.context-sheet{
  max-width: 550px;
  position:relative;
  height: 0;
  overflow: hidden;
  display:block;
  margin-top:0;
  margin-bottom:0;
  padding:0;
  border-radius:14px;

  opacity:0;
  transform: translateY(-10px) scale(0.985);
  pointer-events:none;
  visibility:hidden;

  transition:
    opacity 160ms ease,
    transform 280ms cubic-bezier(.16, 1.4, .3, 1),
    visibility 0s linear 160ms;
}

.context-sheet.open{
  opacity:1;
  transform: translateY(0) scale(1);
  pointer-events:auto;
  visibility:visible;
  margin-bottom:0;
  padding:14px;
  height: auto;
  overflow: visible;
  transition:
    opacity 160ms ease,
    transform 280ms cubic-bezier(.16, 1.4, .3, 1),
    visibility 0s;
}

/* ===== Mobile bottom sheet mode ===== */
@media (max-width: 780px) {
  .context-sheet {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
    opacity: 0;
    height: auto;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.18);
    background: rgba(255,255,255,0.98);
    transition: transform 260ms cubic-bezier(.16, 1, .3, 1), opacity 160ms ease;
    box-sizing: border-box;
  }

  .context-sheet.open {
    transform: translateY(0);
    opacity: 1;
    padding: 16px;
  }

  .context-sheet.popover {
    /* Disable popover positioning on mobile */
    position: fixed !important;
  }
}

.context-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;}
.context-sheet-title{font-weight:800;color:#222;display:flex;align-items:center;gap:10px;}
.context-sheet-sub{font-size:13px;color:#666;margin-top:2px;}

.context-sheet-actions{
  display:flex;
  flex-direction:column;
  max-height: 1200px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease, max-height 220ms ease;
}

/* When slide selection is active, gracefully collapse the main workflow actions */
#workflows-sheet.wf-slides-mode .context-sheet-actions{
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.context-action{
  width:100%;
  text-align:left;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.98);
  cursor:pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
  opacity:0.98;
  box-shadow: none;
  margin:5px 0;
  display:flex;
  align-items:center;
  gap:10px;
}
.context-action:hover{transform: scale(1.0);box-shadow: none !important;}
.context-action strong{
  display:block;
  font-weight:800;
  margin-bottom:3px;
  color:#00737e;
}
.context-action .wf-icon{
  margin-right:10px;
  color:#00737e;
  font-size:16px;
  width:18px;
  text-align:center;
  align-self:center;
}
.context-action .wf-text{flex:1;}
.context-action span{display:block;color:#666;font-size:13px;line-height:1.2;}

.context-step{margin-top:10px;padding:12px;border-radius:14px;border:1px solid rgba(0,0,0,0.10);background: rgba(0,0,0,0.02);}
.context-step h4{margin:0 0 8px 0;font-size:14px;color:#222;}
.context-muted{font-size:13px;color:#666;width:100%;}

.wf-chip{display:inline-flex;align-items:center;gap:8px;padding:7px 10px;border-radius:7px;border:1px solid rgba(0,0,0,0.12);background: rgba(255,255,255,0.96);font-size:12px;color:#444;cursor:pointer;}
.wf-chip input{margin:0;}

.wf-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;}

/* Popover mode: when opened from the fixed subhead button */
#workflows-sheet.popover{
  position:fixed;
  margin-top:0;
  max-width:560px;
  width:min(560px, calc(100vw - 20px));
  z-index:220;
  box-shadow: 0 0px 8px rgba(0,0,0,.15);
  background: rgba(255,255,255,.3);
}

#options-sheet.popover{
  position:fixed;
  margin-top:0;
  max-width:560px;
  width:min(560px, calc(100vw - 20px));
  z-index:220;
  box-shadow: 0 0px 8px rgba(0,0,0,.15);
  background: rgba(255,255,255,.3);
}

/* A tiny utility row in subhead (kept for compatibility) */
#subhead-cta{display:flex;gap:10px;align-items:center;justify-content:flex-end;}

/* Keep the workflows sheet from feeling like an error message */
.wf-success{font-size:13px;}
.wf-success .title{font-weight:900;color:#222;margin-bottom:6px;}
.wf-success .body{color:#555;font-size:13px;line-height:1.3;}
.wf-success a{display:inline-block;margin-top:10px;font-weight:900;text-decoration:underline;}

.context-sheet-close{margin-right: 5px;margin-top: -20px;}